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")
367 (define %linux-libre-hash "153ibjdgys7friij4hnkvmp9ycvx50zgpyl9mwbr4prr409q3ndf")
369 (define-public linux-libre
370 (make-linux-libre %linux-libre-version
372 %intel-compatible-systems
373 #:configuration-file kernel-config))
375 (define-public linux-libre-4.9
376 (make-linux-libre "4.9.35"
377 "0fs90jgb01jybkclngg5asvbs1y70f2abs395qcb3lxpx7zxhy1h"
378 %intel-compatible-systems
379 #:configuration-file kernel-config))
381 (define-public linux-libre-4.4
382 (make-linux-libre "4.4.75"
383 "1h687flrdzlcd1ms5n2khm0mxybr8bj2jfnnm7qvy6ha2vsngb5b"
384 %intel-compatible-systems
385 #:configuration-file kernel-config))
387 (define-public linux-libre-4.1
388 (make-linux-libre "4.1.42"
389 "1g5jhn7cm6ixn7w8ciqm6qgxv7k1jg50v6k05hsvzvrqfpaxqlbz"
390 %intel-compatible-systems
391 #:configuration-file kernel-config))
393 (define-public linux-libre-arm-generic
394 (make-linux-libre %linux-libre-version
397 #:defconfig "multi_v7_defconfig"
398 #:extra-version "arm-generic"))
402 ;;; Pluggable authentication modules (PAM).
405 (define-public linux-pam
413 "http://www.linux-pam.org/library/"
414 "Linux-PAM-" version ".tar.bz2"))
417 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
418 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
420 (build-system gnu-build-system)
424 ;; TODO: optional dependencies
425 ;; ("libxcrypt" ,libxcrypt)
426 ;; ("cracklib" ,cracklib)
429 '(;; Most users, such as `shadow', expect the headers to be under
431 #:configure-flags (list (string-append "--includedir="
432 (assoc-ref %outputs "out")
433 "/include/security"))
435 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
438 (home-page "http://www.linux-pam.org/")
439 (synopsis "Pluggable authentication modules for Linux")
441 "A *Free* project to implement OSF's RFC 86.0.
442 Pluggable authentication modules are small shared object files that can
443 be used through the PAM API to perform tasks, like authenticating a user
444 at login. Local and dynamic reconfiguration are its key features.")
445 (license license:bsd-3)))
447 (define-public linux-pam-1.2
455 "http://www.linux-pam.org/library/"
456 "Linux-PAM-" version ".tar.bz2"))
459 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
460 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
467 (define-public psmisc
474 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
478 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
479 (build-system gnu-build-system)
480 (inputs `(("ncurses" ,ncurses)))
481 (home-page "https://gitlab.com/psmisc/psmisc")
483 "Small utilities that use the proc file system")
485 "This PSmisc package is a set of some small useful utilities that
486 use the proc file system. We're not about changing the world, but
487 providing the system administrator with some help in common tasks.")
488 (license license:gpl2+)))
490 (define-public util-linux
496 (uri (string-append "mirror://kernel.org/linux/utils/"
497 name "/v" (version-major+minor version) "/"
498 name "-" version ".tar.xz"))
501 "1qz81w8vzrmy8xn9yx7ls4amkbgwx6vr62pl6kv9g7r0g3ba9kmc"))
502 (patches (search-patches "util-linux-tests.patch"))
503 (modules '((guix build utils)))
505 ;; We take the 'logger' program from GNU Inetutils and 'kill'
506 ;; from GNU Coreutils.
508 (substitute* "configure"
509 (("build_logger=yes") "build_logger=no")
510 (("build_kill=yes") "build_kill=no"))
512 (build-system gnu-build-system)
514 "static")) ; >2 MiB of static .a libraries
516 `(#:configure-flags (list "--disable-use-tty-group"
517 "--enable-fs-paths-default=/run/current-system/profile/sbin"
518 ;; Install completions where our
519 ;; bash-completion package expects them.
520 (string-append "--with-bashcompletiondir="
521 (assoc-ref %outputs "out")
522 "/etc/bash_completion.d"))
523 #:phases (modify-phases %standard-phases
525 'build 'set-umount-file-name
526 (lambda* (#:key outputs #:allow-other-keys)
527 ;; Tell 'eject' the right file name of 'umount'.
528 (let ((out (assoc-ref outputs "out")))
529 (substitute* "sys-utils/eject.c"
531 (string-append "\"" out "/bin/umount\"")))
535 (lambda* (#:key inputs outputs #:allow-other-keys)
536 (let ((out (assoc-ref outputs "out"))
537 (net (assoc-ref inputs "net-base")))
538 ;; Change the test to refer to the right file.
539 (substitute* "tests/ts/misc/mcookie"
541 (string-append net "/etc/services")))
544 'install 'move-static-libraries
545 (lambda* (#:key outputs #:allow-other-keys)
546 (let ((out (assoc-ref outputs "out"))
547 (static (assoc-ref outputs "static")))
548 (mkdir-p (string-append static "/lib"))
549 (with-directory-excursion out
550 (for-each (lambda (file)
552 (string-append static "/"
554 (find-files "lib" "\\.a$")))
556 (inputs `(("zlib" ,zlib)
559 ;; XXX: This is so that the 'pre-check' phase can find it.
560 ,@(if (%current-target-system)
561 `(("net-base" ,net-base))
565 ("net-base" ,net-base))) ;for tests
566 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
567 (synopsis "Collection of utilities for the Linux kernel")
568 (description "Util-linux is a diverse collection of Linux kernel
569 utilities. It provides dmesg and includes tools for working with file systems,
570 block devices, UUIDs, TTYs, and many other tools.")
572 ;; Note that util-linux doesn't use the same license for all the
573 ;; code. GPLv2+ is the default license for a code without an
574 ;; explicitly defined license.
575 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
576 license:bsd-4 license:public-domain))))
584 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
586 (file-name (string-append name "-" version ".tar.gz"))
588 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
589 (build-system cmake-build-system)
590 (arguments '(#:tests? #f))
591 (home-page "https://github.com/bo0ts/ddate")
592 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
594 "ddate displays the Discordian date and holidays of a given date.
595 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
596 by Robert Shea and Robert Anton Wilson.")
597 (license license:public-domain)))
599 (define-public procps
605 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
606 "procps-ng-" version ".tar.xz"))
609 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
610 (build-system gnu-build-system)
612 '(#:modules ((guix build utils)
613 (guix build gnu-build-system)
617 (modify-phases %standard-phases
618 (add-before 'check 'disable-strtod-test
620 ;; Disable the 'strtod' test, which fails on 32-bit systems.
621 ;; This is what upstream does:
622 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
623 (substitute* "Makefile"
624 (("^(TESTS|check_PROGRAMS) = .*$" all)
625 (string-append "# " all "\n")))
628 'install 'post-install
629 ;; Remove commands and man pages redudant with
631 (lambda* (#:key outputs #:allow-other-keys)
632 (let* ((out (assoc-ref outputs "out"))
633 (dup (append-map (cut find-files out <>)
634 '("^kill" "^uptime"))))
635 (for-each delete-file dup)
637 (inputs `(("ncurses" ,ncurses)))
638 (home-page "https://gitlab.com/procps-ng/procps/")
639 (synopsis "Utilities that give information about processes")
641 "Procps is the package that has a bunch of small useful utilities
642 that give information about processes using the Linux /proc file system.
643 The package includes the programs ps, top, vmstat, w, kill, free,
644 slabtop, and skill.")
645 (license license:gpl2)))
647 (define-public usbutils
654 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
655 "usbutils-" version ".tar.xz"))
658 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
659 (build-system gnu-build-system)
662 ("eudev" ,eudev-with-hwdb)))
664 `(("pkg-config" ,pkg-config)))
665 (home-page "http://www.linux-usb.org/")
667 "Tools for working with USB devices, such as lsusb")
669 "Tools for working with USB devices, such as lsusb.")
670 (license license:gpl2+)))
672 (define-public e2fsprogs
679 "mirror://kernel.org/linux/kernel/people/tytso/"
680 name "/v" version "/"
681 name "-" version ".tar.xz"))
684 "092absr4vrlqrkdf9nwh4ykj40ab6hhwrkdr6sjsccd54c8z5csl"))))
685 (build-system gnu-build-system)
686 (inputs `(("util-linux" ,util-linux)))
687 (native-inputs `(("pkg-config" ,pkg-config)
688 ("texinfo" ,texinfo) ;for the libext2fs Info manual
694 '(;; util-linux is the preferred source for some of the libraries and
695 ;; commands, so disable them (see, e.g.,
696 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
697 #:configure-flags (list "--disable-libblkid"
698 "--disable-libuuid" "--disable-uuidd"
701 ;; Use symlinks instead of hard links for
702 ;; 'fsck.extN' etc. This makes the resulting nar
703 ;; smaller and is preserved across copies.
704 "--enable-symlink-install"
706 (string-append "LDFLAGS=-Wl,-rpath="
707 (assoc-ref %outputs "out")
710 ;; Install libext2fs et al.
711 "--enable-elf-shlibs")
714 (modify-phases %standard-phases
715 (add-before 'configure 'patch-shells
717 (substitute* "configure"
718 (("/bin/sh (.*)parse-types.sh" _ dir)
719 (string-append (which "sh") " " dir
721 (substitute* "MCONFIG.in"
722 (("INSTALL_SYMLINK = /bin/sh")
723 "INSTALL_SYMLINK = sh"))
724 (substitute* (find-files "." "^Makefile.in$")
726 (string-append "#!" (which "sh"))))
728 (add-after 'install 'install-libs
729 (lambda* (#:key outputs #:allow-other-keys)
730 (let* ((out (assoc-ref outputs "out"))
731 (lib (string-append out "/lib")))
732 (and (zero? (system* "make" "install-libs"))
734 ;; Make the .a writable so that 'strip' works.
735 ;; Failing to do that, due to debug symbols, we
736 ;; retain a reference to the final
737 ;; linux-libre-headers, which refer to the
738 ;; bootstrap binaries.
739 (let ((archives (find-files lib "\\.a$")))
740 (for-each (lambda (file)
744 (home-page "http://e2fsprogs.sourceforge.net/")
745 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
747 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
748 (license (list license:gpl2 ;programs
749 license:lgpl2.0 ;libext2fs
750 license:x11)))) ;libuuid
752 (define e2fsprogs/static
754 (package (inherit e2fsprogs)
756 ;; Do not build shared libraries.
757 (substitute-keyword-arguments (package-arguments e2fsprogs)
758 ((#:configure-flags _)
759 '(list "--disable-blkid"))
763 (define-public e2fsck/static
765 (name "e2fsck-static")
766 (version (package-version e2fsprogs))
767 (build-system trivial-build-system)
770 `(("e2fsprogs" ,e2fsprogs/static)))
772 `(#:modules ((guix build utils))
775 (use-modules (guix build utils)
779 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
781 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
783 (with-directory-excursion bin
784 (copy-file e2fsck "e2fsck")
785 (remove-store-references "e2fsck")
786 (chmod "e2fsck" #o555))))))
787 (home-page (package-home-page e2fsprogs))
788 (synopsis "Statically-linked e2fsck command from e2fsprogs")
789 (description "This package provides statically-linked e2fsck command taken
790 from the e2fsprogs package. It is meant to be used in initrds.")
791 (license (package-license e2fsprogs))))
793 (define-public extundelete
799 (uri (string-append "mirror://sourceforge/extundelete/"
800 "extundelete/" version "/extundelete-"
804 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
805 (build-system gnu-build-system)
806 (inputs `(("e2fsprogs" ,e2fsprogs)))
807 (home-page "http://extundelete.sourceforge.net/")
808 (synopsis "Recover deleted files from ext2/3/4 partitions")
810 "Extundelete is a set of tools that can recover deleted files from an
811 ext3 or ext4 partition.")
812 (license license:gpl2)))
814 (define-public zerofree
818 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
821 (uri (string-append home-page name "-" version
825 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
826 (build-system gnu-build-system)
828 '(#:phases (alist-replace
830 (lambda* (#:key outputs #:allow-other-keys)
831 (let* ((out (assoc-ref outputs "out"))
832 (bin (string-append out "/bin")))
834 (copy-file "zerofree"
835 (string-append bin "/zerofree"))
836 (chmod (string-append bin "/zerofree")
839 (alist-delete 'configure %standard-phases))
840 #:tests? #f)) ;no tests
841 (inputs `(("libext2fs" ,e2fsprogs)))
842 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
844 "The zerofree command scans the free blocks in an ext2 file system and
845 fills any non-zero blocks with zeroes. This is a useful way to make disk
846 images more compressible.")
847 (license license:gpl2)))
849 (define-public strace
855 (uri (string-append "mirror://sourceforge/strace/strace/" version
856 "/strace-" version ".tar.xz"))
859 "026agy9nq238nx3ynhmi8h3vx96yra4xacfsm2ybs9k23ry8ibc9"))))
860 (build-system gnu-build-system)
863 (modify-phases %standard-phases
864 (add-after 'unpack 'patch-/bin/sh
866 (substitute* "strace.c"
867 (("/bin/sh") (which "sh")))
869 (native-inputs `(("perl" ,perl)))
870 (home-page "https://strace.io/")
871 (synopsis "System call tracer for Linux")
873 "strace is a system call tracer, i.e. a debugging tool which prints out a
874 trace of all the system calls made by a another process/program.")
875 (license license:bsd-3)))
877 (define-public ltrace
883 (uri (string-append "http://www.ltrace.org/ltrace_" version
887 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
888 (build-system gnu-build-system)
889 (inputs `(("libelf" ,libelf)))
891 ;; Compilation uses -Werror by default, but it fails.
892 '(#:configure-flags '("--disable-werror")))
893 (home-page "http://www.ltrace.org/")
894 (synopsis "Library call tracer for Linux")
896 "ltrace intercepts and records dynamic library calls which are called by
897 an executed process and the signals received by that process. It can also
898 intercept and print the system calls executed by the program.")
899 (license license:gpl2+)))
901 (define-public alsa-lib
908 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
912 "174n2psp0328xcy2f1ayls67598bxli6q9cf00d2qnac3012aa3i"))))
913 (build-system gnu-build-system)
914 (home-page "https://www.alsa-project.org/")
915 (synopsis "The Advanced Linux Sound Architecture libraries")
917 "The Advanced Linux Sound Architecture (ALSA) provides audio and
918 MIDI functionality to the Linux-based operating system.")
919 (license license:lgpl2.1+)))
921 (define-public alsa-utils
927 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
928 name "-" version ".tar.bz2"))
931 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
932 (build-system gnu-build-system)
934 ;; XXX: Disable man page creation until we have DocBook.
935 '(#:configure-flags (list "--disable-xmlto"
937 ;; The udev rule is responsible for restoring
939 (string-append "--with-udev-rules-dir="
940 (assoc-ref %outputs "out")
941 "/lib/udev/rules.d"))
943 (modify-phases %standard-phases
945 'install 'pre-install
947 ;; Don't try to mkdir /var/lib/alsa.
948 (substitute* "Makefile"
949 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
953 `(("libsamplerate" ,libsamplerate)
955 ("alsa-lib" ,alsa-lib)
957 ("gettext" ,gettext-minimal)))
958 (home-page "http://www.alsa-project.org/")
959 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
961 "The Advanced Linux Sound Architecture (ALSA) provides audio and
962 MIDI functionality to the Linux-based operating system.")
964 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
966 (license license:gpl2)))
968 (define-public alsa-plugins
970 (name "alsa-plugins")
974 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
975 name "-" version ".tar.bz2"))
978 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
979 (build-system gnu-build-system)
980 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
981 ;; be split, there are references to both in files.
982 ;; TODO: Remove OSS related plugins, they add support to run native
983 ;; ALSA applications on OSS however we do not offer OSS and OSS is
985 (outputs '("out" "pulseaudio"))
988 (modify-phases %standard-phases
989 (add-after 'install 'split
990 (lambda* (#:key inputs outputs #:allow-other-keys)
991 ;; Distribute the binaries to the various outputs.
992 (let* ((out (assoc-ref outputs "out"))
993 (pua (assoc-ref outputs "pulseaudio"))
994 (pualib (string-append pua "/lib/alsa-lib"))
995 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
998 (chdir (string-append out "/share"))
999 (for-each (lambda (file)
1000 (rename-file file (string-append puaconf "/" (basename file))))
1001 (find-files out "\\.(conf|example)"))
1002 (for-each (lambda (file)
1003 (rename-file file (string-append pualib "/" (basename file))))
1004 (find-files out ".*pulse\\.(la|so)"))
1006 ;; We have moved the files to output pulsaudio, the
1007 ;; directory is now empty.
1008 (delete-file-recursively (string-append out "/share"))
1011 `(("alsa-lib" ,alsa-lib)
1012 ("speex" ,speex) ; libspeexdsp resampling plugin
1013 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1014 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1015 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1017 `(("pkg-config" ,pkg-config)))
1018 (home-page "http://www.alsa-project.org/")
1019 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1021 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1022 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1023 by providing additional plugins which include: upmixing, downmixing, jackd and
1024 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1025 external rate conversion.")
1026 (license (list license:gpl2+
1027 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1028 license:lgpl2.1+))))
1030 (define-public iptables
1037 "mirror://netfilter.org/iptables/iptables-"
1038 version ".tar.bz2"))
1041 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
1042 (build-system gnu-build-system)
1044 `(("pkg-config" ,pkg-config)
1048 `(("libmnl" ,libmnl)
1049 ("libnftnl" ,libnftnl)))
1051 '(#:tests? #f ; no test suite
1052 #:configure-flags ; add $libdir to the RUNPATH of executables
1053 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1054 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1055 (synopsis "Program to configure the Linux IP packet filtering rules")
1057 "iptables is the userspace command line program used to configure the
1058 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1059 system administrators. Since Network Address Translation is also configured
1060 from the packet filter ruleset, iptables is used for this, too. The iptables
1061 package also includes ip6tables. ip6tables is used for configuring the IPv6
1063 (license license:gpl2+)))
1065 (define-public ebtables
1068 (version "2.0.10-4")
1072 "mirror://netfilter.org/ebtables/ebtables-v"
1076 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1077 (build-system gnu-build-system)
1079 '(#:tests? #f ; no test suite
1081 (let* ((out (assoc-ref %outputs "out"))
1082 (bin (string-append out "/sbin"))
1083 (lib (string-append out "/lib"))
1084 (man (string-append out "/share/man"))
1085 (iptables (assoc-ref %build-inputs "iptables"))
1086 (ethertypes (string-append iptables "/etc/ethertypes")))
1087 (list (string-append "LIBDIR=" lib)
1088 (string-append "MANDIR=" man)
1089 (string-append "BINDIR=" bin)
1090 (string-append "ETHERTYPESFILE=" ethertypes)
1091 ;; With the default CFLAGS, it falis with:
1092 ;; communication.c:259:58: error: variable ‘ret’ set but not
1093 ;; used [-Werror=unused-but-set-variable]
1096 (modify-phases %standard-phases
1098 ;; no configure script
1100 (substitute* "Makefile"
1101 ;; Remove user and group options from install commands,
1102 ;; otherwise it fails with: invalid user 'root'.
1103 (("-o root -g root") "")
1104 ;; Remove 'ethertypes' from the install target.
1106 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1110 ("iptables" ,iptables)))
1111 (synopsis "Ethernet bridge frame table administration")
1112 (home-page "http://ebtables.netfilter.org/")
1114 "ebtables is an application program used to set up and maintain the
1115 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1116 analogous to the iptables application, but less complicated, due to the fact
1117 that the Ethernet protocol is much simpler than the IP protocol.")
1118 (license license:gpl2+)))
1120 (define-public iproute
1127 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1131 "0zdxdsxyaazl85xhwskvsmpyzwf5qp21cvjsi1lw3xnrc914q2if"))))
1132 (build-system gnu-build-system)
1134 `(#:tests? #f ; no test suite
1135 #:make-flags (let ((out (assoc-ref %outputs "out")))
1137 (string-append "BASH_COMPDIR=" out
1138 "/etc/bash_completion.d")
1139 (string-append "LIBDIR=" out "/lib")
1140 (string-append "HDRDIR=" out "/include")
1141 (string-append "SBINDIR=" out "/sbin")
1142 (string-append "CONFDIR=" out "/etc")
1143 (string-append "DOCDIR=" out "/share/doc/"
1145 (string-append "MANDIR=" out "/share/man")))
1146 #:phases (modify-phases %standard-phases
1147 (add-before 'install 'pre-install
1149 ;; Don't attempt to create /var/lib/arpd.
1150 (substitute* "Makefile"
1151 (("^.*ARPDDIR.*$") "")))))))
1153 `(("iptables" ,iptables)
1156 `(("pkg-config" ,pkg-config)
1160 "https://wiki.linuxfoundation.org/networking/iproute2")
1162 "Utilities for controlling TCP/IP networking and traffic in Linux")
1164 "Iproute2 is a collection of utilities for controlling TCP/IP
1165 networking and traffic with the Linux kernel.
1167 Most network configuration manuals still refer to ifconfig and route as the
1168 primary network configuration tools, but ifconfig is known to behave
1169 inadequately in modern network environments. They should be deprecated, but
1170 most distros still include them. Most network configuration systems make use
1171 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1172 to support most modern network technologies, as it doesn't use ifconfig and
1173 allows a system administrator to make use of all iproute2 features, including
1176 iproute2 is usually shipped in a package called iproute or iproute2 and
1177 consists of several tools, of which the most important are @command{ip} and
1178 @command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1179 @command{tc} stands for traffic control. Both tools print detailed usage
1180 messages and are accompanied by a set of manpages.")
1181 (license license:gpl2+)))
1183 (define-public net-tools
1184 ;; XXX: This package is basically unmaintained, but it provides a few
1185 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1190 (home-page "http://net-tools.sourceforge.net/")
1193 (uri (list (string-append
1194 "mirror://sourceforge/net-tools/net-tools-"
1197 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1198 "/base/net-tools/net-tools-1.60.tar.bz2")))
1201 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1202 (patches (search-patches "net-tools-bitrot.patch"))))
1203 (build-system gnu-build-system)
1205 '(#:modules ((guix build gnu-build-system)
1209 #:phases (alist-cons-after
1211 (lambda* (#:key inputs #:allow-other-keys)
1212 (define (apply-patch file)
1213 (zero? (system* "patch" "-p1" "--force"
1216 (let ((patch.gz (assoc-ref inputs "patch")))
1217 (format #t "applying Debian patch set '~a'...~%"
1219 (system (string-append "gunzip < " patch.gz " > the-patch"))
1220 (and (apply-patch "the-patch")
1221 (for-each apply-patch
1222 (find-files "debian/patches"
1226 (lambda* (#:key outputs #:allow-other-keys)
1227 (let ((out (assoc-ref outputs "out")))
1228 (mkdir-p (string-append out "/bin"))
1229 (mkdir-p (string-append out "/sbin"))
1231 ;; Pretend we have everything...
1232 (system "yes | make config")
1234 ;; ... except for the things we don't have.
1235 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1236 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1237 ;; that have been removed.
1238 (substitute* '("config.make" "config.h")
1239 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1241 'install 'remove-redundant-commands
1242 (lambda* (#:key outputs #:allow-other-keys)
1243 ;; Remove commands and man pages redundant with
1245 (let* ((out (assoc-ref outputs "out"))
1246 (dup (append-map (cut find-files out <>)
1248 "^(yp|nis|dns)?domainname"))))
1249 (for-each delete-file dup)
1253 ;; Binaries that depend on libnet-tools.a don't declare that
1254 ;; dependency, making it parallel-unsafe.
1255 #:parallel-build? #f
1257 #:tests? #f ; no test suite
1258 #:make-flags (let ((out (assoc-ref %outputs "out")))
1260 (string-append "BASEDIR=" out)
1261 (string-append "INSTALLNLSDIR=" out "/share/locale")
1262 (string-append "mandir=/share/man")))))
1264 ;; Use the big Debian patch set (the thing does not even compile out of
1266 (inputs `(("patch" ,(origin
1269 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1272 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1273 (native-inputs `(("gettext" ,gettext-minimal)))
1275 (synopsis "Tools for controlling the network subsystem in Linux")
1277 "This package includes the important tools for controlling the network
1278 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1279 route. Additionally, this package contains utilities relating to particular
1280 network hardware types (plipconfig, slattach) and advanced aspects of IP
1281 configuration (iptunnel, ipmaddr).")
1282 (license license:gpl2+)))
1284 (define-public libcap
1291 "mirror://kernel.org/linux/libs/security/linux-privs/"
1292 "libcap2/libcap-" version ".tar.xz"))
1295 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1296 (build-system gnu-build-system)
1297 (arguments '(#:phases
1298 (modify-phases %standard-phases
1300 ;; Add $libdir to the RUNPATH of executables.
1302 (substitute* "Make.Rules"
1304 (string-append "LDFLAGS := -Wl,-rpath="
1305 %output "/lib"))))))
1306 #:tests? #f ; no 'check' target
1307 #:make-flags (list "lib=lib"
1308 (string-append "prefix="
1309 (assoc-ref %outputs "out"))
1310 "RAISE_SETFCAP=no")))
1311 (native-inputs `(("perl" ,perl)))
1312 (inputs `(("attr" ,attr)))
1313 (home-page "https://sites.google.com/site/fullycapable/")
1314 (synopsis "Library for working with POSIX capabilities")
1316 "Libcap2 provides a programming interface to POSIX capabilities on
1317 Linux-based operating systems.")
1319 ;; License is BSD-3 or GPLv2, at the user's choice.
1320 (license license:gpl2)))
1322 (define-public bridge-utils
1324 (name "bridge-utils")
1328 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1329 "bridge-utils-" version ".tar.gz"))
1332 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1333 (build-system gnu-build-system)
1335 ;; The tarball lacks all the generated files.
1336 (native-inputs `(("autoconf" ,autoconf)
1337 ("automake" ,automake)))
1339 '(#:phases (alist-cons-after
1342 ;; Fix "field ‘ip6’ has incomplete type" errors.
1343 (substitute* "libbridge/libbridge.h"
1344 (("#include <linux/if_bridge.h>")
1345 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1347 ;; Ensure that the entire build fails if one of the
1348 ;; sub-Makefiles fails.
1349 (substitute* "Makefile.in"
1350 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1351 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1353 (zero? (system* "autoreconf" "-vf")))
1355 #:tests? #f)) ; no 'check' target
1358 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1359 (synopsis "Manipulate Ethernet bridges")
1361 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1362 to connect two Ethernet segments together in a protocol independent way.
1363 Packets are forwarded based on Ethernet address, rather than IP address (like
1364 a router). Since forwarding is done at Layer 2, all protocols can go
1365 transparently through a bridge.")
1366 (license license:gpl2+)))
1368 (define-public libnl
1375 "https://github.com/thom311/libnl/releases/download/"
1376 "libnl" (string-join (string-split version #\.) "_")
1377 "/libnl-" version ".tar.gz"))
1380 "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
1381 (build-system gnu-build-system)
1382 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1383 (home-page "http://www.infradead.org/~tgr/libnl/")
1384 (synopsis "NetLink protocol library suite")
1386 "The libnl suite is a collection of libraries providing APIs to netlink
1387 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1388 between the kernel and user space processes. It was designed to be a more
1389 flexible successor to ioctl to provide mainly networking related kernel
1390 configuration and monitoring interfaces.")
1392 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1393 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1394 (license license:gpl2)))
1403 "mirror://kernel.org/software/network/iw/iw-"
1407 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1408 (build-system gnu-build-system)
1409 (native-inputs `(("pkg-config" ,pkg-config)))
1410 (inputs `(("libnl" ,libnl)))
1412 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1414 #:phases (alist-delete 'configure %standard-phases)))
1415 (home-page "https://wireless.wiki.kernel.org/")
1416 (synopsis "Tool for configuring wireless devices")
1418 "iw is a new nl80211 based CLI configuration utility for wireless
1419 devices. It replaces @code{iwconfig}, which is deprecated.")
1420 (license license:isc)))
1422 (define-public powertop
1430 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1434 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1435 (build-system gnu-build-system)
1438 (modify-phases %standard-phases
1439 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1440 ;; allow calibrating the network interface in GuixSD.
1441 (add-after 'unpack 'patch-absolute-file-names
1442 (lambda* (#:key inputs #:allow-other-keys)
1443 (let ((kmod (assoc-ref inputs "kmod")))
1444 (substitute* (find-files "src" "\\.cpp$")
1445 ;; Give the right 'modprobe' file name so that essential
1446 ;; modules such as msr.ko can be loaded.
1447 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1448 ;; These programs are only needed to calibrate, so using
1449 ;; relative file names avoids adding extra inputs. When they
1450 ;; are missing powertop gracefully handles it.
1451 (("/usr/bin/hcitool") "hcitool")
1452 (("/usr/bin/xset") "xset")
1453 (("/usr/sbin/hciconfig") "hciconfig"))
1458 ("ncurses" ,ncurses)
1459 ("pciutils" ,pciutils)
1462 `(("pkg-config" ,pkg-config)))
1463 (home-page "https://01.org/powertop/")
1464 (synopsis "Analyze power consumption on Intel-based laptops")
1466 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1467 power management. In addition to being a diagnostic tool, PowerTOP also has
1468 an interactive mode where the user can experiment various power management
1469 settings for cases where the operating system has not enabled these
1471 (license license:gpl2)))
1473 (define-public aumix
1480 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1481 version ".tar.bz2"))
1484 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1485 (build-system gnu-build-system)
1486 (inputs `(("ncurses" ,ncurses)))
1487 (home-page "http://www.jpj.net/~trevor/aumix.html")
1488 (synopsis "Audio mixer for X and the console")
1490 "Aumix adjusts an audio mixer from X, the console, a terminal,
1491 the command line or a script.")
1492 (license license:gpl2+)))
1494 (define-public iotop
1501 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1504 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1505 (build-system python-build-system)
1507 ;; The setup.py script expects python-2.
1508 `(#:python ,python-2
1509 ;; There are currently no checks in the package.
1511 (native-inputs `(("python" ,python-2)))
1512 (home-page "http://guichaz.free.fr/iotop/")
1514 "Displays the IO activity of running processes")
1516 "Iotop is a Python program with a top like user interface to show the
1517 processes currently causing I/O.")
1518 (license license:gpl2+)))
1526 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1527 "download/fuse-" version
1528 "/fuse-" version ".tar.gz"))
1531 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1532 (patches (search-patches "fuse-overlapping-headers.patch"))))
1533 (build-system gnu-build-system)
1534 (inputs `(("util-linux" ,util-linux)))
1536 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1537 (assoc-ref %outputs "out")
1539 (string-append "INIT_D_PATH="
1540 (assoc-ref %outputs "out")
1543 ;; The rule makes /dev/fuse 666.
1544 (string-append "UDEV_RULES_PATH="
1545 (assoc-ref %outputs "out")
1546 "/lib/udev/rules.d"))
1547 #:phases (alist-cons-before
1548 'build 'set-file-names
1549 (lambda* (#:key inputs #:allow-other-keys)
1550 ;; libfuse calls out to mount(8) and umount(8). Make sure
1551 ;; it refers to the right ones.
1552 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1553 (("/bin/(u?)mount" _ maybe-u)
1554 (string-append (assoc-ref inputs "util-linux")
1555 "/bin/" maybe-u "mount")))
1556 (substitute* '("util/mount.fuse.c")
1560 ;; This hack leads libfuse to search for 'fusermount' in
1561 ;; $PATH, where it may find a setuid-root binary, instead of
1562 ;; trying solely $out/sbin/fusermount and failing because
1564 (substitute* "lib/Makefile"
1565 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1566 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1568 (home-page "https://github.com/libfuse/libfuse")
1569 (synopsis "Support file systems implemented in user space")
1571 "As a consequence of its monolithic design, file system code for Linux
1572 normally goes into the kernel itself---which is not only a robustness issue,
1573 but also an impediment to system extensibility. FUSE, for \"file systems in
1574 user space\", is a kernel module and user-space library that tries to address
1575 part of this problem by allowing users to run file system implementations as
1576 user-space processes.")
1577 (license (list license:lgpl2.1 ;library
1578 license:gpl2+)))) ;command-line utilities
1580 (define-public unionfs-fuse
1582 (name "unionfs-fuse")
1587 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1589 (file-name (string-append name "-" version ".tar.gz"))
1592 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1593 (build-system cmake-build-system)
1595 `(("python" ,python)
1596 ("python-pytest" ,python-pytest)))
1597 (inputs `(("fuse" ,fuse)))
1600 (modify-phases %standard-phases
1602 ;; Borrowed from the Makefile
1603 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
1604 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1605 (synopsis "User-space union file system")
1607 "UnionFS-FUSE is a flexible union file system implementation in user
1608 space, using the FUSE library. Mounting a union file system allows you to
1609 \"aggregate\" the contents of several directories into a single mount point.
1610 UnionFS-FUSE additionally supports copy-on-write.")
1611 (license license:bsd-3)))
1614 (package (inherit fuse)
1615 (name "fuse-static")
1616 (source (origin (inherit (package-source fuse))
1617 (modules '((guix build utils)))
1619 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1620 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1621 ;; it doesn't do that, allowing us to remove the dependency on
1622 ;; util-linux (something that is useful in initrds.)
1623 '(substitute* '("lib/mount_util.c"
1624 "util/mount_util.c")
1625 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1630 (define-public unionfs-fuse/static
1631 (package (inherit unionfs-fuse)
1632 (synopsis "User-space union file system (statically linked)")
1633 (name (string-append (package-name unionfs-fuse) "-static"))
1634 (source (origin (inherit (package-source unionfs-fuse))
1635 (modules '((guix build utils)))
1637 ;; Add -ldl to the libraries, because libfuse.a needs that.
1638 '(substitute* "src/CMakeLists.txt"
1639 (("target_link_libraries(.*)\\)" _ libs)
1640 (string-append "target_link_libraries"
1644 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1645 #:phases (alist-cons-after
1646 'install 'post-install
1647 (lambda* (#:key outputs #:allow-other-keys)
1648 (let* ((out (assoc-ref outputs "out"))
1649 (exe (string-append out "/bin/unionfs")))
1650 ;; By default, 'unionfs' keeps references to
1651 ;; $glibc/share/locale and similar stuff. Remove them.
1652 (remove-store-references exe)
1654 ;; 'unionfsctl' has references to glibc as well. Since
1655 ;; we don't need it, remove it.
1656 (delete-file (string-append out "/bin/unionfsctl"))
1659 (inputs `(("fuse" ,fuse-static)))))
1661 (define-public sshfs-fuse
1667 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1668 "download/sshfs-" version "/sshfs-" version
1672 "1pp5wsl1jx11apkv2fpp559miifqhi8ka400npy5awp9ghlf3la6"))))
1673 (build-system gnu-build-system)
1678 `(("pkg-config" ,pkg-config)))
1679 (home-page "https://github.com/libfuse/sshfs")
1680 (synopsis "Mount remote file systems over SSH")
1682 "This is a file system client based on the SSH File Transfer Protocol.
1683 Since most SSH servers already support this protocol it is very easy to set
1684 up: on the server side there's nothing to do; on the client side mounting the
1685 file system is as easy as logging into the server with an SSH client.")
1686 (license license:gpl2+)))
1688 (define-public archivemount
1690 (name "archivemount")
1695 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1696 "archivemount-" version ".tar.gz"))
1699 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1700 (build-system gnu-build-system)
1701 (inputs `(("fuse", fuse)
1702 ("libarchive", libarchive)))
1703 (native-inputs `(("pkg-config", pkg-config)))
1704 (home-page "http://www.cybernoia.de/software/archivemount")
1705 (synopsis "Tool for mounting archive files with FUSE")
1706 (description "archivemount is a FUSE-based file system for Unix variants,
1707 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1708 mount point where it can be read from or written to as with any other file
1709 system. This makes accessing the contents of the archive, which may be
1710 compressed, transparent to other programs, without decompressing them.")
1711 (license license:lgpl2.0+)))
1713 (define-public numactl
1720 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1725 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1726 (build-system gnu-build-system)
1728 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1729 ;; to run, which we can't assume to have.
1732 ;; NUMA is apparently not supported on armhf, see
1733 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1734 (supported-systems (delete "armhf-linux" %supported-systems))
1735 (home-page "http://oss.sgi.com/projects/libnuma/")
1736 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1738 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1739 memory is not all in one place. The numactl program allows you to run your
1740 application program on specific CPU's and memory nodes. It does this by
1741 supplying a NUMA memory policy to the operating system before running your
1744 The package contains other commands, such as numademo, numastat and memhog.
1745 The numademo command provides a quick overview of NUMA performance on your
1747 (license (list license:gpl2 ;programs
1748 license:lgpl2.1)))) ;library
1750 (define-public kbd-neo
1757 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1758 version "/linux/console/neo.map"))
1759 (file-name (string-append name "-" version ".map"))
1762 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1763 (build-system trivial-build-system)
1765 `(#:modules ((guix build utils))
1767 (use-modules (guix build utils))
1768 (let ((out (string-append %output "/share/keymaps"))
1769 (source (assoc-ref %build-inputs "source")))
1771 (copy-file source (string-append out "/neo.map"))
1773 (home-page "https://neo-layout.org")
1774 (synopsis "Neo2 console layout")
1776 "Kbd-neo provides the Neo2 keyboard layout for use with
1777 @command{loadkeys(1)} from @code{kbd(4)}.")
1778 ;; The file is located in an svn directory, the entire content of
1779 ;; the directory is licensed as GPL3.
1780 (license license:gpl3+)))
1788 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1792 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1793 (modules '((guix build utils)))
1796 (substitute* "tests/Makefile.in"
1797 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1800 (substitute* '("src/unicode_start" "src/unicode_stop")
1801 ;; Assume the Coreutils are in $PATH.
1804 (build-system gnu-build-system)
1807 (modify-phases %standard-phases
1808 (add-before 'build 'pre-build
1809 (lambda* (#:key inputs #:allow-other-keys)
1810 (let ((gzip (assoc-ref %build-inputs "gzip"))
1811 (bzip2 (assoc-ref %build-inputs "bzip2")))
1812 (substitute* "src/libkeymap/findfile.c"
1814 (string-append gzip "/bin/gzip"))
1816 (string-append bzip2 "/bin/bzip2"))))))
1817 (add-after 'install 'post-install
1818 (lambda* (#:key outputs #:allow-other-keys)
1819 ;; Make sure these programs find their comrades.
1820 (let* ((out (assoc-ref outputs "out"))
1821 (bin (string-append out "/bin")))
1822 (for-each (lambda (prog)
1823 (wrap-program (string-append bin "/" prog)
1824 `("PATH" ":" prefix (,bin))))
1825 '("unicode_start" "unicode_stop"))))))))
1826 (inputs `(("check" ,check)
1829 ("pam" ,linux-pam)))
1830 (native-search-paths
1831 (list (search-path-specification
1832 (variable "LOADKEYS_KEYMAP_PATH")
1833 (files (list "share/keymaps")))))
1834 (native-inputs `(("pkg-config" ,pkg-config)))
1835 (home-page "http://kbd-project.org/")
1836 (synopsis "Linux keyboard utilities and keyboard maps")
1838 "This package contains keytable files and keyboard utilities compatible
1839 for systems using the Linux kernel. This includes commands such as
1840 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1841 (license license:gpl2+)))
1843 (define-public inotify-tools
1845 (name "inotify-tools")
1850 "mirror://sourceforge/inotify-tools/inotify-tools/"
1851 version "/inotify-tools-" version ".tar.gz"))
1854 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1855 (build-system gnu-build-system)
1856 (home-page "http://inotify-tools.sourceforge.net/")
1857 (synopsis "Monitor file accesses")
1859 "The inotify-tools packages provides a C library and command-line tools
1860 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1861 (license license:gpl2+)))
1870 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1871 "kmod-" version ".tar.xz"))
1874 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
1875 (patches (search-patches "kmod-module-directory.patch"))))
1876 (build-system gnu-build-system)
1878 `(("pkg-config" ,pkg-config)))
1883 `(#:tests? #f ; FIXME: Investigate test failures
1884 #:configure-flags '("--with-xz" "--with-zlib")
1885 #:phases (alist-cons-after
1886 'install 'install-modprobe&co
1887 (lambda* (#:key outputs #:allow-other-keys)
1888 (let* ((out (assoc-ref outputs "out"))
1889 (bin (string-append out "/bin")))
1890 (for-each (lambda (tool)
1892 (string-append bin "/" tool)))
1893 '("insmod" "rmmod" "lsmod" "modprobe"
1894 "modinfo" "depmod"))))
1896 (home-page "https://www.kernel.org/")
1897 (synopsis "Kernel module tools")
1898 (description "Kmod is a set of tools to handle common tasks with Linux
1899 kernel modules like insert, remove, list, check properties, resolve
1900 dependencies and aliases.
1902 These tools are designed on top of libkmod, a library that is shipped with
1903 kmod. The aim is to be compatible with tools, configurations and indices
1904 from the module-init-tools project.")
1905 (license license:gpl2+))) ; library under lgpl2.1+
1907 (define-public eudev
1908 ;; The post-systemd fork, maintained by Gentoo.
1915 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1919 "06gyyl90n85x8i7lfhns514y1kg1ians13l467admyzy3kjxkqsp"))
1920 (patches (search-patches "eudev-rules-directory.patch"
1921 "eudev-conflicting-declaration.patch"))))
1922 (build-system gnu-build-system)
1924 `(("pkg-config" ,pkg-config)
1928 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1929 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1930 ;; which contains the rules to do that.
1931 `(("util-linux" ,util-linux) ;for blkid
1933 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1934 (synopsis "Userspace device management")
1935 (description "Udev is a daemon which dynamically creates and removes
1936 device nodes from /dev/, handles hotplug events and loads drivers at boot
1938 (license license:gpl2+)))
1940 (define-public eudev-with-hwdb
1941 ;; TODO: Merge with 'eudev'.
1944 (name "eudev-with-hwdb")
1946 '(#:phases (modify-phases %standard-phases
1947 (add-after 'install 'build-hwdb
1948 (lambda* (#:key outputs #:allow-other-keys)
1949 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1950 ;; similar tools to display product names.
1951 (let ((out (assoc-ref outputs "out")))
1952 (zero? (system* (string-append out "/bin/udevadm")
1953 "hwdb" "--update"))))))))))
1958 (version "2.02.171")
1961 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1965 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
1966 (modules '((guix build utils)))
1969 (use-modules (guix build utils))
1971 ;; Honor sysconfdir.
1972 (substitute* "make.tmpl.in"
1974 "confdir = @sysconfdir@\n")
1975 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1976 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1977 (patches (search-patches "lvm2-static-link.patch"))))
1978 (build-system gnu-build-system)
1980 `(("pkg-config" ,pkg-config)
1981 ("procps" ,procps))) ;tests use 'pgrep'
1986 (modify-phases %standard-phases
1987 (add-after 'configure 'set-makefile-shell
1989 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1991 (setenv "SHELL" (which "sh"))
1993 ;; Replace /bin/sh with the right file name.
1994 (patch-makefile-SHELL "make.tmpl")
1996 (add-before 'strip 'make-objects-writable
1997 (lambda* (#:key outputs #:allow-other-keys)
1998 ;; Make compiled objects writable so they can be stripped.
1999 (let ((out (assoc-ref outputs "out")))
2000 (for-each (lambda (file)
2003 (find-files (string-append out "/lib"))
2004 (find-files (string-append out "/sbin"))))
2007 #:configure-flags (list (string-append "--sysconfdir="
2008 (assoc-ref %outputs "out")
2010 "--enable-udev_sync"
2011 "--enable-udev_rules"
2013 ;; Make sure programs such as 'dmsetup' can
2014 ;; find libdevmapper.so.
2015 (string-append "LDFLAGS=-Wl,-rpath="
2016 (assoc-ref %outputs "out")
2019 ;; The tests use 'mknod', which requires root access.
2021 (home-page "https://sourceware.org/lvm2/")
2022 (synopsis "Logical volume management for Linux")
2024 "LVM2 is the logical volume management tool set for Linux-based systems.
2025 This package includes the user-space libraries and tools, including the device
2026 mapper. Kernel components are part of Linux-libre.")
2028 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2029 ;; Command-line tools are GPLv2.
2030 (license (list license:gpl2 license:lgpl2.1))))
2032 (define-public lvm2-static
2035 (name "lvm2-static")
2037 ;; Propagate udev because libdevmapper.a depends on libudev.
2038 (inputs (alist-delete "udev" (package-inputs lvm2)))
2039 (propagated-inputs `(("udev" ,eudev)))
2042 (substitute-keyword-arguments (package-arguments lvm2)
2043 ((#:configure-flags flags '())
2044 ;; LVM2 doesn't use Libtool, hence the custom option.
2045 `(cons "--enable-static_link" ,flags))))
2046 (synopsis "Logical volume management for Linux (statically linked)")))
2048 (define-public wireless-tools
2050 (name "wireless-tools")
2054 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2058 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2061 ;; Remove the older header files that are not free software.
2062 (for-each (lambda (n)
2063 (delete-file (format #f "wireless.~a.h" n)))
2064 '(10 11 12 13 14 15 16 17 18 19 20))
2066 (build-system gnu-build-system)
2069 (list (string-append "PREFIX=" %output)
2070 (string-append "INSTALL_MAN=" %output "/share/man")
2071 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2073 #:phases (modify-phases %standard-phases
2074 (delete 'configure))
2076 (synopsis "Tools for manipulating Linux Wireless Extensions")
2077 (description "Wireless Tools are used to manipulate the now-deprecated
2078 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2079 Extension was an interface allowing you to set Wireless LAN specific
2080 parameters and get the specific stats. It is deprecated in favor the nl80211
2082 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2083 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2084 ;; other files are distributed under gpl2.
2085 (license (list license:gpl2 license:lgpl2.1+))))
2093 (uri (string-append "mirror://kernel.org/software/network/crda/"
2094 "crda-" version ".tar.xz"))
2097 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2098 (patches (search-patches "crda-optional-gcrypt.patch"))))
2099 (build-system gnu-build-system)
2101 '(#:phases (modify-phases %standard-phases
2104 'build 'no-werror-no-ldconfig
2106 (substitute* "Makefile"
2108 (("ldconfig") "true"))
2111 'build 'set-regulator-db-file-name
2112 (lambda* (#:key inputs #:allow-other-keys)
2113 ;; Tell CRDA where to find our database.
2114 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2115 (substitute* "crda.c"
2116 (("\"/lib/crda/regulatory.bin\"")
2117 (string-append "\"" regdb
2118 "/lib/crda/regulatory.bin\"")))
2120 #:test-target "verify"
2121 #:make-flags (let ((out (assoc-ref %outputs "out"))
2122 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2123 (list "CC=gcc" "V=1"
2125 ;; Disable signature-checking on 'regulatory.bin'.
2126 ;; The reason is that this simplifies maintenance
2127 ;; on our side (no need to manage a distro key
2128 ;; pair), and we can guarantee integrity of
2129 ;; 'regulatory.bin' by other means anyway, such as
2130 ;; 'guix gc --verify'. See
2131 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2135 (string-append "PREFIX=" out)
2136 (string-append "SBINDIR=" out "/sbin/")
2137 (string-append "UDEV_RULE_DIR="
2138 out "/lib/udev/rules.d")
2139 (string-append "LDFLAGS=-Wl,-rpath="
2141 (string-append "REG_BIN=" regdb
2142 "/lib/crda/regulatory.bin")))))
2143 (native-inputs `(("pkg-config" ,pkg-config)
2144 ("python" ,python-2)
2145 ("wireless-regdb" ,wireless-regdb)))
2146 (inputs `(("libnl" ,libnl)))
2148 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2149 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2151 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2152 communication between the kernel Linux and user space for regulatory
2154 (license license:copyleft-next)))
2156 (define-public wireless-regdb
2158 (name "wireless-regdb")
2159 (version "2017.03.07")
2163 "mirror://kernel.org/software/network/wireless-regdb/"
2164 "wireless-regdb-" version ".tar.xz"))
2167 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2169 ;; We're building 'regulatory.bin' by ourselves.
2170 (snippet '(delete-file "regulatory.bin"))))
2171 (build-system gnu-build-system)
2173 '(#:phases (modify-phases %standard-phases
2174 (delete 'configure))
2176 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2177 ;; is computed and can be equal to 'maintainer-clean'; when that
2178 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2179 ;; just built. Thus, build things sequentially.
2180 #:parallel-build? #f
2182 #:tests? #f ;no tests
2183 #:make-flags (let ((out (assoc-ref %outputs "out")))
2184 (list (string-append "PREFIX=" out)
2185 (string-append "LSB_ID=GuixSD")
2186 (string-append "DISTRO_PUBKEY=/dev/null")
2187 (string-append "DISTRO_PRIVKEY=/dev/null")
2188 (string-append "REGDB_PUBKEY=/dev/null")
2190 ;; Leave that empty so that db2bin.py doesn't try
2191 ;; to sign 'regulatory.bin'. This allows us to
2192 ;; avoid managing a key pair for the whole distro.
2193 (string-append "REGDB_PRIVKEY=")))))
2194 (native-inputs `(("python" ,python-2)))
2196 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2197 (synopsis "Wireless regulatory database")
2199 "This package contains the wireless regulatory database Central
2200 Regulatory Database Agent (CRDA) daemon. The database contains information on
2201 country-specific regulations for the wireless spectrum.")
2202 (license license:isc)))
2204 (define-public lm-sensors
2210 (uri (list (string-append
2211 "https://github.com/groeck/lm-sensors/archive/V"
2212 (string-join (string-split version #\.) "-")
2214 (file-name (string-append name "-" version ".tar.gz"))
2217 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2218 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2219 (build-system gnu-build-system)
2220 (inputs `(("rrdtool" ,rrdtool)
2223 ("gnuplot" ,gnuplot)))
2224 (native-inputs `(("pkg-config" ,pkg-config)
2229 `(#:tests? #f ; no 'check' target
2230 #:make-flags (list (string-append "PREFIX=" %output)
2231 (string-append "ETCDIR=" %output "/etc")
2232 (string-append "MANDIR=" %output "/share/man"))
2237 'build 'patch-exec-paths
2238 (lambda* (#:key inputs outputs #:allow-other-keys)
2239 (substitute* "prog/detect/sensors-detect"
2241 (string-append "`" (assoc-ref inputs "coreutils")
2243 (("(`|\")modprobe" all open-quote)
2244 (string-append open-quote
2245 (assoc-ref inputs "kmod")
2247 (substitute* '("prog/pwm/pwmconfig"
2248 "prog/pwm/fancontrol")
2250 (string-append (assoc-ref inputs "gnuplot")
2253 (string-append (assoc-ref inputs "coreutils")
2256 (string-append (assoc-ref inputs "grep")
2259 (string-append (assoc-ref inputs "sed")
2262 (string-append (assoc-ref inputs "coreutils")
2265 (string-append (assoc-ref inputs "coreutils")
2268 (string-append (assoc-ref inputs "coreutils")
2269 "/bin/readlink -f"))))
2270 %standard-phases))))
2271 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2272 (synopsis "Utilities to read temperature/voltage/fan sensors")
2274 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2275 you to access information from temperature, voltage, and fan speed sensors.
2276 It works with most newer systems.")
2277 (license license:gpl2+)))
2279 (define-public i2c-tools
2286 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2287 version ".tar.bz2"))
2290 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2291 (build-system gnu-build-system)
2293 `(#:tests? #f ; no 'check' target
2294 #:make-flags (list (string-append "prefix=" %output)
2296 ;; no configure script
2297 #:phases (alist-delete 'configure %standard-phases)))
2300 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2301 (synopsis "I2C tools for Linux")
2303 "The i2c-tools package contains a heterogeneous set of I2C tools for
2304 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2305 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2307 (license license:gpl2+)))
2309 (define-public xsensors
2316 "http://www.linuxhardware.org/xsensors/xsensors-"
2320 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2321 (build-system gnu-build-system)
2322 (inputs `(("lm-sensors" ,lm-sensors)
2324 (native-inputs `(("pkg-config" ,pkg-config)))
2326 `(#:phases (alist-cons-before
2327 'configure 'enable-deprecated
2329 (substitute* "src/Makefile.in"
2330 (("-DGDK_DISABLE_DEPRECATED") "")
2331 (("-DGTK_DISABLE_DEPRECATED") "")))
2333 'configure 'remove-Werror
2335 (substitute* '("configure" "src/Makefile.in")
2337 %standard-phases))))
2338 (home-page "http://www.linuxhardware.org/xsensors/")
2339 (synopsis "Hardware health information viewer")
2341 "Xsensors reads data from the libsensors library regarding hardware
2342 health such as temperature, voltage and fan speed and displays the information
2343 in a digital read-out.")
2344 (license license:gpl2+)))
2349 (version (package-version linux-libre))
2350 (source (package-source linux-libre))
2351 (build-system gnu-build-system)
2353 '(#:phases (alist-replace
2355 (lambda* (#:key inputs #:allow-other-keys)
2356 (setenv "SHELL_PATH" (which "bash"))
2357 (chdir "tools/perf"))
2359 #:make-flags (list (string-append "DESTDIR="
2360 (assoc-ref %outputs "out"))
2363 ;; By default, 'config/Makefile' uses lib64 on
2364 ;; x86_64. Work around that.
2366 #:tests? #f)) ;no tests
2368 `(("pkg-config" ,pkg-config)
2372 ;; There are build scripts written in these languages.
2374 ("python" ,python-2)))
2376 `(("slang" ,slang) ;for the interactive TUI
2378 ("python" ,python-2) ;'perf' links against libpython
2379 ("elfutils" ,elfutils)
2380 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2383 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2384 ("docbook-xsl" ,docbook-xsl)
2386 ("asciidoc" ,asciidoc)))
2387 (home-page "https://perf.wiki.kernel.org/")
2388 (synopsis "Linux profiling with performance counters")
2390 "perf is a tool suite for profiling using hardware performance counters,
2391 with support in the Linux kernel. perf can instrument CPU performance
2392 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2393 of lightweight profiling. This package contains the user-land tools and in
2394 particular the 'perf' command.")
2395 (license (package-license linux-libre))))
2397 (define-public pflask
2403 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2405 (file-name (string-append name "-" version ".tar.gz"))
2408 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2409 (build-system cmake-build-system)
2411 '(#:tests? #f)) ; no tests
2412 (home-page "http://ghedo.github.io/pflask/")
2413 (synopsis "Simple tool for creating Linux namespace containers")
2414 (description "pflask is a simple tool for creating Linux namespace
2415 containers. It can be used for running a command or even booting an OS inside
2416 an isolated container, created with the help of Linux namespaces. It is
2417 similar in functionality to chroot, although pflask provides better isolation
2418 thanks to the use of namespaces.")
2419 (license license:bsd-2)))
2421 (define-public hdparm
2427 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2428 name "-" version ".tar.gz"))
2431 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
2432 (build-system gnu-build-system)
2434 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2435 (list (string-append "binprefix=" out)
2436 (string-append "manprefix=" out)
2439 (modify-phases %standard-phases
2440 (delete 'configure)) ; no configure script
2441 #:tests? #f)) ; no test suite
2442 (home-page "https://sourceforge.net/projects/hdparm/")
2443 (synopsis "View and tune ATA disk drive parameters")
2445 "@command{hdparm} is a command-line utility to control ATA controllers and
2446 disk drives. It can increase performance and/or reliability by careful tuning
2447 of hardware settings like power and acoustic management, DMA modes, and caching.
2448 It can also display detailed device information, or be used as a simple
2449 performance benchmarking tool.
2451 @command{hdparm} provides a command line interface to various Linux kernel
2452 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2453 IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2454 Command Translation} (SAT) are also supported.")
2455 (license (license:non-copyleft "file://LICENSE.TXT"))))
2457 (define-public rfkill
2463 (uri (string-append "mirror://kernel.org/software/network/"
2464 name "/" name "-" version ".tar.xz"))
2467 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2468 (build-system gnu-build-system)
2470 `(#:make-flags (list "CC=gcc"
2471 (string-append "PREFIX=" %output))
2472 #:phases (modify-phases %standard-phases
2473 (delete 'configure))
2475 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2476 (synopsis "Tool for enabling and disabling wireless devices")
2478 "rfkill is a simple tool for accessing the rfkill device interface,
2479 which is used to enable and disable wireless networking devices, typically
2480 WLAN, Bluetooth and mobile broadband.")
2481 (license (license:non-copyleft "file://COPYING"
2482 "See COPYING in the distribution."))))
2490 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2491 version "/" name "-" version ".tar.gz"))
2494 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2495 (build-system gnu-build-system)
2496 (home-page "http://acpiclient.sourceforge.net")
2497 (synopsis "Display information on ACPI devices")
2498 (description "@code{acpi} attempts to replicate the functionality of the
2499 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2500 information. It does not support ACPI suspending, only displays information
2501 about ACPI devices.")
2502 (license license:gpl2+)))
2504 (define-public acpid
2510 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2514 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2515 (build-system gnu-build-system)
2516 (home-page "https://sourceforge.net/projects/acpid2/")
2517 (synopsis "Daemon for delivering ACPI events to user-space programs")
2519 "acpid is designed to notify user-space programs of Advanced
2520 Configuration and Power Interface (ACPI) events. acpid should be started
2521 during the system boot, and will run as a background process. When an ACPI
2522 event is received from the kernel, acpid will examine the list of rules
2523 specified in /etc/acpi/events and execute the rules that match the event.")
2524 (license license:gpl2+)))
2526 (define-public sysfsutils
2535 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2538 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2539 (build-system gnu-build-system)
2540 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2541 (synopsis "System utilities based on Linux sysfs")
2543 "These are a set of utilities built upon sysfs, a virtual file system in
2544 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2545 also contains the libsysfs library.")
2546 ;; The library is under lgpl2.1+ (all files say "or any later version").
2547 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2548 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2550 (define-public sysfsutils-1
2552 (inherit sysfsutils)
2559 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2560 "/sysfsutils-" version ".tar.gz"))
2562 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2563 (modules '((guix build utils)))
2566 (substitute* "Makefile.in"
2567 (("includedir = /usr/include/sysfs")
2568 "includedir = @includedir@"))
2569 (substitute* "configure"
2570 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2571 (string-append "includedir='" orig "/sysfs'")))))))
2572 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2574 (define-public cpufrequtils
2576 (name "cpufrequtils")
2583 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2586 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2587 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2588 (build-system gnu-build-system)
2590 `(("sysfsutils" ,sysfsutils-1)))
2592 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2593 (assoc-ref %outputs "out") "/lib"))))
2594 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2595 (synopsis "Utilities to get and set CPU frequency on Linux")
2597 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2598 information, and set the CPU frequency if supported, using the cpufreq
2599 capabilities of the Linux kernel.")
2600 (license license:gpl2)))
2602 (define-public libraw1394
2609 "mirror://kernel.org/linux/libs/ieee1394/"
2610 name "-" version ".tar.xz"))
2613 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2614 (build-system gnu-build-system)
2615 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2616 (synopsis "Interface library for the Linux IEEE1394 drivers")
2618 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2619 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2620 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2621 send to and receive from other nodes without requiring a kernel driver for the
2622 protocol in question.")
2623 (license license:lgpl2.1+)))
2625 (define-public libavc1394
2631 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2632 name "-" version ".tar.gz"))
2635 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2636 (build-system gnu-build-system)
2638 `(("pkg-config" ,pkg-config)))
2640 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2641 (home-page "https://sourceforge.net/projects/libavc1394/")
2642 (synopsis "AV/C protocol library for IEEE 1394")
2644 "Libavc1394 is a programming interface to the AV/C specification from
2645 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2646 (license license:lgpl2.1+)))
2648 (define-public libiec61883
2650 (name "libiec61883")
2655 "mirror://kernel.org/linux/libs/ieee1394/"
2656 name "-" version ".tar.xz"))
2659 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2660 (build-system gnu-build-system)
2662 `(("pkg-config" ,pkg-config)))
2664 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2665 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2666 (synopsis "Isochronous streaming media library for IEEE 1394")
2668 "The libiec61883 library provides a higher level API for streaming DV,
2669 MPEG-2 and audio over Linux IEEE 1394.")
2670 (license license:lgpl2.1+)))
2672 (define-public mdadm
2679 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2683 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2684 (build-system gnu-build-system)
2688 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2692 ;; TODO: tell it where to find 'sendmail'
2693 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2694 (string-append "BINDIR=" out "/sbin")
2695 (string-append "MANDIR=" out "/share/man")
2696 (string-append "UDEVDIR=" out "/lib/udev")))
2697 #:phases (alist-cons-before
2698 'build 'patch-program-paths
2699 (lambda* (#:key inputs #:allow-other-keys)
2700 (let ((coreutils (assoc-ref inputs "coreutils")))
2701 (substitute* "udev-md-raid-arrays.rules"
2702 (("/usr/bin/(readlink|basename)" all program)
2703 (string-append coreutils "/bin/" program)))))
2705 'build 'remove-W-error
2707 ;; We cannot build with -Werror on i686 due to a
2708 ;; 'sign-compare' warning in util.c.
2709 (substitute* "Makefile"
2712 (alist-delete 'configure %standard-phases)))
2713 ;;tests must be done as root
2715 (home-page "http://neil.brown.name/blog/mdadm")
2716 (synopsis "Tool for managing Linux Software RAID arrays")
2718 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2719 assemble, report on, and monitor arrays. It can also move spares between raid
2720 arrays when needed.")
2721 (license license:gpl2+)))
2723 (define-public mdadm-static
2726 (name "mdadm-static")
2728 (substitute-keyword-arguments (package-arguments mdadm)
2729 ((#:make-flags flags)
2730 `(cons "LDFLAGS = -static" ,flags))
2732 `(modify-phases ,phases
2733 (add-after 'install 'remove-cruft
2734 (lambda* (#:key outputs #:allow-other-keys)
2735 (let* ((out (assoc-ref outputs "out"))
2736 (precious? (lambda (file)
2737 (member file '("." ".." "sbin"))))
2738 (directories (scandir out (negate precious?))))
2739 (with-directory-excursion out
2740 (for-each delete-file-recursively directories)
2741 (remove-store-references "sbin/mdadm")
2742 (delete-file "sbin/mdmon")
2744 ((#:modules modules %gnu-build-system-modules)
2745 `((ice-9 ftw) ,@modules))
2746 ((#:strip-flags _ '())
2747 ''("--strip-all")) ;strip a few extra KiB
2748 ((#:allowed-references _ '("out"))
2749 '("out")))) ;refer only self
2750 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2752 (define-public multipath-tools
2754 (name "multipath-tools")
2758 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2759 ".git;a=snapshot;h=" version ";sf=tgz"))
2760 (file-name (string-append name "-" version ".tar.gz"))
2763 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2764 (modules '((guix build utils)))
2767 ;; Drop bundled valgrind headers.
2768 (delete-file-recursively "third-party")
2769 (substitute* '("multipathd/main.c"
2770 "libmultipath/debug.c")
2771 (("#include \"../third-party/")
2774 (build-system gnu-build-system)
2776 '(#:tests? #f ; No tests.
2777 #:make-flags (list (string-append "DESTDIR="
2778 (assoc-ref %outputs "out"))
2780 (string-append "LDFLAGS=-Wl,-rpath="
2781 (assoc-ref %outputs "out")
2784 (modify-phases %standard-phases
2785 (add-after 'unpack 'patch-source
2786 (lambda* (#:key inputs #:allow-other-keys)
2787 (let ((lvm2 (assoc-ref inputs "lvm2"))
2788 (udev (assoc-ref inputs "udev")))
2789 (substitute* "Makefile.inc"
2790 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2791 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2792 (("/usr/include/libdevmapper.h")
2793 (string-append lvm2 "/include/libdevmapper.h"))
2794 (("/usr/include/libudev.h")
2795 (string-append udev "/include/libudev.h")))
2798 (add-before 'build 'set-CC
2804 ("pkg-config" ,pkg-config)
2805 ("valgrind" ,valgrind)))
2807 `(("ceph:lib" ,ceph "lib")
2810 ("liburcu" ,liburcu)
2812 ("readline" ,readline)
2814 (home-page "http://christophe.varoqui.free.fr/")
2815 (synopsis "Access block devices through multiple paths")
2817 "This package provides the following binaries to drive the
2818 Linux Device Mapper multipathing driver:
2820 @item @command{multipath} - Device mapper target autoconfig.
2821 @item @command{multipathd} - Multipath daemon.
2822 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2823 @code{dm} multipath devices.
2824 @item @command{kpartx} - Create device maps from partition tables.
2826 (license (list license:gpl2+ ; Main distribution.
2827 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2829 (define-public libaio
2836 (string-append "mirror://debian/pool/main/liba/libaio/"
2837 name "_" version ".orig.tar.gz")))
2840 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2841 (build-system gnu-build-system)
2844 (list "CC=gcc" (string-append "prefix=" %output))
2845 #:test-target "partcheck" ; need root for a full 'check'
2847 (alist-delete 'configure %standard-phases))) ; no configure script
2848 (home-page "http://lse.sourceforge.net/io/aio.html")
2849 (synopsis "Linux-native asynchronous I/O access library")
2851 "This library enables userspace to use Linux kernel asynchronous I/O
2852 system calls, important for the performance of databases and other advanced
2854 (license license:lgpl2.1+)))
2862 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2863 name "-" version ".tar.xz"))
2866 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2867 (build-system gnu-build-system)
2869 `(("libsndfile" ,libsndfile)))
2871 `(("pkg-config" ,pkg-config)))
2872 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2873 (synopsis "Bluetooth subband audio codec")
2875 "The SBC is a digital audio encoder and decoder used to transfer data to
2876 Bluetooth audio output devices like headphones or loudspeakers.")
2877 (license license:gpl2+)))
2879 (define-public bluez
2886 "mirror://kernel.org/linux/bluetooth/bluez-"
2890 "1sb4aflgyrl7apricjipa8wx95qm69yja0lmn2f19g560c3v1b2c"))))
2891 (build-system gnu-build-system)
2894 (let ((out (assoc-ref %outputs "out")))
2895 (list "--sysconfdir=/etc"
2896 "--localstatedir=/var"
2899 ;; Install dbus/udev files to the correct location.
2900 (string-append "--with-dbusconfdir=" out "/etc")
2901 (string-append "--with-udevdir=" out "/lib/udev")))
2903 (modify-phases %standard-phases
2904 (add-after 'install 'post-install
2905 (lambda* (#:key inputs outputs #:allow-other-keys)
2906 (let* ((out (assoc-ref outputs "out"))
2907 (servicedir (string-append out "/share/dbus-1/services"))
2908 (service "obexd/src/org.bluez.obex.service")
2909 (rule (string-append
2910 out "/lib/udev/rules.d/97-hid2hci.rules")))
2911 ;; Install the obex dbus service file.
2912 (substitute* service
2914 (string-append out "/libexec/bluetooth/obexd")))
2915 (install-file service servicedir)
2916 ;; Fix paths in the udev rule.
2918 (("hid2hci --method")
2919 (string-append out "/lib/udev/hid2hci --method"))
2921 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2924 `(("pkg-config" ,pkg-config)
2925 ("gettext" ,gettext-minimal)))
2930 ("libical" ,libical)
2931 ("readline" ,readline)))
2932 (home-page "http://www.bluez.org/")
2933 (synopsis "Linux Bluetooth protocol stack")
2935 "BlueZ provides support for the core Bluetooth layers and protocols. It
2936 is flexible, efficient and uses a modular implementation.")
2937 (license license:gpl2+)))
2939 (define-public fuse-exfat
2946 "https://github.com/relan/exfat/releases/download/v"
2947 version "/" name "-" version ".tar.gz"))
2950 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
2951 (build-system gnu-build-system)
2953 `(("pkg-config" ,pkg-config)))
2956 (home-page "https://github.com/relan/exfat")
2957 (synopsis "Mount exFAT file systems")
2959 "This package provides a FUSE-based file system that provides read and
2960 write access to exFAT devices.")
2961 (license license:gpl2+)))
2970 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2971 version ".tar.bz2"))
2974 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2975 (build-system gnu-build-system)
2977 '(#:phases (modify-phases %standard-phases
2978 (add-before 'configure 'bootstrap
2980 ;; The tarball was not generated with 'make dist' so we
2981 ;; need to bootstrap things ourselves.
2982 (and (zero? (system* "./autogen.sh"))
2984 (patch-makefile-SHELL "Makefile.include.in")
2987 ;; Make sure programs find libgpm.so.
2988 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2989 (assoc-ref %outputs "out")
2992 `(("texinfo" ,texinfo)
2995 ("autoconf" ,autoconf)
2996 ("automake" ,automake)
2997 ("libtool" ,libtool)))
2998 (home-page "http://www.nico.schottelius.org/software/gpm/")
2999 (synopsis "Mouse support for the Linux console")
3001 "The GPM (general-purpose mouse) daemon is a mouse server for
3002 applications running on the Linux console. It allows users to select items
3003 and copy/paste text in the console and in xterm.")
3004 (license license:gpl2+)))
3006 (define-public btrfs-progs
3008 (name "btrfs-progs")
3012 (uri (string-append "mirror://kernel.org/linux/kernel/"
3013 "people/kdave/btrfs-progs/"
3014 "btrfs-progs-v" version ".tar.xz"))
3017 "0vcp9a0a35chhjhq291kvirqhd4i9w5f4zql4y5n81kbwcrxil6h"))))
3018 (build-system gnu-build-system)
3020 "static")) ; static versions of binaries in "out" (~16MiB!)
3022 '(#:phases (modify-phases %standard-phases
3023 (add-after 'build 'build-static
3024 (lambda _ (zero? (system* "make" "static"))))
3025 (add-after 'install 'install-static
3026 (let ((staticbin (string-append (assoc-ref %outputs "static")
3029 (zero? (system* "make"
3030 (string-append "bindir=" staticbin)
3031 "install-static"))))))
3032 #:test-target "test"
3033 #:parallel-tests? #f)) ; tests fail when run in parallel
3034 (inputs `(("e2fsprogs" ,e2fsprogs)
3035 ("libblkid" ,util-linux)
3036 ("libblkid:static" ,util-linux "static")
3037 ("libuuid" ,util-linux)
3038 ("libuuid:static" ,util-linux "static")
3041 (native-inputs `(("pkg-config" ,pkg-config)
3042 ("asciidoc" ,asciidoc)
3044 ;; For building documentation.
3045 ("libxml2" ,libxml2)
3046 ("docbook-xsl" ,docbook-xsl)
3049 (home-page "https://btrfs.wiki.kernel.org/")
3050 (synopsis "Create and manage btrfs copy-on-write file systems")
3051 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3052 aimed at implementing advanced features while focusing on fault tolerance,
3053 repair and easy administration.")
3054 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3055 ;; GPL2: Everything else.
3056 (license (list license:gpl2 license:gpl2+))))
3058 (define-public btrfs-progs/static
3060 (name "btrfs-progs-static")
3061 (version (package-version btrfs-progs))
3063 (build-system trivial-build-system)
3065 `(("btrfs-progs:static" ,btrfs-progs "static")))
3067 `(#:modules ((guix build utils))
3070 (use-modules (guix build utils)
3074 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3075 (out (assoc-ref %outputs "out"))
3076 (source (string-append btrfs "/bin/btrfs.static"))
3077 (target (string-append out "/bin/btrfs")))
3078 (mkdir-p (dirname target))
3079 (copy-file source target)
3080 (remove-store-references target)
3081 (chmod target #o555)))))
3082 (home-page (package-home-page btrfs-progs))
3083 (synopsis "Statically-linked btrfs command from btrfs-progs")
3084 (description "This package provides the statically-linked @command{btrfs}
3085 from the btrfs-progs package. It is meant to be used in initrds.")
3086 (license (package-license btrfs-progs))))
3088 (define-public freefall
3091 (version (package-version linux-libre))
3092 (source (package-source linux-libre))
3093 (build-system gnu-build-system)
3095 '(#:phases (modify-phases %standard-phases
3096 (add-after 'unpack 'enter-subdirectory
3098 (chdir "tools/laptop/freefall")))
3100 (add-before 'build 'increase-timeout
3102 ;; The default of 2 seconds is too low: it assumes an
3103 ;; open lid and AC power without actually checking.
3104 (substitute* "freefall.c"
3105 (("alarm\\(2\\)") "alarm(5)")))))
3106 #:make-flags (list (string-append "PREFIX="
3107 (assoc-ref %outputs "out")))
3108 #:tests? #f)) ;no tests
3109 (home-page (package-home-page linux-libre))
3110 (synopsis "Free-fall protection for spinning laptop hard drives")
3112 "Prevents shock damage to the internal spinning hard drive(s) of some
3113 HP and Dell laptops. When sudden movement is detected, all input/output
3114 operations on the drive are suspended and its heads are parked on the ramp,
3115 where they are less likely to cause damage to the spinning disc. Requires a
3116 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3117 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3118 (license license:gpl2)))
3120 (define-public thinkfan
3126 (uri (string-append "mirror://sourceforge/thinkfan/"
3127 "/thinkfan-" version ".tar.gz"))
3130 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3131 (modules '((guix build utils)))
3132 ;; Fix erroneous man page location in Makefile leading to
3133 ;; a compilation failure.
3135 '(substitute* "CMakeLists.txt"
3136 (("thinkfan\\.1") "src/thinkfan.1")))))
3137 (build-system cmake-build-system)
3139 `(#:modules ((guix build cmake-build-system)
3142 #:tests? #f ;no test target
3144 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3145 `("-DUSE_ATASMART:BOOL=ON")
3147 (modify-phases %standard-phases
3148 ;; Install scripts for various foreign init systems. Also fix
3149 ;; hard-coded path for daemon.
3150 (add-after 'install 'install-rc-scripts
3151 (lambda* (#:key outputs #:allow-other-keys)
3152 (let ((out (assoc-ref outputs "out"))
3154 (string-append "../thinkfan-" ,version "/rcscripts")
3157 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3158 (string-append out "/sbin/" name)))
3159 (for-each (cute install-file <>
3160 (string-append out "/share/thinkfan"))
3164 `(("libatasmart" ,libatasmart)))
3165 (home-page "http://thinkfan.sourceforge.net/")
3166 (synopsis "Simple fan control program")
3168 "Thinkfan is a simple fan control program. It reads temperatures,
3169 checks them against configured limits and switches to appropriate (also
3170 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3171 other @code{hwmon} driver that enables temperature reading and fan control
3173 (license license:gpl3+)))
3175 (define-public ntfs-3g
3178 (version "2016.2.22")
3181 (uri (string-append "https://tuxera.com/opensource/"
3182 "ntfs-3g_ntfsprogs-" version ".tgz"))
3185 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3186 (modules '((guix build utils)))
3187 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
3189 ;; Install under $prefix.
3190 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3193 (build-system gnu-build-system)
3194 (inputs `(("util-linux" ,util-linux)
3195 ("fuse" ,fuse))) ;libuuid
3196 (native-inputs `(("pkg-config" ,pkg-config)))
3198 '(#:configure-flags (list "--exec-prefix=${prefix}"
3199 "--with-fuse=external" ;use our own FUSE
3200 "--enable-mount-helper"
3201 "--enable-posix-acls"
3202 "--enable-xattr-mappings")))
3203 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3204 (synopsis "Read-write access to NTFS file systems")
3206 "NTFS-3G provides read-write access to NTFS file systems, which are
3207 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3208 The package provides additional NTFS tools.")
3209 (license license:gpl2+)))
3211 (define-public rdma-core
3217 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3218 "/releases/download/v" version "/rdma-core-"
3222 "15qdfqkia22vab1dh41s88vgi70yifi40ar5s4x7a456rpbhy8z5"))))
3223 (build-system cmake-build-system)
3225 '(#:tests? #f ; no tests
3226 ;; Upstream uses the "ninja" build system and encourage distros
3227 ;; to do the same for consistency. They also recommend using the
3228 ;; "Release" build type.
3229 #:configure-flags (list "-GNinja"
3230 ;; Defaults to "lib64" on 64-bit archs.
3231 (string-append "-DCMAKE_INSTALL_LIBDIR="
3232 (assoc-ref %outputs "out") "/lib")
3233 "-DCMAKE_BUILD_TYPE=Release")
3235 (modify-phases %standard-phases
3238 (zero? (system* "ninja"
3239 "-j" (number->string (parallel-job-count))))))
3242 (zero? (system* "ninja" "install")))))))
3245 ("pkg-config" ,pkg-config)
3246 ("python" ,python-wrapper)))
3250 (home-page "https://github.com/linux-rdma/rdma-core")
3251 (synopsis "Utilities and libraries for working with RDMA devices")
3253 "This package provides userspace components for the InfiniBand
3254 subsystem of the Linux kernel. Specifically it contains userspace
3255 libraries for the following device nodes:
3258 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3259 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3260 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3263 The following service daemons are also provided:
3265 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3266 @item @code{iwpmd} (for iWARP kernel providers)
3267 @item @code{ibacm} (for InfiniBand communication management assistant)
3269 ;; All library code is dual licensed under GPL2 and a custom MIT
3270 ;; variant. The package also includes some components covered by
3271 ;; other licenses. Consult COPYING.md for full details.
3274 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3275 license:bsd-2 ; Files referring to COPYING.BSD_FB
3276 license:cc0 ; most files in ccan/
3277 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3279 (define-public rng-tools
3286 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3287 "rng-tools-" version ".tar.gz"))
3290 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3291 (build-system gnu-build-system)
3292 (synopsis "Random number generator daemon")
3294 "Monitor a hardware random number generator, and supply entropy
3295 from that to the system kernel's @file{/dev/random} machinery.")
3296 (home-page "https://sourceforge.net/projects/gkernel")
3297 ;; The source package is offered under the GPL2+, but the files
3298 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3299 (license (list license:gpl2 license:gpl2+))))
3301 (define-public cpupower
3304 (version (package-version linux-libre))
3305 (source (package-source linux-libre))
3306 (build-system gnu-build-system)
3308 '(#:phases (modify-phases %standard-phases
3309 (add-after 'unpack 'enter-subdirectory
3311 (chdir "tools/power/cpupower")))
3313 (add-before 'build 'fix-makefiles
3315 (substitute* "Makefile"
3317 (("/bin/(install|pwd)" _ command) command))
3318 (substitute* "bench/Makefile"
3319 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3320 #:make-flags (let ((out (assoc-ref %outputs "out")))
3321 (list (string-append "DESTDIR=" out)
3322 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3323 "docdir=/share/doc/cpupower"
3324 "confdir=$(docdir)/examples"
3325 ;; The Makefile recommends the following changes
3327 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3328 #:tests? #f)) ;no tests
3329 (native-inputs `(("gettext" ,gettext-minimal)))
3330 (inputs `(("pciutils" ,pciutils)))
3331 (home-page (package-home-page linux-libre))
3332 (synopsis "CPU frequency and voltage scaling tools for Linux")
3334 "cpupower is a set of user-space tools that use the cpufreq feature of the
3335 Linux kernel to retrieve and control processor features related to power saving,
3336 such as frequency and voltage scaling.")
3337 (license license:gpl2)))
3339 (define-public haveged
3346 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3350 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3351 (build-system gnu-build-system)
3352 (home-page "http://www.issihosts.com/haveged")
3353 (synopsis "Entropy source for the Linux random number generator")
3355 "haveged generates an unpredictable stream of random numbers for use by
3356 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3357 standard mechanisms for filling the entropy pool may not be sufficient for
3358 systems with high needs or limited user interaction, such as headless servers.
3359 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3360 indirect effects of hardware events on hidden processor state using the HArdware
3361 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3362 its environment and provides the same built-in test suite for the output stream
3363 as used on certified hardware security devices.")
3364 (license (list (license:non-copyleft "file://nist/mconf.h")
3365 (license:non-copyleft "file://nist/packtest.c")
3366 license:public-domain ; nist/dfft.c
3367 license:gpl3+)))) ; everything else
3369 (define-public ecryptfs-utils
3371 (name "ecryptfs-utils")
3376 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3377 version "/+download/ecryptfs-utils_"
3378 version ".orig.tar.gz"))
3381 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3382 (build-system gnu-build-system)
3384 `(#:configure-flags (list "--disable-pywrap")))
3386 `(("intltool" ,intltool)
3387 ("perl" ,perl) ; for pod2man
3388 ("pkg-config" ,pkg-config)))
3390 `(("keyutils" ,keyutils)
3391 ("linux-pam" ,linux-pam)
3393 (home-page "http://ecryptfs.org/")
3394 (synopsis "eCryptfs cryptographic file system utilities")
3396 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3397 Each file's cryptographic meta-data is stored inside the file itself, along
3398 with the encrypted contents. This allows individual encrypted files to be
3399 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3400 native Linux file system, and has been part of the Linux kernel since version
3401 2.6.19. This package contains the userland utilities to manage it.")
3402 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3403 ;; grant additional permission to link with OpenSSL.
3404 (license license:gpl2+)))
3406 (define-public libnfsidmap
3408 (name "libnfsidmap")
3413 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3414 name "/" name "-" version ".tar.gz"))
3417 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3418 (build-system gnu-build-system)
3420 `(#:configure-flags (list
3421 (string-append "--with-pluginpath="
3422 (assoc-ref %outputs "out")
3423 "/lib/libnfsidmap"))))
3425 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3427 "NFSv4 support library for name/ID mapping")
3428 (description "Libnfsidmap is a library holding mulitiple methods of
3429 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3430 extensible array of mapping functions, currently consisting of two choices:
3431 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3432 (license (license:non-copyleft "file://COPYING"
3433 "See COPYING in the distribution."))))
3435 (define-public module-init-tools
3437 (name "module-init-tools")
3442 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3443 "module-init-tools-" version ".tar.bz2"))
3446 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3447 (patches (search-patches "module-init-tools-moduledir.patch"))))
3448 (build-system gnu-build-system)
3450 ;; FIXME: The upstream tarball lacks man pages, and building them would
3451 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3452 ;; but they vanished. In the meantime, fake it.
3453 '(#:phases (alist-cons-before
3454 'configure 'fake-docbook
3456 (substitute* "Makefile.in"
3457 (("^DOCBOOKTOMAN.*$")
3458 "DOCBOOKTOMAN = true\n")))
3460 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3461 (synopsis "Tools for loading and managing Linux kernel modules")
3463 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3464 `insmod', `lsmod', and more.")
3465 (license license:gpl2+)))
3467 (define-public mcelog
3473 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3474 "mcelog.git/snapshot/v" version ".tar.gz"))
3477 "0q40d60p1klzg0aznvxhxgjlddwcxfj2q59s4q86sf9ild6rcdhl"))
3478 (file-name (string-append name "-" version ".tar.gz"))
3479 (modules '((guix build utils)))
3481 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3482 `(substitute* "Makefile"
3483 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3484 (build-system gnu-build-system)
3486 `(#:phases (modify-phases %standard-phases
3487 (delete 'configure)) ; no configure script
3488 #:make-flags (let ((out (assoc-ref %outputs "out")))
3490 (string-append "prefix=" out)
3491 (string-append "DOCDIR=" out "/share/doc/mcelog")
3492 "etcprefix=$(DOCDIR)/examples"))
3493 ;; The tests will only run as root on certain supported CPU models.
3495 (supported-systems (list "i686-linux" "x86_64-linux"))
3496 (home-page "http://mcelog.org/")
3497 (synopsis "Machine check monitor for x86 Linux systems")
3499 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3500 and other hardware errors on x86 systems. It can also perform user-defined
3501 tasks, such as bringing bad pages off-line, when configurable error thresholds
3503 (license license:gpl2)))
3505 (define-public mtd-utils
3512 "ftp://ftp.infradead.org/pub/mtd-utils/"
3513 "mtd-utils-" version ".tar.bz2"))
3516 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3519 ("libuuid" ,util-linux)
3522 (build-system gnu-build-system)
3524 `(#:test-target "tests"
3525 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3526 #:phases (modify-phases %standard-phases
3527 (delete 'configure))))
3528 (synopsis "MTD Flash Storage Utilities")
3529 (description "This package provides utilities for testing, partitioning, etc
3531 (home-page "http://www.linux-mtd.infradead.org/")
3533 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3534 license:mpl1.1 ; All ftl* files
3535 license:expat)))) ; libiniparser
3537 (define-public libseccomp
3543 (uri (string-append "https://github.com/seccomp/libseccomp/"
3544 "releases/download/v" version
3545 "/libseccomp-" version ".tar.gz"))
3548 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3549 (build-system gnu-build-system)
3551 `(("which" ,which)))
3552 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3553 (description "The libseccomp library provides an easy to use, platform
3554 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3555 libseccomp API is designed to abstract away the underlying BPF based syscall
3556 filter language and present a more conventional function-call based filtering
3557 interface that should be familiar to, and easily adopted by, application
3559 (home-page "https://github.com/seccomp/libseccomp")
3560 (license license:lgpl2.1)))
3562 (define-public radeontop
3566 (home-page "https://github.com/clbr/radeontop/")
3569 (uri (string-append home-page "archive/v" version ".tar.gz"))
3570 (file-name (string-append name "-" version ".tar.gz"))
3573 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3574 (build-system gnu-build-system)
3576 `(#:phases (modify-phases %standard-phases
3577 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3578 ;; dependency, and doesn't even work on release(!) tarballs.
3579 (add-after 'unpack 'report-correct-version
3580 (lambda _ (substitute* "getver.sh"
3582 (string-append "ver=" ,version)))))
3583 (delete 'configure)) ; no configure script
3584 #:make-flags (list "CC=gcc"
3585 (string-append "PREFIX=" %output))
3586 #:tests? #f)) ; no tests
3588 `(("gettext" ,gettext-minimal)
3589 ("pkg-config" ,pkg-config)))
3591 `(("libdrm" ,libdrm)
3592 ("libpciaccess" ,libpciaccess)
3594 ("ncurses" ,ncurses)))
3595 (synopsis "Usage monitor for AMD Radeon graphics")
3596 (description "RadeonTop monitors resource consumption on supported AMD
3597 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3598 a terminal or saved to a file for further processing. It measures both the
3599 activity of the GPU as a whole, which is also accurate during OpenCL
3600 computations, as well as separate component statistics that are only meaningful
3601 under OpenGL graphics workloads.")
3602 (license license:gpl3)))
3604 (define-public efivar
3610 (uri (string-append "https://github.com/rhinstaller/" name
3611 "/releases/download/" version "/" name
3612 "-" version ".tar.bz2"))
3615 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3616 (build-system gnu-build-system)
3618 `(;; Tests require a UEFI system and is not detected in the chroot.
3620 #:make-flags (list (string-append "prefix=" %output)
3621 (string-append "libdir=" %output "/lib")
3622 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3624 (modify-phases %standard-phases
3625 (delete 'configure))))
3627 `(("pkg-config" ,pkg-config)))
3630 (home-page "https://github.com/rhinstaller/efivar")
3631 (synopsis "Tool and library to manipulate EFI variables")
3632 (description "This package provides a library and a command line
3633 interface to the variable facility of UEFI boot firmware.")
3634 (license license:lgpl2.1+)))
3636 (define-public efibootmgr
3642 (uri (string-append "https://github.com/rhinstaller/" name
3643 "/releases/download/" version "/" name
3644 "-" version ".tar.bz2"))
3647 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3648 (build-system gnu-build-system)
3650 `(#:tests? #f ; No tests.
3651 #:make-flags (list (string-append "prefix=" %output)
3652 (string-append "libdir=" %output "/lib")
3653 ;; Override CFLAGS to add efivar include directory.
3654 (string-append "CFLAGS=-O2 -g -flto -I"
3655 (assoc-ref %build-inputs "efivar")
3658 (modify-phases %standard-phases
3659 (add-after 'unpack 'branding
3660 ;; Replace default loader path with something more familiar.
3662 (substitute* "src/efibootmgr.c"
3663 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3666 (delete 'configure))))
3668 `(("pkg-config" ,pkg-config)))
3670 `(("efivar" ,efivar)
3672 (home-page "https://github.com/rhinstaller/efibootmgr")
3673 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3675 "@code{efibootmgr} is a user-space application to modify the Intel
3676 Extensible Firmware Interface (EFI) Boot Manager. This application can
3677 create and destroy boot entries, change the boot order, change the next
3678 running boot option, and more.")
3679 (license license:gpl2+)))
3681 (define-public sysstat
3687 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3688 "sysstat-" version ".tar.xz"))
3691 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3692 (build-system gnu-build-system)
3694 `(#:tests? #f ; No test suite.
3695 ;; Without this flag, it tries to install the man pages with group 'root'
3696 ;; and fails because /etc/passwd lacks an entry for the root user.
3698 (list "--disable-file-attr"
3699 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3701 (modify-phases %standard-phases
3702 ;; The build process tries to create '/var/lib/sa', so we skip that
3704 (add-after 'build 'skip-touching-var
3706 (substitute* "Makefile"
3707 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3710 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3711 (synopsis "Performance monitoring tools for Linux")
3712 (description "The sysstat utilities are a collection of performance
3713 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3714 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3715 @code{sadf} and @code{sa}.")
3716 (license license:gpl2+)))
3718 (define-public light
3724 (uri (string-append "https://github.com/haikarainen/" name
3725 "/archive/v" version ".tar.gz"))
3728 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3729 (file-name (string-append name "-" version ".tar.gz"))))
3730 (build-system gnu-build-system)
3732 '(#:tests? #f ; no tests
3733 #:make-flags (list "CC=gcc"
3734 (string-append "PREFIX=" %output))
3736 (modify-phases %standard-phases
3738 (add-after 'unpack 'patch-makefile
3740 (substitute* "Makefile" (("chown") "#")))))))
3742 `(("help2man" ,help2man)))
3743 (home-page "https://haikarainen.github.io/light")
3744 (synopsis "GNU/Linux application to control backlights")
3746 "Light is a program to send commands to screen backlight controllers
3747 under GNU/Linux. Features include:
3750 @item It does not rely on X.
3751 @item Light can automatically figure out the best controller to use, making
3752 full use of underlying hardware.
3753 @item It is possible to set a minimum brightness value, as some controllers
3754 set the screen to be pitch black at a vaĺue of 0 (or higher).
3757 Light is the successor of lightscript.")
3758 (license license:gpl3+)))
3767 "https://github.com/linrunner/"
3768 (string-upcase name)
3769 "/archive/" version ".tar.gz"))
3770 (file-name (string-append name "-" version ".tar.gz"))
3773 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3774 (inputs `(("bash" ,bash)
3776 ("ethtool" ,ethtool)
3780 ("inetutils" ,inetutils)
3783 ("pciutils" ,pciutils)
3787 ("usbutils" ,usbutils)
3788 ("util-linux" ,util-linux)
3789 ("wireless-tools" ,wireless-tools)))
3790 (build-system gnu-build-system)
3793 (modify-phases %standard-phases
3794 (delete 'configure) ; no configure script
3795 (add-before 'build 'setenv
3796 (lambda* (#:key outputs #:allow-other-keys)
3797 (let ((out (assoc-ref outputs "out")))
3798 (setenv "TLP_WITH_SYSTEMD" "0")
3799 (setenv "TLP_NO_INIT" "1")
3800 (setenv "TLP_NO_PMUTILS" "1")
3801 (setenv "TLP_SBIN" (string-append out "/bin"))
3802 (setenv "TLP_BIN" (string-append out "/bin"))
3803 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3804 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3805 (setenv "TLP_CONF" "/etc/tlp")
3807 (string-append out "/share/bash-completion/completions"))
3808 (setenv "TLP_MAN" (string-append out "/share/man")))))
3809 (delete 'check) ; no tests
3810 (add-before 'install 'fix-installation
3812 ;; Stop the Makefile from trying to create system directories.
3813 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
3816 (zero? (system* "make" "install-tlp" "install-man"))))
3817 (add-after 'install 'wrap
3818 (lambda* (#:key inputs outputs #:allow-other-keys)
3819 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3820 (bin-files (find-files bin ".*")))
3821 (define (bin-directory input-name)
3822 (string-append (assoc-ref inputs input-name) "/bin"))
3823 (define (sbin-directory input-name)
3824 (string-append (assoc-ref inputs input-name) "/sbin"))
3825 (for-each (lambda (program)
3826 (wrap-program program
3829 (map bin-directory '("bash"
3840 (map sbin-directory '("ethtool"
3845 "wireless-tools"))))))
3847 (home-page "http://linrunner.de/en/tlp/tlp.html")
3848 (synopsis "Power management tool for Linux")
3849 (description "TLP is a power management tool for Linux. It comes with
3850 a default configuration already optimized for battery life. Nevertheless,
3851 TLP is customizable to fulfil system requirements. TLP settings are applied
3852 every time the power supply source is changed.")
3854 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3856 (license (list license:gpl2+ license:gpl3+))))
3864 (uri (string-append "https://www.ezix.org/software/"
3865 "files/lshw-" version
3869 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3870 (build-system gnu-build-system)
3872 `(#:phases (modify-phases %standard-phases (delete 'configure))
3873 #:tests? #f ; no tests
3875 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3876 (synopsis "List hardware information")
3878 "@command{lshw} (Hardware Lister) is a small tool to provide
3879 detailed information on the hardware configuration of the machine.
3880 It can report exact memory configuration, firmware version, mainboard
3881 configuration, CPU version and speed, cache configuration, bus speed,
3882 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3883 machines (PowerMac G4 is known to work).")
3884 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3885 (license license:gpl2+)))
3887 (define-public libmnl
3894 (uri (string-append "mirror://netfilter.org/libmnl/"
3895 "libmnl-" version ".tar.bz2"))
3898 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
3899 (build-system gnu-build-system)
3900 (home-page "https://www.netfilter.org/projects/libmnl/")
3901 (synopsis "Netlink utility library")
3902 (description "Libmnl is a minimalistic user-space library oriented to
3903 Netlink developers. There are a lot of common tasks in parsing, validating,
3904 constructing of both the Netlink header and TLVs that are repetitive and easy to
3905 get wrong. This library aims to provide simple helpers that allows you to
3906 re-use code and to avoid re-inventing the wheel.")
3907 (license license:lgpl2.1+)))
3909 (define-public libnftnl
3916 (uri (string-append "mirror://netfilter.org/libnftnl/"
3917 "libnftnl-" version ".tar.bz2"))
3920 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
3921 (build-system gnu-build-system)
3923 `(("pkg-config" ,pkg-config)))
3925 `(("libmnl" ,libmnl)))
3926 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
3927 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
3928 (description "Libnftnl is a userspace library providing a low-level netlink
3929 programming interface to the in-kernel nf_tables subsystem. The library
3930 libnftnl has been previously known as libnftables. This library is currently
3932 (license license:gpl2+)))
3934 (define-public nftables
3941 (uri (string-append "http://www.nftables.org/projects/nftables"
3942 "/files/nftables-" version ".tar.bz2"))
3945 "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy"))))
3946 (build-system gnu-build-system)
3947 (inputs `(("bison", bison)
3951 ("libnftnl", libnftnl)
3952 ("readline", readline)))
3953 (native-inputs `(("pkg-config", pkg-config)))
3954 (home-page "http://www.nftables.org")
3955 (synopsis "Userspace utility for Linux packet filtering")
3956 (description "nftables is the project that aims to replace the existing
3957 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
3958 filtering framework, a new userspace utility and also a compatibility layer for
3959 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
3960 infrastructure such as the existing hooks, the connection tracking system, the
3961 userspace queueing component and the logging subsystem.")
3962 (license license:gpl2)))
3964 (define-public proot
3968 (home-page "https://github.com/proot-me/PRoot")
3971 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3972 (file-name (string-append name "-" version ".tar.gz"))
3975 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
3976 (patches (search-patches "proot-test-fhs.patch"))))
3977 (build-system gnu-build-system)
3979 '(#:make-flags '("-C" "src")
3981 #:phases (modify-phases %standard-phases
3983 (add-before 'build 'set-shell-file-name
3984 (lambda* (#:key inputs #:allow-other-keys)
3985 (substitute* (find-files "src" "\\.[ch]$")
3988 (assoc-ref inputs "bash")
3991 (add-before 'check 'fix-fhs-assumptions-in-tests
3993 (substitute* "tests/test-c6b77b77.mk"
3994 (("/bin/bash") (which "bash"))
3995 (("/usr/bin/test") (which "test")))
3996 (substitute* '("tests/test-16573e73.c")
3997 (("/bin/([a-z-]+)" _ program)
4000 (substitute* (find-files "tests" "\\.sh$")
4001 ;; Some of the tests try to "bind-mount" /bin/true.
4003 (string-append "-b " (which "true") ":"))
4004 ;; Likewise for /bin.
4005 (("-b /bin:") "-b /gnu:")
4006 ;; Others try to run /bin/sh.
4007 (("/bin/sh") (which "sh"))
4008 ;; Others assume /etc/fstab exists.
4009 (("/etc/fstab") "/etc/passwd"))
4011 (substitute* "tests/GNUmakefile"
4012 (("-b /bin:") "-b /gnu:"))
4014 ;; XXX: This test fails in an obscure corner case, just
4016 (delete-file "tests/test-kkkkkkkk.c")
4021 (let ((n (parallel-job-count)))
4022 ;; For some reason we get lots of segfaults with
4023 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4024 (setenv "PROOT_NO_SECCOMP" "1")
4026 ;; Most of the tests expect "/bin" to be in $PATH so
4027 ;; they can run things that live in $ROOTFS/bin.
4029 (string-append (getenv "PATH") ":/bin"))
4031 (zero? (system* "make" "check" "-C" "tests"
4033 "-j" (number->string n))))))
4035 (lambda* (#:key outputs #:allow-other-keys)
4036 ;; The 'install' rule does nearly nothing.
4037 (let ((out (assoc-ref outputs "out")))
4039 ;; TODO: 'make install-care' (does not even
4040 ;; build currently.)
4041 (system* "make" "-C" "src" "install"
4042 (string-append "PREFIX=" out)))
4043 (let ((man1 (string-append out
4044 "/share/man/man1")))
4046 (copy-file "doc/proot/man.1"
4047 (string-append man1 "/proot.1"))
4049 (native-inputs `(("which" ,which)
4051 ;; For 'mcookie', used by some of the tests.
4052 ("util-linux" ,util-linux)))
4053 (inputs `(("talloc" ,talloc)))
4054 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4056 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4057 and @code{binfmt_misc}. This means that users don't need any privileges or
4058 setup to do things like using an arbitrary directory as the new root
4059 filesystem, making files accessible somewhere else in the file system
4060 hierarchy, or executing programs built for another CPU architecture
4061 transparently through QEMU user-mode. Also, developers can use PRoot as a
4062 generic process instrumentation engine thanks to its extension mechanism.
4063 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4064 available in the kernel Linux.")
4065 (license license:gpl2+)))
4067 (define-public proot-static
4070 (name "proot-static")
4072 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4073 (inputs `(("talloc" ,talloc/static)))
4075 (substitute-keyword-arguments (package-arguments proot)
4076 ((#:make-flags flags)
4077 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4079 `(modify-phases ,phases
4080 (add-after 'strip 'remove-store-references
4081 (lambda* (#:key outputs #:allow-other-keys)
4082 (let* ((out (assoc-ref outputs "out")))
4083 (with-directory-excursion out
4084 (remove-store-references "bin/proot")
4086 ((#:allowed-references _ '("out"))
4089 (define-public cpuid
4092 (version "20170122")
4095 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4096 version ".src.tar.gz"))
4099 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4100 (build-system gnu-build-system)
4102 '(#:make-flags '("CC=gcc")
4103 #:tests? #f ; no tests
4104 #:phases (modify-phases %standard-phases
4106 (add-before 'install 'fix-makefile
4107 (lambda* (#:key outputs #:allow-other-keys)
4108 (substitute* "Makefile"
4109 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4110 ;; Make the compressed manpages writable so that the
4111 ;; reset-gzip-timestamps phase does not error out.
4112 (substitute* "Makefile"
4113 (("-m 444") "-m 644"))
4115 (inputs `(("perl" ,perl)))
4116 (supported-systems '("i686-linux" "x86_64-linux"))
4117 (home-page "http://www.etallen.com/cpuid.html")
4118 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4119 (description "cpuid dumps detailed information about the CPU(s) gathered
4120 from the CPUID instruction, and also determines the exact model of CPU(s). It
4121 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4122 NexGen, Rise, and SiS CPUs.")
4123 (license license:gpl2+)))
4125 (define-public jmtpfs
4132 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4134 (file-name (string-append name "-" version ".tar.gz"))
4137 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4138 (build-system gnu-build-system)
4142 ("libmtp" ,libmtp)))
4144 `(("pkg-config" ,pkg-config)))
4145 (home-page "https://github.com/JasonFerrara/jmtpfs")
4146 (synopsis "Use a FUSE filesystem to access data over MTP")
4147 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4148 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4149 the MTP device as a filesystem.")
4150 (license license:gpl3)))
4152 (define-public procenv
4159 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4161 (file-name (string-append name "-" version ".tar.gz"))
4163 (base32 "0brzf6185hb76imw107cl21c8lzwiywkxi3jknihrk86bvvicd0d"))))
4164 (build-system gnu-build-system)
4165 (arguments `(#:configure-flags '("--disable-silent-rules")))
4166 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4167 ("groff" ,groff) ; for tests
4168 ("libselinux" ,libselinux)))
4169 (synopsis "Utility to show process environment")
4170 (description "Procenv is a command-line tool that displays as much detail about
4171 itself and its environment as possible. It can be used as a test
4172 tool, to understand the type of environment a process runs in, and for
4173 comparing system environments.")
4174 (home-page "http://github.com/jamesodhunt/procenv/")
4175 (license license:gpl3+)))