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.12.1")
367 (define %linux-libre-hash "1pgp48hf4zziv3nvzm54zvalh9y7kh5a7prrsw2n1qal9h1yslsp")
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.37"
377 "0jrpzv5a8j8qjhh1x1wldyzbjms8p48nk5w6b4gib67fl7vx3135"
378 %intel-compatible-systems
379 #:configuration-file kernel-config))
381 (define-public linux-libre-4.4
382 (make-linux-libre "4.4.76"
383 "1qzgjqj7zv8hk162viyjy4cn24snwy159j8vir6d5jsrkvwq5wrk"
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")
435 ;; XXX: <rpc/rpc.h> is missing from glibc when
436 ;; cross-compiling, so we have to disable NIS
437 ;; support altogether.
438 ,@(if (%current-target-system)
442 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
445 (home-page "http://www.linux-pam.org/")
446 (synopsis "Pluggable authentication modules for Linux")
448 "A *Free* project to implement OSF's RFC 86.0.
449 Pluggable authentication modules are small shared object files that can
450 be used through the PAM API to perform tasks, like authenticating a user
451 at login. Local and dynamic reconfiguration are its key features.")
452 (license license:bsd-3)))
454 (define-public linux-pam-1.2
462 "http://www.linux-pam.org/library/"
463 "Linux-PAM-" version ".tar.bz2"))
466 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
467 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
474 (define-public psmisc
481 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
485 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
486 (build-system gnu-build-system)
487 (inputs `(("ncurses" ,ncurses)))
488 (home-page "https://gitlab.com/psmisc/psmisc")
490 "Small utilities that use the proc file system")
492 "This PSmisc package is a set of some small useful utilities that
493 use the proc file system. We're not about changing the world, but
494 providing the system administrator with some help in common tasks.")
495 (license license:gpl2+)))
497 (define-public util-linux
503 (uri (string-append "mirror://kernel.org/linux/utils/"
504 name "/v" (version-major+minor version) "/"
505 name "-" version ".tar.xz"))
508 "1qz81w8vzrmy8xn9yx7ls4amkbgwx6vr62pl6kv9g7r0g3ba9kmc"))
509 (patches (search-patches "util-linux-tests.patch"))
510 (modules '((guix build utils)))
512 ;; We take the 'logger' program from GNU Inetutils and 'kill'
513 ;; from GNU Coreutils.
515 (substitute* "configure"
516 (("build_logger=yes") "build_logger=no")
517 (("build_kill=yes") "build_kill=no"))
519 (build-system gnu-build-system)
521 "static")) ; >2 MiB of static .a libraries
523 `(#:configure-flags (list "--disable-use-tty-group"
524 "--enable-fs-paths-default=/run/current-system/profile/sbin"
525 ;; Install completions where our
526 ;; bash-completion package expects them.
527 (string-append "--with-bashcompletiondir="
528 (assoc-ref %outputs "out")
529 "/etc/bash_completion.d"))
530 #:phases (modify-phases %standard-phases
532 'build 'set-umount-file-name
533 (lambda* (#:key outputs #:allow-other-keys)
534 ;; Tell 'eject' the right file name of 'umount'.
535 (let ((out (assoc-ref outputs "out")))
536 (substitute* "sys-utils/eject.c"
538 (string-append "\"" out "/bin/umount\"")))
542 (lambda* (#:key inputs outputs #:allow-other-keys)
543 (let ((out (assoc-ref outputs "out"))
544 (net (assoc-ref inputs "net-base")))
545 ;; Change the test to refer to the right file.
546 (substitute* "tests/ts/misc/mcookie"
548 (string-append net "/etc/services")))
551 'install 'move-static-libraries
552 (lambda* (#:key outputs #:allow-other-keys)
553 (let ((out (assoc-ref outputs "out"))
554 (static (assoc-ref outputs "static")))
555 (mkdir-p (string-append static "/lib"))
556 (with-directory-excursion out
557 (for-each (lambda (file)
559 (string-append static "/"
561 (find-files "lib" "\\.a$")))
563 (inputs `(("zlib" ,zlib)
566 ;; XXX: This is so that the 'pre-check' phase can find it.
567 ,@(if (%current-target-system)
568 `(("net-base" ,net-base))
572 ("net-base" ,net-base))) ;for tests
573 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
574 (synopsis "Collection of utilities for the Linux kernel")
575 (description "Util-linux is a diverse collection of Linux kernel
576 utilities. It provides dmesg and includes tools for working with file systems,
577 block devices, UUIDs, TTYs, and many other tools.")
579 ;; Note that util-linux doesn't use the same license for all the
580 ;; code. GPLv2+ is the default license for a code without an
581 ;; explicitly defined license.
582 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
583 license:bsd-4 license:public-domain))))
591 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
593 (file-name (string-append name "-" version ".tar.gz"))
595 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
596 (build-system cmake-build-system)
597 (arguments '(#:tests? #f))
598 (home-page "https://github.com/bo0ts/ddate")
599 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
601 "ddate displays the Discordian date and holidays of a given date.
602 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
603 by Robert Shea and Robert Anton Wilson.")
604 (license license:public-domain)))
606 (define-public procps
612 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
613 "procps-ng-" version ".tar.xz"))
616 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
617 (build-system gnu-build-system)
619 '(#:modules ((guix build utils)
620 (guix build gnu-build-system)
624 (modify-phases %standard-phases
625 (add-before 'check 'disable-strtod-test
627 ;; Disable the 'strtod' test, which fails on 32-bit systems.
628 ;; This is what upstream does:
629 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
630 (substitute* "Makefile"
631 (("^(TESTS|check_PROGRAMS) = .*$" all)
632 (string-append "# " all "\n")))
635 'install 'post-install
636 ;; Remove commands and man pages redudant with
638 (lambda* (#:key outputs #:allow-other-keys)
639 (let* ((out (assoc-ref outputs "out"))
640 (dup (append-map (cut find-files out <>)
641 '("^kill" "^uptime"))))
642 (for-each delete-file dup)
644 (inputs `(("ncurses" ,ncurses)))
645 (home-page "https://gitlab.com/procps-ng/procps/")
646 (synopsis "Utilities that give information about processes")
648 "Procps is the package that has a bunch of small useful utilities
649 that give information about processes using the Linux /proc file system.
650 The package includes the programs ps, top, vmstat, w, kill, free,
651 slabtop, and skill.")
652 (license license:gpl2)))
654 (define-public usbutils
661 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
662 "usbutils-" version ".tar.xz"))
665 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
666 (build-system gnu-build-system)
669 ("eudev" ,eudev-with-hwdb)))
671 `(("pkg-config" ,pkg-config)))
672 (home-page "http://www.linux-usb.org/")
674 "Tools for working with USB devices, such as lsusb")
676 "Tools for working with USB devices, such as lsusb.")
677 (license license:gpl2+)))
679 (define-public e2fsprogs
686 "mirror://kernel.org/linux/kernel/people/tytso/"
687 name "/v" version "/"
688 name "-" version ".tar.xz"))
691 "092absr4vrlqrkdf9nwh4ykj40ab6hhwrkdr6sjsccd54c8z5csl"))))
692 (build-system gnu-build-system)
693 (inputs `(("util-linux" ,util-linux)))
694 (native-inputs `(("pkg-config" ,pkg-config)
695 ("texinfo" ,texinfo) ;for the libext2fs Info manual
701 '(;; util-linux is the preferred source for some of the libraries and
702 ;; commands, so disable them (see, e.g.,
703 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
704 #:configure-flags (list "--disable-libblkid"
705 "--disable-libuuid" "--disable-uuidd"
708 ;; Use symlinks instead of hard links for
709 ;; 'fsck.extN' etc. This makes the resulting nar
710 ;; smaller and is preserved across copies.
711 "--enable-symlink-install"
713 (string-append "LDFLAGS=-Wl,-rpath="
714 (assoc-ref %outputs "out")
717 ;; Install libext2fs et al.
718 "--enable-elf-shlibs")
721 (modify-phases %standard-phases
722 (add-before 'configure 'patch-shells
724 (substitute* "configure"
725 (("/bin/sh (.*)parse-types.sh" _ dir)
726 (string-append (which "sh") " " dir
728 (substitute* "MCONFIG.in"
729 (("INSTALL_SYMLINK = /bin/sh")
730 "INSTALL_SYMLINK = sh"))
731 (substitute* (find-files "." "^Makefile.in$")
733 (string-append "#!" (which "sh"))))
735 (add-after 'install 'install-libs
736 (lambda* (#:key outputs #:allow-other-keys)
737 (let* ((out (assoc-ref outputs "out"))
738 (lib (string-append out "/lib")))
739 (and (zero? (system* "make" "install-libs"))
741 ;; Make the .a writable so that 'strip' works.
742 ;; Failing to do that, due to debug symbols, we
743 ;; retain a reference to the final
744 ;; linux-libre-headers, which refer to the
745 ;; bootstrap binaries.
746 (let ((archives (find-files lib "\\.a$")))
747 (for-each (lambda (file)
751 (home-page "http://e2fsprogs.sourceforge.net/")
752 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
754 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
755 (license (list license:gpl2 ;programs
756 license:lgpl2.0 ;libext2fs
757 license:x11)))) ;libuuid
759 (define e2fsprogs/static
761 (package (inherit e2fsprogs)
763 ;; Do not build shared libraries.
764 (substitute-keyword-arguments (package-arguments e2fsprogs)
765 ((#:configure-flags _)
766 '(list "--disable-blkid"))
770 (define-public e2fsck/static
772 (name "e2fsck-static")
773 (version (package-version e2fsprogs))
774 (build-system trivial-build-system)
777 `(("e2fsprogs" ,e2fsprogs/static)))
779 `(#:modules ((guix build utils))
782 (use-modules (guix build utils)
786 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
788 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
790 (with-directory-excursion bin
791 (copy-file e2fsck "e2fsck")
792 (remove-store-references "e2fsck")
793 (chmod "e2fsck" #o555))))))
794 (home-page (package-home-page e2fsprogs))
795 (synopsis "Statically-linked e2fsck command from e2fsprogs")
796 (description "This package provides statically-linked e2fsck command taken
797 from the e2fsprogs package. It is meant to be used in initrds.")
798 (license (package-license e2fsprogs))))
800 (define-public extundelete
806 (uri (string-append "mirror://sourceforge/extundelete/"
807 "extundelete/" version "/extundelete-"
811 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
812 (build-system gnu-build-system)
813 (inputs `(("e2fsprogs" ,e2fsprogs)))
814 (home-page "http://extundelete.sourceforge.net/")
815 (synopsis "Recover deleted files from ext2/3/4 partitions")
817 "Extundelete is a set of tools that can recover deleted files from an
818 ext3 or ext4 partition.")
819 (license license:gpl2)))
821 (define-public zerofree
825 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
828 (uri (string-append home-page name "-" version
832 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
833 (build-system gnu-build-system)
835 '(#:phases (alist-replace
837 (lambda* (#:key outputs #:allow-other-keys)
838 (let* ((out (assoc-ref outputs "out"))
839 (bin (string-append out "/bin")))
841 (copy-file "zerofree"
842 (string-append bin "/zerofree"))
843 (chmod (string-append bin "/zerofree")
846 (alist-delete 'configure %standard-phases))
847 #:tests? #f)) ;no tests
848 (inputs `(("libext2fs" ,e2fsprogs)))
849 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
851 "The zerofree command scans the free blocks in an ext2 file system and
852 fills any non-zero blocks with zeroes. This is a useful way to make disk
853 images more compressible.")
854 (license license:gpl2)))
856 (define-public strace
862 (uri (string-append "mirror://sourceforge/strace/strace/" version
863 "/strace-" version ".tar.xz"))
866 "026agy9nq238nx3ynhmi8h3vx96yra4xacfsm2ybs9k23ry8ibc9"))))
867 (build-system gnu-build-system)
870 (modify-phases %standard-phases
871 (add-after 'unpack 'patch-/bin/sh
873 (substitute* "strace.c"
874 (("/bin/sh") (which "sh")))
876 (native-inputs `(("perl" ,perl)))
877 (home-page "https://strace.io/")
878 (synopsis "System call tracer for Linux")
880 "strace is a system call tracer, i.e. a debugging tool which prints out a
881 trace of all the system calls made by a another process/program.")
882 (license license:bsd-3)))
884 (define-public ltrace
890 (uri (string-append "http://www.ltrace.org/ltrace_" version
894 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
895 (build-system gnu-build-system)
896 (inputs `(("libelf" ,libelf)))
898 ;; Compilation uses -Werror by default, but it fails.
899 '(#:configure-flags '("--disable-werror")))
900 (home-page "http://www.ltrace.org/")
901 (synopsis "Library call tracer for Linux")
903 "ltrace intercepts and records dynamic library calls which are called by
904 an executed process and the signals received by that process. It can also
905 intercept and print the system calls executed by the program.")
906 (license license:gpl2+)))
908 (define-public alsa-lib
915 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
919 "174n2psp0328xcy2f1ayls67598bxli6q9cf00d2qnac3012aa3i"))))
920 (build-system gnu-build-system)
921 (home-page "https://www.alsa-project.org/")
922 (synopsis "The Advanced Linux Sound Architecture libraries")
924 "The Advanced Linux Sound Architecture (ALSA) provides audio and
925 MIDI functionality to the Linux-based operating system.")
926 (license license:lgpl2.1+)))
928 (define-public alsa-utils
934 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
935 name "-" version ".tar.bz2"))
938 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
939 (build-system gnu-build-system)
941 ;; XXX: Disable man page creation until we have DocBook.
942 '(#:configure-flags (list "--disable-xmlto"
944 ;; The udev rule is responsible for restoring
946 (string-append "--with-udev-rules-dir="
947 (assoc-ref %outputs "out")
948 "/lib/udev/rules.d"))
950 (modify-phases %standard-phases
952 'install 'pre-install
954 ;; Don't try to mkdir /var/lib/alsa.
955 (substitute* "Makefile"
956 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
960 `(("libsamplerate" ,libsamplerate)
962 ("alsa-lib" ,alsa-lib)
964 ("gettext" ,gettext-minimal)))
965 (home-page "http://www.alsa-project.org/")
966 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
968 "The Advanced Linux Sound Architecture (ALSA) provides audio and
969 MIDI functionality to the Linux-based operating system.")
971 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
973 (license license:gpl2)))
975 (define-public alsa-plugins
977 (name "alsa-plugins")
981 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
982 name "-" version ".tar.bz2"))
985 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
986 (build-system gnu-build-system)
987 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
988 ;; be split, there are references to both in files.
989 ;; TODO: Remove OSS related plugins, they add support to run native
990 ;; ALSA applications on OSS however we do not offer OSS and OSS is
992 (outputs '("out" "pulseaudio"))
995 (modify-phases %standard-phases
996 (add-after 'install 'split
997 (lambda* (#:key inputs outputs #:allow-other-keys)
998 ;; Distribute the binaries to the various outputs.
999 (let* ((out (assoc-ref outputs "out"))
1000 (pua (assoc-ref outputs "pulseaudio"))
1001 (pualib (string-append pua "/lib/alsa-lib"))
1002 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
1005 (chdir (string-append out "/share"))
1006 (for-each (lambda (file)
1007 (rename-file file (string-append puaconf "/" (basename file))))
1008 (find-files out "\\.(conf|example)"))
1009 (for-each (lambda (file)
1010 (rename-file file (string-append pualib "/" (basename file))))
1011 (find-files out ".*pulse\\.(la|so)"))
1013 ;; We have moved the files to output pulsaudio, the
1014 ;; directory is now empty.
1015 (delete-file-recursively (string-append out "/share"))
1018 `(("alsa-lib" ,alsa-lib)
1019 ("speex" ,speex) ; libspeexdsp resampling plugin
1020 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1021 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1022 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1024 `(("pkg-config" ,pkg-config)))
1025 (home-page "http://www.alsa-project.org/")
1026 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1028 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1029 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1030 by providing additional plugins which include: upmixing, downmixing, jackd and
1031 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1032 external rate conversion.")
1033 (license (list license:gpl2+
1034 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1035 license:lgpl2.1+))))
1037 (define-public iptables
1044 "mirror://netfilter.org/iptables/iptables-"
1045 version ".tar.bz2"))
1048 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
1049 (build-system gnu-build-system)
1051 `(("pkg-config" ,pkg-config)
1055 `(("libmnl" ,libmnl)
1056 ("libnftnl" ,libnftnl)))
1058 '(#:tests? #f ; no test suite
1059 #:configure-flags ; add $libdir to the RUNPATH of executables
1060 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1061 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1062 (synopsis "Program to configure the Linux IP packet filtering rules")
1064 "iptables is the userspace command line program used to configure the
1065 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1066 system administrators. Since Network Address Translation is also configured
1067 from the packet filter ruleset, iptables is used for this, too. The iptables
1068 package also includes ip6tables. ip6tables is used for configuring the IPv6
1070 (license license:gpl2+)))
1072 (define-public ebtables
1075 (version "2.0.10-4")
1079 "mirror://netfilter.org/ebtables/ebtables-v"
1083 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1084 (build-system gnu-build-system)
1086 '(#:tests? #f ; no test suite
1088 (let* ((out (assoc-ref %outputs "out"))
1089 (bin (string-append out "/sbin"))
1090 (lib (string-append out "/lib"))
1091 (man (string-append out "/share/man"))
1092 (iptables (assoc-ref %build-inputs "iptables"))
1093 (ethertypes (string-append iptables "/etc/ethertypes")))
1094 (list (string-append "LIBDIR=" lib)
1095 (string-append "MANDIR=" man)
1096 (string-append "BINDIR=" bin)
1097 (string-append "ETHERTYPESFILE=" ethertypes)
1098 ;; With the default CFLAGS, it falis with:
1099 ;; communication.c:259:58: error: variable ‘ret’ set but not
1100 ;; used [-Werror=unused-but-set-variable]
1103 (modify-phases %standard-phases
1105 ;; no configure script
1107 (substitute* "Makefile"
1108 ;; Remove user and group options from install commands,
1109 ;; otherwise it fails with: invalid user 'root'.
1110 (("-o root -g root") "")
1111 ;; Remove 'ethertypes' from the install target.
1113 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1117 ("iptables" ,iptables)))
1118 (synopsis "Ethernet bridge frame table administration")
1119 (home-page "http://ebtables.netfilter.org/")
1121 "ebtables is an application program used to set up and maintain the
1122 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1123 analogous to the iptables application, but less complicated, due to the fact
1124 that the Ethernet protocol is much simpler than the IP protocol.")
1125 (license license:gpl2+)))
1127 (define-public iproute
1134 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1138 "0zdxdsxyaazl85xhwskvsmpyzwf5qp21cvjsi1lw3xnrc914q2if"))))
1139 (build-system gnu-build-system)
1141 `(#:tests? #f ; no test suite
1142 #:make-flags (let ((out (assoc-ref %outputs "out")))
1144 (string-append "BASH_COMPDIR=" out
1145 "/etc/bash_completion.d")
1146 (string-append "LIBDIR=" out "/lib")
1147 (string-append "HDRDIR=" out "/include")
1148 (string-append "SBINDIR=" out "/sbin")
1149 (string-append "CONFDIR=" out "/etc")
1150 (string-append "DOCDIR=" out "/share/doc/"
1152 (string-append "MANDIR=" out "/share/man")))
1153 #:phases (modify-phases %standard-phases
1154 (add-before 'install 'pre-install
1156 ;; Don't attempt to create /var/lib/arpd.
1157 (substitute* "Makefile"
1158 (("^.*ARPDDIR.*$") "")))))))
1160 `(("iptables" ,iptables)
1163 `(("pkg-config" ,pkg-config)
1167 "https://wiki.linuxfoundation.org/networking/iproute2")
1169 "Utilities for controlling TCP/IP networking and traffic in Linux")
1171 "Iproute2 is a collection of utilities for controlling TCP/IP
1172 networking and traffic with the Linux kernel.
1174 Most network configuration manuals still refer to ifconfig and route as the
1175 primary network configuration tools, but ifconfig is known to behave
1176 inadequately in modern network environments. They should be deprecated, but
1177 most distros still include them. Most network configuration systems make use
1178 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1179 to support most modern network technologies, as it doesn't use ifconfig and
1180 allows a system administrator to make use of all iproute2 features, including
1183 iproute2 is usually shipped in a package called iproute or iproute2 and
1184 consists of several tools, of which the most important are @command{ip} and
1185 @command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1186 @command{tc} stands for traffic control. Both tools print detailed usage
1187 messages and are accompanied by a set of manpages.")
1188 (license license:gpl2+)))
1190 (define-public net-tools
1191 ;; XXX: This package is basically unmaintained, but it provides a few
1192 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1197 (home-page "http://net-tools.sourceforge.net/")
1200 (uri (list (string-append
1201 "mirror://sourceforge/net-tools/net-tools-"
1204 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1205 "/base/net-tools/net-tools-1.60.tar.bz2")))
1208 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1209 (patches (search-patches "net-tools-bitrot.patch"))))
1210 (build-system gnu-build-system)
1212 '(#:modules ((guix build gnu-build-system)
1216 #:phases (alist-cons-after
1218 (lambda* (#:key inputs #:allow-other-keys)
1219 (define (apply-patch file)
1220 (zero? (system* "patch" "-p1" "--force"
1223 (let ((patch.gz (assoc-ref inputs "patch")))
1224 (format #t "applying Debian patch set '~a'...~%"
1226 (system (string-append "gunzip < " patch.gz " > the-patch"))
1227 (and (apply-patch "the-patch")
1228 (for-each apply-patch
1229 (find-files "debian/patches"
1233 (lambda* (#:key outputs #:allow-other-keys)
1234 (let ((out (assoc-ref outputs "out")))
1235 (mkdir-p (string-append out "/bin"))
1236 (mkdir-p (string-append out "/sbin"))
1238 ;; Pretend we have everything...
1239 (system "yes | make config")
1241 ;; ... except for the things we don't have.
1242 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1243 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1244 ;; that have been removed.
1245 (substitute* '("config.make" "config.h")
1246 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1248 'install 'remove-redundant-commands
1249 (lambda* (#:key outputs #:allow-other-keys)
1250 ;; Remove commands and man pages redundant with
1252 (let* ((out (assoc-ref outputs "out"))
1253 (dup (append-map (cut find-files out <>)
1255 "^(yp|nis|dns)?domainname"))))
1256 (for-each delete-file dup)
1260 ;; Binaries that depend on libnet-tools.a don't declare that
1261 ;; dependency, making it parallel-unsafe.
1262 #:parallel-build? #f
1264 #:tests? #f ; no test suite
1265 #:make-flags (let ((out (assoc-ref %outputs "out")))
1267 (string-append "BASEDIR=" out)
1268 (string-append "INSTALLNLSDIR=" out "/share/locale")
1269 (string-append "mandir=/share/man")))))
1271 ;; Use the big Debian patch set (the thing does not even compile out of
1273 (inputs `(("patch" ,(origin
1276 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1279 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1280 (native-inputs `(("gettext" ,gettext-minimal)))
1282 (synopsis "Tools for controlling the network subsystem in Linux")
1284 "This package includes the important tools for controlling the network
1285 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1286 route. Additionally, this package contains utilities relating to particular
1287 network hardware types (plipconfig, slattach) and advanced aspects of IP
1288 configuration (iptunnel, ipmaddr).")
1289 (license license:gpl2+)))
1291 (define-public libcap
1298 "mirror://kernel.org/linux/libs/security/linux-privs/"
1299 "libcap2/libcap-" version ".tar.xz"))
1302 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1303 (build-system gnu-build-system)
1304 (arguments '(#:phases
1305 (modify-phases %standard-phases
1307 ;; Add $libdir to the RUNPATH of executables.
1309 (substitute* "Make.Rules"
1311 (string-append "LDFLAGS := -Wl,-rpath="
1312 %output "/lib"))))))
1313 #:tests? #f ; no 'check' target
1314 #:make-flags (list "lib=lib"
1315 (string-append "prefix="
1316 (assoc-ref %outputs "out"))
1317 "RAISE_SETFCAP=no")))
1318 (native-inputs `(("perl" ,perl)))
1319 (inputs `(("attr" ,attr)))
1320 (home-page "https://sites.google.com/site/fullycapable/")
1321 (synopsis "Library for working with POSIX capabilities")
1323 "Libcap2 provides a programming interface to POSIX capabilities on
1324 Linux-based operating systems.")
1326 ;; License is BSD-3 or GPLv2, at the user's choice.
1327 (license license:gpl2)))
1329 (define-public bridge-utils
1331 (name "bridge-utils")
1335 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1336 "bridge-utils-" version ".tar.gz"))
1339 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1340 (build-system gnu-build-system)
1342 ;; The tarball lacks all the generated files.
1343 (native-inputs `(("autoconf" ,autoconf)
1344 ("automake" ,automake)))
1346 '(#:phases (alist-cons-after
1349 ;; Fix "field ‘ip6’ has incomplete type" errors.
1350 (substitute* "libbridge/libbridge.h"
1351 (("#include <linux/if_bridge.h>")
1352 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1354 ;; Ensure that the entire build fails if one of the
1355 ;; sub-Makefiles fails.
1356 (substitute* "Makefile.in"
1357 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1358 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1360 (zero? (system* "autoreconf" "-vf")))
1362 #:tests? #f)) ; no 'check' target
1365 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1366 (synopsis "Manipulate Ethernet bridges")
1368 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1369 to connect two Ethernet segments together in a protocol independent way.
1370 Packets are forwarded based on Ethernet address, rather than IP address (like
1371 a router). Since forwarding is done at Layer 2, all protocols can go
1372 transparently through a bridge.")
1373 (license license:gpl2+)))
1375 (define-public libnl
1382 "https://github.com/thom311/libnl/releases/download/"
1383 "libnl" (string-join (string-split version #\.) "_")
1384 "/libnl-" version ".tar.gz"))
1387 "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
1388 (build-system gnu-build-system)
1389 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1390 (home-page "http://www.infradead.org/~tgr/libnl/")
1391 (synopsis "NetLink protocol library suite")
1393 "The libnl suite is a collection of libraries providing APIs to netlink
1394 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1395 between the kernel and user space processes. It was designed to be a more
1396 flexible successor to ioctl to provide mainly networking related kernel
1397 configuration and monitoring interfaces.")
1399 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1400 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1401 (license license:gpl2)))
1410 "mirror://kernel.org/software/network/iw/iw-"
1414 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1415 (build-system gnu-build-system)
1416 (native-inputs `(("pkg-config" ,pkg-config)))
1417 (inputs `(("libnl" ,libnl)))
1419 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1421 #:phases (alist-delete 'configure %standard-phases)))
1422 (home-page "https://wireless.wiki.kernel.org/")
1423 (synopsis "Tool for configuring wireless devices")
1425 "iw is a new nl80211 based CLI configuration utility for wireless
1426 devices. It replaces @code{iwconfig}, which is deprecated.")
1427 (license license:isc)))
1429 (define-public powertop
1437 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1441 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1442 (build-system gnu-build-system)
1445 (modify-phases %standard-phases
1446 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1447 ;; allow calibrating the network interface in GuixSD.
1448 (add-after 'unpack 'patch-absolute-file-names
1449 (lambda* (#:key inputs #:allow-other-keys)
1450 (let ((kmod (assoc-ref inputs "kmod")))
1451 (substitute* (find-files "src" "\\.cpp$")
1452 ;; Give the right 'modprobe' file name so that essential
1453 ;; modules such as msr.ko can be loaded.
1454 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1455 ;; These programs are only needed to calibrate, so using
1456 ;; relative file names avoids adding extra inputs. When they
1457 ;; are missing powertop gracefully handles it.
1458 (("/usr/bin/hcitool") "hcitool")
1459 (("/usr/bin/xset") "xset")
1460 (("/usr/sbin/hciconfig") "hciconfig"))
1465 ("ncurses" ,ncurses)
1466 ("pciutils" ,pciutils)
1469 `(("pkg-config" ,pkg-config)))
1470 (home-page "https://01.org/powertop/")
1471 (synopsis "Analyze power consumption on Intel-based laptops")
1473 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1474 power management. In addition to being a diagnostic tool, PowerTOP also has
1475 an interactive mode where the user can experiment various power management
1476 settings for cases where the operating system has not enabled these
1478 (license license:gpl2)))
1480 (define-public aumix
1487 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1488 version ".tar.bz2"))
1491 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1492 (build-system gnu-build-system)
1493 (inputs `(("ncurses" ,ncurses)))
1494 (home-page "http://www.jpj.net/~trevor/aumix.html")
1495 (synopsis "Audio mixer for X and the console")
1497 "Aumix adjusts an audio mixer from X, the console, a terminal,
1498 the command line or a script.")
1499 (license license:gpl2+)))
1501 (define-public iotop
1508 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1511 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1512 (build-system python-build-system)
1514 ;; The setup.py script expects python-2.
1515 `(#:python ,python-2
1516 ;; There are currently no checks in the package.
1518 (native-inputs `(("python" ,python-2)))
1519 (home-page "http://guichaz.free.fr/iotop/")
1521 "Displays the IO activity of running processes")
1523 "Iotop is a Python program with a top like user interface to show the
1524 processes currently causing I/O.")
1525 (license license:gpl2+)))
1533 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1534 "download/fuse-" version
1535 "/fuse-" version ".tar.gz"))
1538 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1539 (patches (search-patches "fuse-overlapping-headers.patch"))))
1540 (build-system gnu-build-system)
1541 (inputs `(("util-linux" ,util-linux)))
1543 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1544 (assoc-ref %outputs "out")
1546 (string-append "INIT_D_PATH="
1547 (assoc-ref %outputs "out")
1550 ;; The rule makes /dev/fuse 666.
1551 (string-append "UDEV_RULES_PATH="
1552 (assoc-ref %outputs "out")
1553 "/lib/udev/rules.d"))
1554 #:phases (alist-cons-before
1555 'build 'set-file-names
1556 (lambda* (#:key inputs #:allow-other-keys)
1557 ;; libfuse calls out to mount(8) and umount(8). Make sure
1558 ;; it refers to the right ones.
1559 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1560 (("/bin/(u?)mount" _ maybe-u)
1561 (string-append (assoc-ref inputs "util-linux")
1562 "/bin/" maybe-u "mount")))
1563 (substitute* '("util/mount.fuse.c")
1567 ;; This hack leads libfuse to search for 'fusermount' in
1568 ;; $PATH, where it may find a setuid-root binary, instead of
1569 ;; trying solely $out/sbin/fusermount and failing because
1571 (substitute* "lib/Makefile"
1572 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1573 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1575 (home-page "https://github.com/libfuse/libfuse")
1576 (synopsis "Support file systems implemented in user space")
1578 "As a consequence of its monolithic design, file system code for Linux
1579 normally goes into the kernel itself---which is not only a robustness issue,
1580 but also an impediment to system extensibility. FUSE, for \"file systems in
1581 user space\", is a kernel module and user-space library that tries to address
1582 part of this problem by allowing users to run file system implementations as
1583 user-space processes.")
1584 (license (list license:lgpl2.1 ;library
1585 license:gpl2+)))) ;command-line utilities
1587 (define-public unionfs-fuse
1589 (name "unionfs-fuse")
1594 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1596 (file-name (string-append name "-" version ".tar.gz"))
1599 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1600 (build-system cmake-build-system)
1602 `(("python" ,python)
1603 ("python-pytest" ,python-pytest)))
1604 (inputs `(("fuse" ,fuse)))
1607 (modify-phases %standard-phases
1609 ;; Borrowed from the Makefile
1610 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
1611 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1612 (synopsis "User-space union file system")
1614 "UnionFS-FUSE is a flexible union file system implementation in user
1615 space, using the FUSE library. Mounting a union file system allows you to
1616 \"aggregate\" the contents of several directories into a single mount point.
1617 UnionFS-FUSE additionally supports copy-on-write.")
1618 (license license:bsd-3)))
1621 (package (inherit fuse)
1622 (name "fuse-static")
1623 (source (origin (inherit (package-source fuse))
1624 (modules '((guix build utils)))
1626 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1627 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1628 ;; it doesn't do that, allowing us to remove the dependency on
1629 ;; util-linux (something that is useful in initrds.)
1630 '(substitute* '("lib/mount_util.c"
1631 "util/mount_util.c")
1632 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1637 (define-public unionfs-fuse/static
1638 (package (inherit unionfs-fuse)
1639 (synopsis "User-space union file system (statically linked)")
1640 (name (string-append (package-name unionfs-fuse) "-static"))
1641 (source (origin (inherit (package-source unionfs-fuse))
1642 (modules '((guix build utils)))
1644 ;; Add -ldl to the libraries, because libfuse.a needs that.
1645 '(substitute* "src/CMakeLists.txt"
1646 (("target_link_libraries(.*)\\)" _ libs)
1647 (string-append "target_link_libraries"
1651 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1652 #:phases (alist-cons-after
1653 'install 'post-install
1654 (lambda* (#:key outputs #:allow-other-keys)
1655 (let* ((out (assoc-ref outputs "out"))
1656 (exe (string-append out "/bin/unionfs")))
1657 ;; By default, 'unionfs' keeps references to
1658 ;; $glibc/share/locale and similar stuff. Remove them.
1659 (remove-store-references exe)
1661 ;; 'unionfsctl' has references to glibc as well. Since
1662 ;; we don't need it, remove it.
1663 (delete-file (string-append out "/bin/unionfsctl"))
1666 (inputs `(("fuse" ,fuse-static)))))
1668 (define-public sshfs-fuse
1674 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1675 "download/sshfs-" version "/sshfs-" version
1679 "1pp5wsl1jx11apkv2fpp559miifqhi8ka400npy5awp9ghlf3la6"))))
1680 (build-system gnu-build-system)
1685 `(("pkg-config" ,pkg-config)))
1686 (home-page "https://github.com/libfuse/sshfs")
1687 (synopsis "Mount remote file systems over SSH")
1689 "This is a file system client based on the SSH File Transfer Protocol.
1690 Since most SSH servers already support this protocol it is very easy to set
1691 up: on the server side there's nothing to do; on the client side mounting the
1692 file system is as easy as logging into the server with an SSH client.")
1693 (license license:gpl2+)))
1695 (define-public archivemount
1697 (name "archivemount")
1702 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1703 "archivemount-" version ".tar.gz"))
1706 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1707 (build-system gnu-build-system)
1708 (inputs `(("fuse", fuse)
1709 ("libarchive", libarchive)))
1710 (native-inputs `(("pkg-config", pkg-config)))
1711 (home-page "http://www.cybernoia.de/software/archivemount")
1712 (synopsis "Tool for mounting archive files with FUSE")
1713 (description "archivemount is a FUSE-based file system for Unix variants,
1714 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1715 mount point where it can be read from or written to as with any other file
1716 system. This makes accessing the contents of the archive, which may be
1717 compressed, transparent to other programs, without decompressing them.")
1718 (license license:lgpl2.0+)))
1720 (define-public numactl
1727 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1732 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1733 (build-system gnu-build-system)
1735 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1736 ;; to run, which we can't assume to have.
1739 ;; NUMA is apparently not supported on armhf, see
1740 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1741 (supported-systems (delete "armhf-linux" %supported-systems))
1742 (home-page "http://oss.sgi.com/projects/libnuma/")
1743 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1745 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1746 memory is not all in one place. The numactl program allows you to run your
1747 application program on specific CPU's and memory nodes. It does this by
1748 supplying a NUMA memory policy to the operating system before running your
1751 The package contains other commands, such as numademo, numastat and memhog.
1752 The numademo command provides a quick overview of NUMA performance on your
1754 (license (list license:gpl2 ;programs
1755 license:lgpl2.1)))) ;library
1757 (define-public kbd-neo
1764 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1765 version "/linux/console/neo.map"))
1766 (file-name (string-append name "-" version ".map"))
1769 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1770 (build-system trivial-build-system)
1772 `(#:modules ((guix build utils))
1774 (use-modules (guix build utils))
1775 (let ((out (string-append %output "/share/keymaps"))
1776 (source (assoc-ref %build-inputs "source")))
1778 (copy-file source (string-append out "/neo.map"))
1780 (home-page "https://neo-layout.org")
1781 (synopsis "Neo2 console layout")
1783 "Kbd-neo provides the Neo2 keyboard layout for use with
1784 @command{loadkeys(1)} from @code{kbd(4)}.")
1785 ;; The file is located in an svn directory, the entire content of
1786 ;; the directory is licensed as GPL3.
1787 (license license:gpl3+)))
1795 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1799 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1800 (modules '((guix build utils)))
1803 (substitute* "tests/Makefile.in"
1804 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1807 (substitute* '("src/unicode_start" "src/unicode_stop")
1808 ;; Assume the Coreutils are in $PATH.
1811 (build-system gnu-build-system)
1814 (modify-phases %standard-phases
1815 (add-before 'build 'pre-build
1816 (lambda* (#:key inputs #:allow-other-keys)
1817 (let ((gzip (assoc-ref %build-inputs "gzip"))
1818 (bzip2 (assoc-ref %build-inputs "bzip2")))
1819 (substitute* "src/libkeymap/findfile.c"
1821 (string-append gzip "/bin/gzip"))
1823 (string-append bzip2 "/bin/bzip2"))))))
1824 (add-after 'install 'post-install
1825 (lambda* (#:key outputs #:allow-other-keys)
1826 ;; Make sure these programs find their comrades.
1827 (let* ((out (assoc-ref outputs "out"))
1828 (bin (string-append out "/bin")))
1829 (for-each (lambda (prog)
1830 (wrap-program (string-append bin "/" prog)
1831 `("PATH" ":" prefix (,bin))))
1832 '("unicode_start" "unicode_stop"))))))))
1833 (inputs `(("check" ,check)
1836 ("pam" ,linux-pam)))
1837 (native-search-paths
1838 (list (search-path-specification
1839 (variable "LOADKEYS_KEYMAP_PATH")
1840 (files (list "share/keymaps")))))
1841 (native-inputs `(("pkg-config" ,pkg-config)))
1842 (home-page "http://kbd-project.org/")
1843 (synopsis "Linux keyboard utilities and keyboard maps")
1845 "This package contains keytable files and keyboard utilities compatible
1846 for systems using the Linux kernel. This includes commands such as
1847 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1848 (license license:gpl2+)))
1850 (define-public inotify-tools
1852 (name "inotify-tools")
1857 "mirror://sourceforge/inotify-tools/inotify-tools/"
1858 version "/inotify-tools-" version ".tar.gz"))
1861 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1862 (build-system gnu-build-system)
1863 (home-page "http://inotify-tools.sourceforge.net/")
1864 (synopsis "Monitor file accesses")
1866 "The inotify-tools packages provides a C library and command-line tools
1867 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1868 (license license:gpl2+)))
1877 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1878 "kmod-" version ".tar.xz"))
1881 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
1882 (patches (search-patches "kmod-module-directory.patch"))))
1883 (build-system gnu-build-system)
1885 `(("pkg-config" ,pkg-config)))
1890 `(#:tests? #f ; FIXME: Investigate test failures
1891 #:configure-flags '("--with-xz" "--with-zlib")
1892 #:phases (alist-cons-after
1893 'install 'install-modprobe&co
1894 (lambda* (#:key outputs #:allow-other-keys)
1895 (let* ((out (assoc-ref outputs "out"))
1896 (bin (string-append out "/bin")))
1897 (for-each (lambda (tool)
1899 (string-append bin "/" tool)))
1900 '("insmod" "rmmod" "lsmod" "modprobe"
1901 "modinfo" "depmod"))))
1903 (home-page "https://www.kernel.org/")
1904 (synopsis "Kernel module tools")
1905 (description "Kmod is a set of tools to handle common tasks with Linux
1906 kernel modules like insert, remove, list, check properties, resolve
1907 dependencies and aliases.
1909 These tools are designed on top of libkmod, a library that is shipped with
1910 kmod. The aim is to be compatible with tools, configurations and indices
1911 from the module-init-tools project.")
1912 (license license:gpl2+))) ; library under lgpl2.1+
1914 (define-public eudev
1915 ;; The post-systemd fork, maintained by Gentoo.
1922 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1926 "06gyyl90n85x8i7lfhns514y1kg1ians13l467admyzy3kjxkqsp"))
1927 (patches (search-patches "eudev-rules-directory.patch"
1928 "eudev-conflicting-declaration.patch"))))
1929 (build-system gnu-build-system)
1931 `(("pkg-config" ,pkg-config)
1935 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1936 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1937 ;; which contains the rules to do that.
1938 `(("util-linux" ,util-linux) ;for blkid
1940 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1941 (synopsis "Userspace device management")
1942 (description "Udev is a daemon which dynamically creates and removes
1943 device nodes from /dev/, handles hotplug events and loads drivers at boot
1945 (license license:gpl2+)))
1947 (define-public eudev-with-hwdb
1948 ;; TODO: Merge with 'eudev'.
1951 (name "eudev-with-hwdb")
1953 '(#:phases (modify-phases %standard-phases
1954 (add-after 'install 'build-hwdb
1955 (lambda* (#:key outputs #:allow-other-keys)
1956 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1957 ;; similar tools to display product names.
1958 (let ((out (assoc-ref outputs "out")))
1959 (zero? (system* (string-append out "/bin/udevadm")
1960 "hwdb" "--update"))))))))))
1965 (version "2.02.171")
1968 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1972 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
1973 (modules '((guix build utils)))
1976 (use-modules (guix build utils))
1978 ;; Honor sysconfdir.
1979 (substitute* "make.tmpl.in"
1981 "confdir = @sysconfdir@\n")
1982 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1983 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1984 (patches (search-patches "lvm2-static-link.patch"))))
1985 (build-system gnu-build-system)
1987 `(("pkg-config" ,pkg-config)
1988 ("procps" ,procps))) ;tests use 'pgrep'
1993 (modify-phases %standard-phases
1994 (add-after 'configure 'set-makefile-shell
1996 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1998 (setenv "SHELL" (which "sh"))
2000 ;; Replace /bin/sh with the right file name.
2001 (patch-makefile-SHELL "make.tmpl")
2003 (add-before 'strip 'make-objects-writable
2004 (lambda* (#:key outputs #:allow-other-keys)
2005 ;; Make compiled objects writable so they can be stripped.
2006 (let ((out (assoc-ref outputs "out")))
2007 (for-each (lambda (file)
2010 (find-files (string-append out "/lib"))
2011 (find-files (string-append out "/sbin"))))
2014 #:configure-flags (list (string-append "--sysconfdir="
2015 (assoc-ref %outputs "out")
2017 "--enable-udev_sync"
2018 "--enable-udev_rules"
2020 ;; Make sure programs such as 'dmsetup' can
2021 ;; find libdevmapper.so.
2022 (string-append "LDFLAGS=-Wl,-rpath="
2023 (assoc-ref %outputs "out")
2026 ;; The tests use 'mknod', which requires root access.
2028 (home-page "https://sourceware.org/lvm2/")
2029 (synopsis "Logical volume management for Linux")
2031 "LVM2 is the logical volume management tool set for Linux-based systems.
2032 This package includes the user-space libraries and tools, including the device
2033 mapper. Kernel components are part of Linux-libre.")
2035 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2036 ;; Command-line tools are GPLv2.
2037 (license (list license:gpl2 license:lgpl2.1))))
2039 (define-public lvm2-static
2042 (name "lvm2-static")
2044 ;; Propagate udev because libdevmapper.a depends on libudev.
2045 (inputs (alist-delete "udev" (package-inputs lvm2)))
2046 (propagated-inputs `(("udev" ,eudev)))
2049 (substitute-keyword-arguments (package-arguments lvm2)
2050 ((#:configure-flags flags '())
2051 ;; LVM2 doesn't use Libtool, hence the custom option.
2052 `(cons "--enable-static_link" ,flags))))
2053 (synopsis "Logical volume management for Linux (statically linked)")))
2055 (define-public wireless-tools
2057 (name "wireless-tools")
2061 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2065 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2068 ;; Remove the older header files that are not free software.
2069 (for-each (lambda (n)
2070 (delete-file (format #f "wireless.~a.h" n)))
2071 '(10 11 12 13 14 15 16 17 18 19 20))
2073 (build-system gnu-build-system)
2076 (list (string-append "PREFIX=" %output)
2077 (string-append "INSTALL_MAN=" %output "/share/man")
2078 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2080 #:phases (modify-phases %standard-phases
2081 (delete 'configure))
2083 (synopsis "Tools for manipulating Linux Wireless Extensions")
2084 (description "Wireless Tools are used to manipulate the now-deprecated
2085 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2086 Extension was an interface allowing you to set Wireless LAN specific
2087 parameters and get the specific stats. It is deprecated in favor the nl80211
2089 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2090 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2091 ;; other files are distributed under gpl2.
2092 (license (list license:gpl2 license:lgpl2.1+))))
2100 (uri (string-append "mirror://kernel.org/software/network/crda/"
2101 "crda-" version ".tar.xz"))
2104 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2105 (patches (search-patches "crda-optional-gcrypt.patch"))))
2106 (build-system gnu-build-system)
2108 '(#:phases (modify-phases %standard-phases
2111 'build 'no-werror-no-ldconfig
2113 (substitute* "Makefile"
2115 (("ldconfig") "true"))
2118 'build 'set-regulator-db-file-name
2119 (lambda* (#:key inputs #:allow-other-keys)
2120 ;; Tell CRDA where to find our database.
2121 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2122 (substitute* "crda.c"
2123 (("\"/lib/crda/regulatory.bin\"")
2124 (string-append "\"" regdb
2125 "/lib/crda/regulatory.bin\"")))
2127 #:test-target "verify"
2128 #:make-flags (let ((out (assoc-ref %outputs "out"))
2129 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2130 (list "CC=gcc" "V=1"
2132 ;; Disable signature-checking on 'regulatory.bin'.
2133 ;; The reason is that this simplifies maintenance
2134 ;; on our side (no need to manage a distro key
2135 ;; pair), and we can guarantee integrity of
2136 ;; 'regulatory.bin' by other means anyway, such as
2137 ;; 'guix gc --verify'. See
2138 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2142 (string-append "PREFIX=" out)
2143 (string-append "SBINDIR=" out "/sbin/")
2144 (string-append "UDEV_RULE_DIR="
2145 out "/lib/udev/rules.d")
2146 (string-append "LDFLAGS=-Wl,-rpath="
2148 (string-append "REG_BIN=" regdb
2149 "/lib/crda/regulatory.bin")))))
2150 (native-inputs `(("pkg-config" ,pkg-config)
2151 ("python" ,python-2)
2152 ("wireless-regdb" ,wireless-regdb)))
2153 (inputs `(("libnl" ,libnl)))
2155 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2156 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2158 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2159 communication between the kernel Linux and user space for regulatory
2161 (license license:copyleft-next)))
2163 (define-public wireless-regdb
2165 (name "wireless-regdb")
2166 (version "2017.03.07")
2170 "mirror://kernel.org/software/network/wireless-regdb/"
2171 "wireless-regdb-" version ".tar.xz"))
2174 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2176 ;; We're building 'regulatory.bin' by ourselves.
2177 (snippet '(delete-file "regulatory.bin"))))
2178 (build-system gnu-build-system)
2180 '(#:phases (modify-phases %standard-phases
2181 (delete 'configure))
2183 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2184 ;; is computed and can be equal to 'maintainer-clean'; when that
2185 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2186 ;; just built. Thus, build things sequentially.
2187 #:parallel-build? #f
2189 #:tests? #f ;no tests
2190 #:make-flags (let ((out (assoc-ref %outputs "out")))
2191 (list (string-append "PREFIX=" out)
2192 (string-append "LSB_ID=GuixSD")
2193 (string-append "DISTRO_PUBKEY=/dev/null")
2194 (string-append "DISTRO_PRIVKEY=/dev/null")
2195 (string-append "REGDB_PUBKEY=/dev/null")
2197 ;; Leave that empty so that db2bin.py doesn't try
2198 ;; to sign 'regulatory.bin'. This allows us to
2199 ;; avoid managing a key pair for the whole distro.
2200 (string-append "REGDB_PRIVKEY=")))))
2201 (native-inputs `(("python" ,python-2)))
2203 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2204 (synopsis "Wireless regulatory database")
2206 "This package contains the wireless regulatory database Central
2207 Regulatory Database Agent (CRDA) daemon. The database contains information on
2208 country-specific regulations for the wireless spectrum.")
2209 (license license:isc)))
2211 (define-public lm-sensors
2217 (uri (list (string-append
2218 "https://github.com/groeck/lm-sensors/archive/V"
2219 (string-join (string-split version #\.) "-")
2221 (file-name (string-append name "-" version ".tar.gz"))
2224 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2225 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2226 (build-system gnu-build-system)
2227 (inputs `(("rrdtool" ,rrdtool)
2230 ("gnuplot" ,gnuplot)))
2231 (native-inputs `(("pkg-config" ,pkg-config)
2236 `(#:tests? #f ; no 'check' target
2237 #:make-flags (list (string-append "PREFIX=" %output)
2238 (string-append "ETCDIR=" %output "/etc")
2239 (string-append "MANDIR=" %output "/share/man"))
2244 'build 'patch-exec-paths
2245 (lambda* (#:key inputs outputs #:allow-other-keys)
2246 (substitute* "prog/detect/sensors-detect"
2248 (string-append "`" (assoc-ref inputs "coreutils")
2250 (("(`|\")modprobe" all open-quote)
2251 (string-append open-quote
2252 (assoc-ref inputs "kmod")
2254 (substitute* '("prog/pwm/pwmconfig"
2255 "prog/pwm/fancontrol")
2257 (string-append (assoc-ref inputs "gnuplot")
2260 (string-append (assoc-ref inputs "coreutils")
2263 (string-append (assoc-ref inputs "grep")
2266 (string-append (assoc-ref inputs "sed")
2269 (string-append (assoc-ref inputs "coreutils")
2272 (string-append (assoc-ref inputs "coreutils")
2275 (string-append (assoc-ref inputs "coreutils")
2276 "/bin/readlink -f"))))
2277 %standard-phases))))
2278 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2279 (synopsis "Utilities to read temperature/voltage/fan sensors")
2281 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2282 you to access information from temperature, voltage, and fan speed sensors.
2283 It works with most newer systems.")
2284 (license license:gpl2+)))
2286 (define-public i2c-tools
2293 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2294 version ".tar.bz2"))
2297 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2298 (build-system gnu-build-system)
2300 `(#:tests? #f ; no 'check' target
2301 #:make-flags (list (string-append "prefix=" %output)
2303 ;; no configure script
2304 #:phases (alist-delete 'configure %standard-phases)))
2307 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2308 (synopsis "I2C tools for Linux")
2310 "The i2c-tools package contains a heterogeneous set of I2C tools for
2311 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2312 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2314 (license license:gpl2+)))
2316 (define-public xsensors
2323 "http://www.linuxhardware.org/xsensors/xsensors-"
2327 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2328 (build-system gnu-build-system)
2329 (inputs `(("lm-sensors" ,lm-sensors)
2331 (native-inputs `(("pkg-config" ,pkg-config)))
2333 `(#:phases (alist-cons-before
2334 'configure 'enable-deprecated
2336 (substitute* "src/Makefile.in"
2337 (("-DGDK_DISABLE_DEPRECATED") "")
2338 (("-DGTK_DISABLE_DEPRECATED") "")))
2340 'configure 'remove-Werror
2342 (substitute* '("configure" "src/Makefile.in")
2344 %standard-phases))))
2345 (home-page "http://www.linuxhardware.org/xsensors/")
2346 (synopsis "Hardware health information viewer")
2348 "Xsensors reads data from the libsensors library regarding hardware
2349 health such as temperature, voltage and fan speed and displays the information
2350 in a digital read-out.")
2351 (license license:gpl2+)))
2356 (version (package-version linux-libre))
2357 (source (package-source linux-libre))
2358 (build-system gnu-build-system)
2360 '(#:phases (alist-replace
2362 (lambda* (#:key inputs #:allow-other-keys)
2363 (setenv "SHELL_PATH" (which "bash"))
2364 (chdir "tools/perf"))
2366 #:make-flags (list (string-append "DESTDIR="
2367 (assoc-ref %outputs "out"))
2370 ;; By default, 'config/Makefile' uses lib64 on
2371 ;; x86_64. Work around that.
2373 #:tests? #f)) ;no tests
2375 `(("pkg-config" ,pkg-config)
2379 ;; There are build scripts written in these languages.
2381 ("python" ,python-2)))
2383 `(("slang" ,slang) ;for the interactive TUI
2385 ("python" ,python-2) ;'perf' links against libpython
2386 ("elfutils" ,elfutils)
2387 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2390 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2391 ("docbook-xsl" ,docbook-xsl)
2393 ("asciidoc" ,asciidoc)))
2394 (home-page "https://perf.wiki.kernel.org/")
2395 (synopsis "Linux profiling with performance counters")
2397 "perf is a tool suite for profiling using hardware performance counters,
2398 with support in the Linux kernel. perf can instrument CPU performance
2399 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2400 of lightweight profiling. This package contains the user-land tools and in
2401 particular the 'perf' command.")
2402 (license (package-license linux-libre))))
2404 (define-public pflask
2410 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2412 (file-name (string-append name "-" version ".tar.gz"))
2415 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2416 (build-system cmake-build-system)
2418 '(#:tests? #f)) ; no tests
2419 (home-page "http://ghedo.github.io/pflask/")
2420 (synopsis "Simple tool for creating Linux namespace containers")
2421 (description "pflask is a simple tool for creating Linux namespace
2422 containers. It can be used for running a command or even booting an OS inside
2423 an isolated container, created with the help of Linux namespaces. It is
2424 similar in functionality to chroot, although pflask provides better isolation
2425 thanks to the use of namespaces.")
2426 (license license:bsd-2)))
2428 (define-public hdparm
2434 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2435 name "-" version ".tar.gz"))
2438 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
2439 (build-system gnu-build-system)
2441 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2442 (list (string-append "binprefix=" out)
2443 (string-append "manprefix=" out)
2446 (modify-phases %standard-phases
2447 (delete 'configure)) ; no configure script
2448 #:tests? #f)) ; no test suite
2449 (home-page "https://sourceforge.net/projects/hdparm/")
2450 (synopsis "View and tune ATA disk drive parameters")
2452 "@command{hdparm} is a command-line utility to control ATA controllers and
2453 disk drives. It can increase performance and/or reliability by careful tuning
2454 of hardware settings like power and acoustic management, DMA modes, and caching.
2455 It can also display detailed device information, or be used as a simple
2456 performance benchmarking tool.
2458 @command{hdparm} provides a command line interface to various Linux kernel
2459 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2460 IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2461 Command Translation} (SAT) are also supported.")
2462 (license (license:non-copyleft "file://LICENSE.TXT"))))
2464 (define-public rfkill
2470 (uri (string-append "mirror://kernel.org/software/network/"
2471 name "/" name "-" version ".tar.xz"))
2474 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2475 (build-system gnu-build-system)
2477 `(#:make-flags (list "CC=gcc"
2478 (string-append "PREFIX=" %output))
2479 #:phases (modify-phases %standard-phases
2480 (delete 'configure))
2482 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2483 (synopsis "Tool for enabling and disabling wireless devices")
2485 "rfkill is a simple tool for accessing the rfkill device interface,
2486 which is used to enable and disable wireless networking devices, typically
2487 WLAN, Bluetooth and mobile broadband.")
2488 (license (license:non-copyleft "file://COPYING"
2489 "See COPYING in the distribution."))))
2497 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2498 version "/" name "-" version ".tar.gz"))
2501 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2502 (build-system gnu-build-system)
2503 (home-page "http://acpiclient.sourceforge.net")
2504 (synopsis "Display information on ACPI devices")
2505 (description "@code{acpi} attempts to replicate the functionality of the
2506 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2507 information. It does not support ACPI suspending, only displays information
2508 about ACPI devices.")
2509 (license license:gpl2+)))
2511 (define-public acpid
2517 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2521 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2522 (build-system gnu-build-system)
2523 (home-page "https://sourceforge.net/projects/acpid2/")
2524 (synopsis "Daemon for delivering ACPI events to user-space programs")
2526 "acpid is designed to notify user-space programs of Advanced
2527 Configuration and Power Interface (ACPI) events. acpid should be started
2528 during the system boot, and will run as a background process. When an ACPI
2529 event is received from the kernel, acpid will examine the list of rules
2530 specified in /etc/acpi/events and execute the rules that match the event.")
2531 (license license:gpl2+)))
2533 (define-public sysfsutils
2542 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2545 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2546 (build-system gnu-build-system)
2547 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2548 (synopsis "System utilities based on Linux sysfs")
2550 "These are a set of utilities built upon sysfs, a virtual file system in
2551 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2552 also contains the libsysfs library.")
2553 ;; The library is under lgpl2.1+ (all files say "or any later version").
2554 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2555 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2557 (define-public sysfsutils-1
2559 (inherit sysfsutils)
2566 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2567 "/sysfsutils-" version ".tar.gz"))
2569 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2570 (modules '((guix build utils)))
2573 (substitute* "Makefile.in"
2574 (("includedir = /usr/include/sysfs")
2575 "includedir = @includedir@"))
2576 (substitute* "configure"
2577 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2578 (string-append "includedir='" orig "/sysfs'")))))))
2579 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2581 (define-public cpufrequtils
2583 (name "cpufrequtils")
2590 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2593 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2594 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2595 (build-system gnu-build-system)
2597 `(("sysfsutils" ,sysfsutils-1)))
2599 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2600 (assoc-ref %outputs "out") "/lib"))))
2601 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2602 (synopsis "Utilities to get and set CPU frequency on Linux")
2604 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2605 information, and set the CPU frequency if supported, using the cpufreq
2606 capabilities of the Linux kernel.")
2607 (license license:gpl2)))
2609 (define-public libraw1394
2616 "mirror://kernel.org/linux/libs/ieee1394/"
2617 name "-" version ".tar.xz"))
2620 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2621 (build-system gnu-build-system)
2622 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2623 (synopsis "Interface library for the Linux IEEE1394 drivers")
2625 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2626 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2627 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2628 send to and receive from other nodes without requiring a kernel driver for the
2629 protocol in question.")
2630 (license license:lgpl2.1+)))
2632 (define-public libavc1394
2638 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2639 name "-" version ".tar.gz"))
2642 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2643 (build-system gnu-build-system)
2645 `(("pkg-config" ,pkg-config)))
2647 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2648 (home-page "https://sourceforge.net/projects/libavc1394/")
2649 (synopsis "AV/C protocol library for IEEE 1394")
2651 "Libavc1394 is a programming interface to the AV/C specification from
2652 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2653 (license license:lgpl2.1+)))
2655 (define-public libiec61883
2657 (name "libiec61883")
2662 "mirror://kernel.org/linux/libs/ieee1394/"
2663 name "-" version ".tar.xz"))
2666 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2667 (build-system gnu-build-system)
2669 `(("pkg-config" ,pkg-config)))
2671 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2672 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2673 (synopsis "Isochronous streaming media library for IEEE 1394")
2675 "The libiec61883 library provides a higher level API for streaming DV,
2676 MPEG-2 and audio over Linux IEEE 1394.")
2677 (license license:lgpl2.1+)))
2679 (define-public mdadm
2686 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2690 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2691 (build-system gnu-build-system)
2695 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2699 ;; TODO: tell it where to find 'sendmail'
2700 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2701 (string-append "BINDIR=" out "/sbin")
2702 (string-append "MANDIR=" out "/share/man")
2703 (string-append "UDEVDIR=" out "/lib/udev")))
2704 #:phases (alist-cons-before
2705 'build 'patch-program-paths
2706 (lambda* (#:key inputs #:allow-other-keys)
2707 (let ((coreutils (assoc-ref inputs "coreutils")))
2708 (substitute* "udev-md-raid-arrays.rules"
2709 (("/usr/bin/(readlink|basename)" all program)
2710 (string-append coreutils "/bin/" program)))))
2712 'build 'remove-W-error
2714 ;; We cannot build with -Werror on i686 due to a
2715 ;; 'sign-compare' warning in util.c.
2716 (substitute* "Makefile"
2719 (alist-delete 'configure %standard-phases)))
2720 ;;tests must be done as root
2722 (home-page "http://neil.brown.name/blog/mdadm")
2723 (synopsis "Tool for managing Linux Software RAID arrays")
2725 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2726 assemble, report on, and monitor arrays. It can also move spares between raid
2727 arrays when needed.")
2728 (license license:gpl2+)))
2730 (define-public mdadm-static
2733 (name "mdadm-static")
2735 (substitute-keyword-arguments (package-arguments mdadm)
2736 ((#:make-flags flags)
2737 `(cons "LDFLAGS = -static" ,flags))
2739 `(modify-phases ,phases
2740 (add-after 'install 'remove-cruft
2741 (lambda* (#:key outputs #:allow-other-keys)
2742 (let* ((out (assoc-ref outputs "out"))
2743 (precious? (lambda (file)
2744 (member file '("." ".." "sbin"))))
2745 (directories (scandir out (negate precious?))))
2746 (with-directory-excursion out
2747 (for-each delete-file-recursively directories)
2748 (remove-store-references "sbin/mdadm")
2749 (delete-file "sbin/mdmon")
2751 ((#:modules modules %gnu-build-system-modules)
2752 `((ice-9 ftw) ,@modules))
2753 ((#:strip-flags _ '())
2754 ''("--strip-all")) ;strip a few extra KiB
2755 ((#:allowed-references _ '("out"))
2756 '("out")))) ;refer only self
2757 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2759 (define-public multipath-tools
2761 (name "multipath-tools")
2765 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2766 ".git;a=snapshot;h=" version ";sf=tgz"))
2767 (file-name (string-append name "-" version ".tar.gz"))
2770 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2771 (modules '((guix build utils)))
2774 ;; Drop bundled valgrind headers.
2775 (delete-file-recursively "third-party")
2776 (substitute* '("multipathd/main.c"
2777 "libmultipath/debug.c")
2778 (("#include \"../third-party/")
2781 (build-system gnu-build-system)
2783 '(#:tests? #f ; No tests.
2784 #:make-flags (list (string-append "DESTDIR="
2785 (assoc-ref %outputs "out"))
2787 (string-append "LDFLAGS=-Wl,-rpath="
2788 (assoc-ref %outputs "out")
2791 (modify-phases %standard-phases
2792 (add-after 'unpack 'patch-source
2793 (lambda* (#:key inputs #:allow-other-keys)
2794 (let ((lvm2 (assoc-ref inputs "lvm2"))
2795 (udev (assoc-ref inputs "udev")))
2796 (substitute* "Makefile.inc"
2797 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2798 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2799 (("/usr/include/libdevmapper.h")
2800 (string-append lvm2 "/include/libdevmapper.h"))
2801 (("/usr/include/libudev.h")
2802 (string-append udev "/include/libudev.h")))
2805 (add-before 'build 'set-CC
2811 ("pkg-config" ,pkg-config)
2812 ("valgrind" ,valgrind)))
2814 `(("ceph:lib" ,ceph "lib")
2817 ("liburcu" ,liburcu)
2819 ("readline" ,readline)
2821 (home-page "http://christophe.varoqui.free.fr/")
2822 (synopsis "Access block devices through multiple paths")
2824 "This package provides the following binaries to drive the
2825 Linux Device Mapper multipathing driver:
2827 @item @command{multipath} - Device mapper target autoconfig.
2828 @item @command{multipathd} - Multipath daemon.
2829 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2830 @code{dm} multipath devices.
2831 @item @command{kpartx} - Create device maps from partition tables.
2833 (license (list license:gpl2+ ; Main distribution.
2834 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2836 (define-public libaio
2843 (string-append "mirror://debian/pool/main/liba/libaio/"
2844 name "_" version ".orig.tar.gz")))
2847 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2848 (build-system gnu-build-system)
2851 (list "CC=gcc" (string-append "prefix=" %output))
2852 #:test-target "partcheck" ; need root for a full 'check'
2854 (alist-delete 'configure %standard-phases))) ; no configure script
2855 (home-page "http://lse.sourceforge.net/io/aio.html")
2856 (synopsis "Linux-native asynchronous I/O access library")
2858 "This library enables userspace to use Linux kernel asynchronous I/O
2859 system calls, important for the performance of databases and other advanced
2861 (license license:lgpl2.1+)))
2869 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2870 name "-" version ".tar.xz"))
2873 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2874 (build-system gnu-build-system)
2876 `(("libsndfile" ,libsndfile)))
2878 `(("pkg-config" ,pkg-config)))
2879 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2880 (synopsis "Bluetooth subband audio codec")
2882 "The SBC is a digital audio encoder and decoder used to transfer data to
2883 Bluetooth audio output devices like headphones or loudspeakers.")
2884 (license license:gpl2+)))
2886 (define-public bluez
2893 "mirror://kernel.org/linux/bluetooth/bluez-"
2897 "1sb4aflgyrl7apricjipa8wx95qm69yja0lmn2f19g560c3v1b2c"))))
2898 (build-system gnu-build-system)
2901 (let ((out (assoc-ref %outputs "out")))
2902 (list "--sysconfdir=/etc"
2903 "--localstatedir=/var"
2906 ;; Install dbus/udev files to the correct location.
2907 (string-append "--with-dbusconfdir=" out "/etc")
2908 (string-append "--with-udevdir=" out "/lib/udev")))
2910 (modify-phases %standard-phases
2911 (add-after 'install 'post-install
2912 (lambda* (#:key inputs outputs #:allow-other-keys)
2913 (let* ((out (assoc-ref outputs "out"))
2914 (servicedir (string-append out "/share/dbus-1/services"))
2915 (service "obexd/src/org.bluez.obex.service")
2916 (rule (string-append
2917 out "/lib/udev/rules.d/97-hid2hci.rules")))
2918 ;; Install the obex dbus service file.
2919 (substitute* service
2921 (string-append out "/libexec/bluetooth/obexd")))
2922 (install-file service servicedir)
2923 ;; Fix paths in the udev rule.
2925 (("hid2hci --method")
2926 (string-append out "/lib/udev/hid2hci --method"))
2928 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2931 `(("pkg-config" ,pkg-config)
2932 ("gettext" ,gettext-minimal)))
2937 ("libical" ,libical)
2938 ("readline" ,readline)))
2939 (home-page "http://www.bluez.org/")
2940 (synopsis "Linux Bluetooth protocol stack")
2942 "BlueZ provides support for the core Bluetooth layers and protocols. It
2943 is flexible, efficient and uses a modular implementation.")
2944 (license license:gpl2+)))
2946 (define-public fuse-exfat
2953 "https://github.com/relan/exfat/releases/download/v"
2954 version "/" name "-" version ".tar.gz"))
2957 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
2958 (build-system gnu-build-system)
2960 `(("pkg-config" ,pkg-config)))
2963 (home-page "https://github.com/relan/exfat")
2964 (synopsis "Mount exFAT file systems")
2966 "This package provides a FUSE-based file system that provides read and
2967 write access to exFAT devices.")
2968 (license license:gpl2+)))
2977 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2978 version ".tar.bz2"))
2981 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2982 (build-system gnu-build-system)
2984 '(#:phases (modify-phases %standard-phases
2985 (add-before 'configure 'bootstrap
2987 ;; The tarball was not generated with 'make dist' so we
2988 ;; need to bootstrap things ourselves.
2989 (and (zero? (system* "./autogen.sh"))
2991 (patch-makefile-SHELL "Makefile.include.in")
2994 ;; Make sure programs find libgpm.so.
2995 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2996 (assoc-ref %outputs "out")
2999 `(("texinfo" ,texinfo)
3002 ("autoconf" ,autoconf)
3003 ("automake" ,automake)
3004 ("libtool" ,libtool)))
3005 (home-page "http://www.nico.schottelius.org/software/gpm/")
3006 (synopsis "Mouse support for the Linux console")
3008 "The GPM (general-purpose mouse) daemon is a mouse server for
3009 applications running on the Linux console. It allows users to select items
3010 and copy/paste text in the console and in xterm.")
3011 (license license:gpl2+)))
3013 (define-public btrfs-progs
3015 (name "btrfs-progs")
3019 (uri (string-append "mirror://kernel.org/linux/kernel/"
3020 "people/kdave/btrfs-progs/"
3021 "btrfs-progs-v" version ".tar.xz"))
3024 "0vcp9a0a35chhjhq291kvirqhd4i9w5f4zql4y5n81kbwcrxil6h"))))
3025 (build-system gnu-build-system)
3027 "static")) ; static versions of binaries in "out" (~16MiB!)
3029 '(#:phases (modify-phases %standard-phases
3030 (add-after 'build 'build-static
3031 (lambda _ (zero? (system* "make" "static"))))
3032 (add-after 'install 'install-static
3033 (let ((staticbin (string-append (assoc-ref %outputs "static")
3036 (zero? (system* "make"
3037 (string-append "bindir=" staticbin)
3038 "install-static"))))))
3039 #:test-target "test"
3040 #:parallel-tests? #f)) ; tests fail when run in parallel
3041 (inputs `(("e2fsprogs" ,e2fsprogs)
3042 ("libblkid" ,util-linux)
3043 ("libblkid:static" ,util-linux "static")
3044 ("libuuid" ,util-linux)
3045 ("libuuid:static" ,util-linux "static")
3048 (native-inputs `(("pkg-config" ,pkg-config)
3049 ("asciidoc" ,asciidoc)
3051 ;; For building documentation.
3052 ("libxml2" ,libxml2)
3053 ("docbook-xsl" ,docbook-xsl)
3056 (home-page "https://btrfs.wiki.kernel.org/")
3057 (synopsis "Create and manage btrfs copy-on-write file systems")
3058 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3059 aimed at implementing advanced features while focusing on fault tolerance,
3060 repair and easy administration.")
3061 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3062 ;; GPL2: Everything else.
3063 (license (list license:gpl2 license:gpl2+))))
3065 (define-public btrfs-progs/static
3067 (name "btrfs-progs-static")
3068 (version (package-version btrfs-progs))
3070 (build-system trivial-build-system)
3072 `(("btrfs-progs:static" ,btrfs-progs "static")))
3074 `(#:modules ((guix build utils))
3077 (use-modules (guix build utils)
3081 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3082 (out (assoc-ref %outputs "out"))
3083 (source (string-append btrfs "/bin/btrfs.static"))
3084 (target (string-append out "/bin/btrfs")))
3085 (mkdir-p (dirname target))
3086 (copy-file source target)
3087 (remove-store-references target)
3088 (chmod target #o555)))))
3089 (home-page (package-home-page btrfs-progs))
3090 (synopsis "Statically-linked btrfs command from btrfs-progs")
3091 (description "This package provides the statically-linked @command{btrfs}
3092 from the btrfs-progs package. It is meant to be used in initrds.")
3093 (license (package-license btrfs-progs))))
3095 (define-public freefall
3098 (version (package-version linux-libre))
3099 (source (package-source linux-libre))
3100 (build-system gnu-build-system)
3102 '(#:phases (modify-phases %standard-phases
3103 (add-after 'unpack 'enter-subdirectory
3105 (chdir "tools/laptop/freefall")))
3107 (add-before 'build 'increase-timeout
3109 ;; The default of 2 seconds is too low: it assumes an
3110 ;; open lid and AC power without actually checking.
3111 (substitute* "freefall.c"
3112 (("alarm\\(2\\)") "alarm(5)")))))
3113 #:make-flags (list (string-append "PREFIX="
3114 (assoc-ref %outputs "out")))
3115 #:tests? #f)) ;no tests
3116 (home-page (package-home-page linux-libre))
3117 (synopsis "Free-fall protection for spinning laptop hard drives")
3119 "Prevents shock damage to the internal spinning hard drive(s) of some
3120 HP and Dell laptops. When sudden movement is detected, all input/output
3121 operations on the drive are suspended and its heads are parked on the ramp,
3122 where they are less likely to cause damage to the spinning disc. Requires a
3123 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3124 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3125 (license license:gpl2)))
3127 (define-public thinkfan
3133 (uri (string-append "mirror://sourceforge/thinkfan/"
3134 "/thinkfan-" version ".tar.gz"))
3137 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3138 (modules '((guix build utils)))
3139 ;; Fix erroneous man page location in Makefile leading to
3140 ;; a compilation failure.
3142 '(substitute* "CMakeLists.txt"
3143 (("thinkfan\\.1") "src/thinkfan.1")))))
3144 (build-system cmake-build-system)
3146 `(#:modules ((guix build cmake-build-system)
3149 #:tests? #f ;no test target
3151 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3152 `("-DUSE_ATASMART:BOOL=ON")
3154 (modify-phases %standard-phases
3155 ;; Install scripts for various foreign init systems. Also fix
3156 ;; hard-coded path for daemon.
3157 (add-after 'install 'install-rc-scripts
3158 (lambda* (#:key outputs #:allow-other-keys)
3159 (let ((out (assoc-ref outputs "out"))
3161 (string-append "../thinkfan-" ,version "/rcscripts")
3164 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3165 (string-append out "/sbin/" name)))
3166 (for-each (cute install-file <>
3167 (string-append out "/share/thinkfan"))
3171 `(("libatasmart" ,libatasmart)))
3172 (home-page "http://thinkfan.sourceforge.net/")
3173 (synopsis "Simple fan control program")
3175 "Thinkfan is a simple fan control program. It reads temperatures,
3176 checks them against configured limits and switches to appropriate (also
3177 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3178 other @code{hwmon} driver that enables temperature reading and fan control
3180 (license license:gpl3+)))
3182 (define-public ntfs-3g
3185 (version "2016.2.22")
3188 (uri (string-append "https://tuxera.com/opensource/"
3189 "ntfs-3g_ntfsprogs-" version ".tgz"))
3192 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3193 (modules '((guix build utils)))
3194 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
3196 ;; Install under $prefix.
3197 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3200 (build-system gnu-build-system)
3201 (inputs `(("util-linux" ,util-linux)
3202 ("fuse" ,fuse))) ;libuuid
3203 (native-inputs `(("pkg-config" ,pkg-config)))
3205 '(#:configure-flags (list "--exec-prefix=${prefix}"
3206 "--with-fuse=external" ;use our own FUSE
3207 "--enable-mount-helper"
3208 "--enable-posix-acls"
3209 "--enable-xattr-mappings")))
3210 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3211 (synopsis "Read-write access to NTFS file systems")
3213 "NTFS-3G provides read-write access to NTFS file systems, which are
3214 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3215 The package provides additional NTFS tools.")
3216 (license license:gpl2+)))
3218 (define-public rdma-core
3224 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3225 "/releases/download/v" version "/rdma-core-"
3229 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3230 (build-system cmake-build-system)
3232 '(#:tests? #f ; no tests
3233 ;; Upstream uses the "ninja" build system and encourage distros
3234 ;; to do the same for consistency. They also recommend using the
3235 ;; "Release" build type.
3236 #:configure-flags (list "-GNinja"
3237 ;; Defaults to "lib64" on 64-bit archs.
3238 (string-append "-DCMAKE_INSTALL_LIBDIR="
3239 (assoc-ref %outputs "out") "/lib")
3240 "-DCMAKE_BUILD_TYPE=Release")
3242 (modify-phases %standard-phases
3245 (zero? (system* "ninja"
3246 "-j" (number->string (parallel-job-count))))))
3249 (zero? (system* "ninja" "install")))))))
3252 ("pkg-config" ,pkg-config)
3253 ("python" ,python-wrapper)))
3257 (home-page "https://github.com/linux-rdma/rdma-core")
3258 (synopsis "Utilities and libraries for working with RDMA devices")
3260 "This package provides userspace components for the InfiniBand
3261 subsystem of the Linux kernel. Specifically it contains userspace
3262 libraries for the following device nodes:
3265 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3266 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3267 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3270 The following service daemons are also provided:
3272 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3273 @item @code{iwpmd} (for iWARP kernel providers)
3274 @item @code{ibacm} (for InfiniBand communication management assistant)
3276 ;; All library code is dual licensed under GPL2 and a custom MIT
3277 ;; variant. The package also includes some components covered by
3278 ;; other licenses. Consult COPYING.md for full details.
3281 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3282 license:bsd-2 ; Files referring to COPYING.BSD_FB
3283 license:cc0 ; most files in ccan/
3284 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3286 (define-public rng-tools
3293 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3294 "rng-tools-" version ".tar.gz"))
3297 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3298 (build-system gnu-build-system)
3299 (synopsis "Random number generator daemon")
3301 "Monitor a hardware random number generator, and supply entropy
3302 from that to the system kernel's @file{/dev/random} machinery.")
3303 (home-page "https://sourceforge.net/projects/gkernel")
3304 ;; The source package is offered under the GPL2+, but the files
3305 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3306 (license (list license:gpl2 license:gpl2+))))
3308 (define-public cpupower
3311 (version (package-version linux-libre))
3312 (source (package-source linux-libre))
3313 (build-system gnu-build-system)
3315 '(#:phases (modify-phases %standard-phases
3316 (add-after 'unpack 'enter-subdirectory
3318 (chdir "tools/power/cpupower")))
3320 (add-before 'build 'fix-makefiles
3322 (substitute* "Makefile"
3324 (("/bin/(install|pwd)" _ command) command))
3325 (substitute* "bench/Makefile"
3326 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3327 #:make-flags (let ((out (assoc-ref %outputs "out")))
3328 (list (string-append "DESTDIR=" out)
3329 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3330 "docdir=/share/doc/cpupower"
3331 "confdir=$(docdir)/examples"
3332 ;; The Makefile recommends the following changes
3334 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3335 #:tests? #f)) ;no tests
3336 (native-inputs `(("gettext" ,gettext-minimal)))
3337 (inputs `(("pciutils" ,pciutils)))
3338 (home-page (package-home-page linux-libre))
3339 (synopsis "CPU frequency and voltage scaling tools for Linux")
3341 "cpupower is a set of user-space tools that use the cpufreq feature of the
3342 Linux kernel to retrieve and control processor features related to power saving,
3343 such as frequency and voltage scaling.")
3344 (license license:gpl2)))
3346 (define-public haveged
3353 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3357 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3358 (build-system gnu-build-system)
3359 (home-page "http://www.issihosts.com/haveged")
3360 (synopsis "Entropy source for the Linux random number generator")
3362 "haveged generates an unpredictable stream of random numbers for use by
3363 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3364 standard mechanisms for filling the entropy pool may not be sufficient for
3365 systems with high needs or limited user interaction, such as headless servers.
3366 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3367 indirect effects of hardware events on hidden processor state using the HArdware
3368 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3369 its environment and provides the same built-in test suite for the output stream
3370 as used on certified hardware security devices.")
3371 (license (list (license:non-copyleft "file://nist/mconf.h")
3372 (license:non-copyleft "file://nist/packtest.c")
3373 license:public-domain ; nist/dfft.c
3374 license:gpl3+)))) ; everything else
3376 (define-public ecryptfs-utils
3378 (name "ecryptfs-utils")
3383 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3384 version "/+download/ecryptfs-utils_"
3385 version ".orig.tar.gz"))
3388 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3389 (build-system gnu-build-system)
3391 `(#:configure-flags (list "--disable-pywrap")))
3393 `(("intltool" ,intltool)
3394 ("perl" ,perl) ; for pod2man
3395 ("pkg-config" ,pkg-config)))
3397 `(("keyutils" ,keyutils)
3398 ("linux-pam" ,linux-pam)
3400 (home-page "http://ecryptfs.org/")
3401 (synopsis "eCryptfs cryptographic file system utilities")
3403 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3404 Each file's cryptographic meta-data is stored inside the file itself, along
3405 with the encrypted contents. This allows individual encrypted files to be
3406 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3407 native Linux file system, and has been part of the Linux kernel since version
3408 2.6.19. This package contains the userland utilities to manage it.")
3409 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3410 ;; grant additional permission to link with OpenSSL.
3411 (license license:gpl2+)))
3413 (define-public libnfsidmap
3415 (name "libnfsidmap")
3420 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3421 name "/" name "-" version ".tar.gz"))
3424 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3425 (build-system gnu-build-system)
3427 `(#:configure-flags (list
3428 (string-append "--with-pluginpath="
3429 (assoc-ref %outputs "out")
3430 "/lib/libnfsidmap"))))
3432 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3434 "NFSv4 support library for name/ID mapping")
3435 (description "Libnfsidmap is a library holding mulitiple methods of
3436 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3437 extensible array of mapping functions, currently consisting of two choices:
3438 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3439 (license (license:non-copyleft "file://COPYING"
3440 "See COPYING in the distribution."))))
3442 (define-public module-init-tools
3444 (name "module-init-tools")
3449 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3450 "module-init-tools-" version ".tar.bz2"))
3453 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3454 (patches (search-patches "module-init-tools-moduledir.patch"))))
3455 (build-system gnu-build-system)
3457 ;; FIXME: The upstream tarball lacks man pages, and building them would
3458 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3459 ;; but they vanished. In the meantime, fake it.
3460 '(#:phases (alist-cons-before
3461 'configure 'fake-docbook
3463 (substitute* "Makefile.in"
3464 (("^DOCBOOKTOMAN.*$")
3465 "DOCBOOKTOMAN = true\n")))
3467 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3468 (synopsis "Tools for loading and managing Linux kernel modules")
3470 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3471 `insmod', `lsmod', and more.")
3472 (license license:gpl2+)))
3474 (define-public mcelog
3480 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3481 "mcelog.git/snapshot/v" version ".tar.gz"))
3484 "0q40d60p1klzg0aznvxhxgjlddwcxfj2q59s4q86sf9ild6rcdhl"))
3485 (file-name (string-append name "-" version ".tar.gz"))
3486 (modules '((guix build utils)))
3488 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3489 `(substitute* "Makefile"
3490 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3491 (build-system gnu-build-system)
3493 `(#:phases (modify-phases %standard-phases
3494 (delete 'configure)) ; no configure script
3495 #:make-flags (let ((out (assoc-ref %outputs "out")))
3497 (string-append "prefix=" out)
3498 (string-append "DOCDIR=" out "/share/doc/mcelog")
3499 "etcprefix=$(DOCDIR)/examples"))
3500 ;; The tests will only run as root on certain supported CPU models.
3502 (supported-systems (list "i686-linux" "x86_64-linux"))
3503 (home-page "http://mcelog.org/")
3504 (synopsis "Machine check monitor for x86 Linux systems")
3506 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3507 and other hardware errors on x86 systems. It can also perform user-defined
3508 tasks, such as bringing bad pages off-line, when configurable error thresholds
3510 (license license:gpl2)))
3512 (define-public mtd-utils
3519 "ftp://ftp.infradead.org/pub/mtd-utils/"
3520 "mtd-utils-" version ".tar.bz2"))
3523 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3526 ("libuuid" ,util-linux)
3529 (build-system gnu-build-system)
3531 `(#:test-target "tests"
3532 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3533 #:phases (modify-phases %standard-phases
3534 (delete 'configure))))
3535 (synopsis "MTD Flash Storage Utilities")
3536 (description "This package provides utilities for testing, partitioning, etc
3538 (home-page "http://www.linux-mtd.infradead.org/")
3540 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3541 license:mpl1.1 ; All ftl* files
3542 license:expat)))) ; libiniparser
3544 (define-public libseccomp
3550 (uri (string-append "https://github.com/seccomp/libseccomp/"
3551 "releases/download/v" version
3552 "/libseccomp-" version ".tar.gz"))
3555 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3556 (build-system gnu-build-system)
3558 `(("which" ,which)))
3559 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3560 (description "The libseccomp library provides an easy to use, platform
3561 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3562 libseccomp API is designed to abstract away the underlying BPF based syscall
3563 filter language and present a more conventional function-call based filtering
3564 interface that should be familiar to, and easily adopted by, application
3566 (home-page "https://github.com/seccomp/libseccomp")
3567 (license license:lgpl2.1)))
3569 (define-public radeontop
3573 (home-page "https://github.com/clbr/radeontop/")
3576 (uri (string-append home-page "archive/v" version ".tar.gz"))
3577 (file-name (string-append name "-" version ".tar.gz"))
3580 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3581 (build-system gnu-build-system)
3583 `(#:phases (modify-phases %standard-phases
3584 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3585 ;; dependency, and doesn't even work on release(!) tarballs.
3586 (add-after 'unpack 'report-correct-version
3587 (lambda _ (substitute* "getver.sh"
3589 (string-append "ver=" ,version)))))
3590 (delete 'configure)) ; no configure script
3591 #:make-flags (list "CC=gcc"
3592 (string-append "PREFIX=" %output))
3593 #:tests? #f)) ; no tests
3595 `(("gettext" ,gettext-minimal)
3596 ("pkg-config" ,pkg-config)))
3598 `(("libdrm" ,libdrm)
3599 ("libpciaccess" ,libpciaccess)
3601 ("ncurses" ,ncurses)))
3602 (synopsis "Usage monitor for AMD Radeon graphics")
3603 (description "RadeonTop monitors resource consumption on supported AMD
3604 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3605 a terminal or saved to a file for further processing. It measures both the
3606 activity of the GPU as a whole, which is also accurate during OpenCL
3607 computations, as well as separate component statistics that are only meaningful
3608 under OpenGL graphics workloads.")
3609 (license license:gpl3)))
3611 (define-public efivar
3617 (uri (string-append "https://github.com/rhinstaller/" name
3618 "/releases/download/" version "/" name
3619 "-" version ".tar.bz2"))
3622 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3623 (build-system gnu-build-system)
3625 `(;; Tests require a UEFI system and is not detected in the chroot.
3627 #:make-flags (list (string-append "prefix=" %output)
3628 (string-append "libdir=" %output "/lib")
3629 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3631 (modify-phases %standard-phases
3632 (delete 'configure))))
3634 `(("pkg-config" ,pkg-config)))
3637 (home-page "https://github.com/rhinstaller/efivar")
3638 (synopsis "Tool and library to manipulate EFI variables")
3639 (description "This package provides a library and a command line
3640 interface to the variable facility of UEFI boot firmware.")
3641 (license license:lgpl2.1+)))
3643 (define-public efibootmgr
3649 (uri (string-append "https://github.com/rhinstaller/" name
3650 "/releases/download/" version "/" name
3651 "-" version ".tar.bz2"))
3654 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3655 (build-system gnu-build-system)
3657 `(#:tests? #f ; No tests.
3658 #:make-flags (list (string-append "prefix=" %output)
3659 (string-append "libdir=" %output "/lib")
3660 ;; Override CFLAGS to add efivar include directory.
3661 (string-append "CFLAGS=-O2 -g -flto -I"
3662 (assoc-ref %build-inputs "efivar")
3665 (modify-phases %standard-phases
3666 (add-after 'unpack 'branding
3667 ;; Replace default loader path with something more familiar.
3669 (substitute* "src/efibootmgr.c"
3670 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3673 (delete 'configure))))
3675 `(("pkg-config" ,pkg-config)))
3677 `(("efivar" ,efivar)
3679 (home-page "https://github.com/rhinstaller/efibootmgr")
3680 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3682 "@code{efibootmgr} is a user-space application to modify the Intel
3683 Extensible Firmware Interface (EFI) Boot Manager. This application can
3684 create and destroy boot entries, change the boot order, change the next
3685 running boot option, and more.")
3686 (license license:gpl2+)))
3688 (define-public sysstat
3694 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3695 "sysstat-" version ".tar.xz"))
3698 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3699 (build-system gnu-build-system)
3701 `(#:tests? #f ; No test suite.
3702 ;; Without this flag, it tries to install the man pages with group 'root'
3703 ;; and fails because /etc/passwd lacks an entry for the root user.
3705 (list "--disable-file-attr"
3706 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3708 (modify-phases %standard-phases
3709 ;; The build process tries to create '/var/lib/sa', so we skip that
3711 (add-after 'build 'skip-touching-var
3713 (substitute* "Makefile"
3714 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3717 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3718 (synopsis "Performance monitoring tools for Linux")
3719 (description "The sysstat utilities are a collection of performance
3720 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3721 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3722 @code{sadf} and @code{sa}.")
3723 (license license:gpl2+)))
3725 (define-public light
3731 (uri (string-append "https://github.com/haikarainen/" name
3732 "/archive/v" version ".tar.gz"))
3735 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3736 (file-name (string-append name "-" version ".tar.gz"))))
3737 (build-system gnu-build-system)
3739 '(#:tests? #f ; no tests
3740 #:make-flags (list "CC=gcc"
3741 (string-append "PREFIX=" %output))
3743 (modify-phases %standard-phases
3745 (add-after 'unpack 'patch-makefile
3747 (substitute* "Makefile" (("chown") "#")))))))
3749 `(("help2man" ,help2man)))
3750 (home-page "https://haikarainen.github.io/light")
3751 (synopsis "GNU/Linux application to control backlights")
3753 "Light is a program to send commands to screen backlight controllers
3754 under GNU/Linux. Features include:
3757 @item It does not rely on X.
3758 @item Light can automatically figure out the best controller to use, making
3759 full use of underlying hardware.
3760 @item It is possible to set a minimum brightness value, as some controllers
3761 set the screen to be pitch black at a vaĺue of 0 (or higher).
3764 Light is the successor of lightscript.")
3765 (license license:gpl3+)))
3774 "https://github.com/linrunner/"
3775 (string-upcase name)
3776 "/archive/" version ".tar.gz"))
3777 (file-name (string-append name "-" version ".tar.gz"))
3780 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3781 (inputs `(("bash" ,bash)
3783 ("ethtool" ,ethtool)
3787 ("inetutils" ,inetutils)
3790 ("pciutils" ,pciutils)
3794 ("usbutils" ,usbutils)
3795 ("util-linux" ,util-linux)
3796 ("wireless-tools" ,wireless-tools)))
3797 (build-system gnu-build-system)
3800 (modify-phases %standard-phases
3801 (delete 'configure) ; no configure script
3802 (add-before 'build 'setenv
3803 (lambda* (#:key outputs #:allow-other-keys)
3804 (let ((out (assoc-ref outputs "out")))
3805 (setenv "TLP_WITH_SYSTEMD" "0")
3806 (setenv "TLP_NO_INIT" "1")
3807 (setenv "TLP_NO_PMUTILS" "1")
3808 (setenv "TLP_SBIN" (string-append out "/bin"))
3809 (setenv "TLP_BIN" (string-append out "/bin"))
3810 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3811 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3812 (setenv "TLP_CONF" "/etc/tlp")
3814 (string-append out "/share/bash-completion/completions"))
3815 (setenv "TLP_MAN" (string-append out "/share/man")))))
3816 (delete 'check) ; no tests
3817 (add-before 'install 'fix-installation
3819 ;; Stop the Makefile from trying to create system directories.
3820 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
3823 (zero? (system* "make" "install-tlp" "install-man"))))
3824 (add-after 'install 'wrap
3825 (lambda* (#:key inputs outputs #:allow-other-keys)
3826 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3827 (bin-files (find-files bin ".*")))
3828 (define (bin-directory input-name)
3829 (string-append (assoc-ref inputs input-name) "/bin"))
3830 (define (sbin-directory input-name)
3831 (string-append (assoc-ref inputs input-name) "/sbin"))
3832 (for-each (lambda (program)
3833 (wrap-program program
3836 (map bin-directory '("bash"
3847 (map sbin-directory '("ethtool"
3852 "wireless-tools"))))))
3854 (home-page "http://linrunner.de/en/tlp/tlp.html")
3855 (synopsis "Power management tool for Linux")
3856 (description "TLP is a power management tool for Linux. It comes with
3857 a default configuration already optimized for battery life. Nevertheless,
3858 TLP is customizable to fulfil system requirements. TLP settings are applied
3859 every time the power supply source is changed.")
3861 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3863 (license (list license:gpl2+ license:gpl3+))))
3871 (uri (string-append "https://www.ezix.org/software/"
3872 "files/lshw-" version
3876 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3877 (build-system gnu-build-system)
3879 `(#:phases (modify-phases %standard-phases (delete 'configure))
3880 #:tests? #f ; no tests
3882 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3883 (synopsis "List hardware information")
3885 "@command{lshw} (Hardware Lister) is a small tool to provide
3886 detailed information on the hardware configuration of the machine.
3887 It can report exact memory configuration, firmware version, mainboard
3888 configuration, CPU version and speed, cache configuration, bus speed,
3889 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3890 machines (PowerMac G4 is known to work).")
3891 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3892 (license license:gpl2+)))
3894 (define-public libmnl
3901 (uri (string-append "mirror://netfilter.org/libmnl/"
3902 "libmnl-" version ".tar.bz2"))
3905 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
3906 (build-system gnu-build-system)
3907 (home-page "https://www.netfilter.org/projects/libmnl/")
3908 (synopsis "Netlink utility library")
3909 (description "Libmnl is a minimalistic user-space library oriented to
3910 Netlink developers. There are a lot of common tasks in parsing, validating,
3911 constructing of both the Netlink header and TLVs that are repetitive and easy to
3912 get wrong. This library aims to provide simple helpers that allows you to
3913 re-use code and to avoid re-inventing the wheel.")
3914 (license license:lgpl2.1+)))
3916 (define-public libnftnl
3923 (uri (string-append "mirror://netfilter.org/libnftnl/"
3924 "libnftnl-" version ".tar.bz2"))
3927 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
3928 (build-system gnu-build-system)
3930 `(("pkg-config" ,pkg-config)))
3932 `(("libmnl" ,libmnl)))
3933 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
3934 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
3935 (description "Libnftnl is a userspace library providing a low-level netlink
3936 programming interface to the in-kernel nf_tables subsystem. The library
3937 libnftnl has been previously known as libnftables. This library is currently
3939 (license license:gpl2+)))
3941 (define-public nftables
3948 (uri (string-append "http://www.nftables.org/projects/nftables"
3949 "/files/nftables-" version ".tar.bz2"))
3952 "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy"))))
3953 (build-system gnu-build-system)
3954 (inputs `(("bison", bison)
3958 ("libnftnl", libnftnl)
3959 ("readline", readline)))
3960 (native-inputs `(("pkg-config", pkg-config)))
3961 (home-page "http://www.nftables.org")
3962 (synopsis "Userspace utility for Linux packet filtering")
3963 (description "nftables is the project that aims to replace the existing
3964 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
3965 filtering framework, a new userspace utility and also a compatibility layer for
3966 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
3967 infrastructure such as the existing hooks, the connection tracking system, the
3968 userspace queueing component and the logging subsystem.")
3969 (license license:gpl2)))
3971 (define-public proot
3975 (home-page "https://github.com/proot-me/PRoot")
3978 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3979 (file-name (string-append name "-" version ".tar.gz"))
3982 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
3983 (patches (search-patches "proot-test-fhs.patch"))))
3984 (build-system gnu-build-system)
3986 '(#:make-flags '("-C" "src")
3988 #:phases (modify-phases %standard-phases
3990 (add-before 'build 'set-shell-file-name
3991 (lambda* (#:key inputs #:allow-other-keys)
3992 (substitute* (find-files "src" "\\.[ch]$")
3995 (assoc-ref inputs "bash")
3998 (add-before 'check 'fix-fhs-assumptions-in-tests
4000 (substitute* "tests/test-c6b77b77.mk"
4001 (("/bin/bash") (which "bash"))
4002 (("/usr/bin/test") (which "test")))
4003 (substitute* '("tests/test-16573e73.c")
4004 (("/bin/([a-z-]+)" _ program)
4007 (substitute* (find-files "tests" "\\.sh$")
4008 ;; Some of the tests try to "bind-mount" /bin/true.
4010 (string-append "-b " (which "true") ":"))
4011 ;; Likewise for /bin.
4012 (("-b /bin:") "-b /gnu:")
4013 ;; Others try to run /bin/sh.
4014 (("/bin/sh") (which "sh"))
4015 ;; Others assume /etc/fstab exists.
4016 (("/etc/fstab") "/etc/passwd"))
4018 (substitute* "tests/GNUmakefile"
4019 (("-b /bin:") "-b /gnu:"))
4021 ;; XXX: This test fails in an obscure corner case, just
4023 (delete-file "tests/test-kkkkkkkk.c")
4028 (let ((n (parallel-job-count)))
4029 ;; For some reason we get lots of segfaults with
4030 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4031 (setenv "PROOT_NO_SECCOMP" "1")
4033 ;; Most of the tests expect "/bin" to be in $PATH so
4034 ;; they can run things that live in $ROOTFS/bin.
4036 (string-append (getenv "PATH") ":/bin"))
4038 (zero? (system* "make" "check" "-C" "tests"
4040 "-j" (number->string n))))))
4042 (lambda* (#:key outputs #:allow-other-keys)
4043 ;; The 'install' rule does nearly nothing.
4044 (let ((out (assoc-ref outputs "out")))
4046 ;; TODO: 'make install-care' (does not even
4047 ;; build currently.)
4048 (system* "make" "-C" "src" "install"
4049 (string-append "PREFIX=" out)))
4050 (let ((man1 (string-append out
4051 "/share/man/man1")))
4053 (copy-file "doc/proot/man.1"
4054 (string-append man1 "/proot.1"))
4056 (native-inputs `(("which" ,which)
4058 ;; For 'mcookie', used by some of the tests.
4059 ("util-linux" ,util-linux)))
4060 (inputs `(("talloc" ,talloc)))
4061 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4063 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4064 and @code{binfmt_misc}. This means that users don't need any privileges or
4065 setup to do things like using an arbitrary directory as the new root
4066 filesystem, making files accessible somewhere else in the file system
4067 hierarchy, or executing programs built for another CPU architecture
4068 transparently through QEMU user-mode. Also, developers can use PRoot as a
4069 generic process instrumentation engine thanks to its extension mechanism.
4070 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4071 available in the kernel Linux.")
4072 (license license:gpl2+)))
4074 (define-public proot-static
4077 (name "proot-static")
4079 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4080 (inputs `(("talloc" ,talloc/static)))
4082 (substitute-keyword-arguments (package-arguments proot)
4083 ((#:make-flags flags)
4084 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4086 `(modify-phases ,phases
4087 (add-after 'strip 'remove-store-references
4088 (lambda* (#:key outputs #:allow-other-keys)
4089 (let* ((out (assoc-ref outputs "out")))
4090 (with-directory-excursion out
4091 (remove-store-references "bin/proot")
4093 ((#:allowed-references _ '("out"))
4096 (define-public cpuid
4099 (version "20170122")
4102 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4103 version ".src.tar.gz"))
4106 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4107 (build-system gnu-build-system)
4109 '(#:make-flags '("CC=gcc")
4110 #:tests? #f ; no tests
4111 #:phases (modify-phases %standard-phases
4113 (add-before 'install 'fix-makefile
4114 (lambda* (#:key outputs #:allow-other-keys)
4115 (substitute* "Makefile"
4116 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4117 ;; Make the compressed manpages writable so that the
4118 ;; reset-gzip-timestamps phase does not error out.
4119 (substitute* "Makefile"
4120 (("-m 444") "-m 644"))
4122 (inputs `(("perl" ,perl)))
4123 (supported-systems '("i686-linux" "x86_64-linux"))
4124 (home-page "http://www.etallen.com/cpuid.html")
4125 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4126 (description "cpuid dumps detailed information about the CPU(s) gathered
4127 from the CPUID instruction, and also determines the exact model of CPU(s). It
4128 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4129 NexGen, Rise, and SiS CPUs.")
4130 (license license:gpl2+)))
4132 (define-public jmtpfs
4139 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4141 (file-name (string-append name "-" version ".tar.gz"))
4144 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4145 (build-system gnu-build-system)
4149 ("libmtp" ,libmtp)))
4151 `(("pkg-config" ,pkg-config)))
4152 (home-page "https://github.com/JasonFerrara/jmtpfs")
4153 (synopsis "Use a FUSE filesystem to access data over MTP")
4154 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4155 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4156 the MTP device as a filesystem.")
4157 (license license:gpl3)))
4159 (define-public procenv
4166 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4168 (file-name (string-append name "-" version ".tar.gz"))
4170 (base32 "0brzf6185hb76imw107cl21c8lzwiywkxi3jknihrk86bvvicd0d"))))
4171 (build-system gnu-build-system)
4172 (arguments `(#:configure-flags '("--disable-silent-rules")))
4173 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4174 ("groff" ,groff) ; for tests
4175 ("libselinux" ,libselinux)))
4176 (synopsis "Utility to show process environment")
4177 (description "Procenv is a command-line tool that displays as much detail about
4178 itself and its environment as possible. It can be used as a test
4179 tool, to understand the type of environment a process runs in, and for
4180 comparing system environments.")
4181 (home-page "http://github.com/jamesodhunt/procenv/")
4182 (license license:gpl3+)))