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, 2017 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, 2017 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 ng0 <ng0@no-reply.pragmatique.xyz>
22 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
31 ;;; This file is part of GNU Guix.
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46 (define-module (gnu packages linux)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages acl)
49 #:use-module (gnu packages admin)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages attr)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages bash)
56 #:use-module (gnu packages bison)
57 #:use-module (gnu packages calendar)
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages crypto)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages databases)
62 #:use-module (gnu packages datastructures)
63 #:use-module (gnu packages docbook)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages elf)
66 #:use-module (gnu packages flex)
67 #:use-module (gnu packages file)
68 #:use-module (gnu packages freedesktop)
69 #:use-module (gnu packages gcc)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages glib)
72 #:use-module (gnu packages gnuzilla)
73 #:use-module (gnu packages gperf)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages libusb)
76 #:use-module (gnu packages man)
77 #:use-module (gnu packages maths)
78 #:use-module (gnu packages multiprecision)
79 #:use-module (gnu packages ncurses)
80 #:use-module (gnu packages networking)
81 #:use-module (gnu packages ninja)
82 #:use-module (gnu packages perl)
83 #:use-module (gnu packages pciutils)
84 #:use-module (gnu packages pkg-config)
85 #:use-module (gnu packages popt)
86 #:use-module (gnu packages pulseaudio)
87 #:use-module (gnu packages python)
88 #:use-module (gnu packages readline)
89 #:use-module (gnu packages rrdtool)
90 #:use-module (gnu packages samba)
91 #:use-module (gnu packages slang)
92 #:use-module (gnu packages storage)
93 #:use-module (gnu packages texinfo)
94 #:use-module (gnu packages tls)
95 #:use-module (gnu packages valgrind)
96 #:use-module (gnu packages video)
97 #:use-module (gnu packages web)
98 #:use-module (gnu packages xiph)
99 #:use-module (gnu packages xml)
100 #:use-module (gnu packages xdisorg)
101 #:use-module (gnu packages xorg)
102 #:use-module (gnu packages groff)
103 #:use-module (gnu packages selinux)
104 #:use-module (guix build-system cmake)
105 #:use-module (guix build-system gnu)
106 #:use-module (guix build-system python)
107 #:use-module (guix build-system trivial)
108 #:use-module (guix download)
109 #:use-module ((guix licenses) #:prefix license:)
110 #:use-module (guix packages)
111 #:use-module (guix utils)
112 #:use-module (srfi srfi-1)
113 #:use-module (srfi srfi-2)
114 #:use-module (srfi srfi-26)
115 #:use-module (ice-9 match))
117 (define-public (system->linux-architecture arch)
118 "Return the Linux architecture name for ARCH, a Guix system name such as
119 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
120 (let ((arch (car (string-split arch #\-))))
121 (cond ((string=? arch "i686") "i386")
122 ((string-prefix? "mips" arch) "mips")
123 ((string-prefix? "arm" arch) "arm")
124 ((string-prefix? "aarch64" arch) "arm64")
125 ((string-prefix? "alpha" arch) "alpha")
128 (define-public (system->defconfig system)
129 "Some systems (notably powerpc-linux) require a special target for kernel
130 defconfig. Return the appropiate make target if applicable, otherwise return
132 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
135 (define (linux-libre-urls version)
136 "Return a list of URLs for Linux-Libre VERSION."
138 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
139 version "-gnu/linux-libre-" version "-gnu.tar.xz")
141 ;; XXX: Work around <http://bugs.gnu.org/14851>.
143 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
144 version "-gnu.tar.xz")
146 ;; Maybe this URL will become valid eventually.
148 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
149 version "-gnu.tar.xz")))
151 (define-public linux-libre-headers
153 (name "linux-libre-headers")
157 (uri (linux-libre-urls version))
160 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
161 (build-system gnu-build-system)
162 (native-inputs `(("perl" ,perl)))
164 `(#:modules ((guix build gnu-build-system)
168 (modify-phases %standard-phases
172 (let ((arch ,(system->linux-architecture
173 (or (%current-target-system)
175 (defconfig ,(system->defconfig
176 (or (%current-target-system)
177 (%current-system)))))
179 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
180 (and (zero? (system* "make" defconfig))
181 (zero? (system* "make" "mrproper" "headers_check"))))))
183 (lambda* (#:key outputs #:allow-other-keys)
184 (let ((out (assoc-ref outputs "out")))
185 (and (zero? (system* "make"
186 (string-append "INSTALL_HDR_PATH=" out)
189 (mkdir (string-append out "/include/config"))
190 (call-with-output-file
192 "/include/config/kernel.release")
194 (format p "~a-default~%" ,version)))
196 ;; Remove the '.install' and '..install.cmd' files; the
197 ;; latter contains store paths, which pulls in bootstrap
198 ;; binaries in the build environment, and prevents bit
199 ;; reproducibility for the bootstrap binaries.
200 (for-each delete-file (find-files out "\\.install"))
203 #:allowed-references ()
205 (home-page "https://www.gnu.org/software/linux-libre/")
206 (synopsis "GNU Linux-Libre kernel headers")
207 (description "Headers of the Linux-Libre kernel.")
208 (license license:gpl2)))
210 (define %boot-logo-patch
211 ;; Linux-Libre boot logo featuring Freedo and a gnu.
214 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
215 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
218 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
220 (define* (kernel-config arch #:key variant)
221 "Return the absolute file name of the Linux-Libre build configuration file
222 for ARCH and optionally VARIANT, or #f if there is no such configuration."
223 (let* ((name (string-append (if variant (string-append variant "-") "")
224 (if (string=? "i386" arch) "i686" arch) ".conf"))
225 (file (string-append "linux-libre/" name)))
226 (search-auxiliary-file file)))
228 (define %default-extra-linux-options
229 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
230 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
231 ;; Modules required for initrd:
232 ("CONFIG_NET_9P" . m)
233 ("CONFIG_NET_9P_VIRTIO" . m)
234 ("CONFIG_VIRTIO_BLK" . m)
235 ("CONFIG_VIRTIO_NET" . m)
236 ("CONFIG_VIRTIO_PCI" . m)
237 ("CONFIG_VIRTIO_BALLOON" . m)
238 ("CONFIG_VIRTIO_MMIO" . m)
239 ("CONFIG_FUSE_FS" . m)
241 ("CONFIG_9P_FS" . m)))
243 (define (config->string options)
244 (string-join (map (match-lambda
246 (string-append option "=m"))
248 (string-append option "=y"))
250 (string-append option "=n")))
254 (define* (make-linux-libre version hash supported-systems
256 ;; A function that takes an arch and a variant.
257 ;; See kernel-config for an example.
259 (configuration-file #f)
260 (defconfig "defconfig")
261 (extra-options %default-extra-linux-options)
262 (patches (list %boot-logo-patch)))
264 (name (if extra-version
265 (string-append "linux-libre-" extra-version)
270 (uri (linux-libre-urls version))
271 (sha256 (base32 hash))
273 (supported-systems supported-systems)
274 (build-system gnu-build-system)
280 ,@(match (and configuration-file
282 (system->linux-architecture
283 (or (%current-target-system) (%current-system)))
284 #:variant (version-major+minor version)))
285 (#f ;no config for this platform
288 `(("kconfig" ,config))))))
290 `(#:modules ((guix build gnu-build-system)
295 (modify-phases %standard-phases
297 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
298 ;; Avoid introducing timestamps
299 (setenv "KCONFIG_NOTIMESTAMP" "1")
300 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
302 ;; Set ARCH and CROSS_COMPILE
303 (let ((arch ,(system->linux-architecture
304 (or (%current-target-system)
305 (%current-system)))))
307 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
310 (setenv "CROSS_COMPILE" (string-append target "-"))
311 (format #t "`CROSS_COMPILE' set to `~a'~%"
312 (getenv "CROSS_COMPILE"))))
314 (setenv "EXTRA_VERSION" ,extra-version)
316 (let ((build (assoc-ref %standard-phases 'build))
317 (config (assoc-ref inputs "kconfig")))
319 ;; Use a custom kernel configuration file or a default
320 ;; configuration file.
323 (copy-file config ".config")
324 (chmod ".config" #o666))
325 (system* "make" ,defconfig))
327 ;; Appending works even when the option wasn't in the
328 ;; file. The last one prevails if duplicated.
329 (let ((port (open-file ".config" "a"))
330 (extra-configuration ,(config->string extra-options)))
331 (display extra-configuration port)
334 (zero? (system* "make" "oldconfig")))))
336 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
337 (let* ((out (assoc-ref outputs "out"))
338 (moddir (string-append out "/lib/modules"))
339 (dtbdir (string-append out "/lib/dtbs"))
340 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
341 ;; Install kernel image, kernel configuration and link map.
342 (for-each (lambda (file) (install-file file out))
343 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
344 ;; Install device tree files
345 (for-each (lambda (file) (install-file file dtbdir))
346 (find-files "." "\\.dtb$"))
347 ;; Install kernel modules
349 (zero? (system* "make"
350 (string-append "DEPMOD=" kmod "/bin/depmod")
351 (string-append "MODULE_DIR=" moddir)
352 (string-append "INSTALL_PATH=" out)
353 (string-append "INSTALL_MOD_PATH=" out)
354 "INSTALL_MOD_STRIP=1"
355 "modules_install"))))))
357 (home-page "https://www.gnu.org/software/linux-libre//")
358 (synopsis "100% free redistribution of a cleaned Linux kernel")
360 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
361 It has been modified to remove all non-free binary blobs.")
362 (license license:gpl2)))
364 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
366 (define %linux-libre-version "4.11.8")
367 (define %linux-libre-hash "1z35h6xr8gdzq31xv3dpdz6ddz4q3183fwvkmx8qd7h9bhy13aw6")
369 (define-public linux-libre
370 (make-linux-libre %linux-libre-version
372 %intel-compatible-systems
373 #:configuration-file kernel-config))
375 (define-public linux-libre-4.9
376 (make-linux-libre "4.9.35"
377 "0fs90jgb01jybkclngg5asvbs1y70f2abs395qcb3lxpx7zxhy1h"
378 %intel-compatible-systems
379 #:configuration-file kernel-config))
381 (define-public linux-libre-4.4
382 (make-linux-libre "4.4.75"
383 "1h687flrdzlcd1ms5n2khm0mxybr8bj2jfnnm7qvy6ha2vsngb5b"
384 %intel-compatible-systems
385 #:configuration-file kernel-config))
387 (define-public linux-libre-4.1
388 (make-linux-libre "4.1.42"
389 "1g5jhn7cm6ixn7w8ciqm6qgxv7k1jg50v6k05hsvzvrqfpaxqlbz"
390 %intel-compatible-systems
391 #:configuration-file kernel-config))
393 (define-public linux-libre-arm-generic
394 (make-linux-libre %linux-libre-version
397 #:defconfig "multi_v7_defconfig"
398 #:extra-version "arm-generic"))
402 ;;; Pluggable authentication modules (PAM).
405 (define-public linux-pam
413 "http://www.linux-pam.org/library/"
414 "Linux-PAM-" version ".tar.bz2"))
417 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
418 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
420 (build-system gnu-build-system)
424 ;; TODO: optional dependencies
425 ;; ("libxcrypt" ,libxcrypt)
426 ;; ("cracklib" ,cracklib)
429 '(;; Most users, such as `shadow', expect the headers to be under
431 #:configure-flags (list (string-append "--includedir="
432 (assoc-ref %outputs "out")
433 "/include/security"))
435 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
438 (home-page "http://www.linux-pam.org/")
439 (synopsis "Pluggable authentication modules for Linux")
441 "A *Free* project to implement OSF's RFC 86.0.
442 Pluggable authentication modules are small shared object files that can
443 be used through the PAM API to perform tasks, like authenticating a user
444 at login. Local and dynamic reconfiguration are its key features.")
445 (license license:bsd-3)))
447 (define-public linux-pam-1.2
455 "http://www.linux-pam.org/library/"
456 "Linux-PAM-" version ".tar.bz2"))
459 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
460 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
467 (define-public psmisc
474 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
478 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
479 (build-system gnu-build-system)
480 (inputs `(("ncurses" ,ncurses)))
481 (home-page "https://gitlab.com/psmisc/psmisc")
483 "Small utilities that use the proc file system")
485 "This PSmisc package is a set of some small useful utilities that
486 use the proc file system. We're not about changing the world, but
487 providing the system administrator with some help in common tasks.")
488 (license license:gpl2+)))
490 (define-public util-linux
496 (uri (string-append "mirror://kernel.org/linux/utils/"
497 name "/v" (version-major+minor version) "/"
498 name "-" version ".tar.xz"))
501 "1qz81w8vzrmy8xn9yx7ls4amkbgwx6vr62pl6kv9g7r0g3ba9kmc"))
502 (patches (search-patches "util-linux-tests.patch"))
503 (modules '((guix build utils)))
505 ;; We take the 'logger' program from GNU Inetutils and 'kill'
506 ;; from GNU Coreutils.
508 (substitute* "configure"
509 (("build_logger=yes") "build_logger=no")
510 (("build_kill=yes") "build_kill=no"))
512 (build-system gnu-build-system)
514 "static")) ; >2 MiB of static .a libraries
516 `(#:configure-flags (list "--disable-use-tty-group"
517 "--enable-fs-paths-default=/run/current-system/profile/sbin"
518 ;; Install completions where our
519 ;; bash-completion package expects them.
520 (string-append "--with-bashcompletiondir="
521 (assoc-ref %outputs "out")
522 "/etc/bash_completion.d"))
523 #:phases (modify-phases %standard-phases
525 'build 'set-umount-file-name
526 (lambda* (#:key outputs #:allow-other-keys)
527 ;; Tell 'eject' the right file name of 'umount'.
528 (let ((out (assoc-ref outputs "out")))
529 (substitute* "sys-utils/eject.c"
531 (string-append "\"" out "/bin/umount\"")))
535 (lambda* (#:key inputs outputs #:allow-other-keys)
536 (let ((out (assoc-ref outputs "out"))
537 (net (assoc-ref inputs "net-base")))
538 ;; Change the test to refer to the right file.
539 (substitute* "tests/ts/misc/mcookie"
541 (string-append net "/etc/services")))
544 'install 'move-static-libraries
545 (lambda* (#:key outputs #:allow-other-keys)
546 (let ((out (assoc-ref outputs "out"))
547 (static (assoc-ref outputs "static")))
548 (mkdir-p (string-append static "/lib"))
549 (with-directory-excursion out
550 (for-each (lambda (file)
552 (string-append static "/"
554 (find-files "lib" "\\.a$")))
556 (inputs `(("zlib" ,zlib)
557 ("ncurses" ,ncurses)))
560 ("net-base" ,net-base))) ;for tests
561 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
562 (synopsis "Collection of utilities for the Linux kernel")
563 (description "Util-linux is a diverse collection of Linux kernel
564 utilities. It provides dmesg and includes tools for working with file systems,
565 block devices, UUIDs, TTYs, and many other tools.")
567 ;; Note that util-linux doesn't use the same license for all the
568 ;; code. GPLv2+ is the default license for a code without an
569 ;; explicitly defined license.
570 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
571 license:bsd-4 license:public-domain))))
579 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
581 (file-name (string-append name "-" version ".tar.gz"))
583 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
584 (build-system cmake-build-system)
585 (arguments '(#:tests? #f))
586 (home-page "https://github.com/bo0ts/ddate")
587 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
589 "ddate displays the Discordian date and holidays of a given date.
590 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
591 by Robert Shea and Robert Anton Wilson.")
592 (license license:public-domain)))
594 (define-public procps
600 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
601 "procps-ng-" version ".tar.xz"))
604 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
605 (build-system gnu-build-system)
607 '(#:modules ((guix build utils)
608 (guix build gnu-build-system)
612 (modify-phases %standard-phases
613 (add-before 'check 'disable-strtod-test
615 ;; Disable the 'strtod' test, which fails on 32-bit systems.
616 ;; This is what upstream does:
617 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
618 (substitute* "Makefile"
619 (("^(TESTS|check_PROGRAMS) = .*$" all)
620 (string-append "# " all "\n")))
623 'install 'post-install
624 ;; Remove commands and man pages redudant with
626 (lambda* (#:key outputs #:allow-other-keys)
627 (let* ((out (assoc-ref outputs "out"))
628 (dup (append-map (cut find-files out <>)
629 '("^kill" "^uptime"))))
630 (for-each delete-file dup)
632 (inputs `(("ncurses" ,ncurses)))
633 (home-page "https://gitlab.com/procps-ng/procps/")
634 (synopsis "Utilities that give information about processes")
636 "Procps is the package that has a bunch of small useful utilities
637 that give information about processes using the Linux /proc file system.
638 The package includes the programs ps, top, vmstat, w, kill, free,
639 slabtop, and skill.")
640 (license license:gpl2)))
642 (define-public usbutils
649 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
650 "usbutils-" version ".tar.xz"))
653 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
654 (build-system gnu-build-system)
657 ("eudev" ,eudev-with-hwdb)))
659 `(("pkg-config" ,pkg-config)))
660 (home-page "http://www.linux-usb.org/")
662 "Tools for working with USB devices, such as lsusb")
664 "Tools for working with USB devices, such as lsusb.")
665 (license license:gpl2+)))
667 (define-public e2fsprogs
674 "mirror://kernel.org/linux/kernel/people/tytso/"
675 name "/v" version "/"
676 name "-" version ".tar.xz"))
679 "092absr4vrlqrkdf9nwh4ykj40ab6hhwrkdr6sjsccd54c8z5csl"))))
680 (build-system gnu-build-system)
681 (inputs `(("util-linux" ,util-linux)))
682 (native-inputs `(("pkg-config" ,pkg-config)
683 ("texinfo" ,texinfo) ;for the libext2fs Info manual
689 '(;; util-linux is the preferred source for some of the libraries and
690 ;; commands, so disable them (see, e.g.,
691 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
692 #:configure-flags (list "--disable-libblkid"
693 "--disable-libuuid" "--disable-uuidd"
696 ;; Use symlinks instead of hard links for
697 ;; 'fsck.extN' etc. This makes the resulting nar
698 ;; smaller and is preserved across copies.
699 "--enable-symlink-install"
701 (string-append "LDFLAGS=-Wl,-rpath="
702 (assoc-ref %outputs "out")
705 ;; Install libext2fs et al.
706 "--enable-elf-shlibs")
709 (modify-phases %standard-phases
710 (add-before 'configure 'patch-shells
712 (substitute* "configure"
713 (("/bin/sh (.*)parse-types.sh" _ dir)
714 (string-append (which "sh") " " dir
716 (substitute* "MCONFIG.in"
717 (("INSTALL_SYMLINK = /bin/sh")
718 "INSTALL_SYMLINK = sh"))
719 (substitute* (find-files "." "^Makefile.in$")
721 (string-append "#!" (which "sh"))))
723 (add-after 'install 'install-libs
724 (lambda* (#:key outputs #:allow-other-keys)
725 (let* ((out (assoc-ref outputs "out"))
726 (lib (string-append out "/lib")))
727 (and (zero? (system* "make" "install-libs"))
729 ;; Make the .a writable so that 'strip' works.
730 ;; Failing to do that, due to debug symbols, we
731 ;; retain a reference to the final
732 ;; linux-libre-headers, which refer to the
733 ;; bootstrap binaries.
734 (let ((archives (find-files lib "\\.a$")))
735 (for-each (lambda (file)
739 (home-page "http://e2fsprogs.sourceforge.net/")
740 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
742 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
743 (license (list license:gpl2 ;programs
744 license:lgpl2.0 ;libext2fs
745 license:x11)))) ;libuuid
747 (define e2fsprogs/static
749 (package (inherit e2fsprogs)
751 ;; Do not build shared libraries.
752 (substitute-keyword-arguments (package-arguments e2fsprogs)
753 ((#:configure-flags _)
754 '(list "--disable-blkid"))
758 (define-public e2fsck/static
760 (name "e2fsck-static")
761 (version (package-version e2fsprogs))
762 (build-system trivial-build-system)
765 `(("e2fsprogs" ,e2fsprogs/static)))
767 `(#:modules ((guix build utils))
770 (use-modules (guix build utils)
774 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
776 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
778 (with-directory-excursion bin
779 (copy-file e2fsck "e2fsck")
780 (remove-store-references "e2fsck")
781 (chmod "e2fsck" #o555))))))
782 (home-page (package-home-page e2fsprogs))
783 (synopsis "Statically-linked e2fsck command from e2fsprogs")
784 (description "This package provides statically-linked e2fsck command taken
785 from the e2fsprogs package. It is meant to be used in initrds.")
786 (license (package-license e2fsprogs))))
788 (define-public extundelete
794 (uri (string-append "mirror://sourceforge/extundelete/"
795 "extundelete/" version "/extundelete-"
799 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
800 (build-system gnu-build-system)
801 (inputs `(("e2fsprogs" ,e2fsprogs)))
802 (home-page "http://extundelete.sourceforge.net/")
803 (synopsis "Recover deleted files from ext2/3/4 partitions")
805 "Extundelete is a set of tools that can recover deleted files from an
806 ext3 or ext4 partition.")
807 (license license:gpl2)))
809 (define-public zerofree
813 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
816 (uri (string-append home-page name "-" version
820 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
821 (build-system gnu-build-system)
823 '(#:phases (alist-replace
825 (lambda* (#:key outputs #:allow-other-keys)
826 (let* ((out (assoc-ref outputs "out"))
827 (bin (string-append out "/bin")))
829 (copy-file "zerofree"
830 (string-append bin "/zerofree"))
831 (chmod (string-append bin "/zerofree")
834 (alist-delete 'configure %standard-phases))
835 #:tests? #f)) ;no tests
836 (inputs `(("libext2fs" ,e2fsprogs)))
837 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
839 "The zerofree command scans the free blocks in an ext2 file system and
840 fills any non-zero blocks with zeroes. This is a useful way to make disk
841 images more compressible.")
842 (license license:gpl2)))
844 (define-public strace
850 (uri (string-append "mirror://sourceforge/strace/strace/" version
851 "/strace-" version ".tar.xz"))
854 "06bl4dld5fk4a3iiq4pyrkm6sh63599ah8dmds0glg5vbw45pww1"))))
855 (build-system gnu-build-system)
858 (modify-phases %standard-phases
859 (add-after 'unpack 'patch-/bin/sh
861 (substitute* "strace.c"
862 (("/bin/sh") (which "sh")))
864 (native-inputs `(("perl" ,perl)))
865 (home-page "https://strace.io/")
866 (synopsis "System call tracer for Linux")
868 "strace is a system call tracer, i.e. a debugging tool which prints out a
869 trace of all the system calls made by a another process/program.")
870 (license license:bsd-3)))
872 (define-public ltrace
878 (uri (string-append "http://www.ltrace.org/ltrace_" version
882 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
883 (build-system gnu-build-system)
884 (inputs `(("libelf" ,libelf)))
886 ;; Compilation uses -Werror by default, but it fails.
887 '(#:configure-flags '("--disable-werror")))
888 (home-page "http://www.ltrace.org/")
889 (synopsis "Library call tracer for Linux")
891 "ltrace intercepts and records dynamic library calls which are called by
892 an executed process and the signals received by that process. It can also
893 intercept and print the system calls executed by the program.")
894 (license license:gpl2+)))
896 (define-public alsa-lib
903 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
907 "174n2psp0328xcy2f1ayls67598bxli6q9cf00d2qnac3012aa3i"))))
908 (build-system gnu-build-system)
909 (home-page "https://www.alsa-project.org/")
910 (synopsis "The Advanced Linux Sound Architecture libraries")
912 "The Advanced Linux Sound Architecture (ALSA) provides audio and
913 MIDI functionality to the Linux-based operating system.")
914 (license license:lgpl2.1+)))
916 (define-public alsa-utils
922 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
923 name "-" version ".tar.bz2"))
926 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
927 (build-system gnu-build-system)
929 ;; XXX: Disable man page creation until we have DocBook.
930 '(#:configure-flags (list "--disable-xmlto"
932 ;; The udev rule is responsible for restoring
934 (string-append "--with-udev-rules-dir="
935 (assoc-ref %outputs "out")
936 "/lib/udev/rules.d"))
938 (modify-phases %standard-phases
940 'install 'pre-install
942 ;; Don't try to mkdir /var/lib/alsa.
943 (substitute* "Makefile"
944 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
948 `(("libsamplerate" ,libsamplerate)
950 ("alsa-lib" ,alsa-lib)
952 ("gettext" ,gettext-minimal)))
953 (home-page "http://www.alsa-project.org/")
954 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
956 "The Advanced Linux Sound Architecture (ALSA) provides audio and
957 MIDI functionality to the Linux-based operating system.")
959 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
961 (license license:gpl2)))
963 (define-public alsa-plugins
965 (name "alsa-plugins")
969 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
970 name "-" version ".tar.bz2"))
973 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
974 (build-system gnu-build-system)
975 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
976 ;; be split, there are references to both in files.
977 ;; TODO: Remove OSS related plugins, they add support to run native
978 ;; ALSA applications on OSS however we do not offer OSS and OSS is
980 (outputs '("out" "pulseaudio"))
983 (modify-phases %standard-phases
984 (add-after 'install 'split
985 (lambda* (#:key inputs outputs #:allow-other-keys)
986 ;; Distribute the binaries to the various outputs.
987 (let* ((out (assoc-ref outputs "out"))
988 (pua (assoc-ref outputs "pulseaudio"))
989 (pualib (string-append pua "/lib/alsa-lib"))
990 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
993 (chdir (string-append out "/share"))
994 (for-each (lambda (file)
995 (rename-file file (string-append puaconf "/" (basename file))))
996 (find-files out "\\.(conf|example)"))
997 (for-each (lambda (file)
998 (rename-file file (string-append pualib "/" (basename file))))
999 (find-files out ".*pulse\\.(la|so)"))
1001 ;; We have moved the files to output pulsaudio, the
1002 ;; directory is now empty.
1003 (delete-file-recursively (string-append out "/share"))
1006 `(("alsa-lib" ,alsa-lib)
1007 ("speex" ,speex) ; libspeexdsp resampling plugin
1008 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1009 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1010 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1012 `(("pkg-config" ,pkg-config)))
1013 (home-page "http://www.alsa-project.org/")
1014 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1016 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1017 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1018 by providing additional plugins which include: upmixing, downmixing, jackd and
1019 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1020 external rate conversion.")
1021 (license (list license:gpl2+
1022 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1023 license:lgpl2.1+))))
1025 (define-public iptables
1032 "mirror://netfilter.org/iptables/iptables-"
1033 version ".tar.bz2"))
1036 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
1037 (build-system gnu-build-system)
1039 `(("pkg-config" ,pkg-config)
1043 `(("libmnl" ,libmnl)
1044 ("libnftnl" ,libnftnl)))
1046 '(#:tests? #f ; no test suite
1047 #:configure-flags ; add $libdir to the RUNPATH of executables
1048 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1049 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1050 (synopsis "Program to configure the Linux IP packet filtering rules")
1052 "iptables is the userspace command line program used to configure the
1053 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1054 system administrators. Since Network Address Translation is also configured
1055 from the packet filter ruleset, iptables is used for this, too. The iptables
1056 package also includes ip6tables. ip6tables is used for configuring the IPv6
1058 (license license:gpl2+)))
1060 (define-public ebtables
1063 (version "2.0.10-4")
1067 "mirror://netfilter.org/ebtables/ebtables-v"
1071 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1072 (build-system gnu-build-system)
1074 '(#:tests? #f ; no test suite
1076 (let* ((out (assoc-ref %outputs "out"))
1077 (bin (string-append out "/sbin"))
1078 (lib (string-append out "/lib"))
1079 (man (string-append out "/share/man"))
1080 (iptables (assoc-ref %build-inputs "iptables"))
1081 (ethertypes (string-append iptables "/etc/ethertypes")))
1082 (list (string-append "LIBDIR=" lib)
1083 (string-append "MANDIR=" man)
1084 (string-append "BINDIR=" bin)
1085 (string-append "ETHERTYPESFILE=" ethertypes)
1086 ;; With the default CFLAGS, it falis with:
1087 ;; communication.c:259:58: error: variable ‘ret’ set but not
1088 ;; used [-Werror=unused-but-set-variable]
1091 (modify-phases %standard-phases
1093 ;; no configure script
1095 (substitute* "Makefile"
1096 ;; Remove user and group options from install commands,
1097 ;; otherwise it fails with: invalid user 'root'.
1098 (("-o root -g root") "")
1099 ;; Remove 'ethertypes' from the install target.
1101 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1105 ("iptables" ,iptables)))
1106 (synopsis "Ethernet bridge frame table administration")
1107 (home-page "http://ebtables.netfilter.org/")
1109 "ebtables is an application program used to set up and maintain the
1110 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1111 analogous to the iptables application, but less complicated, due to the fact
1112 that the Ethernet protocol is much simpler than the IP protocol.")
1113 (license license:gpl2+)))
1115 (define-public iproute
1122 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1126 "09l0phf09mw17bn3xlzfr80sbhw14mq8xv28iz5x15m6pll10rvj"))))
1127 (build-system gnu-build-system)
1129 `(#:tests? #f ; no test suite
1130 #:make-flags (let ((out (assoc-ref %outputs "out")))
1132 (string-append "BASH_COMPDIR=" out
1133 "/etc/bash_completion.d")
1134 (string-append "LIBDIR=" out "/lib")
1135 (string-append "HDRDIR=" out "/include")
1136 (string-append "SBINDIR=" out "/sbin")
1137 (string-append "CONFDIR=" out "/etc")
1138 (string-append "DOCDIR=" out "/share/doc/"
1140 (string-append "MANDIR=" out "/share/man")))
1141 #:phases (modify-phases %standard-phases
1142 (add-before 'install 'pre-install
1144 ;; Don't attempt to create /var/lib/arpd.
1145 (substitute* "Makefile"
1146 (("^.*ARPDDIR.*$") "")))))))
1148 `(("iptables" ,iptables)
1151 `(("pkg-config" ,pkg-config)
1155 "https://wiki.linuxfoundation.org/networking/iproute2")
1157 "Utilities for controlling TCP/IP networking and traffic in Linux")
1159 "Iproute2 is a collection of utilities for controlling TCP/IP
1160 networking and traffic with the Linux kernel.
1162 Most network configuration manuals still refer to ifconfig and route as the
1163 primary network configuration tools, but ifconfig is known to behave
1164 inadequately in modern network environments. They should be deprecated, but
1165 most distros still include them. Most network configuration systems make use
1166 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1167 to support most modern network technologies, as it doesn't use ifconfig and
1168 allows a system administrator to make use of all iproute2 features, including
1171 iproute2 is usually shipped in a package called iproute or iproute2 and
1172 consists of several tools, of which the most important are @command{ip} and
1173 @command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1174 @command{tc} stands for traffic control. Both tools print detailed usage
1175 messages and are accompanied by a set of manpages.")
1176 (license license:gpl2+)))
1178 (define-public net-tools
1179 ;; XXX: This package is basically unmaintained, but it provides a few
1180 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1185 (home-page "http://net-tools.sourceforge.net/")
1188 (uri (list (string-append
1189 "mirror://sourceforge/net-tools/net-tools-"
1192 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1193 "/base/net-tools/net-tools-1.60.tar.bz2")))
1196 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1197 (patches (search-patches "net-tools-bitrot.patch"))))
1198 (build-system gnu-build-system)
1200 '(#:modules ((guix build gnu-build-system)
1204 #:phases (alist-cons-after
1206 (lambda* (#:key inputs #:allow-other-keys)
1207 (define (apply-patch file)
1208 (zero? (system* "patch" "-p1" "--force"
1211 (let ((patch.gz (assoc-ref inputs "patch")))
1212 (format #t "applying Debian patch set '~a'...~%"
1214 (system (string-append "gunzip < " patch.gz " > the-patch"))
1215 (and (apply-patch "the-patch")
1216 (for-each apply-patch
1217 (find-files "debian/patches"
1221 (lambda* (#:key outputs #:allow-other-keys)
1222 (let ((out (assoc-ref outputs "out")))
1223 (mkdir-p (string-append out "/bin"))
1224 (mkdir-p (string-append out "/sbin"))
1226 ;; Pretend we have everything...
1227 (system "yes | make config")
1229 ;; ... except for the things we don't have.
1230 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1231 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1232 ;; that have been removed.
1233 (substitute* '("config.make" "config.h")
1234 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1236 'install 'remove-redundant-commands
1237 (lambda* (#:key outputs #:allow-other-keys)
1238 ;; Remove commands and man pages redundant with
1240 (let* ((out (assoc-ref outputs "out"))
1241 (dup (append-map (cut find-files out <>)
1243 "^(yp|nis|dns)?domainname"))))
1244 (for-each delete-file dup)
1248 ;; Binaries that depend on libnet-tools.a don't declare that
1249 ;; dependency, making it parallel-unsafe.
1250 #:parallel-build? #f
1252 #:tests? #f ; no test suite
1253 #:make-flags (let ((out (assoc-ref %outputs "out")))
1255 (string-append "BASEDIR=" out)
1256 (string-append "INSTALLNLSDIR=" out "/share/locale")
1257 (string-append "mandir=/share/man")))))
1259 ;; Use the big Debian patch set (the thing does not even compile out of
1261 (inputs `(("patch" ,(origin
1264 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1267 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1268 (native-inputs `(("gettext" ,gettext-minimal)))
1270 (synopsis "Tools for controlling the network subsystem in Linux")
1272 "This package includes the important tools for controlling the network
1273 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1274 netstat, rarp and route. Additionally, this package contains utilities
1275 relating to particular network hardware types (plipconfig, slattach) and
1276 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1277 (license license:gpl2+)))
1279 (define-public libcap
1286 "mirror://kernel.org/linux/libs/security/linux-privs/"
1287 "libcap2/libcap-" version ".tar.xz"))
1290 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1291 (build-system gnu-build-system)
1292 (arguments '(#:phases
1293 (modify-phases %standard-phases
1295 ;; Add $libdir to the RUNPATH of executables.
1297 (substitute* "Make.Rules"
1299 (string-append "LDFLAGS := -Wl,-rpath="
1300 %output "/lib"))))))
1301 #:tests? #f ; no 'check' target
1302 #:make-flags (list "lib=lib"
1303 (string-append "prefix="
1304 (assoc-ref %outputs "out"))
1305 "RAISE_SETFCAP=no")))
1306 (native-inputs `(("perl" ,perl)))
1307 (inputs `(("attr" ,attr)))
1308 (home-page "https://sites.google.com/site/fullycapable/")
1309 (synopsis "Library for working with POSIX capabilities")
1311 "Libcap2 provides a programming interface to POSIX capabilities on
1312 Linux-based operating systems.")
1314 ;; License is BSD-3 or GPLv2, at the user's choice.
1315 (license license:gpl2)))
1317 (define-public bridge-utils
1319 (name "bridge-utils")
1323 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1324 "bridge-utils-" version ".tar.gz"))
1327 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1328 (build-system gnu-build-system)
1330 ;; The tarball lacks all the generated files.
1331 (native-inputs `(("autoconf" ,autoconf)
1332 ("automake" ,automake)))
1334 '(#:phases (alist-cons-after
1337 ;; Fix "field ‘ip6’ has incomplete type" errors.
1338 (substitute* "libbridge/libbridge.h"
1339 (("#include <linux/if_bridge.h>")
1340 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1342 ;; Ensure that the entire build fails if one of the
1343 ;; sub-Makefiles fails.
1344 (substitute* "Makefile.in"
1345 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1346 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1348 (zero? (system* "autoreconf" "-vf")))
1350 #:tests? #f)) ; no 'check' target
1353 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1354 (synopsis "Manipulate Ethernet bridges")
1356 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1357 to connect two Ethernet segments together in a protocol independent way.
1358 Packets are forwarded based on Ethernet address, rather than IP address (like
1359 a router). Since forwarding is done at Layer 2, all protocols can go
1360 transparently through a bridge.")
1361 (license license:gpl2+)))
1363 (define-public libnl
1370 "https://github.com/thom311/libnl/releases/download/"
1371 "libnl" (string-join (string-split version #\.) "_")
1372 "/libnl-" version ".tar.gz"))
1375 "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
1376 (build-system gnu-build-system)
1377 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1378 (home-page "http://www.infradead.org/~tgr/libnl/")
1379 (synopsis "NetLink protocol library suite")
1381 "The libnl suite is a collection of libraries providing APIs to netlink
1382 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1383 between the kernel and user space processes. It was designed to be a more
1384 flexible successor to ioctl to provide mainly networking related kernel
1385 configuration and monitoring interfaces.")
1387 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1388 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1389 (license license:gpl2)))
1398 "mirror://kernel.org/software/network/iw/iw-"
1402 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1403 (build-system gnu-build-system)
1404 (native-inputs `(("pkg-config" ,pkg-config)))
1405 (inputs `(("libnl" ,libnl)))
1407 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1409 #:phases (alist-delete 'configure %standard-phases)))
1410 (home-page "https://wireless.wiki.kernel.org/")
1411 (synopsis "Tool for configuring wireless devices")
1413 "iw is a new nl80211 based CLI configuration utility for wireless
1414 devices. It replaces @code{iwconfig}, which is deprecated.")
1415 (license license:isc)))
1417 (define-public powertop
1425 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1429 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1430 (build-system gnu-build-system)
1433 (modify-phases %standard-phases
1434 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1435 ;; allow calibrating the network interface in GuixSD.
1436 (add-after 'unpack 'patch-absolute-file-names
1437 (lambda* (#:key inputs #:allow-other-keys)
1438 (let ((kmod (assoc-ref inputs "kmod")))
1439 (substitute* (find-files "src" "\\.cpp$")
1440 ;; Give the right 'modprobe' file name so that essential
1441 ;; modules such as msr.ko can be loaded.
1442 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1443 ;; These programs are only needed to calibrate, so using
1444 ;; relative file names avoids adding extra inputs. When they
1445 ;; are missing powertop gracefully handles it.
1446 (("/usr/bin/hcitool") "hcitool")
1447 (("/usr/bin/xset") "xset")
1448 (("/usr/sbin/hciconfig") "hciconfig"))
1453 ("ncurses" ,ncurses)
1454 ("pciutils" ,pciutils)
1457 `(("pkg-config" ,pkg-config)))
1458 (home-page "https://01.org/powertop/")
1459 (synopsis "Analyze power consumption on Intel-based laptops")
1461 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1462 power management. In addition to being a diagnostic tool, PowerTOP also has
1463 an interactive mode where the user can experiment various power management
1464 settings for cases where the operating system has not enabled these
1466 (license license:gpl2)))
1468 (define-public aumix
1475 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1476 version ".tar.bz2"))
1479 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1480 (build-system gnu-build-system)
1481 (inputs `(("ncurses" ,ncurses)))
1482 (home-page "http://www.jpj.net/~trevor/aumix.html")
1483 (synopsis "Audio mixer for X and the console")
1485 "Aumix adjusts an audio mixer from X, the console, a terminal,
1486 the command line or a script.")
1487 (license license:gpl2+)))
1489 (define-public iotop
1496 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1499 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1500 (build-system python-build-system)
1502 ;; The setup.py script expects python-2.
1503 `(#:python ,python-2
1504 ;; There are currently no checks in the package.
1506 (native-inputs `(("python" ,python-2)))
1507 (home-page "http://guichaz.free.fr/iotop/")
1509 "Displays the IO activity of running processes")
1511 "Iotop is a Python program with a top like user interface to show the
1512 processes currently causing I/O.")
1513 (license license:gpl2+)))
1521 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1522 "download/fuse-" version
1523 "/fuse-" version ".tar.gz"))
1526 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1527 (patches (search-patches "fuse-overlapping-headers.patch"))))
1528 (build-system gnu-build-system)
1529 (inputs `(("util-linux" ,util-linux)))
1531 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1532 (assoc-ref %outputs "out")
1534 (string-append "INIT_D_PATH="
1535 (assoc-ref %outputs "out")
1538 ;; The rule makes /dev/fuse 666.
1539 (string-append "UDEV_RULES_PATH="
1540 (assoc-ref %outputs "out")
1541 "/lib/udev/rules.d"))
1542 #:phases (alist-cons-before
1543 'build 'set-file-names
1544 (lambda* (#:key inputs #:allow-other-keys)
1545 ;; libfuse calls out to mount(8) and umount(8). Make sure
1546 ;; it refers to the right ones.
1547 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1548 (("/bin/(u?)mount" _ maybe-u)
1549 (string-append (assoc-ref inputs "util-linux")
1550 "/bin/" maybe-u "mount")))
1551 (substitute* '("util/mount.fuse.c")
1555 ;; This hack leads libfuse to search for 'fusermount' in
1556 ;; $PATH, where it may find a setuid-root binary, instead of
1557 ;; trying solely $out/sbin/fusermount and failing because
1559 (substitute* "lib/Makefile"
1560 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1561 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1563 (home-page "https://github.com/libfuse/libfuse")
1564 (synopsis "Support file systems implemented in user space")
1566 "As a consequence of its monolithic design, file system code for Linux
1567 normally goes into the kernel itself---which is not only a robustness issue,
1568 but also an impediment to system extensibility. FUSE, for \"file systems in
1569 user space\", is a kernel module and user-space library that tries to address
1570 part of this problem by allowing users to run file system implementations as
1571 user-space processes.")
1572 (license (list license:lgpl2.1 ;library
1573 license:gpl2+)))) ;command-line utilities
1575 (define-public unionfs-fuse
1577 (name "unionfs-fuse")
1582 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1584 (file-name (string-append name "-" version ".tar.gz"))
1587 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1588 (build-system cmake-build-system)
1590 `(("python" ,python)
1591 ("python-pytest" ,python-pytest)))
1592 (inputs `(("fuse" ,fuse)))
1595 (modify-phases %standard-phases
1597 ;; Borrowed from the Makefile
1598 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
1599 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1600 (synopsis "User-space union file system")
1602 "UnionFS-FUSE is a flexible union file system implementation in user
1603 space, using the FUSE library. Mounting a union file system allows you to
1604 \"aggregate\" the contents of several directories into a single mount point.
1605 UnionFS-FUSE additionally supports copy-on-write.")
1606 (license license:bsd-3)))
1609 (package (inherit fuse)
1610 (name "fuse-static")
1611 (source (origin (inherit (package-source fuse))
1612 (modules '((guix build utils)))
1614 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1615 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1616 ;; it doesn't do that, allowing us to remove the dependency on
1617 ;; util-linux (something that is useful in initrds.)
1618 '(substitute* '("lib/mount_util.c"
1619 "util/mount_util.c")
1620 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1625 (define-public unionfs-fuse/static
1626 (package (inherit unionfs-fuse)
1627 (synopsis "User-space union file system (statically linked)")
1628 (name (string-append (package-name unionfs-fuse) "-static"))
1629 (source (origin (inherit (package-source unionfs-fuse))
1630 (modules '((guix build utils)))
1632 ;; Add -ldl to the libraries, because libfuse.a needs that.
1633 '(substitute* "src/CMakeLists.txt"
1634 (("target_link_libraries(.*)\\)" _ libs)
1635 (string-append "target_link_libraries"
1639 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1640 #:phases (alist-cons-after
1641 'install 'post-install
1642 (lambda* (#:key outputs #:allow-other-keys)
1643 (let* ((out (assoc-ref outputs "out"))
1644 (exe (string-append out "/bin/unionfs")))
1645 ;; By default, 'unionfs' keeps references to
1646 ;; $glibc/share/locale and similar stuff. Remove them.
1647 (remove-store-references exe)
1649 ;; 'unionfsctl' has references to glibc as well. Since
1650 ;; we don't need it, remove it.
1651 (delete-file (string-append out "/bin/unionfsctl"))
1654 (inputs `(("fuse" ,fuse-static)))))
1656 (define-public sshfs-fuse
1662 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1663 "download/sshfs-" version "/sshfs-" version
1667 "1pp5wsl1jx11apkv2fpp559miifqhi8ka400npy5awp9ghlf3la6"))))
1668 (build-system gnu-build-system)
1673 `(("pkg-config" ,pkg-config)))
1674 (home-page "https://github.com/libfuse/sshfs")
1675 (synopsis "Mount remote file systems over SSH")
1677 "This is a file system client based on the SSH File Transfer Protocol.
1678 Since most SSH servers already support this protocol it is very easy to set
1679 up: on the server side there's nothing to do; on the client side mounting the
1680 file system is as easy as logging into the server with an SSH client.")
1681 (license license:gpl2+)))
1683 (define-public archivemount
1685 (name "archivemount")
1690 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1691 "archivemount-" version ".tar.gz"))
1694 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1695 (build-system gnu-build-system)
1696 (inputs `(("fuse", fuse)
1697 ("libarchive", libarchive)))
1698 (native-inputs `(("pkg-config", pkg-config)))
1699 (home-page "http://www.cybernoia.de/software/archivemount")
1700 (synopsis "Tool for mounting archive files with FUSE")
1701 (description "archivemount is a FUSE-based file system for Unix variants,
1702 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1703 mount point where it can be read from or written to as with any other file
1704 system. This makes accessing the contents of the archive, which may be
1705 compressed, transparent to other programs, without decompressing them.")
1706 (license license:lgpl2.0+)))
1708 (define-public numactl
1715 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1720 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1721 (build-system gnu-build-system)
1723 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1724 ;; to run, which we can't assume to have.
1727 ;; NUMA is apparently not supported on armhf, see
1728 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1729 (supported-systems (delete "armhf-linux" %supported-systems))
1730 (home-page "http://oss.sgi.com/projects/libnuma/")
1731 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1733 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1734 memory is not all in one place. The numactl program allows you to run your
1735 application program on specific CPU's and memory nodes. It does this by
1736 supplying a NUMA memory policy to the operating system before running your
1739 The package contains other commands, such as numademo, numastat and memhog.
1740 The numademo command provides a quick overview of NUMA performance on your
1742 (license (list license:gpl2 ;programs
1743 license:lgpl2.1)))) ;library
1745 (define-public kbd-neo
1752 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1753 version "/linux/console/neo.map"))
1754 (file-name (string-append name "-" version ".map"))
1757 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1758 (build-system trivial-build-system)
1760 `(#:modules ((guix build utils))
1762 (use-modules (guix build utils))
1763 (let ((out (string-append %output "/share/keymaps"))
1764 (source (assoc-ref %build-inputs "source")))
1766 (copy-file source (string-append out "/neo.map"))
1768 (home-page "https://neo-layout.org")
1769 (synopsis "Neo2 console layout")
1771 "Kbd-neo provides the Neo2 keyboard layout for use with
1772 @command{loadkeys(1)} from @code{kbd(4)}.")
1773 ;; The file is located in an svn directory, the entire content of
1774 ;; the directory is licensed as GPL3.
1775 (license license:gpl3+)))
1783 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1787 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1788 (modules '((guix build utils)))
1791 (substitute* "tests/Makefile.in"
1792 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1795 (substitute* '("src/unicode_start" "src/unicode_stop")
1796 ;; Assume the Coreutils are in $PATH.
1799 (build-system gnu-build-system)
1802 (modify-phases %standard-phases
1803 (add-before 'build 'pre-build
1804 (lambda* (#:key inputs #:allow-other-keys)
1805 (let ((gzip (assoc-ref %build-inputs "gzip"))
1806 (bzip2 (assoc-ref %build-inputs "bzip2")))
1807 (substitute* "src/libkeymap/findfile.c"
1809 (string-append gzip "/bin/gzip"))
1811 (string-append bzip2 "/bin/bzip2"))))))
1812 (add-after 'install 'post-install
1813 (lambda* (#:key outputs #:allow-other-keys)
1814 ;; Make sure these programs find their comrades.
1815 (let* ((out (assoc-ref outputs "out"))
1816 (bin (string-append out "/bin")))
1817 (for-each (lambda (prog)
1818 (wrap-program (string-append bin "/" prog)
1819 `("PATH" ":" prefix (,bin))))
1820 '("unicode_start" "unicode_stop"))))))))
1821 (inputs `(("check" ,check)
1824 ("pam" ,linux-pam)))
1825 (native-search-paths
1826 (list (search-path-specification
1827 (variable "LOADKEYS_KEYMAP_PATH")
1828 (files (list "share/keymaps")))))
1829 (native-inputs `(("pkg-config" ,pkg-config)))
1830 (home-page "http://kbd-project.org/")
1831 (synopsis "Linux keyboard utilities and keyboard maps")
1833 "This package contains keytable files and keyboard utilities compatible
1834 for systems using the Linux kernel. This includes commands such as
1835 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1836 (license license:gpl2+)))
1838 (define-public inotify-tools
1840 (name "inotify-tools")
1845 "mirror://sourceforge/inotify-tools/inotify-tools/"
1846 version "/inotify-tools-" version ".tar.gz"))
1849 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1850 (build-system gnu-build-system)
1851 (home-page "http://inotify-tools.sourceforge.net/")
1852 (synopsis "Monitor file accesses")
1854 "The inotify-tools packages provides a C library and command-line tools
1855 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1856 (license license:gpl2+)))
1865 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1866 "kmod-" version ".tar.xz"))
1869 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
1870 (patches (search-patches "kmod-module-directory.patch"))))
1871 (build-system gnu-build-system)
1873 `(("pkg-config" ,pkg-config)))
1878 `(#:tests? #f ; FIXME: Investigate test failures
1879 #:configure-flags '("--with-xz" "--with-zlib")
1880 #:phases (alist-cons-after
1881 'install 'install-modprobe&co
1882 (lambda* (#:key outputs #:allow-other-keys)
1883 (let* ((out (assoc-ref outputs "out"))
1884 (bin (string-append out "/bin")))
1885 (for-each (lambda (tool)
1887 (string-append bin "/" tool)))
1888 '("insmod" "rmmod" "lsmod" "modprobe"
1889 "modinfo" "depmod"))))
1891 (home-page "https://www.kernel.org/")
1892 (synopsis "Kernel module tools")
1893 (description "Kmod is a set of tools to handle common tasks with Linux
1894 kernel modules like insert, remove, list, check properties, resolve
1895 dependencies and aliases.
1897 These tools are designed on top of libkmod, a library that is shipped with
1898 kmod. The aim is to be compatible with tools, configurations and indices
1899 from the module-init-tools project.")
1900 (license license:gpl2+))) ; library under lgpl2.1+
1902 (define-public eudev
1903 ;; The post-systemd fork, maintained by Gentoo.
1910 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1914 "06gyyl90n85x8i7lfhns514y1kg1ians13l467admyzy3kjxkqsp"))
1915 (patches (search-patches "eudev-rules-directory.patch"
1916 "eudev-conflicting-declaration.patch"))))
1917 (build-system gnu-build-system)
1919 `(("pkg-config" ,pkg-config)
1923 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1924 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1925 ;; which contains the rules to do that.
1926 `(("util-linux" ,util-linux) ;for blkid
1928 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1929 (synopsis "Userspace device management")
1930 (description "Udev is a daemon which dynamically creates and removes
1931 device nodes from /dev/, handles hotplug events and loads drivers at boot
1933 (license license:gpl2+)))
1935 (define-public eudev-with-hwdb
1936 ;; TODO: Merge with 'eudev'.
1939 (name "eudev-with-hwdb")
1941 '(#:phases (modify-phases %standard-phases
1942 (add-after 'install 'build-hwdb
1943 (lambda* (#:key outputs #:allow-other-keys)
1944 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1945 ;; similar tools to display product names.
1946 (let ((out (assoc-ref outputs "out")))
1947 (zero? (system* (string-append out "/bin/udevadm")
1948 "hwdb" "--update"))))))))))
1953 (version "2.02.171")
1956 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1960 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
1961 (modules '((guix build utils)))
1964 (use-modules (guix build utils))
1966 ;; Honor sysconfdir.
1967 (substitute* "make.tmpl.in"
1969 "confdir = @sysconfdir@\n")
1970 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1971 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1972 (patches (search-patches "lvm2-static-link.patch"))))
1973 (build-system gnu-build-system)
1975 `(("pkg-config" ,pkg-config)
1976 ("procps" ,procps))) ;tests use 'pgrep'
1981 (modify-phases %standard-phases
1982 (add-after 'configure 'set-makefile-shell
1984 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1986 (setenv "SHELL" (which "sh"))
1988 ;; Replace /bin/sh with the right file name.
1989 (patch-makefile-SHELL "make.tmpl")
1991 (add-before 'strip 'make-objects-writable
1992 (lambda* (#:key outputs #:allow-other-keys)
1993 ;; Make compiled objects writable so they can be stripped.
1994 (let ((out (assoc-ref outputs "out")))
1995 (for-each (lambda (file)
1998 (find-files (string-append out "/lib"))
1999 (find-files (string-append out "/sbin"))))
2002 #:configure-flags (list (string-append "--sysconfdir="
2003 (assoc-ref %outputs "out")
2005 "--enable-udev_sync"
2006 "--enable-udev_rules"
2008 ;; Make sure programs such as 'dmsetup' can
2009 ;; find libdevmapper.so.
2010 (string-append "LDFLAGS=-Wl,-rpath="
2011 (assoc-ref %outputs "out")
2014 ;; The tests use 'mknod', which requires root access.
2016 (home-page "https://sourceware.org/lvm2/")
2017 (synopsis "Logical volume management for Linux")
2019 "LVM2 is the logical volume management tool set for Linux-based systems.
2020 This package includes the user-space libraries and tools, including the device
2021 mapper. Kernel components are part of Linux-libre.")
2023 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2024 ;; Command-line tools are GPLv2.
2025 (license (list license:gpl2 license:lgpl2.1))))
2027 (define-public lvm2-static
2030 (name "lvm2-static")
2032 ;; Propagate udev because libdevmapper.a depends on libudev.
2033 (inputs (alist-delete "udev" (package-inputs lvm2)))
2034 (propagated-inputs `(("udev" ,eudev)))
2037 (substitute-keyword-arguments (package-arguments lvm2)
2038 ((#:configure-flags flags '())
2039 ;; LVM2 doesn't use Libtool, hence the custom option.
2040 `(cons "--enable-static_link" ,flags))))
2041 (synopsis "Logical volume management for Linux (statically linked)")))
2043 (define-public wireless-tools
2045 (name "wireless-tools")
2049 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2053 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2056 ;; Remove the older header files that are not free software.
2057 (for-each (lambda (n)
2058 (delete-file (format #f "wireless.~a.h" n)))
2059 '(10 11 12 13 14 15 16 17 18 19 20))
2061 (build-system gnu-build-system)
2064 (list (string-append "PREFIX=" %output)
2065 (string-append "INSTALL_MAN=" %output "/share/man")
2066 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2068 #:phases (modify-phases %standard-phases
2069 (delete 'configure))
2071 (synopsis "Tools for manipulating Linux Wireless Extensions")
2072 (description "Wireless Tools are used to manipulate the now-deprecated
2073 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2074 Extension was an interface allowing you to set Wireless LAN specific
2075 parameters and get the specific stats. It is deprecated in favor the nl80211
2077 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2078 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2079 ;; other files are distributed under gpl2.
2080 (license (list license:gpl2 license:lgpl2.1+))))
2088 (uri (string-append "mirror://kernel.org/software/network/crda/"
2089 "crda-" version ".tar.xz"))
2092 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2093 (patches (search-patches "crda-optional-gcrypt.patch"))))
2094 (build-system gnu-build-system)
2096 '(#:phases (modify-phases %standard-phases
2099 'build 'no-werror-no-ldconfig
2101 (substitute* "Makefile"
2103 (("ldconfig") "true"))
2106 'build 'set-regulator-db-file-name
2107 (lambda* (#:key inputs #:allow-other-keys)
2108 ;; Tell CRDA where to find our database.
2109 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2110 (substitute* "crda.c"
2111 (("\"/lib/crda/regulatory.bin\"")
2112 (string-append "\"" regdb
2113 "/lib/crda/regulatory.bin\"")))
2115 #:test-target "verify"
2116 #:make-flags (let ((out (assoc-ref %outputs "out"))
2117 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2118 (list "CC=gcc" "V=1"
2120 ;; Disable signature-checking on 'regulatory.bin'.
2121 ;; The reason is that this simplifies maintenance
2122 ;; on our side (no need to manage a distro key
2123 ;; pair), and we can guarantee integrity of
2124 ;; 'regulatory.bin' by other means anyway, such as
2125 ;; 'guix gc --verify'. See
2126 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2130 (string-append "PREFIX=" out)
2131 (string-append "SBINDIR=" out "/sbin/")
2132 (string-append "UDEV_RULE_DIR="
2133 out "/lib/udev/rules.d")
2134 (string-append "LDFLAGS=-Wl,-rpath="
2136 (string-append "REG_BIN=" regdb
2137 "/lib/crda/regulatory.bin")))))
2138 (native-inputs `(("pkg-config" ,pkg-config)
2139 ("python" ,python-2)
2140 ("wireless-regdb" ,wireless-regdb)))
2141 (inputs `(("libnl" ,libnl)))
2143 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2144 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2146 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2147 communication between the kernel Linux and user space for regulatory
2149 (license license:copyleft-next)))
2151 (define-public wireless-regdb
2153 (name "wireless-regdb")
2154 (version "2017.03.07")
2158 "mirror://kernel.org/software/network/wireless-regdb/"
2159 "wireless-regdb-" version ".tar.xz"))
2162 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2164 ;; We're building 'regulatory.bin' by ourselves.
2165 (snippet '(delete-file "regulatory.bin"))))
2166 (build-system gnu-build-system)
2168 '(#:phases (modify-phases %standard-phases
2169 (delete 'configure))
2171 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2172 ;; is computed and can be equal to 'maintainer-clean'; when that
2173 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2174 ;; just built. Thus, build things sequentially.
2175 #:parallel-build? #f
2177 #:tests? #f ;no tests
2178 #:make-flags (let ((out (assoc-ref %outputs "out")))
2179 (list (string-append "PREFIX=" out)
2180 (string-append "LSB_ID=GuixSD")
2181 (string-append "DISTRO_PUBKEY=/dev/null")
2182 (string-append "DISTRO_PRIVKEY=/dev/null")
2183 (string-append "REGDB_PUBKEY=/dev/null")
2185 ;; Leave that empty so that db2bin.py doesn't try
2186 ;; to sign 'regulatory.bin'. This allows us to
2187 ;; avoid managing a key pair for the whole distro.
2188 (string-append "REGDB_PRIVKEY=")))))
2189 (native-inputs `(("python" ,python-2)))
2191 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2192 (synopsis "Wireless regulatory database")
2194 "This package contains the wireless regulatory database Central
2195 Regulatory Database Agent (CRDA) daemon. The database contains information on
2196 country-specific regulations for the wireless spectrum.")
2197 (license license:isc)))
2199 (define-public lm-sensors
2205 (uri (list (string-append
2206 "https://github.com/groeck/lm-sensors/archive/V"
2207 (string-join (string-split version #\.) "-")
2209 (file-name (string-append name "-" version ".tar.gz"))
2212 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2213 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2214 (build-system gnu-build-system)
2215 (inputs `(("rrdtool" ,rrdtool)
2218 ("gnuplot" ,gnuplot)))
2219 (native-inputs `(("pkg-config" ,pkg-config)
2224 `(#:tests? #f ; no 'check' target
2225 #:make-flags (list (string-append "PREFIX=" %output)
2226 (string-append "ETCDIR=" %output "/etc")
2227 (string-append "MANDIR=" %output "/share/man"))
2232 'build 'patch-exec-paths
2233 (lambda* (#:key inputs outputs #:allow-other-keys)
2234 (substitute* "prog/detect/sensors-detect"
2236 (string-append "`" (assoc-ref inputs "coreutils")
2238 (("(`|\")modprobe" all open-quote)
2239 (string-append open-quote
2240 (assoc-ref inputs "kmod")
2242 (substitute* '("prog/pwm/pwmconfig"
2243 "prog/pwm/fancontrol")
2245 (string-append (assoc-ref inputs "gnuplot")
2248 (string-append (assoc-ref inputs "coreutils")
2251 (string-append (assoc-ref inputs "grep")
2254 (string-append (assoc-ref inputs "sed")
2257 (string-append (assoc-ref inputs "coreutils")
2260 (string-append (assoc-ref inputs "coreutils")
2263 (string-append (assoc-ref inputs "coreutils")
2264 "/bin/readlink -f"))))
2265 %standard-phases))))
2266 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2267 (synopsis "Utilities to read temperature/voltage/fan sensors")
2269 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2270 you to access information from temperature, voltage, and fan speed sensors.
2271 It works with most newer systems.")
2272 (license license:gpl2+)))
2274 (define-public i2c-tools
2281 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2282 version ".tar.bz2"))
2285 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2286 (build-system gnu-build-system)
2288 `(#:tests? #f ; no 'check' target
2289 #:make-flags (list (string-append "prefix=" %output)
2291 ;; no configure script
2292 #:phases (alist-delete 'configure %standard-phases)))
2295 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2296 (synopsis "I2C tools for Linux")
2298 "The i2c-tools package contains a heterogeneous set of I2C tools for
2299 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2300 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2302 (license license:gpl2+)))
2304 (define-public xsensors
2311 "http://www.linuxhardware.org/xsensors/xsensors-"
2315 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2316 (build-system gnu-build-system)
2317 (inputs `(("lm-sensors" ,lm-sensors)
2319 (native-inputs `(("pkg-config" ,pkg-config)))
2321 `(#:phases (alist-cons-before
2322 'configure 'enable-deprecated
2324 (substitute* "src/Makefile.in"
2325 (("-DGDK_DISABLE_DEPRECATED") "")
2326 (("-DGTK_DISABLE_DEPRECATED") "")))
2328 'configure 'remove-Werror
2330 (substitute* '("configure" "src/Makefile.in")
2332 %standard-phases))))
2333 (home-page "http://www.linuxhardware.org/xsensors/")
2334 (synopsis "Hardware health information viewer")
2336 "Xsensors reads data from the libsensors library regarding hardware
2337 health such as temperature, voltage and fan speed and displays the information
2338 in a digital read-out.")
2339 (license license:gpl2+)))
2344 (version (package-version linux-libre))
2345 (source (package-source linux-libre))
2346 (build-system gnu-build-system)
2348 '(#:phases (alist-replace
2350 (lambda* (#:key inputs #:allow-other-keys)
2351 (setenv "SHELL_PATH" (which "bash"))
2352 (chdir "tools/perf"))
2354 #:make-flags (list (string-append "DESTDIR="
2355 (assoc-ref %outputs "out"))
2358 ;; By default, 'config/Makefile' uses lib64 on
2359 ;; x86_64. Work around that.
2361 #:tests? #f)) ;no tests
2363 `(("pkg-config" ,pkg-config)
2367 ;; There are build scripts written in these languages.
2369 ("python" ,python-2)))
2371 `(("slang" ,slang) ;for the interactive TUI
2373 ("python" ,python-2) ;'perf' links against libpython
2374 ("elfutils" ,elfutils)
2375 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2378 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2379 ("docbook-xsl" ,docbook-xsl)
2381 ("asciidoc" ,asciidoc)))
2382 (home-page "https://perf.wiki.kernel.org/")
2383 (synopsis "Linux profiling with performance counters")
2385 "perf is a tool suite for profiling using hardware performance counters,
2386 with support in the Linux kernel. perf can instrument CPU performance
2387 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2388 of lightweight profiling. This package contains the user-land tools and in
2389 particular the 'perf' command.")
2390 (license (package-license linux-libre))))
2392 (define-public pflask
2398 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2400 (file-name (string-append name "-" version ".tar.gz"))
2403 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2404 (build-system cmake-build-system)
2406 '(#:tests? #f)) ; no tests
2407 (home-page "http://ghedo.github.io/pflask/")
2408 (synopsis "Simple tool for creating Linux namespace containers")
2409 (description "pflask is a simple tool for creating Linux namespace
2410 containers. It can be used for running a command or even booting an OS inside
2411 an isolated container, created with the help of Linux namespaces. It is
2412 similar in functionality to chroot, although pflask provides better isolation
2413 thanks to the use of namespaces.")
2414 (license license:bsd-2)))
2416 (define-public hdparm
2422 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2423 name "-" version ".tar.gz"))
2426 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
2427 (build-system gnu-build-system)
2429 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2430 (list (string-append "binprefix=" out)
2431 (string-append "manprefix=" out)
2434 (modify-phases %standard-phases
2435 (delete 'configure)) ; no configure script
2436 #:tests? #f)) ; no test suite
2437 (home-page "https://sourceforge.net/projects/hdparm/")
2438 (synopsis "View and tune ATA disk drive parameters")
2440 "@command{hdparm} is a command-line utility to control ATA controllers and
2441 disk drives. It can increase performance and/or reliability by careful tuning
2442 of hardware settings like power and acoustic management, DMA modes, and caching.
2443 It can also display detailed device information, or be used as a simple
2444 performance benchmarking tool.
2446 @command{hdparm} provides a command line interface to various Linux kernel
2447 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2448 IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2449 Command Translation} (SAT) are also supported.")
2450 (license (license:non-copyleft "file://LICENSE.TXT"))))
2452 (define-public rfkill
2458 (uri (string-append "mirror://kernel.org/software/network/"
2459 name "/" name "-" version ".tar.xz"))
2462 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2463 (build-system gnu-build-system)
2465 `(#:make-flags (list "CC=gcc"
2466 (string-append "PREFIX=" %output))
2467 #:phases (modify-phases %standard-phases
2468 (delete 'configure))
2470 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2471 (synopsis "Tool for enabling and disabling wireless devices")
2473 "rfkill is a simple tool for accessing the rfkill device interface,
2474 which is used to enable and disable wireless networking devices, typically
2475 WLAN, Bluetooth and mobile broadband.")
2476 (license (license:non-copyleft "file://COPYING"
2477 "See COPYING in the distribution."))))
2485 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2486 version "/" name "-" version ".tar.gz"))
2489 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2490 (build-system gnu-build-system)
2491 (home-page "http://acpiclient.sourceforge.net")
2492 (synopsis "Display information on ACPI devices")
2493 (description "@code{acpi} attempts to replicate the functionality of the
2494 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2495 information. It does not support ACPI suspending, only displays information
2496 about ACPI devices.")
2497 (license license:gpl2+)))
2499 (define-public acpid
2505 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2509 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2510 (build-system gnu-build-system)
2511 (home-page "https://sourceforge.net/projects/acpid2/")
2512 (synopsis "Daemon for delivering ACPI events to user-space programs")
2514 "acpid is designed to notify user-space programs of Advanced
2515 Configuration and Power Interface (ACPI) events. acpid should be started
2516 during the system boot, and will run as a background process. When an ACPI
2517 event is received from the kernel, acpid will examine the list of rules
2518 specified in /etc/acpi/events and execute the rules that match the event.")
2519 (license license:gpl2+)))
2521 (define-public sysfsutils
2530 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2533 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2534 (build-system gnu-build-system)
2535 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2536 (synopsis "System utilities based on Linux sysfs")
2538 "These are a set of utilities built upon sysfs, a virtual file system in
2539 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2540 also contains the libsysfs library.")
2541 ;; The library is under lgpl2.1+ (all files say "or any later version").
2542 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2543 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2545 (define-public sysfsutils-1
2547 (inherit sysfsutils)
2554 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2555 "/sysfsutils-" version ".tar.gz"))
2557 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2558 (modules '((guix build utils)))
2561 (substitute* "Makefile.in"
2562 (("includedir = /usr/include/sysfs")
2563 "includedir = @includedir@"))
2564 (substitute* "configure"
2565 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2566 (string-append "includedir='" orig "/sysfs'")))))))
2567 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2569 (define-public cpufrequtils
2571 (name "cpufrequtils")
2578 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2581 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2582 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2583 (build-system gnu-build-system)
2585 `(("sysfsutils" ,sysfsutils-1)))
2587 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2588 (assoc-ref %outputs "out") "/lib"))))
2589 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2590 (synopsis "Utilities to get and set CPU frequency on Linux")
2592 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2593 information, and set the CPU frequency if supported, using the cpufreq
2594 capabilities of the Linux kernel.")
2595 (license license:gpl2)))
2597 (define-public libraw1394
2604 "mirror://kernel.org/linux/libs/ieee1394/"
2605 name "-" version ".tar.xz"))
2608 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2609 (build-system gnu-build-system)
2610 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2611 (synopsis "Interface library for the Linux IEEE1394 drivers")
2613 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2614 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2615 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2616 send to and receive from other nodes without requiring a kernel driver for the
2617 protocol in question.")
2618 (license license:lgpl2.1+)))
2620 (define-public libavc1394
2626 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2627 name "-" version ".tar.gz"))
2630 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2631 (build-system gnu-build-system)
2633 `(("pkg-config" ,pkg-config)))
2635 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2636 (home-page "https://sourceforge.net/projects/libavc1394/")
2637 (synopsis "AV/C protocol library for IEEE 1394")
2639 "Libavc1394 is a programming interface to the AV/C specification from
2640 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2641 (license license:lgpl2.1+)))
2643 (define-public libiec61883
2645 (name "libiec61883")
2650 "mirror://kernel.org/linux/libs/ieee1394/"
2651 name "-" version ".tar.xz"))
2654 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2655 (build-system gnu-build-system)
2657 `(("pkg-config" ,pkg-config)))
2659 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2660 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2661 (synopsis "Isochronous streaming media library for IEEE 1394")
2663 "The libiec61883 library provides a higher level API for streaming DV,
2664 MPEG-2 and audio over Linux IEEE 1394.")
2665 (license license:lgpl2.1+)))
2667 (define-public mdadm
2674 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2678 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2679 (build-system gnu-build-system)
2683 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2687 ;; TODO: tell it where to find 'sendmail'
2688 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2689 (string-append "BINDIR=" out "/sbin")
2690 (string-append "MANDIR=" out "/share/man")
2691 (string-append "UDEVDIR=" out "/lib/udev")))
2692 #:phases (alist-cons-before
2693 'build 'patch-program-paths
2694 (lambda* (#:key inputs #:allow-other-keys)
2695 (let ((coreutils (assoc-ref inputs "coreutils")))
2696 (substitute* "udev-md-raid-arrays.rules"
2697 (("/usr/bin/(readlink|basename)" all program)
2698 (string-append coreutils "/bin/" program)))))
2700 'build 'remove-W-error
2702 ;; We cannot build with -Werror on i686 due to a
2703 ;; 'sign-compare' warning in util.c.
2704 (substitute* "Makefile"
2707 (alist-delete 'configure %standard-phases)))
2708 ;;tests must be done as root
2710 (home-page "http://neil.brown.name/blog/mdadm")
2711 (synopsis "Tool for managing Linux Software RAID arrays")
2713 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2714 assemble, report on, and monitor arrays. It can also move spares between raid
2715 arrays when needed.")
2716 (license license:gpl2+)))
2718 (define-public mdadm-static
2721 (name "mdadm-static")
2723 (substitute-keyword-arguments (package-arguments mdadm)
2724 ((#:make-flags flags)
2725 `(cons "LDFLAGS = -static" ,flags))
2727 `(modify-phases ,phases
2728 (add-after 'install 'remove-cruft
2729 (lambda* (#:key outputs #:allow-other-keys)
2730 (let* ((out (assoc-ref outputs "out"))
2731 (precious? (lambda (file)
2732 (member file '("." ".." "sbin"))))
2733 (directories (scandir out (negate precious?))))
2734 (with-directory-excursion out
2735 (for-each delete-file-recursively directories)
2736 (remove-store-references "sbin/mdadm")
2737 (delete-file "sbin/mdmon")
2739 ((#:modules modules %gnu-build-system-modules)
2740 `((ice-9 ftw) ,@modules))
2741 ((#:strip-flags _ '())
2742 ''("--strip-all")) ;strip a few extra KiB
2743 ((#:allowed-references _ '("out"))
2744 '("out")))) ;refer only self
2745 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2747 (define-public multipath-tools
2749 (name "multipath-tools")
2753 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2754 ".git;a=snapshot;h=" version ";sf=tgz"))
2755 (file-name (string-append name "-" version ".tar.gz"))
2758 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2759 (modules '((guix build utils)))
2762 ;; Drop bundled valgrind headers.
2763 (delete-file-recursively "third-party")
2764 (substitute* '("multipathd/main.c"
2765 "libmultipath/debug.c")
2766 (("#include \"../third-party/")
2769 (build-system gnu-build-system)
2771 '(#:tests? #f ; No tests.
2772 #:make-flags (list (string-append "DESTDIR="
2773 (assoc-ref %outputs "out"))
2775 (string-append "LDFLAGS=-Wl,-rpath="
2776 (assoc-ref %outputs "out")
2779 (modify-phases %standard-phases
2780 (add-after 'unpack 'patch-source
2781 (lambda* (#:key inputs #:allow-other-keys)
2782 (let ((lvm2 (assoc-ref inputs "lvm2"))
2783 (udev (assoc-ref inputs "udev")))
2784 (substitute* "Makefile.inc"
2785 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2786 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2787 (("/usr/include/libdevmapper.h")
2788 (string-append lvm2 "/include/libdevmapper.h"))
2789 (("/usr/include/libudev.h")
2790 (string-append udev "/include/libudev.h")))
2793 (add-before 'build 'set-CC
2799 ("pkg-config" ,pkg-config)
2800 ("valgrind" ,valgrind)))
2802 `(("ceph:lib" ,ceph "lib")
2805 ("liburcu" ,liburcu)
2807 ("readline" ,readline)
2809 (home-page "http://christophe.varoqui.free.fr/")
2810 (synopsis "Access block devices through multiple paths")
2812 "This package provides the following binaries to drive the
2813 Linux Device Mapper multipathing driver:
2815 @item @command{multipath} - Device mapper target autoconfig.
2816 @item @command{multipathd} - Multipath daemon.
2817 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2818 @code{dm} multipath devices.
2819 @item @command{kpartx} - Create device maps from partition tables.
2821 (license (list license:gpl2+ ; Main distribution.
2822 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2824 (define-public libaio
2831 (string-append "mirror://debian/pool/main/liba/libaio/"
2832 name "_" version ".orig.tar.gz")))
2835 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2836 (build-system gnu-build-system)
2839 (list "CC=gcc" (string-append "prefix=" %output))
2840 #:test-target "partcheck" ; need root for a full 'check'
2842 (alist-delete 'configure %standard-phases))) ; no configure script
2843 (home-page "http://lse.sourceforge.net/io/aio.html")
2844 (synopsis "Linux-native asynchronous I/O access library")
2846 "This library enables userspace to use Linux kernel asynchronous I/O
2847 system calls, important for the performance of databases and other advanced
2849 (license license:lgpl2.1+)))
2857 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2858 name "-" version ".tar.xz"))
2861 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2862 (build-system gnu-build-system)
2864 `(("libsndfile" ,libsndfile)))
2866 `(("pkg-config" ,pkg-config)))
2867 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2868 (synopsis "Bluetooth subband audio codec")
2870 "The SBC is a digital audio encoder and decoder used to transfer data to
2871 Bluetooth audio output devices like headphones or loudspeakers.")
2872 (license license:gpl2+)))
2874 (define-public bluez
2881 "mirror://kernel.org/linux/bluetooth/bluez-"
2885 "1sb4aflgyrl7apricjipa8wx95qm69yja0lmn2f19g560c3v1b2c"))))
2886 (build-system gnu-build-system)
2889 (let ((out (assoc-ref %outputs "out")))
2890 (list "--sysconfdir=/etc"
2891 "--localstatedir=/var"
2894 ;; Install dbus/udev files to the correct location.
2895 (string-append "--with-dbusconfdir=" out "/etc")
2896 (string-append "--with-udevdir=" out "/lib/udev")))
2898 (modify-phases %standard-phases
2899 (add-after 'install 'post-install
2900 (lambda* (#:key inputs outputs #:allow-other-keys)
2901 (let* ((out (assoc-ref outputs "out"))
2902 (servicedir (string-append out "/share/dbus-1/services"))
2903 (service "obexd/src/org.bluez.obex.service")
2904 (rule (string-append
2905 out "/lib/udev/rules.d/97-hid2hci.rules")))
2906 ;; Install the obex dbus service file.
2907 (substitute* service
2909 (string-append out "/libexec/bluetooth/obexd")))
2910 (install-file service servicedir)
2911 ;; Fix paths in the udev rule.
2913 (("hid2hci --method")
2914 (string-append out "/lib/udev/hid2hci --method"))
2916 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2919 `(("pkg-config" ,pkg-config)
2920 ("gettext" ,gettext-minimal)))
2925 ("libical" ,libical)
2926 ("readline" ,readline)))
2927 (home-page "http://www.bluez.org/")
2928 (synopsis "Linux Bluetooth protocol stack")
2930 "BlueZ provides support for the core Bluetooth layers and protocols. It
2931 is flexible, efficient and uses a modular implementation.")
2932 (license license:gpl2+)))
2934 (define-public fuse-exfat
2941 "https://github.com/relan/exfat/releases/download/v"
2942 version "/" name "-" version ".tar.gz"))
2945 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
2946 (build-system gnu-build-system)
2948 `(("pkg-config" ,pkg-config)))
2951 (home-page "https://github.com/relan/exfat")
2952 (synopsis "Mount exFAT file systems")
2954 "This package provides a FUSE-based file system that provides read and
2955 write access to exFAT devices.")
2956 (license license:gpl2+)))
2965 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2966 version ".tar.bz2"))
2969 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2970 (build-system gnu-build-system)
2972 '(#:phases (modify-phases %standard-phases
2973 (add-before 'configure 'bootstrap
2975 ;; The tarball was not generated with 'make dist' so we
2976 ;; need to bootstrap things ourselves.
2977 (and (zero? (system* "./autogen.sh"))
2979 (patch-makefile-SHELL "Makefile.include.in")
2982 ;; Make sure programs find libgpm.so.
2983 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2984 (assoc-ref %outputs "out")
2987 `(("texinfo" ,texinfo)
2990 ("autoconf" ,autoconf)
2991 ("automake" ,automake)
2992 ("libtool" ,libtool)))
2993 (home-page "http://www.nico.schottelius.org/software/gpm/")
2994 (synopsis "Mouse support for the Linux console")
2996 "The GPM (general-purpose mouse) daemon is a mouse server for
2997 applications running on the Linux console. It allows users to select items
2998 and copy/paste text in the console and in xterm.")
2999 (license license:gpl2+)))
3001 (define-public btrfs-progs
3003 (name "btrfs-progs")
3007 (uri (string-append "mirror://kernel.org/linux/kernel/"
3008 "people/kdave/btrfs-progs/"
3009 "btrfs-progs-v" version ".tar.xz"))
3012 "03mzv89f08gdsqv4ima793g44kdavcfyjialf5dr0zd2ab66hyp1"))))
3013 (build-system gnu-build-system)
3015 "static")) ; static versions of binaries in "out" (~16MiB!)
3017 '(#:phases (modify-phases %standard-phases
3018 (add-after 'build 'build-static
3019 (lambda _ (zero? (system* "make" "static"))))
3020 (add-after 'install 'install-static
3021 (let ((staticbin (string-append (assoc-ref %outputs "static")
3024 (zero? (system* "make"
3025 (string-append "bindir=" staticbin)
3026 "install-static"))))))
3027 #:test-target "test"
3028 #:parallel-tests? #f)) ; tests fail when run in parallel
3029 (inputs `(("e2fsprogs" ,e2fsprogs)
3030 ("libblkid" ,util-linux)
3031 ("libblkid:static" ,util-linux "static")
3032 ("libuuid" ,util-linux)
3033 ("libuuid:static" ,util-linux "static")
3036 (native-inputs `(("pkg-config" ,pkg-config)
3037 ("asciidoc" ,asciidoc)
3039 ;; For building documentation.
3040 ("libxml2" ,libxml2)
3041 ("docbook-xsl" ,docbook-xsl)
3044 (home-page "https://btrfs.wiki.kernel.org/")
3045 (synopsis "Create and manage btrfs copy-on-write file systems")
3046 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3047 aimed at implementing advanced features while focusing on fault tolerance,
3048 repair and easy administration.")
3049 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3050 ;; GPL2: Everything else.
3051 (license (list license:gpl2 license:gpl2+))))
3053 (define-public btrfs-progs/static
3055 (name "btrfs-progs-static")
3056 (version (package-version btrfs-progs))
3058 (build-system trivial-build-system)
3060 `(("btrfs-progs:static" ,btrfs-progs "static")))
3062 `(#:modules ((guix build utils))
3065 (use-modules (guix build utils)
3069 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3070 (out (assoc-ref %outputs "out"))
3071 (source (string-append btrfs "/bin/btrfs.static"))
3072 (target (string-append out "/bin/btrfs")))
3073 (mkdir-p (dirname target))
3074 (copy-file source target)
3075 (remove-store-references target)
3076 (chmod target #o555)))))
3077 (home-page (package-home-page btrfs-progs))
3078 (synopsis "Statically-linked btrfs command from btrfs-progs")
3079 (description "This package provides the statically-linked @command{btrfs}
3080 from the btrfs-progs package. It is meant to be used in initrds.")
3081 (license (package-license btrfs-progs))))
3083 (define-public freefall
3086 (version (package-version linux-libre))
3087 (source (package-source linux-libre))
3088 (build-system gnu-build-system)
3090 '(#:phases (modify-phases %standard-phases
3091 (add-after 'unpack 'enter-subdirectory
3093 (chdir "tools/laptop/freefall")))
3095 (add-before 'build 'increase-timeout
3097 ;; The default of 2 seconds is too low: it assumes an
3098 ;; open lid and AC power without actually checking.
3099 (substitute* "freefall.c"
3100 (("alarm\\(2\\)") "alarm(5)")))))
3101 #:make-flags (list (string-append "PREFIX="
3102 (assoc-ref %outputs "out")))
3103 #:tests? #f)) ;no tests
3104 (home-page (package-home-page linux-libre))
3105 (synopsis "Free-fall protection for spinning laptop hard drives")
3107 "Prevents shock damage to the internal spinning hard drive(s) of some
3108 HP and Dell laptops. When sudden movement is detected, all input/output
3109 operations on the drive are suspended and its heads are parked on the ramp,
3110 where they are less likely to cause damage to the spinning disc. Requires a
3111 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3112 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3113 (license license:gpl2)))
3115 (define-public thinkfan
3121 (uri (string-append "mirror://sourceforge/thinkfan/"
3122 "/thinkfan-" version ".tar.gz"))
3125 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3126 (modules '((guix build utils)))
3127 ;; Fix erroneous man page location in Makefile leading to
3128 ;; a compilation failure.
3130 '(substitute* "CMakeLists.txt"
3131 (("thinkfan\\.1") "src/thinkfan.1")))))
3132 (build-system cmake-build-system)
3134 `(#:modules ((guix build cmake-build-system)
3137 #:tests? #f ;no test target
3139 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3140 `("-DUSE_ATASMART:BOOL=ON")
3142 (modify-phases %standard-phases
3143 ;; Install scripts for various foreign init systems. Also fix
3144 ;; hard-coded path for daemon.
3145 (add-after 'install 'install-rc-scripts
3146 (lambda* (#:key outputs #:allow-other-keys)
3147 (let ((out (assoc-ref outputs "out"))
3149 (string-append "../thinkfan-" ,version "/rcscripts")
3152 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3153 (string-append out "/sbin/" name)))
3154 (for-each (cute install-file <>
3155 (string-append out "/share/thinkfan"))
3159 `(("libatasmart" ,libatasmart)))
3160 (home-page "http://thinkfan.sourceforge.net/")
3161 (synopsis "Simple fan control program")
3163 "Thinkfan is a simple fan control program. It reads temperatures,
3164 checks them against configured limits and switches to appropriate (also
3165 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3166 other @code{hwmon} driver that enables temperature reading and fan control
3168 (license license:gpl3+)))
3170 (define-public ntfs-3g
3173 (version "2016.2.22")
3176 (uri (string-append "https://tuxera.com/opensource/"
3177 "ntfs-3g_ntfsprogs-" version ".tgz"))
3180 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3181 (modules '((guix build utils)))
3182 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
3184 ;; Install under $prefix.
3185 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3188 (build-system gnu-build-system)
3189 (inputs `(("util-linux" ,util-linux)
3190 ("fuse" ,fuse))) ;libuuid
3191 (native-inputs `(("pkg-config" ,pkg-config)))
3193 '(#:configure-flags (list "--exec-prefix=${prefix}"
3194 "--with-fuse=external" ;use our own FUSE
3195 "--enable-mount-helper"
3196 "--enable-posix-acls"
3197 "--enable-xattr-mappings")))
3198 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3199 (synopsis "Read-write access to NTFS file systems")
3201 "NTFS-3G provides read-write access to NTFS file systems, which are
3202 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3203 The package provides additional NTFS tools.")
3204 (license license:gpl2+)))
3206 (define-public rdma-core
3212 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3213 "/releases/download/v" version "/rdma-core-"
3217 "15qdfqkia22vab1dh41s88vgi70yifi40ar5s4x7a456rpbhy8z5"))))
3218 (build-system cmake-build-system)
3220 '(#:tests? #f ; no tests
3221 ;; Upstream uses the "ninja" build system and encourage distros
3222 ;; to do the same for consistency. They also recommend using the
3223 ;; "Release" build type.
3224 #:configure-flags (list "-GNinja"
3225 ;; Defaults to "lib64" on 64-bit archs.
3226 (string-append "-DCMAKE_INSTALL_LIBDIR="
3227 (assoc-ref %outputs "out") "/lib")
3228 "-DCMAKE_BUILD_TYPE=Release")
3230 (modify-phases %standard-phases
3233 (zero? (system* "ninja"
3234 "-j" (number->string (parallel-job-count))))))
3237 (zero? (system* "ninja" "install")))))))
3240 ("pkg-config" ,pkg-config)
3241 ("python" ,python-wrapper)))
3245 (home-page "https://github.com/linux-rdma/rdma-core")
3246 (synopsis "Utilities and libraries for working with RDMA devices")
3248 "This package provides userspace components for the InfiniBand
3249 subsystem of the Linux kernel. Specifically it contains userspace
3250 libraries for the following device nodes:
3253 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3254 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3255 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3258 The following service daemons are also provided:
3260 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3261 @item @code{iwpmd} (for iWARP kernel providers)
3262 @item @code{ibacm} (for InfiniBand communication management assistant)
3264 ;; All library code is dual licensed under GPL2 and a custom MIT
3265 ;; variant. The package also includes some components covered by
3266 ;; other licenses. Consult COPYING.md for full details.
3269 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3270 license:bsd-2 ; Files referring to COPYING.BSD_FB
3271 license:cc0 ; most files in ccan/
3272 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3274 (define-public rng-tools
3281 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3282 "rng-tools-" version ".tar.gz"))
3285 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3286 (build-system gnu-build-system)
3287 (synopsis "Random number generator daemon")
3289 "Monitor a hardware random number generator, and supply entropy
3290 from that to the system kernel's @file{/dev/random} machinery.")
3291 (home-page "https://sourceforge.net/projects/gkernel")
3292 ;; The source package is offered under the GPL2+, but the files
3293 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3294 (license (list license:gpl2 license:gpl2+))))
3296 (define-public cpupower
3299 (version (package-version linux-libre))
3300 (source (package-source linux-libre))
3301 (build-system gnu-build-system)
3303 '(#:phases (modify-phases %standard-phases
3304 (add-after 'unpack 'enter-subdirectory
3306 (chdir "tools/power/cpupower")))
3308 (add-before 'build 'fix-makefiles
3310 (substitute* "Makefile"
3312 (("/bin/(install|pwd)" _ command) command))
3313 (substitute* "bench/Makefile"
3314 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3315 #:make-flags (let ((out (assoc-ref %outputs "out")))
3316 (list (string-append "DESTDIR=" out)
3317 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3318 "docdir=/share/doc/cpupower"
3319 "confdir=$(docdir)/examples"
3320 ;; The Makefile recommends the following changes
3322 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3323 #:tests? #f)) ;no tests
3324 (native-inputs `(("gettext" ,gettext-minimal)))
3325 (inputs `(("pciutils" ,pciutils)))
3326 (home-page (package-home-page linux-libre))
3327 (synopsis "CPU frequency and voltage scaling tools for Linux")
3329 "cpupower is a set of user-space tools that use the cpufreq feature of the
3330 Linux kernel to retrieve and control processor features related to power saving,
3331 such as frequency and voltage scaling.")
3332 (license license:gpl2)))
3334 (define-public haveged
3341 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3345 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3346 (build-system gnu-build-system)
3347 (home-page "http://www.issihosts.com/haveged")
3348 (synopsis "Entropy source for the Linux random number generator")
3350 "haveged generates an unpredictable stream of random numbers for use by
3351 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3352 standard mechanisms for filling the entropy pool may not be sufficient for
3353 systems with high needs or limited user interaction, such as headless servers.
3354 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3355 indirect effects of hardware events on hidden processor state using the HArdware
3356 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3357 its environment and provides the same built-in test suite for the output stream
3358 as used on certified hardware security devices.")
3359 (license (list (license:non-copyleft "file://nist/mconf.h")
3360 (license:non-copyleft "file://nist/packtest.c")
3361 license:public-domain ; nist/dfft.c
3362 license:gpl3+)))) ; everything else
3364 (define-public ecryptfs-utils
3366 (name "ecryptfs-utils")
3371 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3372 version "/+download/ecryptfs-utils_"
3373 version ".orig.tar.gz"))
3376 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3377 (build-system gnu-build-system)
3379 `(#:configure-flags (list "--disable-pywrap")))
3381 `(("intltool" ,intltool)
3382 ("perl" ,perl) ; for pod2man
3383 ("pkg-config" ,pkg-config)))
3385 `(("keyutils" ,keyutils)
3386 ("linux-pam" ,linux-pam)
3388 (home-page "http://ecryptfs.org/")
3389 (synopsis "eCryptfs cryptographic file system utilities")
3391 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3392 Each file's cryptographic meta-data is stored inside the file itself, along
3393 with the encrypted contents. This allows individual encrypted files to be
3394 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3395 native Linux file system, and has been part of the Linux kernel since version
3396 2.6.19. This package contains the userland utilities to manage it.")
3397 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3398 ;; grant additional permission to link with OpenSSL.
3399 (license license:gpl2+)))
3401 (define-public libnfsidmap
3403 (name "libnfsidmap")
3408 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3409 name "/" name "-" version ".tar.gz"))
3412 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3413 (build-system gnu-build-system)
3415 `(#:configure-flags (list
3416 (string-append "--with-pluginpath="
3417 (assoc-ref %outputs "out")
3418 "/lib/libnfsidmap"))))
3420 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3422 "NFSv4 support library for name/ID mapping")
3423 (description "Libnfsidmap is a library holding mulitiple methods of
3424 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3425 extensible array of mapping functions, currently consisting of two choices:
3426 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3427 (license (license:non-copyleft "file://COPYING"
3428 "See COPYING in the distribution."))))
3430 (define-public module-init-tools
3432 (name "module-init-tools")
3437 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3438 "module-init-tools-" version ".tar.bz2"))
3441 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3442 (patches (search-patches "module-init-tools-moduledir.patch"))))
3443 (build-system gnu-build-system)
3445 ;; FIXME: The upstream tarball lacks man pages, and building them would
3446 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3447 ;; but they vanished. In the meantime, fake it.
3448 '(#:phases (alist-cons-before
3449 'configure 'fake-docbook
3451 (substitute* "Makefile.in"
3452 (("^DOCBOOKTOMAN.*$")
3453 "DOCBOOKTOMAN = true\n")))
3455 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3456 (synopsis "Tools for loading and managing Linux kernel modules")
3458 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3459 `insmod', `lsmod', and more.")
3460 (license license:gpl2+)))
3462 (define-public mcelog
3468 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3469 "mcelog.git/snapshot/v" version ".tar.gz"))
3472 "0q40d60p1klzg0aznvxhxgjlddwcxfj2q59s4q86sf9ild6rcdhl"))
3473 (file-name (string-append name "-" version ".tar.gz"))
3474 (modules '((guix build utils)))
3476 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3477 `(substitute* "Makefile"
3478 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3479 (build-system gnu-build-system)
3481 `(#:phases (modify-phases %standard-phases
3482 (delete 'configure)) ; no configure script
3483 #:make-flags (let ((out (assoc-ref %outputs "out")))
3485 (string-append "prefix=" out)
3486 (string-append "DOCDIR=" out "/share/doc/mcelog")
3487 "etcprefix=$(DOCDIR)/examples"))
3488 ;; The tests will only run as root on certain supported CPU models.
3490 (supported-systems (list "i686-linux" "x86_64-linux"))
3491 (home-page "http://mcelog.org/")
3492 (synopsis "Machine check monitor for x86 Linux systems")
3494 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3495 and other hardware errors on x86 systems. It can also perform user-defined
3496 tasks, such as bringing bad pages off-line, when configurable error thresholds
3498 (license license:gpl2)))
3500 (define-public mtd-utils
3507 "ftp://ftp.infradead.org/pub/mtd-utils/"
3508 "mtd-utils-" version ".tar.bz2"))
3511 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3514 ("libuuid" ,util-linux)
3517 (build-system gnu-build-system)
3519 `(#:test-target "tests"
3520 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3521 #:phases (modify-phases %standard-phases
3522 (delete 'configure))))
3523 (synopsis "MTD Flash Storage Utilities")
3524 (description "This package provides utilities for testing, partitioning, etc
3526 (home-page "http://www.linux-mtd.infradead.org/")
3528 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3529 license:mpl1.1 ; All ftl* files
3530 license:expat)))) ; libiniparser
3532 (define-public libseccomp
3538 (uri (string-append "https://github.com/seccomp/libseccomp/"
3539 "releases/download/v" version
3540 "/libseccomp-" version ".tar.gz"))
3543 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3544 (build-system gnu-build-system)
3546 `(("which" ,which)))
3547 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3548 (description "The libseccomp library provides an easy to use, platform
3549 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3550 libseccomp API is designed to abstract away the underlying BPF based syscall
3551 filter language and present a more conventional function-call based filtering
3552 interface that should be familiar to, and easily adopted by, application
3554 (home-page "https://github.com/seccomp/libseccomp")
3555 (license license:lgpl2.1)))
3557 (define-public radeontop
3561 (home-page "https://github.com/clbr/radeontop/")
3564 (uri (string-append home-page "archive/v" version ".tar.gz"))
3565 (file-name (string-append name "-" version ".tar.gz"))
3568 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3569 (build-system gnu-build-system)
3571 `(#:phases (modify-phases %standard-phases
3572 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3573 ;; dependency, and doesn't even work on release(!) tarballs.
3574 (add-after 'unpack 'report-correct-version
3575 (lambda _ (substitute* "getver.sh"
3577 (string-append "ver=" ,version)))))
3578 (delete 'configure)) ; no configure script
3579 #:make-flags (list "CC=gcc"
3580 (string-append "PREFIX=" %output))
3581 #:tests? #f)) ; no tests
3583 `(("gettext" ,gettext-minimal)
3584 ("pkg-config" ,pkg-config)))
3586 `(("libdrm" ,libdrm)
3587 ("libpciaccess" ,libpciaccess)
3589 ("ncurses" ,ncurses)))
3590 (synopsis "Usage monitor for AMD Radeon graphics")
3591 (description "RadeonTop monitors resource consumption on supported AMD
3592 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3593 a terminal or saved to a file for further processing. It measures both the
3594 activity of the GPU as a whole, which is also accurate during OpenCL
3595 computations, as well as separate component statistics that are only meaningful
3596 under OpenGL graphics workloads.")
3597 (license license:gpl3)))
3599 (define-public efivar
3605 (uri (string-append "https://github.com/rhinstaller/" name
3606 "/releases/download/" version "/" name
3607 "-" version ".tar.bz2"))
3610 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3611 (build-system gnu-build-system)
3613 `(;; Tests require a UEFI system and is not detected in the chroot.
3615 #:make-flags (list (string-append "prefix=" %output)
3616 (string-append "libdir=" %output "/lib")
3617 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3619 (modify-phases %standard-phases
3620 (delete 'configure))))
3622 `(("pkg-config" ,pkg-config)))
3625 (home-page "https://github.com/rhinstaller/efivar")
3626 (synopsis "Tool and library to manipulate EFI variables")
3627 (description "This package provides a library and a command line
3628 interface to the variable facility of UEFI boot firmware.")
3629 (license license:lgpl2.1+)))
3631 (define-public efibootmgr
3637 (uri (string-append "https://github.com/rhinstaller/" name
3638 "/releases/download/" version "/" name
3639 "-" version ".tar.bz2"))
3642 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3643 (build-system gnu-build-system)
3645 `(#:tests? #f ; No tests.
3646 #:make-flags (list (string-append "prefix=" %output)
3647 (string-append "libdir=" %output "/lib")
3648 ;; Override CFLAGS to add efivar include directory.
3649 (string-append "CFLAGS=-O2 -g -flto -I"
3650 (assoc-ref %build-inputs "efivar")
3653 (modify-phases %standard-phases
3654 (add-after 'unpack 'branding
3655 ;; Replace default loader path with something more familiar.
3657 (substitute* "src/efibootmgr.c"
3658 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3661 (delete 'configure))))
3663 `(("pkg-config" ,pkg-config)))
3665 `(("efivar" ,efivar)
3667 (home-page "https://github.com/rhinstaller/efibootmgr")
3668 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3670 "@code{efibootmgr} is a user-space application to modify the Intel
3671 Extensible Firmware Interface (EFI) Boot Manager. This application can
3672 create and destroy boot entries, change the boot order, change the next
3673 running boot option, and more.")
3674 (license license:gpl2+)))
3676 (define-public sysstat
3682 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3683 "sysstat-" version ".tar.xz"))
3686 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3687 (build-system gnu-build-system)
3689 `(#:tests? #f ; No test suite.
3690 ;; Without this flag, it tries to install the man pages with group 'root'
3691 ;; and fails because /etc/passwd lacks an entry for the root user.
3693 (list "--disable-file-attr"
3694 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3696 (modify-phases %standard-phases
3697 ;; The build process tries to create '/var/lib/sa', so we skip that
3699 (add-after 'build 'skip-touching-var
3701 (substitute* "Makefile"
3702 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3705 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3706 (synopsis "Performance monitoring tools for Linux")
3707 (description "The sysstat utilities are a collection of performance
3708 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3709 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3710 @code{sadf} and @code{sa}.")
3711 (license license:gpl2+)))
3713 (define-public light
3719 (uri (string-append "https://github.com/haikarainen/" name
3720 "/archive/v" version ".tar.gz"))
3723 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3724 (file-name (string-append name "-" version ".tar.gz"))))
3725 (build-system gnu-build-system)
3727 '(#:tests? #f ; no tests
3728 #:make-flags (list "CC=gcc"
3729 (string-append "PREFIX=" %output))
3731 (modify-phases %standard-phases
3733 (add-after 'unpack 'patch-makefile
3735 (substitute* "Makefile" (("chown") "#")))))))
3737 `(("help2man" ,help2man)))
3738 (home-page "https://haikarainen.github.io/light")
3739 (synopsis "GNU/Linux application to control backlights")
3741 "Light is a program to send commands to screen backlight controllers
3742 under GNU/Linux. Features include:
3745 @item It does not rely on X.
3746 @item Light can automatically figure out the best controller to use, making
3747 full use of underlying hardware.
3748 @item It is possible to set a minimum brightness value, as some controllers
3749 set the screen to be pitch black at a vaĺue of 0 (or higher).
3752 Light is the successor of lightscript.")
3753 (license license:gpl3+)))
3762 "https://github.com/linrunner/"
3763 (string-upcase name)
3764 "/archive/" version ".tar.gz"))
3765 (file-name (string-append name "-" version ".tar.gz"))
3768 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3769 (inputs `(("bash" ,bash)
3771 ("ethtool" ,ethtool)
3775 ("inetutils" ,inetutils)
3778 ("pciutils" ,pciutils)
3782 ("usbutils" ,usbutils)
3783 ("util-linux" ,util-linux)
3784 ("wireless-tools" ,wireless-tools)))
3785 (build-system gnu-build-system)
3788 (modify-phases %standard-phases
3789 (delete 'configure) ; no configure script
3790 (add-before 'build 'setenv
3791 (lambda* (#:key outputs #:allow-other-keys)
3792 (let ((out (assoc-ref outputs "out")))
3793 (setenv "TLP_WITH_SYSTEMD" "0")
3794 (setenv "TLP_NO_INIT" "1")
3795 (setenv "TLP_NO_PMUTILS" "1")
3796 (setenv "TLP_SBIN" (string-append out "/bin"))
3797 (setenv "TLP_BIN" (string-append out "/bin"))
3798 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3799 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3800 (setenv "TLP_CONF" "/etc/tlp")
3802 (string-append out "/share/bash-completion/completions"))
3803 (setenv "TLP_MAN" (string-append out "/share/man")))))
3804 (delete 'check) ; no tests
3805 (add-before 'install 'fix-installation
3807 ;; Stop the Makefile from trying to create system directories.
3808 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
3811 (zero? (system* "make" "install-tlp" "install-man"))))
3812 (add-after 'install 'wrap
3813 (lambda* (#:key inputs outputs #:allow-other-keys)
3814 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3815 (bin-files (find-files bin ".*")))
3816 (define (bin-directory input-name)
3817 (string-append (assoc-ref inputs input-name) "/bin"))
3818 (define (sbin-directory input-name)
3819 (string-append (assoc-ref inputs input-name) "/sbin"))
3820 (for-each (lambda (program)
3821 (wrap-program program
3824 (map bin-directory '("bash"
3835 (map sbin-directory '("ethtool"
3840 "wireless-tools"))))))
3842 (home-page "http://linrunner.de/en/tlp/tlp.html")
3843 (synopsis "Power management tool for Linux")
3844 (description "TLP is a power management tool for Linux. It comes with
3845 a default configuration already optimized for battery life. Nevertheless,
3846 TLP is customizable to fulfil system requirements. TLP settings are applied
3847 every time the power supply source is changed.")
3849 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3851 (license (list license:gpl2+ license:gpl3+))))
3859 (uri (string-append "https://www.ezix.org/software/"
3860 "files/lshw-" version
3864 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3865 (build-system gnu-build-system)
3867 `(#:phases (modify-phases %standard-phases (delete 'configure))
3868 #:tests? #f ; no tests
3870 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3871 (synopsis "List hardware information")
3873 "@command{lshw} (Hardware Lister) is a small tool to provide
3874 detailed information on the hardware configuration of the machine.
3875 It can report exact memory configuration, firmware version, mainboard
3876 configuration, CPU version and speed, cache configuration, bus speed,
3877 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3878 machines (PowerMac G4 is known to work).")
3879 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3880 (license license:gpl2+)))
3882 (define-public libmnl
3889 (uri (string-append "mirror://netfilter.org/libmnl/"
3890 "libmnl-" version ".tar.bz2"))
3893 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
3894 (build-system gnu-build-system)
3895 (home-page "https://www.netfilter.org/projects/libmnl/")
3896 (synopsis "Netlink utility library")
3897 (description "Libmnl is a minimalistic user-space library oriented to
3898 Netlink developers. There are a lot of common tasks in parsing, validating,
3899 constructing of both the Netlink header and TLVs that are repetitive and easy to
3900 get wrong. This library aims to provide simple helpers that allows you to
3901 re-use code and to avoid re-inventing the wheel.")
3902 (license license:lgpl2.1+)))
3904 (define-public libnftnl
3911 (uri (string-append "mirror://netfilter.org/libnftnl/"
3912 "libnftnl-" version ".tar.bz2"))
3915 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
3916 (build-system gnu-build-system)
3918 `(("pkg-config" ,pkg-config)))
3920 `(("libmnl" ,libmnl)))
3921 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
3922 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
3923 (description "Libnftnl is a userspace library providing a low-level netlink
3924 programming interface to the in-kernel nf_tables subsystem. The library
3925 libnftnl has been previously known as libnftables. This library is currently
3927 (license license:gpl2+)))
3929 (define-public nftables
3936 (uri (string-append "http://www.nftables.org/projects/nftables"
3937 "/files/nftables-" version ".tar.bz2"))
3940 "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy"))))
3941 (build-system gnu-build-system)
3942 (inputs `(("bison", bison)
3946 ("libnftnl", libnftnl)
3947 ("readline", readline)))
3948 (native-inputs `(("pkg-config", pkg-config)))
3949 (home-page "http://www.nftables.org")
3950 (synopsis "Userspace utility for Linux packet filtering")
3951 (description "nftables is the project that aims to replace the existing
3952 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
3953 filtering framework, a new userspace utility and also a compatibility layer for
3954 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
3955 infrastructure such as the existing hooks, the connection tracking system, the
3956 userspace queueing component and the logging subsystem.")
3957 (license license:gpl2)))
3959 (define-public proot
3963 (home-page "https://github.com/proot-me/PRoot")
3966 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3967 (file-name (string-append name "-" version ".tar.gz"))
3970 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
3971 (patches (search-patches "proot-test-fhs.patch"))))
3972 (build-system gnu-build-system)
3974 '(#:make-flags '("-C" "src")
3976 #:phases (modify-phases %standard-phases
3978 (add-before 'build 'set-shell-file-name
3979 (lambda* (#:key inputs #:allow-other-keys)
3980 (substitute* (find-files "src" "\\.[ch]$")
3983 (assoc-ref inputs "bash")
3986 (add-before 'check 'fix-fhs-assumptions-in-tests
3988 (substitute* "tests/test-c6b77b77.mk"
3989 (("/bin/bash") (which "bash"))
3990 (("/usr/bin/test") (which "test")))
3991 (substitute* '("tests/test-16573e73.c")
3992 (("/bin/([a-z-]+)" _ program)
3995 (substitute* (find-files "tests" "\\.sh$")
3996 ;; Some of the tests try to "bind-mount" /bin/true.
3998 (string-append "-b " (which "true") ":"))
3999 ;; Likewise for /bin.
4000 (("-b /bin:") "-b /gnu:")
4001 ;; Others try to run /bin/sh.
4002 (("/bin/sh") (which "sh"))
4003 ;; Others assume /etc/fstab exists.
4004 (("/etc/fstab") "/etc/passwd"))
4006 (substitute* "tests/GNUmakefile"
4007 (("-b /bin:") "-b /gnu:"))
4009 ;; XXX: This test fails in an obscure corner case, just
4011 (delete-file "tests/test-kkkkkkkk.c")
4016 (let ((n (parallel-job-count)))
4017 ;; For some reason we get lots of segfaults with
4018 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4019 (setenv "PROOT_NO_SECCOMP" "1")
4021 ;; Most of the tests expect "/bin" to be in $PATH so
4022 ;; they can run things that live in $ROOTFS/bin.
4024 (string-append (getenv "PATH") ":/bin"))
4026 (zero? (system* "make" "check" "-C" "tests"
4028 "-j" (number->string n))))))
4030 (lambda* (#:key outputs #:allow-other-keys)
4031 ;; The 'install' rule does nearly nothing.
4032 (let ((out (assoc-ref outputs "out")))
4034 ;; TODO: 'make install-care' (does not even
4035 ;; build currently.)
4036 (system* "make" "-C" "src" "install"
4037 (string-append "PREFIX=" out)))
4038 (let ((man1 (string-append out
4039 "/share/man/man1")))
4041 (copy-file "doc/proot/man.1"
4042 (string-append man1 "/proot.1"))
4044 (native-inputs `(("which" ,which)
4046 ;; For 'mcookie', used by some of the tests.
4047 ("util-linux" ,util-linux)))
4048 (inputs `(("talloc" ,talloc)))
4049 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4051 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4052 and @code{binfmt_misc}. This means that users don't need any privileges or
4053 setup to do things like using an arbitrary directory as the new root
4054 filesystem, making files accessible somewhere else in the file system
4055 hierarchy, or executing programs built for another CPU architecture
4056 transparently through QEMU user-mode. Also, developers can use PRoot as a
4057 generic process instrumentation engine thanks to its extension mechanism.
4058 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4059 available in the kernel Linux.")
4060 (license license:gpl2+)))
4062 (define-public proot-static
4065 (name "proot-static")
4067 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4068 (inputs `(("talloc" ,talloc/static)))
4070 (substitute-keyword-arguments (package-arguments proot)
4071 ((#:make-flags flags)
4072 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4074 `(modify-phases ,phases
4075 (add-after 'strip 'remove-store-references
4076 (lambda* (#:key outputs #:allow-other-keys)
4077 (let* ((out (assoc-ref outputs "out")))
4078 (with-directory-excursion out
4079 (remove-store-references "bin/proot")
4081 ((#:allowed-references _ '("out"))
4084 (define-public cpuid
4087 (version "20170122")
4090 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4091 version ".src.tar.gz"))
4094 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4095 (build-system gnu-build-system)
4097 '(#:make-flags '("CC=gcc")
4098 #:tests? #f ; no tests
4099 #:phases (modify-phases %standard-phases
4101 (add-before 'install 'fix-makefile
4102 (lambda* (#:key outputs #:allow-other-keys)
4103 (substitute* "Makefile"
4104 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4105 ;; Make the compressed manpages writable so that the
4106 ;; reset-gzip-timestamps phase does not error out.
4107 (substitute* "Makefile"
4108 (("-m 444") "-m 644"))
4110 (inputs `(("perl" ,perl)))
4111 (supported-systems '("i686-linux" "x86_64-linux"))
4112 (home-page "http://www.etallen.com/cpuid.html")
4113 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4114 (description "cpuid dumps detailed information about the CPU(s) gathered
4115 from the CPUID instruction, and also determines the exact model of CPU(s). It
4116 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4117 NexGen, Rise, and SiS CPUs.")
4118 (license license:gpl2+)))
4120 (define-public jmtpfs
4127 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4129 (file-name (string-append name "-" version ".tar.gz"))
4132 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4133 (build-system gnu-build-system)
4137 ("libmtp" ,libmtp)))
4139 `(("pkg-config" ,pkg-config)))
4140 (home-page "https://github.com/JasonFerrara/jmtpfs")
4141 (synopsis "Use a FUSE filesystem to access data over MTP")
4142 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4143 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4144 the MTP device as a filesystem.")
4145 (license license:gpl3)))
4147 (define-public procenv
4154 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4156 (file-name (string-append name "-" version ".tar.gz"))
4158 (base32 "0brzf6185hb76imw107cl21c8lzwiywkxi3jknihrk86bvvicd0d"))))
4159 (build-system gnu-build-system)
4160 (arguments `(#:configure-flags '("--disable-silent-rules")))
4161 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4162 ("groff" ,groff) ; for tests
4163 ("libselinux" ,libselinux)))
4164 (synopsis "Utility to show process environment")
4165 (description "Procenv is a command-line tool that displays as much detail about
4166 itself and its environment as possible. It can be used as a test
4167 tool, to understand the type of environment a process runs in, and for
4168 comparing system environments.")
4169 (home-page "http://github.com/jamesodhunt/procenv/")
4170 (license license:gpl3+)))