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>
23 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
24 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; This file is part of GNU Guix.
28 ;;; GNU Guix is free software; you can redistribute it and/or modify it
29 ;;; under the terms of the GNU General Public License as published by
30 ;;; the Free Software Foundation; either version 3 of the License, or (at
31 ;;; your option) any later version.
33 ;;; GNU Guix is distributed in the hope that it will be useful, but
34 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;;; GNU General Public License for more details.
38 ;;; You should have received a copy of the GNU General Public License
39 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41 (define-module (gnu packages linux)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages acl)
44 #:use-module (gnu packages admin)
45 #:use-module (gnu packages algebra)
46 #:use-module (gnu packages attr)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages base)
49 #:use-module (gnu packages bash)
50 #:use-module (gnu packages bison)
51 #:use-module (gnu packages calendar)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages crypto)
54 #:use-module (gnu packages compression)
55 #:use-module (gnu packages databases)
56 #:use-module (gnu packages docbook)
57 #:use-module (gnu packages documentation)
58 #:use-module (gnu packages elf)
59 #:use-module (gnu packages flex)
60 #:use-module (gnu packages freedesktop)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages gettext)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gnuzilla)
65 #:use-module (gnu packages gperf)
66 #:use-module (gnu packages gtk)
67 #:use-module (gnu packages libusb)
68 #:use-module (gnu packages man)
69 #:use-module (gnu packages maths)
70 #:use-module (gnu packages ncurses)
71 #:use-module (gnu packages networking)
72 #:use-module (gnu packages perl)
73 #:use-module (gnu packages pciutils)
74 #:use-module (gnu packages pkg-config)
75 #:use-module (gnu packages popt)
76 #:use-module (gnu packages pulseaudio)
77 #:use-module (gnu packages python)
78 #:use-module (gnu packages readline)
79 #:use-module (gnu packages rrdtool)
80 #:use-module (gnu packages slang)
81 #:use-module (gnu packages texinfo)
82 #:use-module (gnu packages tls)
83 #:use-module (gnu packages video)
84 #:use-module (gnu packages xiph)
85 #:use-module (gnu packages xml)
86 #:use-module (gnu packages xdisorg)
87 #:use-module (gnu packages xorg)
88 #:use-module (guix build-system cmake)
89 #:use-module (guix build-system gnu)
90 #:use-module (guix build-system python)
91 #:use-module (guix build-system trivial)
92 #:use-module (guix download)
93 #:use-module ((guix licenses) #:prefix license:)
94 #:use-module (guix packages)
95 #:use-module (guix utils)
96 #:use-module (srfi srfi-1)
97 #:use-module (srfi srfi-2)
98 #:use-module (srfi srfi-26)
99 #:use-module (ice-9 match))
101 (define-public (system->linux-architecture arch)
102 "Return the Linux architecture name for ARCH, a Guix system name such as
103 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
104 (let ((arch (car (string-split arch #\-))))
105 (cond ((string=? arch "i686") "i386")
106 ((string-prefix? "mips" arch) "mips")
107 ((string-prefix? "arm" arch) "arm")
108 ((string-prefix? "aarch64" arch) "arm64")
111 (define (linux-libre-urls version)
112 "Return a list of URLs for Linux-Libre VERSION."
114 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
115 version "-gnu/linux-libre-" version "-gnu.tar.xz")
117 ;; XXX: Work around <http://bugs.gnu.org/14851>.
119 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
120 version "-gnu.tar.xz")
122 ;; Maybe this URL will become valid eventually.
124 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
125 version "-gnu.tar.xz")))
127 (define-public linux-libre-headers
129 (name "linux-libre-headers")
133 (uri (linux-libre-urls version))
136 "0k8k17in7dkjd9d8zg3i8l1ax466dba6bxw28flxizzyq8znljps"))))
137 (build-system gnu-build-system)
138 (native-inputs `(("perl" ,perl)))
140 `(#:modules ((guix build gnu-build-system)
144 (modify-phases %standard-phases
148 (let ((arch ,(system->linux-architecture
149 (or (%current-target-system)
150 (%current-system)))))
152 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
154 (and (zero? (system* "make" "defconfig"))
155 (zero? (system* "make" "mrproper" "headers_check"))))))
157 (lambda* (#:key outputs #:allow-other-keys)
158 (let ((out (assoc-ref outputs "out")))
159 (and (zero? (system* "make"
160 (string-append "INSTALL_HDR_PATH=" out)
163 (mkdir (string-append out "/include/config"))
164 (call-with-output-file
166 "/include/config/kernel.release")
168 (format p "~a-default~%" ,version)))
170 ;; Remove the '.install' and '..install.cmd' files; the
171 ;; latter contains store paths, which pulls in bootstrap
172 ;; binaries in the build environment, and prevents bit
173 ;; reproducibility for the bootstrap binaries.
174 (for-each delete-file (find-files out "\\.install"))
177 #:allowed-references ()
179 (home-page "http://www.gnu.org/software/linux-libre")
180 (synopsis "GNU Linux-Libre kernel headers")
181 (description "Headers of the Linux-Libre kernel.")
182 (license license:gpl2)))
184 (define %boot-logo-patch
185 ;; Linux-Libre boot logo featuring Freedo and a gnu.
188 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
189 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
192 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
194 (define* (kernel-config arch #:key variant)
195 "Return the absolute file name of the Linux-Libre build configuration file
196 for ARCH and optionally VARIANT, or #f if there is no such configuration."
197 (let* ((name (string-append "linux-libre-"
198 (if variant (string-append variant "-") "")
199 (if (string=? "i386" arch) "i686" arch) ".conf"))
200 (file (string-append "gnu/packages/" name)))
201 (search-path %load-path file)))
203 (define %default-extra-linux-options
204 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
205 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
206 ;; Modules required for initrd:
207 ("CONFIG_NET_9P" . m)
208 ("CONFIG_NET_9P_VIRTIO" . m)
209 ("CONFIG_VIRTIO_BLK" . m)
210 ("CONFIG_VIRTIO_NET" . m)
211 ("CONFIG_VIRTIO_PCI" . m)
212 ("CONFIG_VIRTIO_BALLOON" . m)
213 ("CONFIG_VIRTIO_MMIO" . m)
214 ("CONFIG_FUSE_FS" . m)
216 ("CONFIG_9P_FS" . m)))
218 (define (config->string options)
219 (string-join (map (match-lambda
221 (string-append option "=m"))
223 (string-append option "=y"))
225 (string-append option "=n")))
229 (define* (make-linux-libre version hash supported-systems
231 ;; A function that takes an arch and a variant.
232 ;; See kernel-config for an example.
234 (configuration-file #f)
235 (defconfig "defconfig")
236 (extra-options %default-extra-linux-options)
237 (patches (list %boot-logo-patch)))
239 (name (if extra-version
240 (string-append "linux-libre-" extra-version)
245 (uri (linux-libre-urls version))
246 (sha256 (base32 hash))
248 (supported-systems supported-systems)
249 (build-system gnu-build-system)
255 ,@(match (and configuration-file
257 (system->linux-architecture
258 (or (%current-target-system) (%current-system)))
259 #:variant (version-major+minor version)))
260 (#f ;no config for this platform
263 `(("kconfig" ,config))))))
265 `(#:modules ((guix build gnu-build-system)
270 (modify-phases %standard-phases
272 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
273 ;; Avoid introducing timestamps
274 (setenv "KCONFIG_NOTIMESTAMP" "1")
275 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
277 ;; Set ARCH and CROSS_COMPILE
278 (let ((arch ,(system->linux-architecture
279 (or (%current-target-system)
280 (%current-system)))))
282 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
285 (setenv "CROSS_COMPILE" (string-append target "-"))
286 (format #t "`CROSS_COMPILE' set to `~a'~%"
287 (getenv "CROSS_COMPILE"))))
289 (setenv "EXTRA_VERSION" ,extra-version)
291 (let ((build (assoc-ref %standard-phases 'build))
292 (config (assoc-ref inputs "kconfig")))
294 ;; Use a custom kernel configuration file or a default
295 ;; configuration file.
298 (copy-file config ".config")
299 (chmod ".config" #o666))
300 (system* "make" ,defconfig))
302 ;; Appending works even when the option wasn't in the
303 ;; file. The last one prevails if duplicated.
304 (let ((port (open-file ".config" "a"))
305 (extra-configuration ,(config->string extra-options)))
306 (display extra-configuration port)
309 (zero? (system* "make" "oldconfig")))))
311 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
312 (let* ((out (assoc-ref outputs "out"))
313 (moddir (string-append out "/lib/modules"))
314 (dtbdir (string-append out "/lib/dtbs"))
315 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
316 ;; Install kernel image, kernel configuration and link map.
317 (for-each (lambda (file) (install-file file out))
318 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
319 ;; Install device tree files
320 (for-each (lambda (file) (install-file file dtbdir))
321 (find-files "." "\\.dtb$"))
322 ;; Install kernel modules
324 (zero? (system* "make"
325 (string-append "DEPMOD=" kmod "/bin/depmod")
326 (string-append "MODULE_DIR=" moddir)
327 (string-append "INSTALL_PATH=" out)
328 (string-append "INSTALL_MOD_PATH=" out)
329 "INSTALL_MOD_STRIP=1"
330 "modules_install"))))))
332 (home-page "http://www.gnu.org/software/linux-libre/")
333 (synopsis "100% free redistribution of a cleaned Linux kernel")
335 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
336 It has been modified to remove all non-free binary blobs.")
337 (license license:gpl2)))
339 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
341 (define %linux-libre-version "4.10")
342 (define %linux-libre-hash "167zzgkivpqsp07did25wjqsswddzp3gifcdkq7xk00llxlmspla")
344 (define-public linux-libre
345 (make-linux-libre %linux-libre-version
347 %intel-compatible-systems
348 #:configuration-file kernel-config))
350 (define-public linux-libre-4.9
351 (make-linux-libre "4.9.11"
352 "1gypfg2984zr4z7hihnl3bbpxnk1mrqbynb6xd8ad2v2z04aw13q"
353 %intel-compatible-systems
354 #:configuration-file kernel-config))
356 (define-public linux-libre-4.4
357 (make-linux-libre "4.4.50"
358 "0c157kk0vgrb1fsyy4q3czqdg4npgql82n6p303afy8ylh2w6d3l"
359 %intel-compatible-systems
360 #:configuration-file kernel-config))
362 (define-public linux-libre-4.1
363 (make-linux-libre "4.1.38"
364 "165kmzglhg63hn7y4q7r6cb2dpsljxiq1czvgyx0bkd1vd2bcvsa"
365 %intel-compatible-systems
366 #:configuration-file kernel-config))
368 (define-public linux-libre-arm-generic
369 (make-linux-libre %linux-libre-version
372 #:defconfig "multi_v7_defconfig"
373 #:extra-version "arm-generic"))
377 ;;; Pluggable authentication modules (PAM).
380 (define-public linux-pam
388 "http://www.linux-pam.org/library/"
389 "Linux-PAM-" version ".tar.bz2"))
392 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
393 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
395 (build-system gnu-build-system)
399 ;; TODO: optional dependencies
400 ;; ("libxcrypt" ,libxcrypt)
401 ;; ("cracklib" ,cracklib)
404 '(;; Most users, such as `shadow', expect the headers to be under
406 #:configure-flags (list (string-append "--includedir="
407 (assoc-ref %outputs "out")
408 "/include/security"))
410 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
413 (home-page "http://www.linux-pam.org/")
414 (synopsis "Pluggable authentication modules for Linux")
416 "A *Free* project to implement OSF's RFC 86.0.
417 Pluggable authentication modules are small shared object files that can
418 be used through the PAM API to perform tasks, like authenticating a user
419 at login. Local and dynamic reconfiguration are its key features.")
420 (license license:bsd-3)))
422 (define-public linux-pam-1.2
430 "http://www.linux-pam.org/library/"
431 "Linux-PAM-" version ".tar.bz2"))
434 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
435 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
442 (define-public psmisc
449 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
453 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
454 (build-system gnu-build-system)
455 (inputs `(("ncurses" ,ncurses)))
456 (home-page "http://psmisc.sourceforge.net/")
458 "Small utilities that use the proc file system")
460 "This PSmisc package is a set of some small useful utilities that
461 use the proc file system. We're not about changing the world, but
462 providing the system administrator with some help in common tasks.")
463 (license license:gpl2+)))
465 (define-public util-linux
471 (uri (string-append "mirror://kernel.org/linux/utils/"
472 name "/v" (version-major+minor version) "/"
473 name "-" version ".tar.xz"))
476 "03xnaw3c7pavxvvh1vnimcr44hlhhf25whawiyv8dxsflfj4xkiy"))
477 (patches (search-patches "util-linux-tests.patch"))
478 (modules '((guix build utils)))
480 ;; We take the 'logger' program from GNU Inetutils and 'kill'
481 ;; from GNU Coreutils.
483 (substitute* "configure"
484 (("build_logger=yes") "build_logger=no")
485 (("build_kill=yes") "build_kill=no"))
487 (build-system gnu-build-system)
489 "static")) ; >2 MiB of static .a libraries
491 `(#:configure-flags (list "--disable-use-tty-group"
493 ;; Install completions where our
494 ;; bash-completion package expects them.
495 (string-append "--with-bashcompletiondir="
496 (assoc-ref %outputs "out")
497 "/etc/bash_completion.d"))
498 #:phases (modify-phases %standard-phases
500 'build 'set-umount-file-name
501 (lambda* (#:key outputs #:allow-other-keys)
502 ;; Tell 'eject' the right file name of 'umount'.
503 (let ((out (assoc-ref outputs "out")))
504 (substitute* "sys-utils/eject.c"
506 (string-append "\"" out "/bin/umount\"")))
510 (lambda* (#:key inputs outputs #:allow-other-keys)
511 (let ((out (assoc-ref outputs "out"))
512 (net (assoc-ref inputs "net-base")))
513 ;; Change the test to refer to the right file.
514 (substitute* "tests/ts/misc/mcookie"
516 (string-append net "/etc/services")))
519 'install 'move-static-libraries
520 (lambda* (#:key outputs #:allow-other-keys)
521 (let ((out (assoc-ref outputs "out"))
522 (static (assoc-ref outputs "static")))
523 (mkdir-p (string-append static "/lib"))
524 (with-directory-excursion out
525 (for-each (lambda (file)
527 (string-append static "/"
529 (find-files "lib" "\\.a$")))
531 (inputs `(("zlib" ,zlib)
532 ("ncurses" ,ncurses)))
535 ("net-base" ,net-base))) ;for tests
536 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
537 (synopsis "Collection of utilities for the Linux kernel")
538 (description "Util-linux is a diverse collection of Linux kernel
539 utilities. It provides dmesg and includes tools for working with file systems,
540 block devices, UUIDs, TTYs, and many other tools.")
542 ;; Note that util-linux doesn't use the same license for all the
543 ;; code. GPLv2+ is the default license for a code without an
544 ;; explicitly defined license.
545 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
546 license:bsd-4 license:public-domain))))
548 (define-public procps
554 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
555 "procps-ng-" version ".tar.xz"))
558 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
559 (build-system gnu-build-system)
561 '(#:modules ((guix build utils)
562 (guix build gnu-build-system)
566 (modify-phases %standard-phases
567 (add-before 'check 'disable-strtod-test
569 ;; Disable the 'strtod' test, which fails on 32-bit systems.
570 ;; This is what upstream does:
571 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
572 (substitute* "Makefile"
573 (("^(TESTS|check_PROGRAMS) = .*$" all)
574 (string-append "# " all "\n")))
577 'install 'post-install
578 ;; Remove commands and man pages redudant with
580 (lambda* (#:key outputs #:allow-other-keys)
581 (let* ((out (assoc-ref outputs "out"))
582 (dup (append-map (cut find-files out <>)
583 '("^kill" "^uptime"))))
584 (for-each delete-file dup)
586 (inputs `(("ncurses" ,ncurses)))
587 (home-page "https://gitlab.com/procps-ng/procps/")
588 (synopsis "Utilities that give information about processes")
590 "Procps is the package that has a bunch of small useful utilities
591 that give information about processes using the Linux /proc file system.
592 The package includes the programs ps, top, vmstat, w, kill, free,
593 slabtop, and skill.")
594 (license license:gpl2)))
596 (define-public usbutils
603 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
604 "usbutils-" version ".tar.xz"))
607 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
608 (build-system gnu-build-system)
611 ("eudev" ,eudev-with-hwdb)))
613 `(("pkg-config" ,pkg-config)))
614 (home-page "http://www.linux-usb.org/")
616 "Tools for working with USB devices, such as lsusb")
618 "Tools for working with USB devices, such as lsusb.")
619 (license license:gpl2+)))
621 (define-public e2fsprogs
628 "mirror://kernel.org/linux/kernel/people/tytso/"
629 name "/v" version "/"
630 name "-" version ".tar.xz"))
633 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
634 (modules '((guix build utils)))
637 (substitute* "MCONFIG.in"
638 (("INSTALL_SYMLINK = /bin/sh")
639 "INSTALL_SYMLINK = sh"))
641 ;; Do not include a timestamp in libext2fs.info.gz.
642 (substitute* "doc/Makefile.in"
645 (build-system gnu-build-system)
646 (inputs `(("util-linux" ,util-linux)))
647 (native-inputs `(("pkg-config" ,pkg-config)
648 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
650 '(;; Parallel building reliably yields a failure like this:
651 ;; "make[2]: *** No rule to make target '../lib/libss.so', needed by
654 ;; util-linux is the preferred source for some of the libraries and
655 ;; commands, so disable them (see, e.g.,
656 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
657 #:configure-flags '("--disable-libblkid"
658 "--disable-libuuid" "--disable-uuidd"
661 ;; Use symlinks instead of hard links for
662 ;; 'fsck.extN' etc. This makes the resulting nar
663 ;; smaller and is preserved across copies.
664 "--enable-symlink-install"
666 ;; Install libext2fs et al.
667 "--enable-elf-shlibs")
669 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
670 (assoc-ref %outputs "out")
673 #:phases (alist-cons-before
674 'configure 'patch-shells
676 (substitute* "configure"
677 (("/bin/sh (.*)parse-types.sh" _ dir)
678 (string-append (which "sh") " " dir
680 (substitute* (find-files "." "^Makefile.in$")
682 (string-append "#!" (which "sh")))))
684 'install 'install-libs
685 (lambda* (#:key outputs #:allow-other-keys)
686 (let* ((out (assoc-ref outputs "out"))
687 (lib (string-append out "/lib")))
688 (and (zero? (system* "make" "install-libs"))
690 ;; Make the .a writable so that 'strip' works.
691 ;; Failing to do that, due to debug symbols, we
692 ;; retain a reference to the final
693 ;; linux-libre-headers, which refer to the
694 ;; bootstrap binaries.
695 (let ((archives (find-files lib "\\.a$")))
696 (for-each (lambda (file)
702 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
703 ;; they fail because we get an extra line that says "Can't check if
704 ;; file system is mounted due to missing mtab file".
706 (home-page "http://e2fsprogs.sourceforge.net/")
707 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
709 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
710 (license (list license:gpl2 ;programs
711 license:lgpl2.0 ;libext2fs
712 license:x11)))) ;libuuid
714 (define e2fsprogs/static
716 (package (inherit e2fsprogs)
718 ;; Do not build shared libraries.
719 (substitute-keyword-arguments (package-arguments e2fsprogs)
720 ((#:configure-flags _)
721 '(list "--disable-blkid"))
725 (define-public e2fsck/static
727 (name "e2fsck-static")
728 (version (package-version e2fsprogs))
729 (build-system trivial-build-system)
732 `(("e2fsprogs" ,e2fsprogs/static)))
734 `(#:modules ((guix build utils))
737 (use-modules (guix build utils)
741 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
743 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
745 (with-directory-excursion bin
746 (copy-file e2fsck "e2fsck")
747 (remove-store-references "e2fsck")
748 (chmod "e2fsck" #o555))))))
749 (home-page (package-home-page e2fsprogs))
750 (synopsis "Statically-linked e2fsck command from e2fsprogs")
751 (description "This package provides statically-linked e2fsck command taken
752 from the e2fsprogs package. It is meant to be used in initrds.")
753 (license (package-license e2fsprogs))))
755 (define-public extundelete
761 (uri (string-append "mirror://sourceforge/extundelete/"
762 "extundelete/" version "/extundelete-"
766 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
767 (build-system gnu-build-system)
768 (inputs `(("e2fsprogs" ,e2fsprogs)))
769 (home-page "http://extundelete.sourceforge.net/")
770 (synopsis "Recover deleted files from ext2/3/4 partitions")
772 "Extundelete is a set of tools that can recover deleted files from an
773 ext3 or ext4 partition.")
774 (license license:gpl2)))
776 (define-public zerofree
780 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
783 (uri (string-append home-page name "-" version
787 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
788 (build-system gnu-build-system)
790 '(#:phases (alist-replace
792 (lambda* (#:key outputs #:allow-other-keys)
793 (let* ((out (assoc-ref outputs "out"))
794 (bin (string-append out "/bin")))
796 (copy-file "zerofree"
797 (string-append bin "/zerofree"))
798 (chmod (string-append bin "/zerofree")
801 (alist-delete 'configure %standard-phases))
802 #:tests? #f)) ;no tests
803 (inputs `(("libext2fs" ,e2fsprogs)))
804 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
806 "The zerofree command scans the free blocks in an ext2 file system and
807 fills any non-zero blocks with zeroes. This is a useful way to make disk
808 images more compressible.")
809 (license license:gpl2)))
811 (define-public strace
817 (uri (string-append "mirror://sourceforge/strace/strace/" version
818 "/strace-" version ".tar.xz"))
821 "1vzhmpcy989i4k12q4cc438yal2ghhm6x7ychscjbhcf2yspqj4q"))))
822 (build-system gnu-build-system)
825 (modify-phases %standard-phases
826 (add-after 'unpack 'patch-/bin/sh
828 (substitute* "strace.c"
829 (("/bin/sh") (which "sh")))
831 (native-inputs `(("perl" ,perl)))
832 (home-page "https://strace.io/")
833 (synopsis "System call tracer for Linux")
835 "strace is a system call tracer, i.e. a debugging tool which prints out a
836 trace of all the system calls made by a another process/program.")
837 (license license:bsd-3)))
839 (define-public ltrace
845 (uri (string-append "http://www.ltrace.org/ltrace_" version
849 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
850 (build-system gnu-build-system)
851 (inputs `(("libelf" ,libelf)))
853 ;; Compilation uses -Werror by default, but it fails.
854 '(#:configure-flags '("--disable-werror")))
855 (home-page "http://www.ltrace.org/")
856 (synopsis "Library call tracer for Linux")
858 "ltrace intercepts and records dynamic library calls which are called by
859 an executed process and the signals received by that process. It can also
860 intercept and print the system calls executed by the program.")
861 (license license:gpl2+)))
863 (define-public alsa-lib
870 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
874 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
875 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
876 (build-system gnu-build-system)
877 (home-page "http://www.alsa-project.org/")
878 (synopsis "The Advanced Linux Sound Architecture libraries")
880 "The Advanced Linux Sound Architecture (ALSA) provides audio and
881 MIDI functionality to the Linux-based operating system.")
882 (license license:lgpl2.1+)))
884 (define-public alsa-utils
890 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
891 name "-" version ".tar.bz2"))
894 "0z0nnqp1707bm02dys2d16m88lsg5nd26bqaf14rl3za9sjifwhj"))))
895 (build-system gnu-build-system)
897 ;; XXX: Disable man page creation until we have DocBook.
898 '(#:configure-flags (list "--disable-xmlto"
900 ;; The udev rule is responsible for restoring
902 (string-append "--with-udev-rules-dir="
903 (assoc-ref %outputs "out")
904 "/lib/udev/rules.d"))
906 (modify-phases %standard-phases
908 'install 'pre-install
910 ;; Don't try to mkdir /var/lib/alsa.
911 (substitute* "Makefile"
912 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
916 `(("libsamplerate" ,libsamplerate)
918 ("alsa-lib" ,alsa-lib)
920 ("gettext" ,gettext-minimal)))
921 (home-page "http://www.alsa-project.org/")
922 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
924 "The Advanced Linux Sound Architecture (ALSA) provides audio and
925 MIDI functionality to the Linux-based operating system.")
927 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
929 (license license:gpl2)))
931 (define-public alsa-plugins
933 (name "alsa-plugins")
937 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
938 name "-" version ".tar.bz2"))
941 "1w81z5jlwqhd1l2m7qrq69lc4k9dnrg1wn52jsl2hrf3hbhd394f"))))
942 (build-system gnu-build-system)
943 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
944 ;; be split, there are references to both in files.
945 ;; TODO: Remove OSS related plugins, they add support to run native
946 ;; ALSA applications on OSS however we do not offer OSS and OSS is
948 (outputs '("out" "pulseaudio"))
951 (modify-phases %standard-phases
952 (add-after 'install 'split
953 (lambda* (#:key inputs outputs #:allow-other-keys)
954 ;; Distribute the binaries to the various outputs.
955 (let* ((out (assoc-ref outputs "out"))
956 (pua (assoc-ref outputs "pulseaudio"))
957 (pualib (string-append pua "/lib/alsa-lib"))
958 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
961 (chdir (string-append out "/share"))
962 (for-each (lambda (file)
963 (rename-file file (string-append puaconf "/" (basename file))))
964 (find-files out "\\.(conf|example)"))
965 (for-each (lambda (file)
966 (rename-file file (string-append pualib "/" (basename file))))
967 (find-files out ".*pulse\\.(la|so)"))
969 ;; We have moved the files to output pulsaudio, the
970 ;; directory is now empty.
971 (delete-file-recursively (string-append out "/share"))
974 `(("alsa-lib" ,alsa-lib)
975 ("speex" ,speex) ; libspeexdsp resampling plugin
976 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
977 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
978 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
980 `(("pkg-config" ,pkg-config)))
981 (home-page "http://www.alsa-project.org/")
982 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
984 "The Advanced Linux Sound Architecture (ALSA) provides audio and
985 MIDI functionality to the Linux-based operating system. This package enhances ALSA
986 by providing additional plugins which include: upmixing, downmixing, jackd and
987 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
988 external rate conversion.")
989 (license (list license:gpl2+
990 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
993 (define-public iptables
1000 "http://www.netfilter.org/projects/iptables/files/iptables-"
1001 version ".tar.bz2"))
1004 "1q6kg7sf0pgpq0qhab6sywl23cngxxfzc9zdzscsba8x09l4q02j"))))
1005 (build-system gnu-build-system)
1007 '(#:tests? #f ; no test suite
1008 #:configure-flags ; add $libdir to the RUNPATH of executables
1009 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1010 (home-page "http://www.netfilter.org/projects/iptables/index.html")
1011 (synopsis "Program to configure the Linux IP packet filtering rules")
1013 "iptables is the userspace command line program used to configure the
1014 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1015 system administrators. Since Network Address Translation is also configured
1016 from the packet filter ruleset, iptables is used for this, too. The iptables
1017 package also includes ip6tables. ip6tables is used for configuring the IPv6
1019 (license license:gpl2+)))
1021 (define-public iproute
1028 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1032 "1i0n071hiqxw1gisngw2jln3kcp9sh47n6fj5hdwqrvp7w20zwy0"))))
1033 (build-system gnu-build-system)
1035 `(#:tests? #f ; no test suite
1036 #:make-flags (let ((out (assoc-ref %outputs "out")))
1038 (string-append "BASH_COMPDIR=" out
1039 "/etc/bash_completion.d")
1040 (string-append "LIBDIR=" out "/lib")
1041 (string-append "SBINDIR=" out "/sbin")
1042 (string-append "CONFDIR=" out "/etc")
1043 (string-append "DOCDIR=" out "/share/doc/"
1045 (string-append "MANDIR=" out "/share/man")))
1046 #:phases (modify-phases %standard-phases
1047 (add-before 'install 'pre-install
1049 ;; Don't attempt to create /var/lib/arpd.
1050 (substitute* "Makefile"
1051 (("^.*ARPDDIR.*$") "")))))))
1053 `(("iptables" ,iptables)
1056 `(("pkg-config" ,pkg-config)
1060 "https://wiki.linuxfoundation.org/networking/iproute2")
1062 "Utilities for controlling TCP/IP networking and traffic in Linux")
1064 "Iproute2 is a collection of utilities for controlling TCP/IP
1065 networking and traffic with the Linux kernel.
1067 Most network configuration manuals still refer to ifconfig and route as the
1068 primary network configuration tools, but ifconfig is known to behave
1069 inadequately in modern network environments. They should be deprecated, but
1070 most distros still include them. Most network configuration systems make use
1071 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1072 to support most modern network technologies, as it doesn't use ifconfig and
1073 allows a system administrator to make use of all iproute2 features, including
1076 iproute2 is usually shipped in a package called iproute or iproute2 and
1077 consists of several tools, of which the most important are ip and tc. ip
1078 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
1079 tools print detailed usage messages and are accompanied by a set of
1081 (license license:gpl2+)))
1083 (define-public net-tools
1084 ;; XXX: This package is basically unmaintained, but it provides a few
1085 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1090 (home-page "http://net-tools.sourceforge.net/")
1093 (uri (list (string-append
1094 "mirror://sourceforge/net-tools/net-tools-"
1097 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1098 "/base/net-tools/net-tools-1.60.tar.bz2")))
1101 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1102 (patches (search-patches "net-tools-bitrot.patch"))))
1103 (build-system gnu-build-system)
1105 '(#:modules ((guix build gnu-build-system)
1109 #:phases (alist-cons-after
1111 (lambda* (#:key inputs #:allow-other-keys)
1112 (define (apply-patch file)
1113 (zero? (system* "patch" "-p1" "--force"
1116 (let ((patch.gz (assoc-ref inputs "patch")))
1117 (format #t "applying Debian patch set '~a'...~%"
1119 (system (string-append "gunzip < " patch.gz " > the-patch"))
1120 (and (apply-patch "the-patch")
1121 (for-each apply-patch
1122 (find-files "debian/patches"
1126 (lambda* (#:key outputs #:allow-other-keys)
1127 (let ((out (assoc-ref outputs "out")))
1128 (mkdir-p (string-append out "/bin"))
1129 (mkdir-p (string-append out "/sbin"))
1131 ;; Pretend we have everything...
1132 (system "yes | make config")
1134 ;; ... except for the things we don't have.
1135 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1136 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1137 ;; that have been removed.
1138 (substitute* '("config.make" "config.h")
1139 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1141 'install 'remove-redundant-commands
1142 (lambda* (#:key outputs #:allow-other-keys)
1143 ;; Remove commands and man pages redundant with
1145 (let* ((out (assoc-ref outputs "out"))
1146 (dup (append-map (cut find-files out <>)
1148 "^(yp|nis|dns)?domainname"))))
1149 (for-each delete-file dup)
1153 ;; Binaries that depend on libnet-tools.a don't declare that
1154 ;; dependency, making it parallel-unsafe.
1155 #:parallel-build? #f
1157 #:tests? #f ; no test suite
1158 #:make-flags (let ((out (assoc-ref %outputs "out")))
1160 (string-append "BASEDIR=" out)
1161 (string-append "INSTALLNLSDIR=" out "/share/locale")
1162 (string-append "mandir=/share/man")))))
1164 ;; Use the big Debian patch set (the thing does not even compile out of
1166 (inputs `(("patch" ,(origin
1169 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1172 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1173 (native-inputs `(("gettext" ,gettext-minimal)))
1175 (synopsis "Tools for controlling the network subsystem in Linux")
1177 "This package includes the important tools for controlling the network
1178 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1179 netstat, rarp and route. Additionally, this package contains utilities
1180 relating to particular network hardware types (plipconfig, slattach) and
1181 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1182 (license license:gpl2+)))
1184 (define-public libcap
1191 "mirror://kernel.org/linux/libs/security/linux-privs/"
1192 "libcap2/libcap-" version ".tar.xz"))
1195 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
1196 (build-system gnu-build-system)
1197 (arguments '(#:phases
1198 (modify-phases %standard-phases
1200 ;; Add $libdir to the RUNPATH of executables.
1202 (substitute* "Make.Rules"
1204 (string-append "LDFLAGS := -Wl,-rpath="
1205 %output "/lib"))))))
1206 #:tests? #f ; no 'check' target
1207 #:make-flags (list "lib=lib"
1208 (string-append "prefix="
1209 (assoc-ref %outputs "out"))
1210 "RAISE_SETFCAP=no")))
1211 (native-inputs `(("perl" ,perl)))
1212 (inputs `(("attr" ,attr)))
1213 (home-page "https://sites.google.com/site/fullycapable/")
1214 (synopsis "Library for working with POSIX capabilities")
1216 "Libcap2 provides a programming interface to POSIX capabilities on
1217 Linux-based operating systems.")
1219 ;; License is BSD-3 or GPLv2, at the user's choice.
1220 (license license:gpl2)))
1222 (define-public bridge-utils
1224 (name "bridge-utils")
1228 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1229 "bridge-utils-" version ".tar.gz"))
1232 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1233 (build-system gnu-build-system)
1235 ;; The tarball lacks all the generated files.
1236 (native-inputs `(("autoconf" ,autoconf)
1237 ("automake" ,automake)))
1239 '(#:phases (alist-cons-after
1242 ;; Fix "field ‘ip6’ has incomplete type" errors.
1243 (substitute* "libbridge/libbridge.h"
1244 (("#include <linux/if_bridge.h>")
1245 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1247 ;; Ensure that the entire build fails if one of the
1248 ;; sub-Makefiles fails.
1249 (substitute* "Makefile.in"
1250 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1251 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1253 (zero? (system* "autoreconf" "-vf")))
1255 #:tests? #f)) ; no 'check' target
1258 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1259 (synopsis "Manipulate Ethernet bridges")
1261 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1262 to connect two Ethernet segments together in a protocol independent way.
1263 Packets are forwarded based on Ethernet address, rather than IP address (like
1264 a router). Since forwarding is done at Layer 2, all protocols can go
1265 transparently through a bridge.")
1266 (license license:gpl2+)))
1268 (define-public libnl
1275 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1279 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1280 (build-system gnu-build-system)
1281 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1282 (home-page "http://www.infradead.org/~tgr/libnl/")
1283 (synopsis "NetLink protocol library suite")
1285 "The libnl suite is a collection of libraries providing APIs to netlink
1286 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1287 between the kernel and user space processes. It was designed to be a more
1288 flexible successor to ioctl to provide mainly networking related kernel
1289 configuration and monitoring interfaces.")
1291 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1292 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1293 (license license:gpl2)))
1302 "mirror://kernel.org/software/network/iw/iw-"
1306 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1307 (build-system gnu-build-system)
1308 (native-inputs `(("pkg-config" ,pkg-config)))
1309 (inputs `(("libnl" ,libnl)))
1311 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1313 #:phases (alist-delete 'configure %standard-phases)))
1314 (home-page "https://wireless.wiki.kernel.org/")
1315 (synopsis "Tool for configuring wireless devices")
1317 "iw is a new nl80211 based CLI configuration utility for wireless
1318 devices. It replaces @code{iwconfig}, which is deprecated.")
1319 (license license:isc)))
1321 (define-public powertop
1329 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1333 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1334 (build-system gnu-build-system)
1337 (modify-phases %standard-phases
1338 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1339 ;; allow calibrating the network interface in GuixSD.
1340 (add-after 'unpack 'patch-absolute-file-names
1341 (lambda* (#:key inputs #:allow-other-keys)
1342 (let ((kmod (assoc-ref inputs "kmod")))
1343 (substitute* (find-files "src" "\\.cpp$")
1344 ;; Give the right 'modprobe' file name so that essential
1345 ;; modules such as msr.ko can be loaded.
1346 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1347 ;; These programs are only needed to calibrate, so using
1348 ;; relative file names avoids adding extra inputs. When they
1349 ;; are missing powertop gracefully handles it.
1350 (("/usr/bin/hcitool") "hcitool")
1351 (("/usr/bin/xset") "xset")
1352 (("/usr/sbin/hciconfig") "hciconfig"))
1357 ("ncurses" ,ncurses)
1358 ("pciutils" ,pciutils)
1361 `(("pkg-config" ,pkg-config)))
1362 (home-page "https://01.org/powertop/")
1363 (synopsis "Analyze power consumption on Intel-based laptops")
1365 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1366 power management. In addition to being a diagnostic tool, PowerTOP also has
1367 an interactive mode where the user can experiment various power management
1368 settings for cases where the operating system has not enabled these
1370 (license license:gpl2)))
1372 (define-public aumix
1379 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1380 version ".tar.bz2"))
1383 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1384 (build-system gnu-build-system)
1385 (inputs `(("ncurses" ,ncurses)))
1386 (home-page "http://www.jpj.net/~trevor/aumix.html")
1387 (synopsis "Audio mixer for X and the console")
1389 "Aumix adjusts an audio mixer from X, the console, a terminal,
1390 the command line or a script.")
1391 (license license:gpl2+)))
1393 (define-public iotop
1400 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1403 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1404 (build-system python-build-system)
1406 ;; The setup.py script expects python-2.
1407 `(#:python ,python-2
1408 ;; There are currently no checks in the package.
1410 (native-inputs `(("python" ,python-2)))
1411 (home-page "http://guichaz.free.fr/iotop/")
1413 "Displays the IO activity of running processes")
1415 "Iotop is a Python program with a top like user interface to show the
1416 processes currently causing I/O.")
1417 (license license:gpl2+)))
1425 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1426 "download/fuse-" version
1427 "/fuse-" version ".tar.gz"))
1430 "0szi2vlsjxg03y4ji51jks34p269jqj5ify6l0ajsqq6f6y8pd0c"))))
1431 (build-system gnu-build-system)
1432 (inputs `(("util-linux" ,util-linux)))
1434 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1435 (assoc-ref %outputs "out")
1437 (string-append "INIT_D_PATH="
1438 (assoc-ref %outputs "out")
1441 ;; The rule makes /dev/fuse 666.
1442 (string-append "UDEV_RULES_PATH="
1443 (assoc-ref %outputs "out")
1444 "/lib/udev/rules.d"))
1445 #:phases (alist-cons-before
1446 'build 'set-file-names
1447 (lambda* (#:key inputs #:allow-other-keys)
1448 ;; libfuse calls out to mount(8) and umount(8). Make sure
1449 ;; it refers to the right ones.
1450 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1451 (("/bin/(u?)mount" _ maybe-u)
1452 (string-append (assoc-ref inputs "util-linux")
1453 "/bin/" maybe-u "mount")))
1454 (substitute* '("util/mount.fuse.c")
1458 ;; This hack leads libfuse to search for 'fusermount' in
1459 ;; $PATH, where it may find a setuid-root binary, instead of
1460 ;; trying solely $out/sbin/fusermount and failing because
1462 (substitute* "lib/Makefile"
1463 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1464 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1466 (home-page "https://github.com/libfuse/libfuse")
1467 (synopsis "Support file systems implemented in user space")
1469 "As a consequence of its monolithic design, file system code for Linux
1470 normally goes into the kernel itself---which is not only a robustness issue,
1471 but also an impediment to system extensibility. FUSE, for \"file systems in
1472 user space\", is a kernel module and user-space library that tries to address
1473 part of this problem by allowing users to run file system implementations as
1474 user-space processes.")
1475 (license (list license:lgpl2.1 ;library
1476 license:gpl2+)))) ;command-line utilities
1478 (define-public unionfs-fuse
1480 (name "unionfs-fuse")
1485 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1489 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1490 (build-system cmake-build-system)
1491 (inputs `(("fuse" ,fuse)))
1492 (arguments '(#:tests? #f)) ; no tests
1493 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1494 (synopsis "User-space union file system")
1496 "UnionFS-FUSE is a flexible union file system implementation in user
1497 space, using the FUSE library. Mounting a union file system allows you to
1498 \"aggregate\" the contents of several directories into a single mount point.
1499 UnionFS-FUSE additionally supports copy-on-write.")
1500 (license license:bsd-3)))
1503 (package (inherit fuse)
1504 (name "fuse-static")
1505 (source (origin (inherit (package-source fuse))
1506 (modules '((guix build utils)))
1508 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1509 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1510 ;; it doesn't do that, allowing us to remove the dependency on
1511 ;; util-linux (something that is useful in initrds.)
1512 '(substitute* '("lib/mount_util.c"
1513 "util/mount_util.c")
1514 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1519 (define-public unionfs-fuse/static
1520 (package (inherit unionfs-fuse)
1521 (synopsis "User-space union file system (statically linked)")
1522 (name (string-append (package-name unionfs-fuse) "-static"))
1523 (source (origin (inherit (package-source unionfs-fuse))
1524 (modules '((guix build utils)))
1526 ;; Add -ldl to the libraries, because libfuse.a needs that.
1527 '(substitute* "src/CMakeLists.txt"
1528 (("target_link_libraries(.*)\\)" _ libs)
1529 (string-append "target_link_libraries"
1533 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1534 #:phases (alist-cons-after
1535 'install 'post-install
1536 (lambda* (#:key outputs #:allow-other-keys)
1537 (let* ((out (assoc-ref outputs "out"))
1538 (exe (string-append out "/bin/unionfs")))
1539 ;; By default, 'unionfs' keeps references to
1540 ;; $glibc/share/locale and similar stuff. Remove them.
1541 (remove-store-references exe)))
1543 (inputs `(("fuse" ,fuse-static)))))
1545 (define-public sshfs-fuse
1551 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1552 "download/sshfs_" version
1553 "/sshfs-" version ".tar.gz"))
1556 "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
1557 (build-system gnu-build-system)
1562 `(("pkg-config" ,pkg-config)))
1563 (home-page "http://fuse.sourceforge.net/sshfs.html")
1564 (synopsis "Mount remote file systems over SSH")
1566 "This is a file system client based on the SSH File Transfer Protocol.
1567 Since most SSH servers already support this protocol it is very easy to set
1568 up: on the server side there's nothing to do; on the client side mounting the
1569 file system is as easy as logging into the server with an SSH client.")
1570 (license license:gpl2+)))
1572 (define-public numactl
1579 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1584 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1585 (build-system gnu-build-system)
1587 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1588 ;; to run, which we can't assume to have.
1591 ;; NUMA is apparently not supported on armhf, see
1592 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1593 (supported-systems (delete "armhf-linux" %supported-systems))
1594 (home-page "http://oss.sgi.com/projects/libnuma/")
1595 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1597 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1598 memory is not all in one place. The numactl program allows you to run your
1599 application program on specific CPU's and memory nodes. It does this by
1600 supplying a NUMA memory policy to the operating system before running your
1603 The package contains other commands, such as numademo, numastat and memhog.
1604 The numademo command provides a quick overview of NUMA performance on your
1606 (license (list license:gpl2 ;programs
1607 license:lgpl2.1)))) ;library
1615 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1619 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1620 (modules '((guix build utils)))
1623 (substitute* "tests/Makefile.in"
1624 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1627 (substitute* '("src/unicode_start" "src/unicode_stop")
1628 ;; Assume the Coreutils are in $PATH.
1631 (build-system gnu-build-system)
1634 (modify-phases %standard-phases
1635 (add-before 'build 'pre-build
1636 (lambda* (#:key inputs #:allow-other-keys)
1637 (let ((gzip (assoc-ref %build-inputs "gzip"))
1638 (bzip2 (assoc-ref %build-inputs "bzip2")))
1639 (substitute* "src/libkeymap/findfile.c"
1641 (string-append gzip "/bin/gzip"))
1643 (string-append bzip2 "/bin/bzip2"))))))
1644 (add-after 'install 'post-install
1645 (lambda* (#:key outputs #:allow-other-keys)
1646 ;; Make sure these programs find their comrades.
1647 (let* ((out (assoc-ref outputs "out"))
1648 (bin (string-append out "/bin")))
1649 (for-each (lambda (prog)
1650 (wrap-program (string-append bin "/" prog)
1651 `("PATH" ":" prefix (,bin))))
1652 '("unicode_start" "unicode_stop"))))))))
1653 (inputs `(("check" ,check)
1656 ("pam" ,linux-pam)))
1657 (native-inputs `(("pkg-config" ,pkg-config)))
1658 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1659 (synopsis "Linux keyboard utilities and keyboard maps")
1661 "This package contains keytable files and keyboard utilities compatible
1662 for systems using the Linux kernel. This includes commands such as
1663 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1664 (license license:gpl2+)))
1666 (define-public inotify-tools
1668 (name "inotify-tools")
1673 "mirror://sourceforge/inotify-tools/inotify-tools/"
1674 version "/inotify-tools-" version ".tar.gz"))
1677 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1678 (build-system gnu-build-system)
1679 (home-page "http://inotify-tools.sourceforge.net/")
1680 (synopsis "Monitor file accesses")
1682 "The inotify-tools packages provides a C library and command-line tools
1683 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1684 (license license:gpl2+)))
1693 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1694 "kmod-" version ".tar.xz"))
1697 "0mc12sx06p8il1ym3hdmgxxb37apn9yv7xij26gddjdfkx8xa0yk"))
1698 (patches (search-patches "kmod-module-directory.patch"))))
1699 (build-system gnu-build-system)
1701 `(("pkg-config" ,pkg-config)))
1706 `(#:tests? #f ; FIXME: Investigate test failures
1707 #:configure-flags '("--with-xz" "--with-zlib")
1708 #:phases (alist-cons-after
1709 'install 'install-modprobe&co
1710 (lambda* (#:key outputs #:allow-other-keys)
1711 (let* ((out (assoc-ref outputs "out"))
1712 (bin (string-append out "/bin")))
1713 (for-each (lambda (tool)
1715 (string-append bin "/" tool)))
1716 '("insmod" "rmmod" "lsmod" "modprobe"
1717 "modinfo" "depmod"))))
1719 (home-page "https://www.kernel.org/")
1720 (synopsis "Kernel module tools")
1721 (description "Kmod is a set of tools to handle common tasks with Linux
1722 kernel modules like insert, remove, list, check properties, resolve
1723 dependencies and aliases.
1725 These tools are designed on top of libkmod, a library that is shipped with
1726 kmod. The aim is to be compatible with tools, configurations and indices
1727 from the module-init-tools project.")
1728 (license license:gpl2+))) ; library under lgpl2.1+
1730 (define-public eudev
1731 ;; The post-systemd fork, maintained by Gentoo.
1738 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1742 "099w62ncq78nxpxizf910mx18hc8x4qvzw3azjd00fir89wmyjnq"))
1743 (patches (search-patches "eudev-rules-directory.patch"))))
1744 (build-system gnu-build-system)
1746 `(("pkg-config" ,pkg-config)
1750 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1751 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1752 ;; which contains the rules to do that.
1753 `(("util-linux" ,util-linux) ;for blkid
1755 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1756 (synopsis "Userspace device management")
1757 (description "Udev is a daemon which dynamically creates and removes
1758 device nodes from /dev/, handles hotplug events and loads drivers at boot
1760 (license license:gpl2+)))
1762 (define-public eudev-with-hwdb
1763 ;; TODO: Merge with 'eudev'.
1766 (name "eudev-with-hwdb")
1768 '(#:phases (modify-phases %standard-phases
1769 (add-after 'install 'build-hwdb
1770 (lambda* (#:key outputs #:allow-other-keys)
1771 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1772 ;; similar tools to display product names.
1773 (let ((out (assoc-ref outputs "out")))
1774 (zero? (system* (string-append out "/bin/udevadm")
1775 "hwdb" "--update"))))))))))
1780 (version "2.02.168")
1783 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1787 "03b62hcsj9z37ckd8c21wwpm07s9zblq7grfh58yzcs1vp6x38r3"))
1788 (modules '((guix build utils)))
1791 (use-modules (guix build utils))
1793 ;; Honor sysconfdir.
1794 (substitute* "make.tmpl.in"
1796 "confdir = @sysconfdir@\n")
1797 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1798 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1799 (patches (search-patches "lvm2-static-link.patch"))))
1800 (build-system gnu-build-system)
1802 `(("pkg-config" ,pkg-config)
1803 ("procps" ,procps))) ;tests use 'pgrep'
1808 (modify-phases %standard-phases
1809 (add-after 'configure 'set-makefile-shell
1811 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1813 (setenv "SHELL" (which "sh"))
1815 ;; Replace /bin/sh with the right file name.
1816 (patch-makefile-SHELL "make.tmpl")
1818 (add-before 'strip 'make-objects-writable
1819 (lambda* (#:key outputs #:allow-other-keys)
1820 ;; Make compiled objects writable so they can be stripped.
1821 (let ((out (assoc-ref outputs "out")))
1822 (for-each (lambda (file)
1825 (find-files (string-append out "/lib"))
1826 (find-files (string-append out "/sbin"))))
1829 #:configure-flags (list (string-append "--sysconfdir="
1830 (assoc-ref %outputs "out")
1832 "--enable-udev_sync"
1833 "--enable-udev_rules"
1835 ;; Make sure programs such as 'dmsetup' can
1836 ;; find libdevmapper.so.
1837 (string-append "LDFLAGS=-Wl,-rpath="
1838 (assoc-ref %outputs "out")
1841 ;; The tests use 'mknod', which requires root access.
1843 (home-page "http://sourceware.org/lvm2/")
1844 (synopsis "Logical volume management for Linux")
1846 "LVM2 is the logical volume management tool set for Linux-based systems.
1847 This package includes the user-space libraries and tools, including the device
1848 mapper. Kernel components are part of Linux-libre.")
1850 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1851 ;; Command-line tools are GPLv2.
1852 (license (list license:gpl2 license:lgpl2.1))))
1854 (define-public lvm2-static
1857 (name "lvm2-static")
1859 ;; Propagate udev because libdevmapper.a depends on libudev.
1860 (inputs (alist-delete "udev" (package-inputs lvm2)))
1861 (propagated-inputs `(("udev" ,eudev)))
1864 (substitute-keyword-arguments (package-arguments lvm2)
1865 ((#:configure-flags flags '())
1866 ;; LVM2 doesn't use Libtool, hence the custom option.
1867 `(cons "--enable-static_link" ,flags))))
1868 (synopsis "Logical volume management for Linux (statically linked)")))
1870 (define-public wireless-tools
1872 (name "wireless-tools")
1876 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1880 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1883 ;; Remove the older header files that are not free software.
1884 (for-each (lambda (n)
1885 (delete-file (format #f "wireless.~a.h" n)))
1886 '(10 11 12 13 14 15 16 17 18 19 20))
1888 (build-system gnu-build-system)
1891 (list (string-append "PREFIX=" %output)
1892 (string-append "INSTALL_MAN=" %output "/share/man")
1893 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1895 #:phases (modify-phases %standard-phases
1896 (delete 'configure))
1898 (synopsis "Tools for manipulating Linux Wireless Extensions")
1899 (description "Wireless Tools are used to manipulate the now-deprecated
1900 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1901 Extension was an interface allowing you to set Wireless LAN specific
1902 parameters and get the specific stats. It is deprecated in favor the nl80211
1904 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1905 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1906 ;; other files are distributed under gpl2.
1907 (license (list license:gpl2 license:lgpl2.1+))))
1915 (uri (string-append "mirror://kernel.org/software/network/crda/"
1916 "crda-" version ".tar.xz"))
1919 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
1920 (patches (search-patches "crda-optional-gcrypt.patch"))))
1921 (build-system gnu-build-system)
1923 '(#:phases (modify-phases %standard-phases
1926 'build 'no-werror-no-ldconfig
1928 (substitute* "Makefile"
1930 (("ldconfig") "true"))
1933 'build 'set-regulator-db-file-name
1934 (lambda* (#:key inputs #:allow-other-keys)
1935 ;; Tell CRDA where to find our database.
1936 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1937 (substitute* "crda.c"
1938 (("\"/lib/crda/regulatory.bin\"")
1939 (string-append "\"" regdb
1940 "/lib/crda/regulatory.bin\"")))
1942 #:test-target "verify"
1943 #:make-flags (let ((out (assoc-ref %outputs "out"))
1944 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1945 (list "CC=gcc" "V=1"
1947 ;; Disable signature-checking on 'regulatory.bin'.
1948 ;; The reason is that this simplifies maintenance
1949 ;; on our side (no need to manage a distro key
1950 ;; pair), and we can guarantee integrity of
1951 ;; 'regulatory.bin' by other means anyway, such as
1952 ;; 'guix gc --verify'. See
1953 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1957 (string-append "PREFIX=" out)
1958 (string-append "SBINDIR=" out "/sbin/")
1959 (string-append "UDEV_RULE_DIR="
1960 out "/lib/udev/rules.d")
1961 (string-append "LDFLAGS=-Wl,-rpath="
1963 (string-append "REG_BIN=" regdb
1964 "/lib/crda/regulatory.bin")))))
1965 (native-inputs `(("pkg-config" ,pkg-config)
1966 ("python" ,python-2)
1967 ("wireless-regdb" ,wireless-regdb)))
1968 (inputs `(("libnl" ,libnl)))
1970 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1971 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1973 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1974 communication between the kernel Linux and user space for regulatory
1976 (license license:copyleft-next)))
1978 (define-public wireless-regdb
1980 (name "wireless-regdb")
1981 (version "2016.06.10")
1985 "mirror://kernel.org/software/network/wireless-regdb/"
1986 "wireless-regdb-" version ".tar.xz"))
1989 "1dxqy7a7zpzya30ff00s8k1qgrlndrwys99gc0r8yg0vab1z3vfg"))
1991 ;; We're building 'regulatory.bin' by ourselves.
1992 (snippet '(delete-file "regulatory.bin"))))
1993 (build-system gnu-build-system)
1995 '(#:phases (modify-phases %standard-phases
1996 (delete 'configure))
1998 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
1999 ;; is computed and can be equal to 'maintainer-clean'; when that
2000 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2001 ;; just built. Thus, build things sequentially.
2002 #:parallel-build? #f
2004 #:tests? #f ;no tests
2005 #:make-flags (let ((out (assoc-ref %outputs "out")))
2006 (list (string-append "PREFIX=" out)
2007 (string-append "LSB_ID=GuixSD")
2008 (string-append "DISTRO_PUBKEY=/dev/null")
2009 (string-append "DISTRO_PRIVKEY=/dev/null")
2010 (string-append "REGDB_PUBKEY=/dev/null")
2012 ;; Leave that empty so that db2bin.py doesn't try
2013 ;; to sign 'regulatory.bin'. This allows us to
2014 ;; avoid managing a key pair for the whole distro.
2015 (string-append "REGDB_PRIVKEY=")))))
2016 (native-inputs `(("python" ,python-2)))
2018 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2019 (synopsis "Wireless regulatory database")
2021 "This package contains the wireless regulatory database Central
2022 Regulatory Database Agent (CRDA) daemon. The database contains information on
2023 country-specific regulations for the wireless spectrum.")
2024 (license license:isc)))
2026 (define-public lm-sensors
2032 (uri (list (string-append
2033 "https://github.com/groeck/lm-sensors/archive/V"
2034 (string-join (string-split version #\.) "-")
2038 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2039 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2040 (build-system gnu-build-system)
2041 (inputs `(("rrdtool" ,rrdtool)
2044 ("gnuplot" ,gnuplot)))
2045 (native-inputs `(("pkg-config" ,pkg-config)
2050 `(#:tests? #f ; no 'check' target
2051 #:make-flags (list (string-append "PREFIX=" %output)
2052 (string-append "ETCDIR=" %output "/etc")
2053 (string-append "MANDIR=" %output "/share/man"))
2058 'build 'patch-exec-paths
2059 (lambda* (#:key inputs outputs #:allow-other-keys)
2060 (substitute* "prog/detect/sensors-detect"
2062 (string-append "`" (assoc-ref inputs "coreutils")
2064 (("(`|\")modprobe" all open-quote)
2065 (string-append open-quote
2066 (assoc-ref inputs "kmod")
2068 (substitute* '("prog/pwm/pwmconfig"
2069 "prog/pwm/fancontrol")
2071 (string-append (assoc-ref inputs "gnuplot")
2074 (string-append (assoc-ref inputs "coreutils")
2077 (string-append (assoc-ref inputs "grep")
2080 (string-append (assoc-ref inputs "sed")
2083 (string-append (assoc-ref inputs "coreutils")
2086 (string-append (assoc-ref inputs "coreutils")
2089 (string-append (assoc-ref inputs "coreutils")
2090 "/bin/readlink -f"))))
2091 %standard-phases))))
2092 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2093 (synopsis "Utilities to read temperature/voltage/fan sensors")
2095 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2096 you to access information from temperature, voltage, and fan speed sensors.
2097 It works with most newer systems.")
2098 (license license:gpl2+)))
2100 (define-public i2c-tools
2107 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2108 version ".tar.bz2"))
2111 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2112 (build-system gnu-build-system)
2114 `(#:tests? #f ; no 'check' target
2115 #:make-flags (list (string-append "prefix=" %output)
2117 ;; no configure script
2118 #:phases (alist-delete 'configure %standard-phases)))
2121 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2122 (synopsis "I2C tools for Linux")
2124 "The i2c-tools package contains a heterogeneous set of I2C tools for
2125 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2126 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2128 (license license:gpl2+)))
2130 (define-public xsensors
2137 "http://www.linuxhardware.org/xsensors/xsensors-"
2141 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2142 (build-system gnu-build-system)
2143 (inputs `(("lm-sensors" ,lm-sensors)
2145 (native-inputs `(("pkg-config" ,pkg-config)))
2147 `(#:phases (alist-cons-before
2148 'configure 'enable-deprecated
2150 (substitute* "src/Makefile.in"
2151 (("-DGDK_DISABLE_DEPRECATED") "")
2152 (("-DGTK_DISABLE_DEPRECATED") "")))
2154 'configure 'remove-Werror
2156 (substitute* '("configure" "src/Makefile.in")
2158 %standard-phases))))
2159 (home-page "http://www.linuxhardware.org/xsensors/")
2160 (synopsis "Hardware health information viewer")
2162 "Xsensors reads data from the libsensors library regarding hardware
2163 health such as temperature, voltage and fan speed and displays the information
2164 in a digital read-out.")
2165 (license license:gpl2+)))
2170 (version (package-version linux-libre))
2171 (source (package-source linux-libre))
2172 (build-system gnu-build-system)
2174 '(#:phases (alist-replace
2176 (lambda* (#:key inputs #:allow-other-keys)
2177 (setenv "SHELL_PATH" (which "bash"))
2178 (chdir "tools/perf"))
2180 #:make-flags (list (string-append "DESTDIR="
2181 (assoc-ref %outputs "out"))
2184 ;; By default, 'config/Makefile' uses lib64 on
2185 ;; x86_64. Work around that.
2187 #:tests? #f)) ;no tests
2189 `(("pkg-config" ,pkg-config)
2193 ;; There are build scripts written in these languages.
2195 ("python" ,python-2)))
2197 `(("slang" ,slang) ;for the interactive TUI
2199 ("python" ,python-2) ;'perf' links against libpython
2200 ("elfutils" ,elfutils)
2203 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2204 ("libxslt" ,libxslt)
2205 ("docbook-xml" ,docbook-xml)
2206 ("docbook-xsl" ,docbook-xsl)
2208 ("asciidoc" ,asciidoc)))
2209 (home-page "https://perf.wiki.kernel.org/")
2210 (synopsis "Linux profiling with performance counters")
2212 "perf is a tool suite for profiling using hardware performance counters,
2213 with support in the Linux kernel. perf can instrument CPU performance
2214 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2215 of lightweight profiling. This package contains the user-land tools and in
2216 particular the 'perf' command.")
2217 (license (package-license linux-libre))))
2219 (define-public pflask
2225 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2227 (file-name (string-append name "-" version ".tar.gz"))
2230 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2231 (build-system cmake-build-system)
2233 '(#:tests? #f)) ; no tests
2234 (home-page "http://ghedo.github.io/pflask/")
2235 (synopsis "Simple tool for creating Linux namespace containers")
2236 (description "pflask is a simple tool for creating Linux namespace
2237 containers. It can be used for running a command or even booting an OS inside
2238 an isolated container, created with the help of Linux namespaces. It is
2239 similar in functionality to chroot, although pflask provides better isolation
2240 thanks to the use of namespaces.")
2241 (license license:bsd-2)))
2243 (define-public hdparm
2249 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2250 name "-" version ".tar.gz"))
2253 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2254 (build-system gnu-build-system)
2256 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2257 (list (string-append "binprefix=" out)
2258 (string-append "manprefix=" out)
2260 #:phases (alist-delete 'configure %standard-phases)
2261 #:tests? #f)) ; no test suite
2262 (home-page "https://sourceforge.net/projects/hdparm/")
2263 (synopsis "Tune hard disk parameters for high performance")
2265 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
2266 is for enabling irq-unmasking and IDE multiple-mode.")
2267 (license (license:non-copyleft "file://LICENSE.TXT"))))
2269 (define-public rfkill
2275 (uri (string-append "mirror://kernel.org/software/network/"
2276 name "/" name "-" version ".tar.xz"))
2279 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2280 (build-system gnu-build-system)
2282 `(#:make-flags (list "CC=gcc"
2283 (string-append "PREFIX=" %output))
2284 #:phases (modify-phases %standard-phases
2285 (delete 'configure))
2287 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2288 (synopsis "Tool for enabling and disabling wireless devices")
2290 "rfkill is a simple tool for accessing the rfkill device interface,
2291 which is used to enable and disable wireless networking devices, typically
2292 WLAN, Bluetooth and mobile broadband.")
2293 (license (license:non-copyleft "file://COPYING"
2294 "See COPYING in the distribution."))))
2302 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2303 version "/" name "-" version ".tar.gz"))
2306 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2307 (build-system gnu-build-system)
2308 (home-page "http://acpiclient.sourceforge.net")
2309 (synopsis "Display information on ACPI devices")
2310 (description "@code{acpi} attempts to replicate the functionality of the
2311 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2312 information. It does not support ACPI suspending, only displays information
2313 about ACPI devices.")
2314 (license license:gpl2+)))
2316 (define-public acpid
2322 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2326 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
2327 (build-system gnu-build-system)
2328 (home-page "https://sourceforge.net/projects/acpid2/")
2329 (synopsis "Daemon for delivering ACPI events to user-space programs")
2331 "acpid is designed to notify user-space programs of Advanced
2332 Configuration and Power Interface (ACPI) events. acpid should be started
2333 during the system boot, and will run as a background process. When an ACPI
2334 event is received from the kernel, acpid will examine the list of rules
2335 specified in /etc/acpi/events and execute the rules that match the event.")
2336 (license license:gpl2+)))
2338 (define-public sysfsutils
2347 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2350 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2351 (build-system gnu-build-system)
2352 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2353 (synopsis "System utilities based on Linux sysfs")
2355 "These are a set of utilities built upon sysfs, a virtual file system in
2356 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2357 also contains the libsysfs library.")
2358 ;; The library is under lgpl2.1+ (all files say "or any later version").
2359 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2360 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2362 (define-public sysfsutils-1
2364 (inherit sysfsutils)
2371 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2372 "/sysfsutils-" version ".tar.gz"))
2374 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2375 (modules '((guix build utils)))
2378 (substitute* "Makefile.in"
2379 (("includedir = /usr/include/sysfs")
2380 "includedir = @includedir@"))
2381 (substitute* "configure"
2382 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2383 (string-append "includedir='" orig "/sysfs'")))))))
2384 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2386 (define-public cpufrequtils
2388 (name "cpufrequtils")
2395 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2398 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2399 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2400 (build-system gnu-build-system)
2402 `(("sysfsutils" ,sysfsutils-1)))
2404 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2405 (assoc-ref %outputs "out") "/lib"))))
2406 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2407 (synopsis "Utilities to get and set CPU frequency on Linux")
2409 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2410 information, and set the CPU frequency if supported, using the cpufreq
2411 capabilities of the Linux kernel.")
2412 (license license:gpl2)))
2414 (define-public libraw1394
2421 "mirror://kernel.org/linux/libs/ieee1394/"
2422 name "-" version ".tar.xz"))
2425 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2426 (build-system gnu-build-system)
2427 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2428 (synopsis "Interface library for the Linux IEEE1394 drivers")
2430 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2431 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2432 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2433 send to and receive from other nodes without requiring a kernel driver for the
2434 protocol in question.")
2435 (license license:lgpl2.1+)))
2437 (define-public libavc1394
2443 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2444 name "-" version ".tar.gz"))
2447 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2448 (build-system gnu-build-system)
2450 `(("pkg-config" ,pkg-config)))
2452 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2453 (home-page "https://sourceforge.net/projects/libavc1394/")
2454 (synopsis "AV/C protocol library for IEEE 1394")
2456 "Libavc1394 is a programming interface to the AV/C specification from
2457 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2458 (license license:lgpl2.1+)))
2460 (define-public libiec61883
2462 (name "libiec61883")
2467 "mirror://kernel.org/linux/libs/ieee1394/"
2468 name "-" version ".tar.xz"))
2471 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2472 (build-system gnu-build-system)
2474 `(("pkg-config" ,pkg-config)))
2476 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2477 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2478 (synopsis "Isochronous streaming media library for IEEE 1394")
2480 "The libiec61883 library provides a higher level API for streaming DV,
2481 MPEG-2 and audio over Linux IEEE 1394.")
2482 (license license:lgpl2.1+)))
2484 (define-public mdadm
2491 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2495 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2496 (build-system gnu-build-system)
2500 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2504 ;; TODO: tell it where to find 'sendmail'
2505 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2506 (string-append "BINDIR=" out "/sbin")
2507 (string-append "MANDIR=" out "/share/man")
2508 (string-append "UDEVDIR=" out "/lib/udev")))
2509 #:phases (alist-cons-before
2510 'build 'patch-program-paths
2511 (lambda* (#:key inputs #:allow-other-keys)
2512 (let ((coreutils (assoc-ref inputs "coreutils")))
2513 (substitute* "udev-md-raid-arrays.rules"
2514 (("/usr/bin/(readlink|basename)" all program)
2515 (string-append coreutils "/bin/" program)))))
2517 'build 'remove-W-error
2519 ;; We cannot build with -Werror on i686 due to a
2520 ;; 'sign-compare' warning in util.c.
2521 (substitute* "Makefile"
2524 (alist-delete 'configure %standard-phases)))
2525 ;;tests must be done as root
2527 (home-page "http://neil.brown.name/blog/mdadm")
2528 (synopsis "Tool for managing Linux Software RAID arrays")
2530 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2531 assemble, report on, and monitor arrays. It can also move spares between raid
2532 arrays when needed.")
2533 (license license:gpl2+)))
2535 (define-public mdadm-static
2538 (name "mdadm-static")
2540 (substitute-keyword-arguments (package-arguments mdadm)
2541 ((#:make-flags flags)
2542 `(cons "LDFLAGS = -static" ,flags))
2544 `(modify-phases ,phases
2545 (add-after 'install 'remove-cruft
2546 (lambda* (#:key outputs #:allow-other-keys)
2547 (let* ((out (assoc-ref outputs "out"))
2548 (precious? (lambda (file)
2549 (member file '("." ".." "sbin"))))
2550 (directories (scandir out (negate precious?))))
2551 (with-directory-excursion out
2552 (for-each delete-file-recursively directories)
2553 (remove-store-references "sbin/mdadm")
2554 (delete-file "sbin/mdmon")
2556 ((#:modules modules %gnu-build-system-modules)
2557 `((ice-9 ftw) ,@modules))
2558 ((#:strip-flags _ '())
2559 ''("--strip-all")) ;strip a few extra KiB
2560 ((#:allowed-references _ '("out"))
2561 '("out")))) ;refer only self
2562 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2564 (define-public libaio
2571 (string-append "mirror://debian/pool/main/liba/libaio/"
2572 name "_" version ".orig.tar.gz")
2573 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2574 name "-" version ".tar.gz")))
2577 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2578 (build-system gnu-build-system)
2581 (list "CC=gcc" (string-append "prefix=" %output))
2582 #:test-target "partcheck" ; need root for a full 'check'
2584 (alist-delete 'configure %standard-phases))) ; no configure script
2585 (home-page "http://lse.sourceforge.net/io/aio.html")
2586 (synopsis "Linux-native asynchronous I/O access library")
2588 "This library enables userspace to use Linux kernel asynchronous I/O
2589 system calls, important for the performance of databases and other advanced
2591 (license license:lgpl2.1+)))
2599 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2600 name "-" version ".tar.xz"))
2603 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2604 (build-system gnu-build-system)
2606 `(("libsndfile" ,libsndfile)))
2608 `(("pkg-config" ,pkg-config)))
2609 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2610 (synopsis "Bluetooth subband audio codec")
2612 "The SBC is a digital audio encoder and decoder used to transfer data to
2613 Bluetooth audio output devices like headphones or loudspeakers.")
2614 (license license:gpl2+)))
2616 (define-public bluez
2623 "mirror://kernel.org/linux/bluetooth/bluez-"
2627 "05cdnpz0w2lwq2x5ba87q1h2wgb4lfnpbnbh6p7499hx59fw1j8n"))))
2628 (build-system gnu-build-system)
2631 (let ((out (assoc-ref %outputs "out")))
2632 (list "--sysconfdir=/etc"
2633 "--localstatedir=/var"
2636 ;; Install dbus/udev files to the correct location.
2637 (string-append "--with-dbusconfdir=" out "/etc")
2638 (string-append "--with-udevdir=" out "/lib/udev")))
2640 (modify-phases %standard-phases
2641 (add-after 'install 'post-install
2642 (lambda* (#:key inputs outputs #:allow-other-keys)
2643 (let* ((out (assoc-ref outputs "out"))
2644 (servicedir (string-append out "/share/dbus-1/services"))
2645 (service "obexd/src/org.bluez.obex.service")
2646 (rule (string-append
2647 out "/lib/udev/rules.d/97-hid2hci.rules")))
2648 ;; Install the obex dbus service file.
2649 (substitute* service
2651 (string-append out "/libexec/bluetooth/obexd")))
2652 (install-file service servicedir)
2653 ;; Fix paths in the udev rule.
2655 (("hid2hci --method")
2656 (string-append out "/lib/udev/hid2hci --method"))
2658 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2661 `(("pkg-config" ,pkg-config)
2662 ("gettext" ,gettext-minimal)))
2667 ("libical" ,libical)
2668 ("readline" ,readline)))
2669 (home-page "http://www.bluez.org/")
2670 (synopsis "Linux Bluetooth protocol stack")
2672 "BlueZ provides support for the core Bluetooth layers and protocols. It
2673 is flexible, efficient and uses a modular implementation.")
2674 (license license:gpl2+)))
2676 (define-public fuse-exfat
2683 "https://github.com/relan/exfat/releases/download/v"
2684 version "/" name "-" version ".tar.gz"))
2687 "1rvq4hapy2anal1vg1yidv4x8rg4iw5sxfwqixkw0q2qsxb54471"))))
2688 (build-system gnu-build-system)
2690 `(("pkg-config" ,pkg-config)))
2693 (home-page "https://github.com/relan/exfat")
2694 (synopsis "Mount exFAT file systems")
2696 "This package provides a FUSE-based file system that provides read and
2697 write access to exFAT devices.")
2698 (license license:gpl2+)))
2707 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2708 version ".tar.bz2"))
2711 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2712 (build-system gnu-build-system)
2714 '(#:phases (modify-phases %standard-phases
2715 (add-before 'configure 'bootstrap
2717 ;; The tarball was not generated with 'make dist' so we
2718 ;; need to bootstrap things ourselves.
2719 (and (zero? (system* "./autogen.sh"))
2721 (patch-makefile-SHELL "Makefile.include.in")
2724 ;; Make sure programs find libgpm.so.
2725 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2726 (assoc-ref %outputs "out")
2729 `(("texinfo" ,texinfo)
2732 ("autoconf" ,autoconf)
2733 ("automake" ,automake)
2734 ("libtool" ,libtool)))
2735 (home-page "http://www.nico.schottelius.org/software/gpm/")
2736 (synopsis "Mouse support for the Linux console")
2738 "The GPM (general-purpose mouse) daemon is a mouse server for
2739 applications running on the Linux console. It allows users to select items
2740 and copy/paste text in the console and in xterm.")
2741 (license license:gpl2+)))
2743 (define-public btrfs-progs
2745 (name "btrfs-progs")
2749 (uri (string-append "mirror://kernel.org/linux/kernel/"
2750 "people/kdave/btrfs-progs/"
2751 "btrfs-progs-v" version ".tar.xz"))
2754 "1ppy2y9vypxw9awchari21yd3s2d7w2a9q3f4jq7dnjy5gyrnjj6"))))
2755 (build-system gnu-build-system)
2757 "static")) ; static versions of binaries in "out" (~16MiB!)
2759 '(#:phases (modify-phases %standard-phases
2760 (add-after 'build 'build-static
2761 (lambda _ (zero? (system* "make" "static"))))
2762 (add-after 'install 'install-static
2763 (let ((staticbin (string-append (assoc-ref %outputs "static")
2766 (zero? (system* "make"
2767 (string-append "bindir=" staticbin)
2768 "install-static"))))))
2769 #:test-target "test"
2770 #:parallel-tests? #f)) ; tests fail when run in parallel
2771 (inputs `(("e2fsprogs" ,e2fsprogs)
2772 ("libblkid" ,util-linux)
2773 ("libblkid:static" ,util-linux "static")
2774 ("libuuid" ,util-linux)
2775 ("libuuid:static" ,util-linux "static")
2778 (native-inputs `(("pkg-config" ,pkg-config)
2779 ("asciidoc" ,asciidoc)
2781 ;; For building documentation.
2782 ("libxml2" ,libxml2)
2783 ("docbook-xml" ,docbook-xml)
2784 ("docbook-xsl" ,docbook-xsl)
2787 (home-page "https://btrfs.wiki.kernel.org/")
2788 (synopsis "Create and manage btrfs copy-on-write file systems")
2789 (description "Btrfs is a copy-on-write (CoW) file system for Linux aimed at
2790 implementing advanced features while focusing on fault tolerance, repair and
2791 easy administration.")
2792 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2793 ;; GPL2: Everything else.
2794 (license (list license:gpl2 license:gpl2+))))
2796 (define-public btrfs-progs/static
2798 (name "btrfs-progs-static")
2799 (version (package-version btrfs-progs))
2801 (build-system trivial-build-system)
2803 `(("btrfs-progs:static" ,btrfs-progs "static")))
2805 `(#:modules ((guix build utils))
2808 (use-modules (guix build utils)
2812 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
2813 (out (assoc-ref %outputs "out"))
2814 (source (string-append btrfs "/bin/btrfs.static"))
2815 (target (string-append out "/bin/btrfs")))
2816 (mkdir-p (dirname target))
2817 (copy-file source target)
2818 (remove-store-references target)
2819 (chmod target #o555)))))
2820 (home-page (package-home-page btrfs-progs))
2821 (synopsis "Statically-linked btrfs command from btrfsprogs")
2822 (description "This package provides statically-linked command of btrfs taken
2823 from the btrfsprogs package. It is meant to be used in initrds.")
2824 (license (package-license btrfs-progs))))
2826 (define-public freefall
2829 (version (package-version linux-libre))
2830 (source (package-source linux-libre))
2831 (build-system gnu-build-system)
2833 '(#:phases (modify-phases %standard-phases
2834 (add-after 'unpack 'enter-subdirectory
2836 (chdir "tools/laptop/freefall")))
2838 (add-before 'build 'increase-timeout
2840 ;; The default of 2 seconds is too low: it assumes an
2841 ;; open lid and AC power without actually checking.
2842 (substitute* "freefall.c"
2843 (("alarm\\(2\\)") "alarm(5)")))))
2844 #:make-flags (list (string-append "PREFIX="
2845 (assoc-ref %outputs "out")))
2846 #:tests? #f)) ;no tests
2847 (home-page (package-home-page linux-libre))
2848 (synopsis "Free-fall protection for spinning laptop hard drives")
2850 "Prevents shock damage to the internal spinning hard drive(s) of some
2851 HP and Dell laptops. When sudden movement is detected, all input/output
2852 operations on the drive are suspended and its heads are parked on the ramp,
2853 where they are less likely to cause damage to the spinning disc. Requires a
2854 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2855 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2856 (license license:gpl2)))
2858 (define-public thinkfan
2864 (uri (string-append "mirror://sourceforge/thinkfan/"
2865 "/thinkfan-" version ".tar.gz"))
2868 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2869 (modules '((guix build utils)))
2870 ;; Fix erroneous man page location in Makefile leading to
2871 ;; a compilation failure.
2873 '(substitute* "CMakeLists.txt"
2874 (("thinkfan\\.1") "src/thinkfan.1")))))
2875 (build-system cmake-build-system)
2877 `(#:modules ((guix build cmake-build-system)
2880 #:tests? #f ;no test target
2882 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2883 `("-DUSE_ATASMART:BOOL=ON")
2885 (modify-phases %standard-phases
2886 ;; Install scripts for various foreign init systems. Also fix
2887 ;; hard-coded path for daemon.
2888 (add-after 'install 'install-rc-scripts
2889 (lambda* (#:key outputs #:allow-other-keys)
2890 (let ((out (assoc-ref outputs "out"))
2892 (string-append "../thinkfan-" ,version "/rcscripts")
2895 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2896 (string-append out "/sbin/" name)))
2897 (for-each (cute install-file <>
2898 (string-append out "/share/thinkfan"))
2902 `(("libatasmart" ,libatasmart)))
2903 (home-page "http://thinkfan.sourceforge.net/")
2904 (synopsis "Simple fan control program")
2906 "Thinkfan is a simple fan control program. It reads temperatures,
2907 checks them against configured limits and switches to appropriate (also
2908 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2909 other @code{hwmon} driver that enables temperature reading and fan control
2911 (license license:gpl3+)))
2913 (define-public ntfs-3g
2916 (version "2016.2.22")
2919 (uri (string-append "https://tuxera.com/opensource/"
2920 "ntfs-3g_ntfsprogs-" version ".tgz"))
2923 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
2924 (modules '((guix build utils)))
2925 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
2927 ;; Install under $prefix.
2928 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
2931 (build-system gnu-build-system)
2932 (inputs `(("util-linux" ,util-linux)
2933 ("fuse" ,fuse))) ;libuuid
2934 (native-inputs `(("pkg-config" ,pkg-config)))
2936 '(#:configure-flags (list "--exec-prefix=${prefix}"
2937 "--with-fuse=external" ;use our own FUSE
2938 "--enable-mount-helper"
2939 "--enable-posix-acls"
2940 "--enable-xattr-mappings")))
2941 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
2942 (synopsis "Read-write access to NTFS file systems")
2944 "NTFS-3G provides read-write access to NTFS file systems, which are
2945 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
2946 The package provides additional NTFS tools.")
2947 (license license:gpl2+)))
2949 (define-public rng-tools
2956 "http://downloads.sourceforge.net/sourceforge/gkernel/"
2957 "rng-tools-" version ".tar.gz"))
2960 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
2961 (build-system gnu-build-system)
2962 (synopsis "Random number generator daemon")
2964 "Monitor a hardware random number generator, and supply entropy
2965 from that to the system kernel's @file{/dev/random} machinery.")
2966 (home-page "https://sourceforge.net/projects/gkernel")
2967 ;; The source package is offered under the GPL2+, but the files
2968 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
2969 (license (list license:gpl2 license:gpl2+))))
2971 (define-public cpupower
2974 (version (package-version linux-libre))
2975 (source (package-source linux-libre))
2976 (build-system gnu-build-system)
2978 '(#:phases (modify-phases %standard-phases
2979 (add-after 'unpack 'enter-subdirectory
2981 (chdir "tools/power/cpupower")))
2983 (add-before 'build 'fix-makefiles
2985 (substitute* "Makefile"
2987 (("/bin/(install|pwd)" _ command) command))
2988 (substitute* "bench/Makefile"
2989 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
2990 #:make-flags (let ((out (assoc-ref %outputs "out")))
2991 (list (string-append "DESTDIR=" out)
2992 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
2993 "docdir=/share/doc/cpupower"
2994 "confdir=$(docdir)/examples"
2995 ;; The Makefile recommends the following changes
2997 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
2998 #:tests? #f)) ;no tests
2999 (native-inputs `(("gettext" ,gettext-minimal)))
3000 (inputs `(("pciutils" ,pciutils)))
3001 (home-page (package-home-page linux-libre))
3002 (synopsis "CPU frequency and voltage scaling tools for Linux")
3004 "cpupower is a set of user-space tools that use the cpufreq feature of the
3005 Linux kernel to retrieve and control processor features related to power saving,
3006 such as frequency and voltage scaling.")
3007 (license license:gpl2)))
3009 (define-public haveged
3016 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3020 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3021 (build-system gnu-build-system)
3022 (home-page "http://www.issihosts.com/haveged")
3023 (synopsis "Entropy source for the Linux random number generator")
3025 "haveged generates an unpredictable stream of random numbers for use by
3026 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3027 standard mechanisms for filling the entropy pool may not be sufficient for
3028 systems with high needs or limited user interaction, such as headless servers.
3029 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3030 indirect effects of hardware events on hidden processor state using the HArdware
3031 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3032 its environment and provides the same built-in test suite for the output stream
3033 as used on certified hardware security devices.")
3034 (license (list (license:non-copyleft "file://nist/mconf.h")
3035 (license:non-copyleft "file://nist/packtest.c")
3036 license:public-domain ; nist/dfft.c
3037 license:gpl3+)))) ; everything else
3039 (define-public ecryptfs-utils
3041 (name "ecryptfs-utils")
3046 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3047 version "/+download/ecryptfs-utils_"
3048 version ".orig.tar.gz"))
3051 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3052 (build-system gnu-build-system)
3054 `(#:configure-flags (list "--disable-pywrap")))
3056 `(("intltool" ,intltool)
3057 ("perl" ,perl) ; for pod2man
3058 ("pkg-config" ,pkg-config)))
3060 `(("keyutils" ,keyutils)
3061 ("linux-pam" ,linux-pam)
3063 (home-page "http://ecryptfs.org/")
3064 (synopsis "eCryptfs cryptographic file system utilities")
3066 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3067 Each file's cryptographic meta-data is stored inside the file itself, along
3068 with the encrypted contents. This allows individual encrypted files to be
3069 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3070 native Linux file system, and has been part of the Linux kernel since version
3071 2.6.19. This package contains the userland utilities to manage it.")
3072 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3073 ;; grant additional permission to link with OpenSSL.
3074 (license license:gpl2+)))
3076 (define-public libnfsidmap
3078 (name "libnfsidmap")
3083 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3084 name "/" name "-" version ".tar.gz"))
3087 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3088 (build-system gnu-build-system)
3090 `(#:configure-flags (list
3091 (string-append "--with-pluginpath="
3092 (assoc-ref %outputs "out")
3093 "/lib/libnfsidmap"))))
3095 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3097 "NFSv4 support library for name/ID mapping")
3098 (description "Libnfsidmap is a library holding mulitiple methods of
3099 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3100 extensible array of mapping functions, currently consisting of two choices:
3101 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3102 (license (license:non-copyleft "file://COPYING"
3103 "See COPYING in the distribution."))))
3105 (define-public module-init-tools
3107 (name "module-init-tools")
3112 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3113 "module-init-tools-" version ".tar.bz2"))
3116 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3117 (patches (search-patches "module-init-tools-moduledir.patch"))))
3118 (build-system gnu-build-system)
3120 ;; FIXME: The upstream tarball lacks man pages, and building them would
3121 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3122 ;; but they vanished. In the meantime, fake it.
3123 '(#:phases (alist-cons-before
3124 'configure 'fake-docbook
3126 (substitute* "Makefile.in"
3127 (("^DOCBOOKTOMAN.*$")
3128 "DOCBOOKTOMAN = true\n")))
3130 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3131 (synopsis "Tools for loading and managing Linux kernel modules")
3133 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3134 `insmod', `lsmod', and more.")
3135 (license license:gpl2+)))
3137 (define-public mcelog
3143 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3144 "mcelog.git/snapshot/v" version ".tar.gz"))
3147 "1d5g09ndfsnl56vyhb5xw0zxspnh0f937biw3agqhdfbvw40j9jr"))
3148 (file-name (string-append name "-" version ".tar.gz"))
3149 (modules '((guix build utils)))
3151 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3152 `(substitute* "Makefile"
3153 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3154 (build-system gnu-build-system)
3156 `(#:phases (modify-phases %standard-phases
3157 (delete 'configure)) ; no configure script
3158 #:make-flags (let ((out (assoc-ref %outputs "out")))
3160 (string-append "prefix=" out)
3161 (string-append "DOCDIR=" out "/share/doc/mcelog")
3162 "etcprefix=$(DOCDIR)/examples"))
3163 ;; The tests will only run as root on certain supported CPU models.
3165 (supported-systems (list "i686-linux" "x86_64-linux"))
3166 (home-page "http://mcelog.org/")
3167 (synopsis "Machine check monitor for x86 Linux systems")
3169 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3170 and other hardware errors on x86 systems. It can also perform user-defined
3171 tasks, such as bringing bad pages off-line, when configurable error thresholds
3173 (license license:gpl2)))
3175 (define-public mtd-utils
3182 "ftp://ftp.infradead.org/pub/mtd-utils/"
3183 "mtd-utils-" version ".tar.bz2"))
3186 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3189 ("libuuid" ,util-linux)
3192 (build-system gnu-build-system)
3194 `(#:test-target "tests"
3195 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3196 #:phases (modify-phases %standard-phases
3197 (delete 'configure))))
3198 (synopsis "MTD Flash Storage Utilities")
3199 (description "This package provides utilities for testing, partitioning, etc
3201 (home-page "http://www.linux-mtd.infradead.org/")
3203 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3204 license:mpl1.1 ; All ftl* files
3205 license:expat)))) ; libiniparser
3207 (define-public libseccomp
3213 (uri (string-append "https://github.com/seccomp/libseccomp/"
3214 "releases/download/v" version
3215 "/libseccomp-" version ".tar.gz"))
3218 "0asnlkzqms520r0dra08dzcz5hh6hs7lkajfw9wij3vrd0hxsnzz"))))
3219 (build-system gnu-build-system)
3221 `(("which" ,which)))
3222 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3223 (description "The libseccomp library provides an easy to use, platform
3224 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3225 libseccomp API is designed to abstract away the underlying BPF based syscall
3226 filter language and present a more conventional function-call based filtering
3227 interface that should be familiar to, and easily adopted by, application
3229 (home-page "https://github.com/seccomp/libseccomp")
3230 (license license:lgpl2.1)))
3232 (define-public radeontop
3236 (home-page "https://github.com/clbr/radeontop/")
3239 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3240 (file-name (string-append name "-" version ".tar.gz"))
3243 "07fnimn6wwablmdjw0av11hk9a6xilbryh09izq4b2ic4b8md2p7"))))
3244 (build-system gnu-build-system)
3246 `(#:phases (modify-phases %standard-phases
3247 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3248 ;; dependency, and doesn't even work on release(!) tarballs.
3249 (add-after 'unpack 'report-correct-version
3250 (lambda _ (substitute* "getver.sh"
3252 (string-append "ver=" ,version)))))
3253 (delete 'configure)) ; no configure script
3254 #:make-flags (list "CC=gcc"
3255 (string-append "PREFIX=" %output))
3256 #:tests? #f)) ; no tests
3258 `(("gettext" ,gettext-minimal)
3259 ("pkg-config" ,pkg-config)))
3261 `(("libdrm" ,libdrm)
3262 ("libpciaccess" ,libpciaccess)
3263 ("ncurses" ,ncurses)))
3264 (synopsis "Usage monitor for AMD Radeon graphics")
3265 (description "RadeonTop monitors resource consumption on supported AMD
3266 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3267 a terminal or saved to a file for further processing. It measures both the
3268 activity of the GPU as a whole, which is also accurate during OpenCL
3269 computations, as well as separate component statistics that are only meaningful
3270 under OpenGL graphics workloads.")
3271 (license license:gpl3)))
3273 (define-public efivar
3279 (uri (string-append "https://github.com/rhinstaller/" name
3280 "/releases/download/" version "/" name
3281 "-" version ".tar.bz2"))
3284 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3285 (build-system gnu-build-system)
3287 `(;; Tests require a UEFI system and is not detected in the chroot.
3289 #:make-flags (list (string-append "prefix=" %output)
3290 (string-append "libdir=" %output "/lib")
3291 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3293 (modify-phases %standard-phases
3294 (delete 'configure))))
3296 `(("pkg-config" ,pkg-config)))
3299 (home-page "https://github.com/rhinstaller/efivar")
3300 (synopsis "Tool and library to manipulate EFI variables")
3301 (description "This package provides a library and a command line
3302 interface to the variable facility of UEFI boot firmware.")
3303 (license license:lgpl2.1+)))
3305 (define-public efibootmgr
3311 (uri (string-append "https://github.com/rhinstaller/" name
3312 "/releases/download/" version "/" name
3313 "-" version ".tar.bz2"))
3316 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3317 (build-system gnu-build-system)
3319 `(#:tests? #f ; No tests.
3320 #:make-flags (list (string-append "prefix=" %output)
3321 (string-append "libdir=" %output "/lib")
3322 ;; Override CFLAGS to add efivar include directory.
3323 (string-append "CFLAGS=-O2 -g -flto -I"
3324 (assoc-ref %build-inputs "efivar")
3327 (modify-phases %standard-phases
3328 (add-after 'unpack 'branding
3329 ;; Replace default loader path with something more familiar.
3331 (substitute* "src/efibootmgr.c"
3332 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3335 (delete 'configure))))
3337 `(("pkg-config" ,pkg-config)))
3339 `(("efivar" ,efivar)
3341 (home-page "https://github.com/rhinstaller/efibootmgr")
3342 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3344 "@code{efibootmgr} is a user-space application to modify the Intel
3345 Extensible Firmware Interface (EFI) Boot Manager. This application can
3346 create and destroy boot entries, change the boot order, change the next
3347 running boot option, and more.")
3348 (license license:gpl2+)))
3350 (define-public sysstat
3356 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3357 "sysstat-" version ".tar.xz"))
3360 "0f8gk1hma3bk198ziwrhh5jhisnbbgc1v4rxhny58n0zjzw0gm0z"))))
3361 (build-system gnu-build-system)
3363 `(#:tests? #f ; No test suite.
3364 ;; Without this flag, it tries to install the man pages with group 'root'
3365 ;; and fails because /etc/passwd lacks an entry for the root user.
3367 (list "--disable-file-attr"
3368 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3370 (modify-phases %standard-phases
3371 ;; The build process tries to create '/var/lib/sa', so we skip that
3373 (add-after 'build 'skip-touching-var
3375 (substitute* "Makefile"
3376 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3379 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3380 (synopsis "Performance monitoring tools for Linux")
3381 (description "The sysstat utilities are a collection of performance
3382 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3383 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3384 @code{sadf} and @code{sa}.")
3385 (license license:gpl2+)))
3387 (define-public light
3393 (uri (string-append "https://github.com/haikarainen/" name
3394 "/archive/v" version ".tar.gz"))
3397 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3398 (file-name (string-append name "-" version ".tar.gz"))))
3399 (build-system gnu-build-system)
3401 '(#:tests? #f ; no tests
3402 #:make-flags (list "CC=gcc"
3403 (string-append "PREFIX=" %output))
3405 (modify-phases %standard-phases
3407 (add-after 'unpack 'patch-makefile
3409 (substitute* "Makefile" (("chown") "#")))))))
3411 `(("help2man" ,help2man)))
3412 (home-page "https://haikarainen.github.io/light")
3413 (synopsis "GNU/Linux application to control backlights")
3415 "Light is a program to send commands to screen backlight controllers
3416 under GNU/Linux. Features include:
3419 @item It does not rely on X.
3420 @item Light can automatically figure out the best controller to use, making
3421 full use of underlying hardware.
3422 @item It is possible to set a minimum brightness value, as some controllers
3423 set the screen to be pitch black at a vaĺue of 0 (or higher).
3426 Light is the successor of lightscript.")
3427 (license license:gpl3+)))
3436 "https://github.com/linrunner/"
3437 (string-upcase name)
3438 "/archive/" version ".tar.gz"))
3439 (file-name (string-append name "-" version ".tar.gz"))
3442 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3443 (inputs `(("bash" ,bash)
3445 ("ethtool" ,ethtool)
3449 ("inetutils" ,inetutils)
3452 ("pciutils" ,pciutils)
3456 ("usbutils" ,usbutils)
3457 ("util-linux" ,util-linux)
3458 ("wireless-tools" ,wireless-tools)))
3459 (build-system gnu-build-system)
3462 (modify-phases %standard-phases
3464 (add-before 'build 'setenv
3465 (lambda* (#:key outputs #:allow-other-keys)
3466 (let ((out (assoc-ref outputs "out")))
3467 (setenv "TLP_WITH_SYSTEMD" "0")
3468 (setenv "TLP_NO_INIT" "1")
3469 (setenv "TLP_NO_PMUTILS" "1")
3470 (setenv "TLP_SBIN" (string-append out "/bin"))
3471 (setenv "TLP_BIN" (string-append out "/bin"))
3472 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3473 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3474 (setenv "TLP_CONF" (string-append out "/etc/tlp"))
3476 (string-append out "/share/bash-completion/completions"))
3477 (setenv "TLP_MAN" (string-append out "/share/man")))))
3481 (system "make install-tlp install-man")))
3482 (add-after 'install 'wrap
3483 (lambda* (#:key inputs outputs #:allow-other-keys)
3484 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3485 (bin-files (find-files bin ".*")))
3486 (define (bin-directory input-name)
3487 (string-append (assoc-ref inputs input-name) "/bin"))
3488 (define (sbin-directory input-name)
3489 (string-append (assoc-ref inputs input-name) "/sbin"))
3490 (for-each (lambda (program)
3491 (wrap-program program
3494 (map bin-directory '("bash"
3505 (map sbin-directory '("ethtool"
3510 "wireless-tools"))))))
3512 (home-page "http://linrunner.de/en/tlp/tlp.html")
3513 (synopsis "Power management tool for Linux")
3514 (description "TLP is a power management tool for Linux. It comes with
3515 a default configuration already optimized for battery life. Nevertheless,
3516 TLP is customizable to fulfil system requirements. TLP settings are applied
3517 every time the power supply source is changed.")
3519 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3521 (license (list license:gpl2+ license:gpl3+))))
3529 (uri (string-append "https://www.ezix.org/software/"
3530 "files/lshw-" version
3534 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3535 (build-system gnu-build-system)
3537 `(#:phases (modify-phases %standard-phases (delete 'configure))
3538 #:tests? #f ; no tests
3540 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3541 (synopsis "List hardware information")
3543 "@command{lshw} (Hardware Lister) is a small tool to provide
3544 detailed information on the hardware configuration of the machine.
3545 It can report exact memory configuration, firmware version, mainboard
3546 configuration, CPU version and speed, cache configuration, bus speed,
3547 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3548 machines (PowerMac G4 is known to work).")
3549 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3550 (license license:gpl2+)))