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, 2017 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")
109 ((string-prefix? "alpha" arch) "alpha")
112 (define (linux-libre-urls version)
113 "Return a list of URLs for Linux-Libre VERSION."
115 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
116 version "-gnu/linux-libre-" version "-gnu.tar.xz")
118 ;; XXX: Work around <http://bugs.gnu.org/14851>.
120 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
121 version "-gnu.tar.xz")
123 ;; Maybe this URL will become valid eventually.
125 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
126 version "-gnu.tar.xz")))
128 (define-public linux-libre-headers
130 (name "linux-libre-headers")
134 (uri (linux-libre-urls version))
137 "0k8k17in7dkjd9d8zg3i8l1ax466dba6bxw28flxizzyq8znljps"))))
138 (build-system gnu-build-system)
139 (native-inputs `(("perl" ,perl)))
141 `(#:modules ((guix build gnu-build-system)
145 (modify-phases %standard-phases
149 (let ((arch ,(system->linux-architecture
150 (or (%current-target-system)
151 (%current-system)))))
153 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
155 (and (zero? (system* "make" "defconfig"))
156 (zero? (system* "make" "mrproper" "headers_check"))))))
158 (lambda* (#:key outputs #:allow-other-keys)
159 (let ((out (assoc-ref outputs "out")))
160 (and (zero? (system* "make"
161 (string-append "INSTALL_HDR_PATH=" out)
164 (mkdir (string-append out "/include/config"))
165 (call-with-output-file
167 "/include/config/kernel.release")
169 (format p "~a-default~%" ,version)))
171 ;; Remove the '.install' and '..install.cmd' files; the
172 ;; latter contains store paths, which pulls in bootstrap
173 ;; binaries in the build environment, and prevents bit
174 ;; reproducibility for the bootstrap binaries.
175 (for-each delete-file (find-files out "\\.install"))
178 #:allowed-references ()
180 (home-page "http://www.gnu.org/software/linux-libre")
181 (synopsis "GNU Linux-Libre kernel headers")
182 (description "Headers of the Linux-Libre kernel.")
183 (license license:gpl2)))
185 (define %boot-logo-patch
186 ;; Linux-Libre boot logo featuring Freedo and a gnu.
189 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
190 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
193 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
195 (define* (kernel-config arch #:key variant)
196 "Return the absolute file name of the Linux-Libre build configuration file
197 for ARCH and optionally VARIANT, or #f if there is no such configuration."
198 (let* ((name (string-append (if variant (string-append variant "-") "")
199 (if (string=? "i386" arch) "i686" arch) ".conf"))
200 (file (string-append "linux-libre/" name)))
201 (search-auxiliary-file 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.1")
342 (define %linux-libre-hash "0mvwrjny1bjqyjqjxff9m97j48ybfdw8qpdazr5rwk12234v4k3d")
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.13"
352 "16miggwcwfpm7kx0yz256x887rky9wgmp1grg850lf8sdkiz0a1p"
353 %intel-compatible-systems
354 #:configuration-file kernel-config))
356 (define-public linux-libre-4.4
357 (make-linux-libre "4.4.52"
358 "1fzcq9bbsxiij2fh6kgwrp417sy2j5gnbzs0wwlmznj7mvysl7qg"
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 (list %boot-logo-patch
372 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=5edabca9d4cff7f1f2b68f0bac55ef99d9798ba4")
373 (file-name "linux-libre-CVE-2017-6074.patch")
376 "1x40slfz1qxgiaznyy13bwlh34450pkyyrkljpyjlx6c4mrzb1jj"))))))
378 (define-public linux-libre-arm-generic
379 (make-linux-libre %linux-libre-version
382 #:defconfig "multi_v7_defconfig"
383 #:extra-version "arm-generic"))
387 ;;; Pluggable authentication modules (PAM).
390 (define-public linux-pam
398 "http://www.linux-pam.org/library/"
399 "Linux-PAM-" version ".tar.bz2"))
402 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
403 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
405 (build-system gnu-build-system)
409 ;; TODO: optional dependencies
410 ;; ("libxcrypt" ,libxcrypt)
411 ;; ("cracklib" ,cracklib)
414 '(;; Most users, such as `shadow', expect the headers to be under
416 #:configure-flags (list (string-append "--includedir="
417 (assoc-ref %outputs "out")
418 "/include/security"))
420 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
423 (home-page "http://www.linux-pam.org/")
424 (synopsis "Pluggable authentication modules for Linux")
426 "A *Free* project to implement OSF's RFC 86.0.
427 Pluggable authentication modules are small shared object files that can
428 be used through the PAM API to perform tasks, like authenticating a user
429 at login. Local and dynamic reconfiguration are its key features.")
430 (license license:bsd-3)))
432 (define-public linux-pam-1.2
440 "http://www.linux-pam.org/library/"
441 "Linux-PAM-" version ".tar.bz2"))
444 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
445 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
452 (define-public psmisc
459 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
463 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
464 (build-system gnu-build-system)
465 (inputs `(("ncurses" ,ncurses)))
466 (home-page "http://psmisc.sourceforge.net/")
468 "Small utilities that use the proc file system")
470 "This PSmisc package is a set of some small useful utilities that
471 use the proc file system. We're not about changing the world, but
472 providing the system administrator with some help in common tasks.")
473 (license license:gpl2+)))
475 (define-public util-linux
478 (replacement util-linux/fixed)
482 (uri (string-append "mirror://kernel.org/linux/utils/"
483 name "/v" (version-major+minor version) "/"
484 name "-" version ".tar.xz"))
487 "03xnaw3c7pavxvvh1vnimcr44hlhhf25whawiyv8dxsflfj4xkiy"))
488 (patches (search-patches "util-linux-tests.patch"))
489 (modules '((guix build utils)))
491 ;; We take the 'logger' program from GNU Inetutils and 'kill'
492 ;; from GNU Coreutils.
494 (substitute* "configure"
495 (("build_logger=yes") "build_logger=no")
496 (("build_kill=yes") "build_kill=no"))
498 (build-system gnu-build-system)
500 "static")) ; >2 MiB of static .a libraries
502 `(#:configure-flags (list "--disable-use-tty-group"
504 ;; Install completions where our
505 ;; bash-completion package expects them.
506 (string-append "--with-bashcompletiondir="
507 (assoc-ref %outputs "out")
508 "/etc/bash_completion.d"))
509 #:phases (modify-phases %standard-phases
511 'build 'set-umount-file-name
512 (lambda* (#:key outputs #:allow-other-keys)
513 ;; Tell 'eject' the right file name of 'umount'.
514 (let ((out (assoc-ref outputs "out")))
515 (substitute* "sys-utils/eject.c"
517 (string-append "\"" out "/bin/umount\"")))
521 (lambda* (#:key inputs outputs #:allow-other-keys)
522 (let ((out (assoc-ref outputs "out"))
523 (net (assoc-ref inputs "net-base")))
524 ;; Change the test to refer to the right file.
525 (substitute* "tests/ts/misc/mcookie"
527 (string-append net "/etc/services")))
530 'install 'move-static-libraries
531 (lambda* (#:key outputs #:allow-other-keys)
532 (let ((out (assoc-ref outputs "out"))
533 (static (assoc-ref outputs "static")))
534 (mkdir-p (string-append static "/lib"))
535 (with-directory-excursion out
536 (for-each (lambda (file)
538 (string-append static "/"
540 (find-files "lib" "\\.a$")))
542 (inputs `(("zlib" ,zlib)
543 ("ncurses" ,ncurses)))
546 ("net-base" ,net-base))) ;for tests
547 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
548 (synopsis "Collection of utilities for the Linux kernel")
549 (description "Util-linux is a diverse collection of Linux kernel
550 utilities. It provides dmesg and includes tools for working with file systems,
551 block devices, UUIDs, TTYs, and many other tools.")
553 ;; Note that util-linux doesn't use the same license for all the
554 ;; code. GPLv2+ is the default license for a code without an
555 ;; explicitly defined license.
556 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
557 license:bsd-4 license:public-domain))))
559 (define util-linux/fixed
564 (inherit (package-source util-linux))
567 (origin-patches (package-source util-linux))
568 (search-patches "util-linux-CVE-2017-2616.patch")))))))
570 (define-public procps
576 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
577 "procps-ng-" version ".tar.xz"))
580 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
581 (build-system gnu-build-system)
583 '(#:modules ((guix build utils)
584 (guix build gnu-build-system)
588 (modify-phases %standard-phases
589 (add-before 'check 'disable-strtod-test
591 ;; Disable the 'strtod' test, which fails on 32-bit systems.
592 ;; This is what upstream does:
593 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
594 (substitute* "Makefile"
595 (("^(TESTS|check_PROGRAMS) = .*$" all)
596 (string-append "# " all "\n")))
599 'install 'post-install
600 ;; Remove commands and man pages redudant with
602 (lambda* (#:key outputs #:allow-other-keys)
603 (let* ((out (assoc-ref outputs "out"))
604 (dup (append-map (cut find-files out <>)
605 '("^kill" "^uptime"))))
606 (for-each delete-file dup)
608 (inputs `(("ncurses" ,ncurses)))
609 (home-page "https://gitlab.com/procps-ng/procps/")
610 (synopsis "Utilities that give information about processes")
612 "Procps is the package that has a bunch of small useful utilities
613 that give information about processes using the Linux /proc file system.
614 The package includes the programs ps, top, vmstat, w, kill, free,
615 slabtop, and skill.")
616 (license license:gpl2)))
618 (define-public usbutils
625 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
626 "usbutils-" version ".tar.xz"))
629 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
630 (build-system gnu-build-system)
633 ("eudev" ,eudev-with-hwdb)))
635 `(("pkg-config" ,pkg-config)))
636 (home-page "http://www.linux-usb.org/")
638 "Tools for working with USB devices, such as lsusb")
640 "Tools for working with USB devices, such as lsusb.")
641 (license license:gpl2+)))
643 (define-public e2fsprogs
650 "mirror://kernel.org/linux/kernel/people/tytso/"
651 name "/v" version "/"
652 name "-" version ".tar.xz"))
655 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
656 (modules '((guix build utils)))
659 (substitute* "MCONFIG.in"
660 (("INSTALL_SYMLINK = /bin/sh")
661 "INSTALL_SYMLINK = sh"))
663 ;; Do not include a timestamp in libext2fs.info.gz.
664 (substitute* "doc/Makefile.in"
667 (build-system gnu-build-system)
668 (inputs `(("util-linux" ,util-linux)))
669 (native-inputs `(("pkg-config" ,pkg-config)
670 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
672 '(;; Parallel building reliably yields a failure like this:
673 ;; "make[2]: *** No rule to make target '../lib/libss.so', needed by
676 ;; util-linux is the preferred source for some of the libraries and
677 ;; commands, so disable them (see, e.g.,
678 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
679 #:configure-flags '("--disable-libblkid"
680 "--disable-libuuid" "--disable-uuidd"
683 ;; Use symlinks instead of hard links for
684 ;; 'fsck.extN' etc. This makes the resulting nar
685 ;; smaller and is preserved across copies.
686 "--enable-symlink-install"
688 ;; Install libext2fs et al.
689 "--enable-elf-shlibs")
691 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
692 (assoc-ref %outputs "out")
695 #:phases (alist-cons-before
696 'configure 'patch-shells
698 (substitute* "configure"
699 (("/bin/sh (.*)parse-types.sh" _ dir)
700 (string-append (which "sh") " " dir
702 (substitute* (find-files "." "^Makefile.in$")
704 (string-append "#!" (which "sh")))))
706 'install 'install-libs
707 (lambda* (#:key outputs #:allow-other-keys)
708 (let* ((out (assoc-ref outputs "out"))
709 (lib (string-append out "/lib")))
710 (and (zero? (system* "make" "install-libs"))
712 ;; Make the .a writable so that 'strip' works.
713 ;; Failing to do that, due to debug symbols, we
714 ;; retain a reference to the final
715 ;; linux-libre-headers, which refer to the
716 ;; bootstrap binaries.
717 (let ((archives (find-files lib "\\.a$")))
718 (for-each (lambda (file)
724 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
725 ;; they fail because we get an extra line that says "Can't check if
726 ;; file system is mounted due to missing mtab file".
728 (home-page "http://e2fsprogs.sourceforge.net/")
729 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
731 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
732 (license (list license:gpl2 ;programs
733 license:lgpl2.0 ;libext2fs
734 license:x11)))) ;libuuid
736 (define e2fsprogs/static
738 (package (inherit e2fsprogs)
740 ;; Do not build shared libraries.
741 (substitute-keyword-arguments (package-arguments e2fsprogs)
742 ((#:configure-flags _)
743 '(list "--disable-blkid"))
747 (define-public e2fsck/static
749 (name "e2fsck-static")
750 (version (package-version e2fsprogs))
751 (build-system trivial-build-system)
754 `(("e2fsprogs" ,e2fsprogs/static)))
756 `(#:modules ((guix build utils))
759 (use-modules (guix build utils)
763 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
765 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
767 (with-directory-excursion bin
768 (copy-file e2fsck "e2fsck")
769 (remove-store-references "e2fsck")
770 (chmod "e2fsck" #o555))))))
771 (home-page (package-home-page e2fsprogs))
772 (synopsis "Statically-linked e2fsck command from e2fsprogs")
773 (description "This package provides statically-linked e2fsck command taken
774 from the e2fsprogs package. It is meant to be used in initrds.")
775 (license (package-license e2fsprogs))))
777 (define-public extundelete
783 (uri (string-append "mirror://sourceforge/extundelete/"
784 "extundelete/" version "/extundelete-"
788 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
789 (build-system gnu-build-system)
790 (inputs `(("e2fsprogs" ,e2fsprogs)))
791 (home-page "http://extundelete.sourceforge.net/")
792 (synopsis "Recover deleted files from ext2/3/4 partitions")
794 "Extundelete is a set of tools that can recover deleted files from an
795 ext3 or ext4 partition.")
796 (license license:gpl2)))
798 (define-public zerofree
802 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
805 (uri (string-append home-page name "-" version
809 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
810 (build-system gnu-build-system)
812 '(#:phases (alist-replace
814 (lambda* (#:key outputs #:allow-other-keys)
815 (let* ((out (assoc-ref outputs "out"))
816 (bin (string-append out "/bin")))
818 (copy-file "zerofree"
819 (string-append bin "/zerofree"))
820 (chmod (string-append bin "/zerofree")
823 (alist-delete 'configure %standard-phases))
824 #:tests? #f)) ;no tests
825 (inputs `(("libext2fs" ,e2fsprogs)))
826 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
828 "The zerofree command scans the free blocks in an ext2 file system and
829 fills any non-zero blocks with zeroes. This is a useful way to make disk
830 images more compressible.")
831 (license license:gpl2)))
833 (define-public strace
839 (uri (string-append "mirror://sourceforge/strace/strace/" version
840 "/strace-" version ".tar.xz"))
843 "1vzhmpcy989i4k12q4cc438yal2ghhm6x7ychscjbhcf2yspqj4q"))))
844 (build-system gnu-build-system)
847 (modify-phases %standard-phases
848 (add-after 'unpack 'patch-/bin/sh
850 (substitute* "strace.c"
851 (("/bin/sh") (which "sh")))
853 (native-inputs `(("perl" ,perl)))
854 (home-page "https://strace.io/")
855 (synopsis "System call tracer for Linux")
857 "strace is a system call tracer, i.e. a debugging tool which prints out a
858 trace of all the system calls made by a another process/program.")
859 (license license:bsd-3)))
861 (define-public ltrace
867 (uri (string-append "http://www.ltrace.org/ltrace_" version
871 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
872 (build-system gnu-build-system)
873 (inputs `(("libelf" ,libelf)))
875 ;; Compilation uses -Werror by default, but it fails.
876 '(#:configure-flags '("--disable-werror")))
877 (home-page "http://www.ltrace.org/")
878 (synopsis "Library call tracer for Linux")
880 "ltrace intercepts and records dynamic library calls which are called by
881 an executed process and the signals received by that process. It can also
882 intercept and print the system calls executed by the program.")
883 (license license:gpl2+)))
885 (define-public alsa-lib
892 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
896 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
897 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
898 (build-system gnu-build-system)
899 (home-page "http://www.alsa-project.org/")
900 (synopsis "The Advanced Linux Sound Architecture libraries")
902 "The Advanced Linux Sound Architecture (ALSA) provides audio and
903 MIDI functionality to the Linux-based operating system.")
904 (license license:lgpl2.1+)))
906 (define-public alsa-utils
912 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
913 name "-" version ".tar.bz2"))
916 "0z0nnqp1707bm02dys2d16m88lsg5nd26bqaf14rl3za9sjifwhj"))))
917 (build-system gnu-build-system)
919 ;; XXX: Disable man page creation until we have DocBook.
920 '(#:configure-flags (list "--disable-xmlto"
922 ;; The udev rule is responsible for restoring
924 (string-append "--with-udev-rules-dir="
925 (assoc-ref %outputs "out")
926 "/lib/udev/rules.d"))
928 (modify-phases %standard-phases
930 'install 'pre-install
932 ;; Don't try to mkdir /var/lib/alsa.
933 (substitute* "Makefile"
934 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
938 `(("libsamplerate" ,libsamplerate)
940 ("alsa-lib" ,alsa-lib)
942 ("gettext" ,gettext-minimal)))
943 (home-page "http://www.alsa-project.org/")
944 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
946 "The Advanced Linux Sound Architecture (ALSA) provides audio and
947 MIDI functionality to the Linux-based operating system.")
949 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
951 (license license:gpl2)))
953 (define-public alsa-plugins
955 (name "alsa-plugins")
959 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
960 name "-" version ".tar.bz2"))
963 "1w81z5jlwqhd1l2m7qrq69lc4k9dnrg1wn52jsl2hrf3hbhd394f"))))
964 (build-system gnu-build-system)
965 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
966 ;; be split, there are references to both in files.
967 ;; TODO: Remove OSS related plugins, they add support to run native
968 ;; ALSA applications on OSS however we do not offer OSS and OSS is
970 (outputs '("out" "pulseaudio"))
973 (modify-phases %standard-phases
974 (add-after 'install 'split
975 (lambda* (#:key inputs outputs #:allow-other-keys)
976 ;; Distribute the binaries to the various outputs.
977 (let* ((out (assoc-ref outputs "out"))
978 (pua (assoc-ref outputs "pulseaudio"))
979 (pualib (string-append pua "/lib/alsa-lib"))
980 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
983 (chdir (string-append out "/share"))
984 (for-each (lambda (file)
985 (rename-file file (string-append puaconf "/" (basename file))))
986 (find-files out "\\.(conf|example)"))
987 (for-each (lambda (file)
988 (rename-file file (string-append pualib "/" (basename file))))
989 (find-files out ".*pulse\\.(la|so)"))
991 ;; We have moved the files to output pulsaudio, the
992 ;; directory is now empty.
993 (delete-file-recursively (string-append out "/share"))
996 `(("alsa-lib" ,alsa-lib)
997 ("speex" ,speex) ; libspeexdsp resampling plugin
998 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
999 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1000 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1002 `(("pkg-config" ,pkg-config)))
1003 (home-page "http://www.alsa-project.org/")
1004 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1006 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1007 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1008 by providing additional plugins which include: upmixing, downmixing, jackd and
1009 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1010 external rate conversion.")
1011 (license (list license:gpl2+
1012 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1013 license:lgpl2.1+))))
1015 (define-public iptables
1022 "http://www.netfilter.org/projects/iptables/files/iptables-"
1023 version ".tar.bz2"))
1026 "1q6kg7sf0pgpq0qhab6sywl23cngxxfzc9zdzscsba8x09l4q02j"))))
1027 (build-system gnu-build-system)
1029 '(#:tests? #f ; no test suite
1030 #:configure-flags ; add $libdir to the RUNPATH of executables
1031 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1032 (home-page "http://www.netfilter.org/projects/iptables/index.html")
1033 (synopsis "Program to configure the Linux IP packet filtering rules")
1035 "iptables is the userspace command line program used to configure the
1036 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1037 system administrators. Since Network Address Translation is also configured
1038 from the packet filter ruleset, iptables is used for this, too. The iptables
1039 package also includes ip6tables. ip6tables is used for configuring the IPv6
1041 (license license:gpl2+)))
1043 (define-public iproute
1050 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1054 "1a59y1zkddvr7z0lh2y9iasbh9wpfc1n39p56xcd6jkhzk0y3c92"))))
1055 (build-system gnu-build-system)
1057 `(#:tests? #f ; no test suite
1058 #:make-flags (let ((out (assoc-ref %outputs "out")))
1060 (string-append "BASH_COMPDIR=" out
1061 "/etc/bash_completion.d")
1062 (string-append "LIBDIR=" out "/lib")
1063 (string-append "HDRDIR=" out "/include")
1064 (string-append "SBINDIR=" out "/sbin")
1065 (string-append "CONFDIR=" out "/etc")
1066 (string-append "DOCDIR=" out "/share/doc/"
1068 (string-append "MANDIR=" out "/share/man")))
1069 #:phases (modify-phases %standard-phases
1070 (add-before 'install 'pre-install
1072 ;; Don't attempt to create /var/lib/arpd.
1073 (substitute* "Makefile"
1074 (("^.*ARPDDIR.*$") "")))))))
1076 `(("iptables" ,iptables)
1079 `(("pkg-config" ,pkg-config)
1083 "https://wiki.linuxfoundation.org/networking/iproute2")
1085 "Utilities for controlling TCP/IP networking and traffic in Linux")
1087 "Iproute2 is a collection of utilities for controlling TCP/IP
1088 networking and traffic with the Linux kernel.
1090 Most network configuration manuals still refer to ifconfig and route as the
1091 primary network configuration tools, but ifconfig is known to behave
1092 inadequately in modern network environments. They should be deprecated, but
1093 most distros still include them. Most network configuration systems make use
1094 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1095 to support most modern network technologies, as it doesn't use ifconfig and
1096 allows a system administrator to make use of all iproute2 features, including
1099 iproute2 is usually shipped in a package called iproute or iproute2 and
1100 consists of several tools, of which the most important are @command{ip} and
1101 @command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1102 @command{tc} stands for traffic control. Both tools print detailed usage
1103 messages and are accompanied by a set of manpages.")
1104 (license license:gpl2+)))
1106 (define-public net-tools
1107 ;; XXX: This package is basically unmaintained, but it provides a few
1108 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1113 (home-page "http://net-tools.sourceforge.net/")
1116 (uri (list (string-append
1117 "mirror://sourceforge/net-tools/net-tools-"
1120 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1121 "/base/net-tools/net-tools-1.60.tar.bz2")))
1124 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1125 (patches (search-patches "net-tools-bitrot.patch"))))
1126 (build-system gnu-build-system)
1128 '(#:modules ((guix build gnu-build-system)
1132 #:phases (alist-cons-after
1134 (lambda* (#:key inputs #:allow-other-keys)
1135 (define (apply-patch file)
1136 (zero? (system* "patch" "-p1" "--force"
1139 (let ((patch.gz (assoc-ref inputs "patch")))
1140 (format #t "applying Debian patch set '~a'...~%"
1142 (system (string-append "gunzip < " patch.gz " > the-patch"))
1143 (and (apply-patch "the-patch")
1144 (for-each apply-patch
1145 (find-files "debian/patches"
1149 (lambda* (#:key outputs #:allow-other-keys)
1150 (let ((out (assoc-ref outputs "out")))
1151 (mkdir-p (string-append out "/bin"))
1152 (mkdir-p (string-append out "/sbin"))
1154 ;; Pretend we have everything...
1155 (system "yes | make config")
1157 ;; ... except for the things we don't have.
1158 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1159 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1160 ;; that have been removed.
1161 (substitute* '("config.make" "config.h")
1162 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1164 'install 'remove-redundant-commands
1165 (lambda* (#:key outputs #:allow-other-keys)
1166 ;; Remove commands and man pages redundant with
1168 (let* ((out (assoc-ref outputs "out"))
1169 (dup (append-map (cut find-files out <>)
1171 "^(yp|nis|dns)?domainname"))))
1172 (for-each delete-file dup)
1176 ;; Binaries that depend on libnet-tools.a don't declare that
1177 ;; dependency, making it parallel-unsafe.
1178 #:parallel-build? #f
1180 #:tests? #f ; no test suite
1181 #:make-flags (let ((out (assoc-ref %outputs "out")))
1183 (string-append "BASEDIR=" out)
1184 (string-append "INSTALLNLSDIR=" out "/share/locale")
1185 (string-append "mandir=/share/man")))))
1187 ;; Use the big Debian patch set (the thing does not even compile out of
1189 (inputs `(("patch" ,(origin
1192 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1195 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1196 (native-inputs `(("gettext" ,gettext-minimal)))
1198 (synopsis "Tools for controlling the network subsystem in Linux")
1200 "This package includes the important tools for controlling the network
1201 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1202 netstat, rarp and route. Additionally, this package contains utilities
1203 relating to particular network hardware types (plipconfig, slattach) and
1204 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1205 (license license:gpl2+)))
1207 (define-public libcap
1214 "mirror://kernel.org/linux/libs/security/linux-privs/"
1215 "libcap2/libcap-" version ".tar.xz"))
1218 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
1219 (build-system gnu-build-system)
1220 (arguments '(#:phases
1221 (modify-phases %standard-phases
1223 ;; Add $libdir to the RUNPATH of executables.
1225 (substitute* "Make.Rules"
1227 (string-append "LDFLAGS := -Wl,-rpath="
1228 %output "/lib"))))))
1229 #:tests? #f ; no 'check' target
1230 #:make-flags (list "lib=lib"
1231 (string-append "prefix="
1232 (assoc-ref %outputs "out"))
1233 "RAISE_SETFCAP=no")))
1234 (native-inputs `(("perl" ,perl)))
1235 (inputs `(("attr" ,attr)))
1236 (home-page "https://sites.google.com/site/fullycapable/")
1237 (synopsis "Library for working with POSIX capabilities")
1239 "Libcap2 provides a programming interface to POSIX capabilities on
1240 Linux-based operating systems.")
1242 ;; License is BSD-3 or GPLv2, at the user's choice.
1243 (license license:gpl2)))
1245 (define-public bridge-utils
1247 (name "bridge-utils")
1251 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1252 "bridge-utils-" version ".tar.gz"))
1255 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1256 (build-system gnu-build-system)
1258 ;; The tarball lacks all the generated files.
1259 (native-inputs `(("autoconf" ,autoconf)
1260 ("automake" ,automake)))
1262 '(#:phases (alist-cons-after
1265 ;; Fix "field ‘ip6’ has incomplete type" errors.
1266 (substitute* "libbridge/libbridge.h"
1267 (("#include <linux/if_bridge.h>")
1268 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1270 ;; Ensure that the entire build fails if one of the
1271 ;; sub-Makefiles fails.
1272 (substitute* "Makefile.in"
1273 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1274 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1276 (zero? (system* "autoreconf" "-vf")))
1278 #:tests? #f)) ; no 'check' target
1281 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1282 (synopsis "Manipulate Ethernet bridges")
1284 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1285 to connect two Ethernet segments together in a protocol independent way.
1286 Packets are forwarded based on Ethernet address, rather than IP address (like
1287 a router). Since forwarding is done at Layer 2, all protocols can go
1288 transparently through a bridge.")
1289 (license license:gpl2+)))
1291 (define-public libnl
1298 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1302 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1303 (build-system gnu-build-system)
1304 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1305 (home-page "http://www.infradead.org/~tgr/libnl/")
1306 (synopsis "NetLink protocol library suite")
1308 "The libnl suite is a collection of libraries providing APIs to netlink
1309 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1310 between the kernel and user space processes. It was designed to be a more
1311 flexible successor to ioctl to provide mainly networking related kernel
1312 configuration and monitoring interfaces.")
1314 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1315 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1316 (license license:gpl2)))
1325 "mirror://kernel.org/software/network/iw/iw-"
1329 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1330 (build-system gnu-build-system)
1331 (native-inputs `(("pkg-config" ,pkg-config)))
1332 (inputs `(("libnl" ,libnl)))
1334 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1336 #:phases (alist-delete 'configure %standard-phases)))
1337 (home-page "https://wireless.wiki.kernel.org/")
1338 (synopsis "Tool for configuring wireless devices")
1340 "iw is a new nl80211 based CLI configuration utility for wireless
1341 devices. It replaces @code{iwconfig}, which is deprecated.")
1342 (license license:isc)))
1344 (define-public powertop
1352 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1356 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1357 (build-system gnu-build-system)
1360 (modify-phases %standard-phases
1361 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1362 ;; allow calibrating the network interface in GuixSD.
1363 (add-after 'unpack 'patch-absolute-file-names
1364 (lambda* (#:key inputs #:allow-other-keys)
1365 (let ((kmod (assoc-ref inputs "kmod")))
1366 (substitute* (find-files "src" "\\.cpp$")
1367 ;; Give the right 'modprobe' file name so that essential
1368 ;; modules such as msr.ko can be loaded.
1369 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1370 ;; These programs are only needed to calibrate, so using
1371 ;; relative file names avoids adding extra inputs. When they
1372 ;; are missing powertop gracefully handles it.
1373 (("/usr/bin/hcitool") "hcitool")
1374 (("/usr/bin/xset") "xset")
1375 (("/usr/sbin/hciconfig") "hciconfig"))
1380 ("ncurses" ,ncurses)
1381 ("pciutils" ,pciutils)
1384 `(("pkg-config" ,pkg-config)))
1385 (home-page "https://01.org/powertop/")
1386 (synopsis "Analyze power consumption on Intel-based laptops")
1388 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1389 power management. In addition to being a diagnostic tool, PowerTOP also has
1390 an interactive mode where the user can experiment various power management
1391 settings for cases where the operating system has not enabled these
1393 (license license:gpl2)))
1395 (define-public aumix
1402 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1403 version ".tar.bz2"))
1406 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1407 (build-system gnu-build-system)
1408 (inputs `(("ncurses" ,ncurses)))
1409 (home-page "http://www.jpj.net/~trevor/aumix.html")
1410 (synopsis "Audio mixer for X and the console")
1412 "Aumix adjusts an audio mixer from X, the console, a terminal,
1413 the command line or a script.")
1414 (license license:gpl2+)))
1416 (define-public iotop
1423 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1426 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1427 (build-system python-build-system)
1429 ;; The setup.py script expects python-2.
1430 `(#:python ,python-2
1431 ;; There are currently no checks in the package.
1433 (native-inputs `(("python" ,python-2)))
1434 (home-page "http://guichaz.free.fr/iotop/")
1436 "Displays the IO activity of running processes")
1438 "Iotop is a Python program with a top like user interface to show the
1439 processes currently causing I/O.")
1440 (license license:gpl2+)))
1448 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1449 "download/fuse-" version
1450 "/fuse-" version ".tar.gz"))
1453 "0szi2vlsjxg03y4ji51jks34p269jqj5ify6l0ajsqq6f6y8pd0c"))))
1454 (build-system gnu-build-system)
1455 (inputs `(("util-linux" ,util-linux)))
1457 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1458 (assoc-ref %outputs "out")
1460 (string-append "INIT_D_PATH="
1461 (assoc-ref %outputs "out")
1464 ;; The rule makes /dev/fuse 666.
1465 (string-append "UDEV_RULES_PATH="
1466 (assoc-ref %outputs "out")
1467 "/lib/udev/rules.d"))
1468 #:phases (alist-cons-before
1469 'build 'set-file-names
1470 (lambda* (#:key inputs #:allow-other-keys)
1471 ;; libfuse calls out to mount(8) and umount(8). Make sure
1472 ;; it refers to the right ones.
1473 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1474 (("/bin/(u?)mount" _ maybe-u)
1475 (string-append (assoc-ref inputs "util-linux")
1476 "/bin/" maybe-u "mount")))
1477 (substitute* '("util/mount.fuse.c")
1481 ;; This hack leads libfuse to search for 'fusermount' in
1482 ;; $PATH, where it may find a setuid-root binary, instead of
1483 ;; trying solely $out/sbin/fusermount and failing because
1485 (substitute* "lib/Makefile"
1486 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1487 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1489 (home-page "https://github.com/libfuse/libfuse")
1490 (synopsis "Support file systems implemented in user space")
1492 "As a consequence of its monolithic design, file system code for Linux
1493 normally goes into the kernel itself---which is not only a robustness issue,
1494 but also an impediment to system extensibility. FUSE, for \"file systems in
1495 user space\", is a kernel module and user-space library that tries to address
1496 part of this problem by allowing users to run file system implementations as
1497 user-space processes.")
1498 (license (list license:lgpl2.1 ;library
1499 license:gpl2+)))) ;command-line utilities
1501 (define-public unionfs-fuse
1503 (name "unionfs-fuse")
1508 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1512 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1513 (build-system cmake-build-system)
1514 (inputs `(("fuse" ,fuse)))
1515 (arguments '(#:tests? #f)) ; no tests
1516 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1517 (synopsis "User-space union file system")
1519 "UnionFS-FUSE is a flexible union file system implementation in user
1520 space, using the FUSE library. Mounting a union file system allows you to
1521 \"aggregate\" the contents of several directories into a single mount point.
1522 UnionFS-FUSE additionally supports copy-on-write.")
1523 (license license:bsd-3)))
1526 (package (inherit fuse)
1527 (name "fuse-static")
1528 (source (origin (inherit (package-source fuse))
1529 (modules '((guix build utils)))
1531 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1532 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1533 ;; it doesn't do that, allowing us to remove the dependency on
1534 ;; util-linux (something that is useful in initrds.)
1535 '(substitute* '("lib/mount_util.c"
1536 "util/mount_util.c")
1537 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1542 (define-public unionfs-fuse/static
1543 (package (inherit unionfs-fuse)
1544 (synopsis "User-space union file system (statically linked)")
1545 (name (string-append (package-name unionfs-fuse) "-static"))
1546 (source (origin (inherit (package-source unionfs-fuse))
1547 (modules '((guix build utils)))
1549 ;; Add -ldl to the libraries, because libfuse.a needs that.
1550 '(substitute* "src/CMakeLists.txt"
1551 (("target_link_libraries(.*)\\)" _ libs)
1552 (string-append "target_link_libraries"
1556 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1557 #:phases (alist-cons-after
1558 'install 'post-install
1559 (lambda* (#:key outputs #:allow-other-keys)
1560 (let* ((out (assoc-ref outputs "out"))
1561 (exe (string-append out "/bin/unionfs")))
1562 ;; By default, 'unionfs' keeps references to
1563 ;; $glibc/share/locale and similar stuff. Remove them.
1564 (remove-store-references exe)))
1566 (inputs `(("fuse" ,fuse-static)))))
1568 (define-public sshfs-fuse
1574 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1575 "download/sshfs_" version
1576 "/sshfs-" version ".tar.gz"))
1579 "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
1580 (build-system gnu-build-system)
1585 `(("pkg-config" ,pkg-config)))
1586 (home-page "http://fuse.sourceforge.net/sshfs.html")
1587 (synopsis "Mount remote file systems over SSH")
1589 "This is a file system client based on the SSH File Transfer Protocol.
1590 Since most SSH servers already support this protocol it is very easy to set
1591 up: on the server side there's nothing to do; on the client side mounting the
1592 file system is as easy as logging into the server with an SSH client.")
1593 (license license:gpl2+)))
1595 (define-public numactl
1602 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1607 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1608 (build-system gnu-build-system)
1610 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1611 ;; to run, which we can't assume to have.
1614 ;; NUMA is apparently not supported on armhf, see
1615 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1616 (supported-systems (delete "armhf-linux" %supported-systems))
1617 (home-page "http://oss.sgi.com/projects/libnuma/")
1618 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1620 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1621 memory is not all in one place. The numactl program allows you to run your
1622 application program on specific CPU's and memory nodes. It does this by
1623 supplying a NUMA memory policy to the operating system before running your
1626 The package contains other commands, such as numademo, numastat and memhog.
1627 The numademo command provides a quick overview of NUMA performance on your
1629 (license (list license:gpl2 ;programs
1630 license:lgpl2.1)))) ;library
1638 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1642 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1643 (modules '((guix build utils)))
1646 (substitute* "tests/Makefile.in"
1647 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1650 (substitute* '("src/unicode_start" "src/unicode_stop")
1651 ;; Assume the Coreutils are in $PATH.
1654 (build-system gnu-build-system)
1657 (modify-phases %standard-phases
1658 (add-before 'build 'pre-build
1659 (lambda* (#:key inputs #:allow-other-keys)
1660 (let ((gzip (assoc-ref %build-inputs "gzip"))
1661 (bzip2 (assoc-ref %build-inputs "bzip2")))
1662 (substitute* "src/libkeymap/findfile.c"
1664 (string-append gzip "/bin/gzip"))
1666 (string-append bzip2 "/bin/bzip2"))))))
1667 (add-after 'install 'post-install
1668 (lambda* (#:key outputs #:allow-other-keys)
1669 ;; Make sure these programs find their comrades.
1670 (let* ((out (assoc-ref outputs "out"))
1671 (bin (string-append out "/bin")))
1672 (for-each (lambda (prog)
1673 (wrap-program (string-append bin "/" prog)
1674 `("PATH" ":" prefix (,bin))))
1675 '("unicode_start" "unicode_stop"))))))))
1676 (inputs `(("check" ,check)
1679 ("pam" ,linux-pam)))
1680 (native-inputs `(("pkg-config" ,pkg-config)))
1681 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1682 (synopsis "Linux keyboard utilities and keyboard maps")
1684 "This package contains keytable files and keyboard utilities compatible
1685 for systems using the Linux kernel. This includes commands such as
1686 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1687 (license license:gpl2+)))
1689 (define-public inotify-tools
1691 (name "inotify-tools")
1696 "mirror://sourceforge/inotify-tools/inotify-tools/"
1697 version "/inotify-tools-" version ".tar.gz"))
1700 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1701 (build-system gnu-build-system)
1702 (home-page "http://inotify-tools.sourceforge.net/")
1703 (synopsis "Monitor file accesses")
1705 "The inotify-tools packages provides a C library and command-line tools
1706 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1707 (license license:gpl2+)))
1716 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1717 "kmod-" version ".tar.xz"))
1720 "0mc12sx06p8il1ym3hdmgxxb37apn9yv7xij26gddjdfkx8xa0yk"))
1721 (patches (search-patches "kmod-module-directory.patch"))))
1722 (build-system gnu-build-system)
1724 `(("pkg-config" ,pkg-config)))
1729 `(#:tests? #f ; FIXME: Investigate test failures
1730 #:configure-flags '("--with-xz" "--with-zlib")
1731 #:phases (alist-cons-after
1732 'install 'install-modprobe&co
1733 (lambda* (#:key outputs #:allow-other-keys)
1734 (let* ((out (assoc-ref outputs "out"))
1735 (bin (string-append out "/bin")))
1736 (for-each (lambda (tool)
1738 (string-append bin "/" tool)))
1739 '("insmod" "rmmod" "lsmod" "modprobe"
1740 "modinfo" "depmod"))))
1742 (home-page "https://www.kernel.org/")
1743 (synopsis "Kernel module tools")
1744 (description "Kmod is a set of tools to handle common tasks with Linux
1745 kernel modules like insert, remove, list, check properties, resolve
1746 dependencies and aliases.
1748 These tools are designed on top of libkmod, a library that is shipped with
1749 kmod. The aim is to be compatible with tools, configurations and indices
1750 from the module-init-tools project.")
1751 (license license:gpl2+))) ; library under lgpl2.1+
1753 (define-public eudev
1754 ;; The post-systemd fork, maintained by Gentoo.
1761 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1765 "099w62ncq78nxpxizf910mx18hc8x4qvzw3azjd00fir89wmyjnq"))
1766 (patches (search-patches "eudev-rules-directory.patch"))))
1767 (build-system gnu-build-system)
1769 `(("pkg-config" ,pkg-config)
1773 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1774 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1775 ;; which contains the rules to do that.
1776 `(("util-linux" ,util-linux) ;for blkid
1778 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1779 (synopsis "Userspace device management")
1780 (description "Udev is a daemon which dynamically creates and removes
1781 device nodes from /dev/, handles hotplug events and loads drivers at boot
1783 (license license:gpl2+)))
1785 (define-public eudev-with-hwdb
1786 ;; TODO: Merge with 'eudev'.
1789 (name "eudev-with-hwdb")
1791 '(#:phases (modify-phases %standard-phases
1792 (add-after 'install 'build-hwdb
1793 (lambda* (#:key outputs #:allow-other-keys)
1794 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1795 ;; similar tools to display product names.
1796 (let ((out (assoc-ref outputs "out")))
1797 (zero? (system* (string-append out "/bin/udevadm")
1798 "hwdb" "--update"))))))))))
1803 (version "2.02.168")
1806 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1810 "03b62hcsj9z37ckd8c21wwpm07s9zblq7grfh58yzcs1vp6x38r3"))
1811 (modules '((guix build utils)))
1814 (use-modules (guix build utils))
1816 ;; Honor sysconfdir.
1817 (substitute* "make.tmpl.in"
1819 "confdir = @sysconfdir@\n")
1820 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1821 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1822 (patches (search-patches "lvm2-static-link.patch"))))
1823 (build-system gnu-build-system)
1825 `(("pkg-config" ,pkg-config)
1826 ("procps" ,procps))) ;tests use 'pgrep'
1831 (modify-phases %standard-phases
1832 (add-after 'configure 'set-makefile-shell
1834 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1836 (setenv "SHELL" (which "sh"))
1838 ;; Replace /bin/sh with the right file name.
1839 (patch-makefile-SHELL "make.tmpl")
1841 (add-before 'strip 'make-objects-writable
1842 (lambda* (#:key outputs #:allow-other-keys)
1843 ;; Make compiled objects writable so they can be stripped.
1844 (let ((out (assoc-ref outputs "out")))
1845 (for-each (lambda (file)
1848 (find-files (string-append out "/lib"))
1849 (find-files (string-append out "/sbin"))))
1852 #:configure-flags (list (string-append "--sysconfdir="
1853 (assoc-ref %outputs "out")
1855 "--enable-udev_sync"
1856 "--enable-udev_rules"
1858 ;; Make sure programs such as 'dmsetup' can
1859 ;; find libdevmapper.so.
1860 (string-append "LDFLAGS=-Wl,-rpath="
1861 (assoc-ref %outputs "out")
1864 ;; The tests use 'mknod', which requires root access.
1866 (home-page "http://sourceware.org/lvm2/")
1867 (synopsis "Logical volume management for Linux")
1869 "LVM2 is the logical volume management tool set for Linux-based systems.
1870 This package includes the user-space libraries and tools, including the device
1871 mapper. Kernel components are part of Linux-libre.")
1873 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1874 ;; Command-line tools are GPLv2.
1875 (license (list license:gpl2 license:lgpl2.1))))
1877 (define-public lvm2-static
1880 (name "lvm2-static")
1882 ;; Propagate udev because libdevmapper.a depends on libudev.
1883 (inputs (alist-delete "udev" (package-inputs lvm2)))
1884 (propagated-inputs `(("udev" ,eudev)))
1887 (substitute-keyword-arguments (package-arguments lvm2)
1888 ((#:configure-flags flags '())
1889 ;; LVM2 doesn't use Libtool, hence the custom option.
1890 `(cons "--enable-static_link" ,flags))))
1891 (synopsis "Logical volume management for Linux (statically linked)")))
1893 (define-public wireless-tools
1895 (name "wireless-tools")
1899 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1903 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1906 ;; Remove the older header files that are not free software.
1907 (for-each (lambda (n)
1908 (delete-file (format #f "wireless.~a.h" n)))
1909 '(10 11 12 13 14 15 16 17 18 19 20))
1911 (build-system gnu-build-system)
1914 (list (string-append "PREFIX=" %output)
1915 (string-append "INSTALL_MAN=" %output "/share/man")
1916 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1918 #:phases (modify-phases %standard-phases
1919 (delete 'configure))
1921 (synopsis "Tools for manipulating Linux Wireless Extensions")
1922 (description "Wireless Tools are used to manipulate the now-deprecated
1923 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1924 Extension was an interface allowing you to set Wireless LAN specific
1925 parameters and get the specific stats. It is deprecated in favor the nl80211
1927 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1928 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1929 ;; other files are distributed under gpl2.
1930 (license (list license:gpl2 license:lgpl2.1+))))
1938 (uri (string-append "mirror://kernel.org/software/network/crda/"
1939 "crda-" version ".tar.xz"))
1942 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
1943 (patches (search-patches "crda-optional-gcrypt.patch"))))
1944 (build-system gnu-build-system)
1946 '(#:phases (modify-phases %standard-phases
1949 'build 'no-werror-no-ldconfig
1951 (substitute* "Makefile"
1953 (("ldconfig") "true"))
1956 'build 'set-regulator-db-file-name
1957 (lambda* (#:key inputs #:allow-other-keys)
1958 ;; Tell CRDA where to find our database.
1959 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1960 (substitute* "crda.c"
1961 (("\"/lib/crda/regulatory.bin\"")
1962 (string-append "\"" regdb
1963 "/lib/crda/regulatory.bin\"")))
1965 #:test-target "verify"
1966 #:make-flags (let ((out (assoc-ref %outputs "out"))
1967 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1968 (list "CC=gcc" "V=1"
1970 ;; Disable signature-checking on 'regulatory.bin'.
1971 ;; The reason is that this simplifies maintenance
1972 ;; on our side (no need to manage a distro key
1973 ;; pair), and we can guarantee integrity of
1974 ;; 'regulatory.bin' by other means anyway, such as
1975 ;; 'guix gc --verify'. See
1976 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1980 (string-append "PREFIX=" out)
1981 (string-append "SBINDIR=" out "/sbin/")
1982 (string-append "UDEV_RULE_DIR="
1983 out "/lib/udev/rules.d")
1984 (string-append "LDFLAGS=-Wl,-rpath="
1986 (string-append "REG_BIN=" regdb
1987 "/lib/crda/regulatory.bin")))))
1988 (native-inputs `(("pkg-config" ,pkg-config)
1989 ("python" ,python-2)
1990 ("wireless-regdb" ,wireless-regdb)))
1991 (inputs `(("libnl" ,libnl)))
1993 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1994 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1996 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1997 communication between the kernel Linux and user space for regulatory
1999 (license license:copyleft-next)))
2001 (define-public wireless-regdb
2003 (name "wireless-regdb")
2004 (version "2016.06.10")
2008 "mirror://kernel.org/software/network/wireless-regdb/"
2009 "wireless-regdb-" version ".tar.xz"))
2012 "1dxqy7a7zpzya30ff00s8k1qgrlndrwys99gc0r8yg0vab1z3vfg"))
2014 ;; We're building 'regulatory.bin' by ourselves.
2015 (snippet '(delete-file "regulatory.bin"))))
2016 (build-system gnu-build-system)
2018 '(#:phases (modify-phases %standard-phases
2019 (delete 'configure))
2021 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2022 ;; is computed and can be equal to 'maintainer-clean'; when that
2023 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2024 ;; just built. Thus, build things sequentially.
2025 #:parallel-build? #f
2027 #:tests? #f ;no tests
2028 #:make-flags (let ((out (assoc-ref %outputs "out")))
2029 (list (string-append "PREFIX=" out)
2030 (string-append "LSB_ID=GuixSD")
2031 (string-append "DISTRO_PUBKEY=/dev/null")
2032 (string-append "DISTRO_PRIVKEY=/dev/null")
2033 (string-append "REGDB_PUBKEY=/dev/null")
2035 ;; Leave that empty so that db2bin.py doesn't try
2036 ;; to sign 'regulatory.bin'. This allows us to
2037 ;; avoid managing a key pair for the whole distro.
2038 (string-append "REGDB_PRIVKEY=")))))
2039 (native-inputs `(("python" ,python-2)))
2041 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2042 (synopsis "Wireless regulatory database")
2044 "This package contains the wireless regulatory database Central
2045 Regulatory Database Agent (CRDA) daemon. The database contains information on
2046 country-specific regulations for the wireless spectrum.")
2047 (license license:isc)))
2049 (define-public lm-sensors
2055 (uri (list (string-append
2056 "https://github.com/groeck/lm-sensors/archive/V"
2057 (string-join (string-split version #\.) "-")
2061 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2062 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2063 (build-system gnu-build-system)
2064 (inputs `(("rrdtool" ,rrdtool)
2067 ("gnuplot" ,gnuplot)))
2068 (native-inputs `(("pkg-config" ,pkg-config)
2073 `(#:tests? #f ; no 'check' target
2074 #:make-flags (list (string-append "PREFIX=" %output)
2075 (string-append "ETCDIR=" %output "/etc")
2076 (string-append "MANDIR=" %output "/share/man"))
2081 'build 'patch-exec-paths
2082 (lambda* (#:key inputs outputs #:allow-other-keys)
2083 (substitute* "prog/detect/sensors-detect"
2085 (string-append "`" (assoc-ref inputs "coreutils")
2087 (("(`|\")modprobe" all open-quote)
2088 (string-append open-quote
2089 (assoc-ref inputs "kmod")
2091 (substitute* '("prog/pwm/pwmconfig"
2092 "prog/pwm/fancontrol")
2094 (string-append (assoc-ref inputs "gnuplot")
2097 (string-append (assoc-ref inputs "coreutils")
2100 (string-append (assoc-ref inputs "grep")
2103 (string-append (assoc-ref inputs "sed")
2106 (string-append (assoc-ref inputs "coreutils")
2109 (string-append (assoc-ref inputs "coreutils")
2112 (string-append (assoc-ref inputs "coreutils")
2113 "/bin/readlink -f"))))
2114 %standard-phases))))
2115 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2116 (synopsis "Utilities to read temperature/voltage/fan sensors")
2118 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2119 you to access information from temperature, voltage, and fan speed sensors.
2120 It works with most newer systems.")
2121 (license license:gpl2+)))
2123 (define-public i2c-tools
2130 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2131 version ".tar.bz2"))
2134 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2135 (build-system gnu-build-system)
2137 `(#:tests? #f ; no 'check' target
2138 #:make-flags (list (string-append "prefix=" %output)
2140 ;; no configure script
2141 #:phases (alist-delete 'configure %standard-phases)))
2144 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2145 (synopsis "I2C tools for Linux")
2147 "The i2c-tools package contains a heterogeneous set of I2C tools for
2148 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2149 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2151 (license license:gpl2+)))
2153 (define-public xsensors
2160 "http://www.linuxhardware.org/xsensors/xsensors-"
2164 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2165 (build-system gnu-build-system)
2166 (inputs `(("lm-sensors" ,lm-sensors)
2168 (native-inputs `(("pkg-config" ,pkg-config)))
2170 `(#:phases (alist-cons-before
2171 'configure 'enable-deprecated
2173 (substitute* "src/Makefile.in"
2174 (("-DGDK_DISABLE_DEPRECATED") "")
2175 (("-DGTK_DISABLE_DEPRECATED") "")))
2177 'configure 'remove-Werror
2179 (substitute* '("configure" "src/Makefile.in")
2181 %standard-phases))))
2182 (home-page "http://www.linuxhardware.org/xsensors/")
2183 (synopsis "Hardware health information viewer")
2185 "Xsensors reads data from the libsensors library regarding hardware
2186 health such as temperature, voltage and fan speed and displays the information
2187 in a digital read-out.")
2188 (license license:gpl2+)))
2193 (version (package-version linux-libre))
2194 (source (package-source linux-libre))
2195 (build-system gnu-build-system)
2197 '(#:phases (alist-replace
2199 (lambda* (#:key inputs #:allow-other-keys)
2200 (setenv "SHELL_PATH" (which "bash"))
2201 (chdir "tools/perf"))
2203 #:make-flags (list (string-append "DESTDIR="
2204 (assoc-ref %outputs "out"))
2207 ;; By default, 'config/Makefile' uses lib64 on
2208 ;; x86_64. Work around that.
2210 #:tests? #f)) ;no tests
2212 `(("pkg-config" ,pkg-config)
2216 ;; There are build scripts written in these languages.
2218 ("python" ,python-2)))
2220 `(("slang" ,slang) ;for the interactive TUI
2222 ("python" ,python-2) ;'perf' links against libpython
2223 ("elfutils" ,elfutils)
2226 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2227 ("libxslt" ,libxslt)
2228 ("docbook-xml" ,docbook-xml)
2229 ("docbook-xsl" ,docbook-xsl)
2231 ("asciidoc" ,asciidoc)))
2232 (home-page "https://perf.wiki.kernel.org/")
2233 (synopsis "Linux profiling with performance counters")
2235 "perf is a tool suite for profiling using hardware performance counters,
2236 with support in the Linux kernel. perf can instrument CPU performance
2237 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2238 of lightweight profiling. This package contains the user-land tools and in
2239 particular the 'perf' command.")
2240 (license (package-license linux-libre))))
2242 (define-public pflask
2248 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2250 (file-name (string-append name "-" version ".tar.gz"))
2253 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2254 (build-system cmake-build-system)
2256 '(#:tests? #f)) ; no tests
2257 (home-page "http://ghedo.github.io/pflask/")
2258 (synopsis "Simple tool for creating Linux namespace containers")
2259 (description "pflask is a simple tool for creating Linux namespace
2260 containers. It can be used for running a command or even booting an OS inside
2261 an isolated container, created with the help of Linux namespaces. It is
2262 similar in functionality to chroot, although pflask provides better isolation
2263 thanks to the use of namespaces.")
2264 (license license:bsd-2)))
2266 (define-public hdparm
2272 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2273 name "-" version ".tar.gz"))
2276 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2277 (build-system gnu-build-system)
2279 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2280 (list (string-append "binprefix=" out)
2281 (string-append "manprefix=" out)
2283 #:phases (alist-delete 'configure %standard-phases)
2284 #:tests? #f)) ; no test suite
2285 (home-page "https://sourceforge.net/projects/hdparm/")
2286 (synopsis "Tune hard disk parameters for high performance")
2288 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
2289 is for enabling irq-unmasking and IDE multiple-mode.")
2290 (license (license:non-copyleft "file://LICENSE.TXT"))))
2292 (define-public rfkill
2298 (uri (string-append "mirror://kernel.org/software/network/"
2299 name "/" name "-" version ".tar.xz"))
2302 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2303 (build-system gnu-build-system)
2305 `(#:make-flags (list "CC=gcc"
2306 (string-append "PREFIX=" %output))
2307 #:phases (modify-phases %standard-phases
2308 (delete 'configure))
2310 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2311 (synopsis "Tool for enabling and disabling wireless devices")
2313 "rfkill is a simple tool for accessing the rfkill device interface,
2314 which is used to enable and disable wireless networking devices, typically
2315 WLAN, Bluetooth and mobile broadband.")
2316 (license (license:non-copyleft "file://COPYING"
2317 "See COPYING in the distribution."))))
2325 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2326 version "/" name "-" version ".tar.gz"))
2329 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2330 (build-system gnu-build-system)
2331 (home-page "http://acpiclient.sourceforge.net")
2332 (synopsis "Display information on ACPI devices")
2333 (description "@code{acpi} attempts to replicate the functionality of the
2334 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2335 information. It does not support ACPI suspending, only displays information
2336 about ACPI devices.")
2337 (license license:gpl2+)))
2339 (define-public acpid
2345 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2349 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2350 (build-system gnu-build-system)
2351 (home-page "https://sourceforge.net/projects/acpid2/")
2352 (synopsis "Daemon for delivering ACPI events to user-space programs")
2354 "acpid is designed to notify user-space programs of Advanced
2355 Configuration and Power Interface (ACPI) events. acpid should be started
2356 during the system boot, and will run as a background process. When an ACPI
2357 event is received from the kernel, acpid will examine the list of rules
2358 specified in /etc/acpi/events and execute the rules that match the event.")
2359 (license license:gpl2+)))
2361 (define-public sysfsutils
2370 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2373 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2374 (build-system gnu-build-system)
2375 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2376 (synopsis "System utilities based on Linux sysfs")
2378 "These are a set of utilities built upon sysfs, a virtual file system in
2379 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2380 also contains the libsysfs library.")
2381 ;; The library is under lgpl2.1+ (all files say "or any later version").
2382 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2383 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2385 (define-public sysfsutils-1
2387 (inherit sysfsutils)
2394 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2395 "/sysfsutils-" version ".tar.gz"))
2397 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2398 (modules '((guix build utils)))
2401 (substitute* "Makefile.in"
2402 (("includedir = /usr/include/sysfs")
2403 "includedir = @includedir@"))
2404 (substitute* "configure"
2405 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2406 (string-append "includedir='" orig "/sysfs'")))))))
2407 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2409 (define-public cpufrequtils
2411 (name "cpufrequtils")
2418 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2421 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2422 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2423 (build-system gnu-build-system)
2425 `(("sysfsutils" ,sysfsutils-1)))
2427 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2428 (assoc-ref %outputs "out") "/lib"))))
2429 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2430 (synopsis "Utilities to get and set CPU frequency on Linux")
2432 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2433 information, and set the CPU frequency if supported, using the cpufreq
2434 capabilities of the Linux kernel.")
2435 (license license:gpl2)))
2437 (define-public libraw1394
2444 "mirror://kernel.org/linux/libs/ieee1394/"
2445 name "-" version ".tar.xz"))
2448 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2449 (build-system gnu-build-system)
2450 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2451 (synopsis "Interface library for the Linux IEEE1394 drivers")
2453 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2454 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2455 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2456 send to and receive from other nodes without requiring a kernel driver for the
2457 protocol in question.")
2458 (license license:lgpl2.1+)))
2460 (define-public libavc1394
2466 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2467 name "-" version ".tar.gz"))
2470 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2471 (build-system gnu-build-system)
2473 `(("pkg-config" ,pkg-config)))
2475 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2476 (home-page "https://sourceforge.net/projects/libavc1394/")
2477 (synopsis "AV/C protocol library for IEEE 1394")
2479 "Libavc1394 is a programming interface to the AV/C specification from
2480 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2481 (license license:lgpl2.1+)))
2483 (define-public libiec61883
2485 (name "libiec61883")
2490 "mirror://kernel.org/linux/libs/ieee1394/"
2491 name "-" version ".tar.xz"))
2494 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2495 (build-system gnu-build-system)
2497 `(("pkg-config" ,pkg-config)))
2499 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2500 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2501 (synopsis "Isochronous streaming media library for IEEE 1394")
2503 "The libiec61883 library provides a higher level API for streaming DV,
2504 MPEG-2 and audio over Linux IEEE 1394.")
2505 (license license:lgpl2.1+)))
2507 (define-public mdadm
2514 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2518 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2519 (build-system gnu-build-system)
2523 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2527 ;; TODO: tell it where to find 'sendmail'
2528 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2529 (string-append "BINDIR=" out "/sbin")
2530 (string-append "MANDIR=" out "/share/man")
2531 (string-append "UDEVDIR=" out "/lib/udev")))
2532 #:phases (alist-cons-before
2533 'build 'patch-program-paths
2534 (lambda* (#:key inputs #:allow-other-keys)
2535 (let ((coreutils (assoc-ref inputs "coreutils")))
2536 (substitute* "udev-md-raid-arrays.rules"
2537 (("/usr/bin/(readlink|basename)" all program)
2538 (string-append coreutils "/bin/" program)))))
2540 'build 'remove-W-error
2542 ;; We cannot build with -Werror on i686 due to a
2543 ;; 'sign-compare' warning in util.c.
2544 (substitute* "Makefile"
2547 (alist-delete 'configure %standard-phases)))
2548 ;;tests must be done as root
2550 (home-page "http://neil.brown.name/blog/mdadm")
2551 (synopsis "Tool for managing Linux Software RAID arrays")
2553 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2554 assemble, report on, and monitor arrays. It can also move spares between raid
2555 arrays when needed.")
2556 (license license:gpl2+)))
2558 (define-public mdadm-static
2561 (name "mdadm-static")
2563 (substitute-keyword-arguments (package-arguments mdadm)
2564 ((#:make-flags flags)
2565 `(cons "LDFLAGS = -static" ,flags))
2567 `(modify-phases ,phases
2568 (add-after 'install 'remove-cruft
2569 (lambda* (#:key outputs #:allow-other-keys)
2570 (let* ((out (assoc-ref outputs "out"))
2571 (precious? (lambda (file)
2572 (member file '("." ".." "sbin"))))
2573 (directories (scandir out (negate precious?))))
2574 (with-directory-excursion out
2575 (for-each delete-file-recursively directories)
2576 (remove-store-references "sbin/mdadm")
2577 (delete-file "sbin/mdmon")
2579 ((#:modules modules %gnu-build-system-modules)
2580 `((ice-9 ftw) ,@modules))
2581 ((#:strip-flags _ '())
2582 ''("--strip-all")) ;strip a few extra KiB
2583 ((#:allowed-references _ '("out"))
2584 '("out")))) ;refer only self
2585 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2587 (define-public libaio
2594 (string-append "mirror://debian/pool/main/liba/libaio/"
2595 name "_" version ".orig.tar.gz")
2596 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2597 name "-" version ".tar.gz")))
2600 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2601 (build-system gnu-build-system)
2604 (list "CC=gcc" (string-append "prefix=" %output))
2605 #:test-target "partcheck" ; need root for a full 'check'
2607 (alist-delete 'configure %standard-phases))) ; no configure script
2608 (home-page "http://lse.sourceforge.net/io/aio.html")
2609 (synopsis "Linux-native asynchronous I/O access library")
2611 "This library enables userspace to use Linux kernel asynchronous I/O
2612 system calls, important for the performance of databases and other advanced
2614 (license license:lgpl2.1+)))
2622 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2623 name "-" version ".tar.xz"))
2626 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2627 (build-system gnu-build-system)
2629 `(("libsndfile" ,libsndfile)))
2631 `(("pkg-config" ,pkg-config)))
2632 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2633 (synopsis "Bluetooth subband audio codec")
2635 "The SBC is a digital audio encoder and decoder used to transfer data to
2636 Bluetooth audio output devices like headphones or loudspeakers.")
2637 (license license:gpl2+)))
2639 (define-public bluez
2646 "mirror://kernel.org/linux/bluetooth/bluez-"
2650 "05cdnpz0w2lwq2x5ba87q1h2wgb4lfnpbnbh6p7499hx59fw1j8n"))))
2651 (build-system gnu-build-system)
2654 (let ((out (assoc-ref %outputs "out")))
2655 (list "--sysconfdir=/etc"
2656 "--localstatedir=/var"
2659 ;; Install dbus/udev files to the correct location.
2660 (string-append "--with-dbusconfdir=" out "/etc")
2661 (string-append "--with-udevdir=" out "/lib/udev")))
2663 (modify-phases %standard-phases
2664 (add-after 'install 'post-install
2665 (lambda* (#:key inputs outputs #:allow-other-keys)
2666 (let* ((out (assoc-ref outputs "out"))
2667 (servicedir (string-append out "/share/dbus-1/services"))
2668 (service "obexd/src/org.bluez.obex.service")
2669 (rule (string-append
2670 out "/lib/udev/rules.d/97-hid2hci.rules")))
2671 ;; Install the obex dbus service file.
2672 (substitute* service
2674 (string-append out "/libexec/bluetooth/obexd")))
2675 (install-file service servicedir)
2676 ;; Fix paths in the udev rule.
2678 (("hid2hci --method")
2679 (string-append out "/lib/udev/hid2hci --method"))
2681 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2684 `(("pkg-config" ,pkg-config)
2685 ("gettext" ,gettext-minimal)))
2690 ("libical" ,libical)
2691 ("readline" ,readline)))
2692 (home-page "http://www.bluez.org/")
2693 (synopsis "Linux Bluetooth protocol stack")
2695 "BlueZ provides support for the core Bluetooth layers and protocols. It
2696 is flexible, efficient and uses a modular implementation.")
2697 (license license:gpl2+)))
2699 (define-public fuse-exfat
2706 "https://github.com/relan/exfat/releases/download/v"
2707 version "/" name "-" version ".tar.gz"))
2710 "1rvq4hapy2anal1vg1yidv4x8rg4iw5sxfwqixkw0q2qsxb54471"))))
2711 (build-system gnu-build-system)
2713 `(("pkg-config" ,pkg-config)))
2716 (home-page "https://github.com/relan/exfat")
2717 (synopsis "Mount exFAT file systems")
2719 "This package provides a FUSE-based file system that provides read and
2720 write access to exFAT devices.")
2721 (license license:gpl2+)))
2730 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2731 version ".tar.bz2"))
2734 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2735 (build-system gnu-build-system)
2737 '(#:phases (modify-phases %standard-phases
2738 (add-before 'configure 'bootstrap
2740 ;; The tarball was not generated with 'make dist' so we
2741 ;; need to bootstrap things ourselves.
2742 (and (zero? (system* "./autogen.sh"))
2744 (patch-makefile-SHELL "Makefile.include.in")
2747 ;; Make sure programs find libgpm.so.
2748 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2749 (assoc-ref %outputs "out")
2752 `(("texinfo" ,texinfo)
2755 ("autoconf" ,autoconf)
2756 ("automake" ,automake)
2757 ("libtool" ,libtool)))
2758 (home-page "http://www.nico.schottelius.org/software/gpm/")
2759 (synopsis "Mouse support for the Linux console")
2761 "The GPM (general-purpose mouse) daemon is a mouse server for
2762 applications running on the Linux console. It allows users to select items
2763 and copy/paste text in the console and in xterm.")
2764 (license license:gpl2+)))
2766 (define-public btrfs-progs
2768 (name "btrfs-progs")
2772 (uri (string-append "mirror://kernel.org/linux/kernel/"
2773 "people/kdave/btrfs-progs/"
2774 "btrfs-progs-v" version ".tar.xz"))
2777 "1ppy2y9vypxw9awchari21yd3s2d7w2a9q3f4jq7dnjy5gyrnjj6"))))
2778 (build-system gnu-build-system)
2780 "static")) ; static versions of binaries in "out" (~16MiB!)
2782 '(#:phases (modify-phases %standard-phases
2783 (add-after 'build 'build-static
2784 (lambda _ (zero? (system* "make" "static"))))
2785 (add-after 'install 'install-static
2786 (let ((staticbin (string-append (assoc-ref %outputs "static")
2789 (zero? (system* "make"
2790 (string-append "bindir=" staticbin)
2791 "install-static"))))))
2792 #:test-target "test"
2793 #:parallel-tests? #f)) ; tests fail when run in parallel
2794 (inputs `(("e2fsprogs" ,e2fsprogs)
2795 ("libblkid" ,util-linux)
2796 ("libblkid:static" ,util-linux "static")
2797 ("libuuid" ,util-linux)
2798 ("libuuid:static" ,util-linux "static")
2801 (native-inputs `(("pkg-config" ,pkg-config)
2802 ("asciidoc" ,asciidoc)
2804 ;; For building documentation.
2805 ("libxml2" ,libxml2)
2806 ("docbook-xml" ,docbook-xml)
2807 ("docbook-xsl" ,docbook-xsl)
2810 (home-page "https://btrfs.wiki.kernel.org/")
2811 (synopsis "Create and manage btrfs copy-on-write file systems")
2812 (description "Btrfs is a copy-on-write (CoW) file system for Linux aimed at
2813 implementing advanced features while focusing on fault tolerance, repair and
2814 easy administration.")
2815 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2816 ;; GPL2: Everything else.
2817 (license (list license:gpl2 license:gpl2+))))
2819 (define-public btrfs-progs/static
2821 (name "btrfs-progs-static")
2822 (version (package-version btrfs-progs))
2824 (build-system trivial-build-system)
2826 `(("btrfs-progs:static" ,btrfs-progs "static")))
2828 `(#:modules ((guix build utils))
2831 (use-modules (guix build utils)
2835 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
2836 (out (assoc-ref %outputs "out"))
2837 (source (string-append btrfs "/bin/btrfs.static"))
2838 (target (string-append out "/bin/btrfs")))
2839 (mkdir-p (dirname target))
2840 (copy-file source target)
2841 (remove-store-references target)
2842 (chmod target #o555)))))
2843 (home-page (package-home-page btrfs-progs))
2844 (synopsis "Statically-linked btrfs command from btrfsprogs")
2845 (description "This package provides statically-linked command of btrfs taken
2846 from the btrfsprogs package. It is meant to be used in initrds.")
2847 (license (package-license btrfs-progs))))
2849 (define-public freefall
2852 (version (package-version linux-libre))
2853 (source (package-source linux-libre))
2854 (build-system gnu-build-system)
2856 '(#:phases (modify-phases %standard-phases
2857 (add-after 'unpack 'enter-subdirectory
2859 (chdir "tools/laptop/freefall")))
2861 (add-before 'build 'increase-timeout
2863 ;; The default of 2 seconds is too low: it assumes an
2864 ;; open lid and AC power without actually checking.
2865 (substitute* "freefall.c"
2866 (("alarm\\(2\\)") "alarm(5)")))))
2867 #:make-flags (list (string-append "PREFIX="
2868 (assoc-ref %outputs "out")))
2869 #:tests? #f)) ;no tests
2870 (home-page (package-home-page linux-libre))
2871 (synopsis "Free-fall protection for spinning laptop hard drives")
2873 "Prevents shock damage to the internal spinning hard drive(s) of some
2874 HP and Dell laptops. When sudden movement is detected, all input/output
2875 operations on the drive are suspended and its heads are parked on the ramp,
2876 where they are less likely to cause damage to the spinning disc. Requires a
2877 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2878 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2879 (license license:gpl2)))
2881 (define-public thinkfan
2887 (uri (string-append "mirror://sourceforge/thinkfan/"
2888 "/thinkfan-" version ".tar.gz"))
2891 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2892 (modules '((guix build utils)))
2893 ;; Fix erroneous man page location in Makefile leading to
2894 ;; a compilation failure.
2896 '(substitute* "CMakeLists.txt"
2897 (("thinkfan\\.1") "src/thinkfan.1")))))
2898 (build-system cmake-build-system)
2900 `(#:modules ((guix build cmake-build-system)
2903 #:tests? #f ;no test target
2905 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2906 `("-DUSE_ATASMART:BOOL=ON")
2908 (modify-phases %standard-phases
2909 ;; Install scripts for various foreign init systems. Also fix
2910 ;; hard-coded path for daemon.
2911 (add-after 'install 'install-rc-scripts
2912 (lambda* (#:key outputs #:allow-other-keys)
2913 (let ((out (assoc-ref outputs "out"))
2915 (string-append "../thinkfan-" ,version "/rcscripts")
2918 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2919 (string-append out "/sbin/" name)))
2920 (for-each (cute install-file <>
2921 (string-append out "/share/thinkfan"))
2925 `(("libatasmart" ,libatasmart)))
2926 (home-page "http://thinkfan.sourceforge.net/")
2927 (synopsis "Simple fan control program")
2929 "Thinkfan is a simple fan control program. It reads temperatures,
2930 checks them against configured limits and switches to appropriate (also
2931 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2932 other @code{hwmon} driver that enables temperature reading and fan control
2934 (license license:gpl3+)))
2936 (define-public ntfs-3g
2939 (version "2016.2.22")
2942 (uri (string-append "https://tuxera.com/opensource/"
2943 "ntfs-3g_ntfsprogs-" version ".tgz"))
2946 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
2947 (modules '((guix build utils)))
2948 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
2950 ;; Install under $prefix.
2951 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
2954 (build-system gnu-build-system)
2955 (inputs `(("util-linux" ,util-linux)
2956 ("fuse" ,fuse))) ;libuuid
2957 (native-inputs `(("pkg-config" ,pkg-config)))
2959 '(#:configure-flags (list "--exec-prefix=${prefix}"
2960 "--with-fuse=external" ;use our own FUSE
2961 "--enable-mount-helper"
2962 "--enable-posix-acls"
2963 "--enable-xattr-mappings")))
2964 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
2965 (synopsis "Read-write access to NTFS file systems")
2967 "NTFS-3G provides read-write access to NTFS file systems, which are
2968 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
2969 The package provides additional NTFS tools.")
2970 (license license:gpl2+)))
2972 (define-public rng-tools
2979 "http://downloads.sourceforge.net/sourceforge/gkernel/"
2980 "rng-tools-" version ".tar.gz"))
2983 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
2984 (build-system gnu-build-system)
2985 (synopsis "Random number generator daemon")
2987 "Monitor a hardware random number generator, and supply entropy
2988 from that to the system kernel's @file{/dev/random} machinery.")
2989 (home-page "https://sourceforge.net/projects/gkernel")
2990 ;; The source package is offered under the GPL2+, but the files
2991 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
2992 (license (list license:gpl2 license:gpl2+))))
2994 (define-public cpupower
2997 (version (package-version linux-libre))
2998 (source (package-source linux-libre))
2999 (build-system gnu-build-system)
3001 '(#:phases (modify-phases %standard-phases
3002 (add-after 'unpack 'enter-subdirectory
3004 (chdir "tools/power/cpupower")))
3006 (add-before 'build 'fix-makefiles
3008 (substitute* "Makefile"
3010 (("/bin/(install|pwd)" _ command) command))
3011 (substitute* "bench/Makefile"
3012 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3013 #:make-flags (let ((out (assoc-ref %outputs "out")))
3014 (list (string-append "DESTDIR=" out)
3015 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3016 "docdir=/share/doc/cpupower"
3017 "confdir=$(docdir)/examples"
3018 ;; The Makefile recommends the following changes
3020 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3021 #:tests? #f)) ;no tests
3022 (native-inputs `(("gettext" ,gettext-minimal)))
3023 (inputs `(("pciutils" ,pciutils)))
3024 (home-page (package-home-page linux-libre))
3025 (synopsis "CPU frequency and voltage scaling tools for Linux")
3027 "cpupower is a set of user-space tools that use the cpufreq feature of the
3028 Linux kernel to retrieve and control processor features related to power saving,
3029 such as frequency and voltage scaling.")
3030 (license license:gpl2)))
3032 (define-public haveged
3039 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3043 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3044 (build-system gnu-build-system)
3045 (home-page "http://www.issihosts.com/haveged")
3046 (synopsis "Entropy source for the Linux random number generator")
3048 "haveged generates an unpredictable stream of random numbers for use by
3049 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3050 standard mechanisms for filling the entropy pool may not be sufficient for
3051 systems with high needs or limited user interaction, such as headless servers.
3052 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3053 indirect effects of hardware events on hidden processor state using the HArdware
3054 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3055 its environment and provides the same built-in test suite for the output stream
3056 as used on certified hardware security devices.")
3057 (license (list (license:non-copyleft "file://nist/mconf.h")
3058 (license:non-copyleft "file://nist/packtest.c")
3059 license:public-domain ; nist/dfft.c
3060 license:gpl3+)))) ; everything else
3062 (define-public ecryptfs-utils
3064 (name "ecryptfs-utils")
3069 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3070 version "/+download/ecryptfs-utils_"
3071 version ".orig.tar.gz"))
3074 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3075 (build-system gnu-build-system)
3077 `(#:configure-flags (list "--disable-pywrap")))
3079 `(("intltool" ,intltool)
3080 ("perl" ,perl) ; for pod2man
3081 ("pkg-config" ,pkg-config)))
3083 `(("keyutils" ,keyutils)
3084 ("linux-pam" ,linux-pam)
3086 (home-page "http://ecryptfs.org/")
3087 (synopsis "eCryptfs cryptographic file system utilities")
3089 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3090 Each file's cryptographic meta-data is stored inside the file itself, along
3091 with the encrypted contents. This allows individual encrypted files to be
3092 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3093 native Linux file system, and has been part of the Linux kernel since version
3094 2.6.19. This package contains the userland utilities to manage it.")
3095 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3096 ;; grant additional permission to link with OpenSSL.
3097 (license license:gpl2+)))
3099 (define-public libnfsidmap
3101 (name "libnfsidmap")
3106 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3107 name "/" name "-" version ".tar.gz"))
3110 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3111 (build-system gnu-build-system)
3113 `(#:configure-flags (list
3114 (string-append "--with-pluginpath="
3115 (assoc-ref %outputs "out")
3116 "/lib/libnfsidmap"))))
3118 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3120 "NFSv4 support library for name/ID mapping")
3121 (description "Libnfsidmap is a library holding mulitiple methods of
3122 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3123 extensible array of mapping functions, currently consisting of two choices:
3124 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3125 (license (license:non-copyleft "file://COPYING"
3126 "See COPYING in the distribution."))))
3128 (define-public module-init-tools
3130 (name "module-init-tools")
3135 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3136 "module-init-tools-" version ".tar.bz2"))
3139 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3140 (patches (search-patches "module-init-tools-moduledir.patch"))))
3141 (build-system gnu-build-system)
3143 ;; FIXME: The upstream tarball lacks man pages, and building them would
3144 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3145 ;; but they vanished. In the meantime, fake it.
3146 '(#:phases (alist-cons-before
3147 'configure 'fake-docbook
3149 (substitute* "Makefile.in"
3150 (("^DOCBOOKTOMAN.*$")
3151 "DOCBOOKTOMAN = true\n")))
3153 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3154 (synopsis "Tools for loading and managing Linux kernel modules")
3156 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3157 `insmod', `lsmod', and more.")
3158 (license license:gpl2+)))
3160 (define-public mcelog
3166 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3167 "mcelog.git/snapshot/v" version ".tar.gz"))
3170 "1d5g09ndfsnl56vyhb5xw0zxspnh0f937biw3agqhdfbvw40j9jr"))
3171 (file-name (string-append name "-" version ".tar.gz"))
3172 (modules '((guix build utils)))
3174 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3175 `(substitute* "Makefile"
3176 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3177 (build-system gnu-build-system)
3179 `(#:phases (modify-phases %standard-phases
3180 (delete 'configure)) ; no configure script
3181 #:make-flags (let ((out (assoc-ref %outputs "out")))
3183 (string-append "prefix=" out)
3184 (string-append "DOCDIR=" out "/share/doc/mcelog")
3185 "etcprefix=$(DOCDIR)/examples"))
3186 ;; The tests will only run as root on certain supported CPU models.
3188 (supported-systems (list "i686-linux" "x86_64-linux"))
3189 (home-page "http://mcelog.org/")
3190 (synopsis "Machine check monitor for x86 Linux systems")
3192 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3193 and other hardware errors on x86 systems. It can also perform user-defined
3194 tasks, such as bringing bad pages off-line, when configurable error thresholds
3196 (license license:gpl2)))
3198 (define-public mtd-utils
3205 "ftp://ftp.infradead.org/pub/mtd-utils/"
3206 "mtd-utils-" version ".tar.bz2"))
3209 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3212 ("libuuid" ,util-linux)
3215 (build-system gnu-build-system)
3217 `(#:test-target "tests"
3218 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3219 #:phases (modify-phases %standard-phases
3220 (delete 'configure))))
3221 (synopsis "MTD Flash Storage Utilities")
3222 (description "This package provides utilities for testing, partitioning, etc
3224 (home-page "http://www.linux-mtd.infradead.org/")
3226 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3227 license:mpl1.1 ; All ftl* files
3228 license:expat)))) ; libiniparser
3230 (define-public libseccomp
3236 (uri (string-append "https://github.com/seccomp/libseccomp/"
3237 "releases/download/v" version
3238 "/libseccomp-" version ".tar.gz"))
3241 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3242 (build-system gnu-build-system)
3244 `(("which" ,which)))
3245 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3246 (description "The libseccomp library provides an easy to use, platform
3247 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3248 libseccomp API is designed to abstract away the underlying BPF based syscall
3249 filter language and present a more conventional function-call based filtering
3250 interface that should be familiar to, and easily adopted by, application
3252 (home-page "https://github.com/seccomp/libseccomp")
3253 (license license:lgpl2.1)))
3255 (define-public radeontop
3259 (home-page "https://github.com/clbr/radeontop/")
3262 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3263 (file-name (string-append name "-" version ".tar.gz"))
3266 "07fnimn6wwablmdjw0av11hk9a6xilbryh09izq4b2ic4b8md2p7"))))
3267 (build-system gnu-build-system)
3269 `(#:phases (modify-phases %standard-phases
3270 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3271 ;; dependency, and doesn't even work on release(!) tarballs.
3272 (add-after 'unpack 'report-correct-version
3273 (lambda _ (substitute* "getver.sh"
3275 (string-append "ver=" ,version)))))
3276 (delete 'configure)) ; no configure script
3277 #:make-flags (list "CC=gcc"
3278 (string-append "PREFIX=" %output))
3279 #:tests? #f)) ; no tests
3281 `(("gettext" ,gettext-minimal)
3282 ("pkg-config" ,pkg-config)))
3284 `(("libdrm" ,libdrm)
3285 ("libpciaccess" ,libpciaccess)
3286 ("ncurses" ,ncurses)))
3287 (synopsis "Usage monitor for AMD Radeon graphics")
3288 (description "RadeonTop monitors resource consumption on supported AMD
3289 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3290 a terminal or saved to a file for further processing. It measures both the
3291 activity of the GPU as a whole, which is also accurate during OpenCL
3292 computations, as well as separate component statistics that are only meaningful
3293 under OpenGL graphics workloads.")
3294 (license license:gpl3)))
3296 (define-public efivar
3302 (uri (string-append "https://github.com/rhinstaller/" name
3303 "/releases/download/" version "/" name
3304 "-" version ".tar.bz2"))
3307 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3308 (build-system gnu-build-system)
3310 `(;; Tests require a UEFI system and is not detected in the chroot.
3312 #:make-flags (list (string-append "prefix=" %output)
3313 (string-append "libdir=" %output "/lib")
3314 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3316 (modify-phases %standard-phases
3317 (delete 'configure))))
3319 `(("pkg-config" ,pkg-config)))
3322 (home-page "https://github.com/rhinstaller/efivar")
3323 (synopsis "Tool and library to manipulate EFI variables")
3324 (description "This package provides a library and a command line
3325 interface to the variable facility of UEFI boot firmware.")
3326 (license license:lgpl2.1+)))
3328 (define-public efibootmgr
3334 (uri (string-append "https://github.com/rhinstaller/" name
3335 "/releases/download/" version "/" name
3336 "-" version ".tar.bz2"))
3339 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3340 (build-system gnu-build-system)
3342 `(#:tests? #f ; No tests.
3343 #:make-flags (list (string-append "prefix=" %output)
3344 (string-append "libdir=" %output "/lib")
3345 ;; Override CFLAGS to add efivar include directory.
3346 (string-append "CFLAGS=-O2 -g -flto -I"
3347 (assoc-ref %build-inputs "efivar")
3350 (modify-phases %standard-phases
3351 (add-after 'unpack 'branding
3352 ;; Replace default loader path with something more familiar.
3354 (substitute* "src/efibootmgr.c"
3355 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3358 (delete 'configure))))
3360 `(("pkg-config" ,pkg-config)))
3362 `(("efivar" ,efivar)
3364 (home-page "https://github.com/rhinstaller/efibootmgr")
3365 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3367 "@code{efibootmgr} is a user-space application to modify the Intel
3368 Extensible Firmware Interface (EFI) Boot Manager. This application can
3369 create and destroy boot entries, change the boot order, change the next
3370 running boot option, and more.")
3371 (license license:gpl2+)))
3373 (define-public sysstat
3379 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3380 "sysstat-" version ".tar.xz"))
3383 "0f8gk1hma3bk198ziwrhh5jhisnbbgc1v4rxhny58n0zjzw0gm0z"))))
3384 (build-system gnu-build-system)
3386 `(#:tests? #f ; No test suite.
3387 ;; Without this flag, it tries to install the man pages with group 'root'
3388 ;; and fails because /etc/passwd lacks an entry for the root user.
3390 (list "--disable-file-attr"
3391 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3393 (modify-phases %standard-phases
3394 ;; The build process tries to create '/var/lib/sa', so we skip that
3396 (add-after 'build 'skip-touching-var
3398 (substitute* "Makefile"
3399 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3402 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3403 (synopsis "Performance monitoring tools for Linux")
3404 (description "The sysstat utilities are a collection of performance
3405 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3406 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3407 @code{sadf} and @code{sa}.")
3408 (license license:gpl2+)))
3410 (define-public light
3416 (uri (string-append "https://github.com/haikarainen/" name
3417 "/archive/v" version ".tar.gz"))
3420 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3421 (file-name (string-append name "-" version ".tar.gz"))))
3422 (build-system gnu-build-system)
3424 '(#:tests? #f ; no tests
3425 #:make-flags (list "CC=gcc"
3426 (string-append "PREFIX=" %output))
3428 (modify-phases %standard-phases
3430 (add-after 'unpack 'patch-makefile
3432 (substitute* "Makefile" (("chown") "#")))))))
3434 `(("help2man" ,help2man)))
3435 (home-page "https://haikarainen.github.io/light")
3436 (synopsis "GNU/Linux application to control backlights")
3438 "Light is a program to send commands to screen backlight controllers
3439 under GNU/Linux. Features include:
3442 @item It does not rely on X.
3443 @item Light can automatically figure out the best controller to use, making
3444 full use of underlying hardware.
3445 @item It is possible to set a minimum brightness value, as some controllers
3446 set the screen to be pitch black at a vaĺue of 0 (or higher).
3449 Light is the successor of lightscript.")
3450 (license license:gpl3+)))
3459 "https://github.com/linrunner/"
3460 (string-upcase name)
3461 "/archive/" version ".tar.gz"))
3462 (file-name (string-append name "-" version ".tar.gz"))
3465 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3466 (inputs `(("bash" ,bash)
3468 ("ethtool" ,ethtool)
3472 ("inetutils" ,inetutils)
3475 ("pciutils" ,pciutils)
3479 ("usbutils" ,usbutils)
3480 ("util-linux" ,util-linux)
3481 ("wireless-tools" ,wireless-tools)))
3482 (build-system gnu-build-system)
3485 (modify-phases %standard-phases
3487 (add-before 'build 'setenv
3488 (lambda* (#:key outputs #:allow-other-keys)
3489 (let ((out (assoc-ref outputs "out")))
3490 (setenv "TLP_WITH_SYSTEMD" "0")
3491 (setenv "TLP_NO_INIT" "1")
3492 (setenv "TLP_NO_PMUTILS" "1")
3493 (setenv "TLP_SBIN" (string-append out "/bin"))
3494 (setenv "TLP_BIN" (string-append out "/bin"))
3495 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3496 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3497 (setenv "TLP_CONF" (string-append out "/etc/tlp"))
3499 (string-append out "/share/bash-completion/completions"))
3500 (setenv "TLP_MAN" (string-append out "/share/man")))))
3504 (system "make install-tlp install-man")))
3505 (add-after 'install 'wrap
3506 (lambda* (#:key inputs outputs #:allow-other-keys)
3507 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3508 (bin-files (find-files bin ".*")))
3509 (define (bin-directory input-name)
3510 (string-append (assoc-ref inputs input-name) "/bin"))
3511 (define (sbin-directory input-name)
3512 (string-append (assoc-ref inputs input-name) "/sbin"))
3513 (for-each (lambda (program)
3514 (wrap-program program
3517 (map bin-directory '("bash"
3528 (map sbin-directory '("ethtool"
3533 "wireless-tools"))))))
3535 (home-page "http://linrunner.de/en/tlp/tlp.html")
3536 (synopsis "Power management tool for Linux")
3537 (description "TLP is a power management tool for Linux. It comes with
3538 a default configuration already optimized for battery life. Nevertheless,
3539 TLP is customizable to fulfil system requirements. TLP settings are applied
3540 every time the power supply source is changed.")
3542 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3544 (license (list license:gpl2+ license:gpl3+))))
3552 (uri (string-append "https://www.ezix.org/software/"
3553 "files/lshw-" version
3557 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3558 (build-system gnu-build-system)
3560 `(#:phases (modify-phases %standard-phases (delete 'configure))
3561 #:tests? #f ; no tests
3563 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3564 (synopsis "List hardware information")
3566 "@command{lshw} (Hardware Lister) is a small tool to provide
3567 detailed information on the hardware configuration of the machine.
3568 It can report exact memory configuration, firmware version, mainboard
3569 configuration, CPU version and speed, cache configuration, bus speed,
3570 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3571 machines (PowerMac G4 is known to work).")
3572 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3573 (license license:gpl2+)))