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>
30 ;;; This file is part of GNU Guix.
32 ;;; GNU Guix is free software; you can redistribute it and/or modify it
33 ;;; under the terms of the GNU General Public License as published by
34 ;;; the Free Software Foundation; either version 3 of the License, or (at
35 ;;; your option) any later version.
37 ;;; GNU Guix is distributed in the hope that it will be useful, but
38 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 ;;; GNU General Public License for more details.
42 ;;; You should have received a copy of the GNU General Public License
43 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
45 (define-module (gnu packages linux)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages acl)
48 #:use-module (gnu packages admin)
49 #:use-module (gnu packages algebra)
50 #:use-module (gnu packages attr)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages backup)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages bison)
56 #:use-module (gnu packages calendar)
57 #:use-module (gnu packages check)
58 #:use-module (gnu packages crypto)
59 #:use-module (gnu packages compression)
60 #:use-module (gnu packages databases)
61 #:use-module (gnu packages datastructures)
62 #:use-module (gnu packages docbook)
63 #:use-module (gnu packages documentation)
64 #:use-module (gnu packages elf)
65 #:use-module (gnu packages flex)
66 #:use-module (gnu packages file)
67 #:use-module (gnu packages freedesktop)
68 #:use-module (gnu packages gcc)
69 #:use-module (gnu packages gettext)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnuzilla)
72 #:use-module (gnu packages gperf)
73 #:use-module (gnu packages gtk)
74 #:use-module (gnu packages libusb)
75 #:use-module (gnu packages man)
76 #:use-module (gnu packages maths)
77 #:use-module (gnu packages multiprecision)
78 #:use-module (gnu packages ncurses)
79 #:use-module (gnu packages networking)
80 #:use-module (gnu packages ninja)
81 #:use-module (gnu packages perl)
82 #:use-module (gnu packages pciutils)
83 #:use-module (gnu packages pkg-config)
84 #:use-module (gnu packages popt)
85 #:use-module (gnu packages pulseaudio)
86 #:use-module (gnu packages python)
87 #:use-module (gnu packages readline)
88 #:use-module (gnu packages rrdtool)
89 #:use-module (gnu packages samba)
90 #:use-module (gnu packages slang)
91 #:use-module (gnu packages storage)
92 #:use-module (gnu packages texinfo)
93 #:use-module (gnu packages tls)
94 #:use-module (gnu packages valgrind)
95 #:use-module (gnu packages video)
96 #:use-module (gnu packages web)
97 #:use-module (gnu packages xiph)
98 #:use-module (gnu packages xml)
99 #:use-module (gnu packages xdisorg)
100 #:use-module (gnu packages xorg)
101 #:use-module (guix build-system cmake)
102 #:use-module (guix build-system gnu)
103 #:use-module (guix build-system python)
104 #:use-module (guix build-system trivial)
105 #:use-module (guix download)
106 #:use-module ((guix licenses) #:prefix license:)
107 #:use-module (guix packages)
108 #:use-module (guix utils)
109 #:use-module (srfi srfi-1)
110 #:use-module (srfi srfi-2)
111 #:use-module (srfi srfi-26)
112 #:use-module (ice-9 match))
114 (define-public (system->linux-architecture arch)
115 "Return the Linux architecture name for ARCH, a Guix system name such as
116 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
117 (let ((arch (car (string-split arch #\-))))
118 (cond ((string=? arch "i686") "i386")
119 ((string-prefix? "mips" arch) "mips")
120 ((string-prefix? "arm" arch) "arm")
121 ((string-prefix? "aarch64" arch) "arm64")
122 ((string-prefix? "alpha" arch) "alpha")
125 (define-public (system->defconfig system)
126 "Some systems (notably powerpc-linux) require a special target for kernel
127 defconfig. Return the appropiate make target if applicable, otherwise return
129 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
132 (define (linux-libre-urls version)
133 "Return a list of URLs for Linux-Libre VERSION."
135 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
136 version "-gnu/linux-libre-" version "-gnu.tar.xz")
138 ;; XXX: Work around <http://bugs.gnu.org/14851>.
140 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
141 version "-gnu.tar.xz")
143 ;; Maybe this URL will become valid eventually.
145 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
146 version "-gnu.tar.xz")))
148 (define-public linux-libre-headers
150 (name "linux-libre-headers")
154 (uri (linux-libre-urls version))
157 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
158 (build-system gnu-build-system)
159 (native-inputs `(("perl" ,perl)))
161 `(#:modules ((guix build gnu-build-system)
165 (modify-phases %standard-phases
169 (let ((arch ,(system->linux-architecture
170 (or (%current-target-system)
172 (defconfig ,(system->defconfig
173 (or (%current-target-system)
174 (%current-system)))))
176 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
177 (and (zero? (system* "make" defconfig))
178 (zero? (system* "make" "mrproper" "headers_check"))))))
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let ((out (assoc-ref outputs "out")))
182 (and (zero? (system* "make"
183 (string-append "INSTALL_HDR_PATH=" out)
186 (mkdir (string-append out "/include/config"))
187 (call-with-output-file
189 "/include/config/kernel.release")
191 (format p "~a-default~%" ,version)))
193 ;; Remove the '.install' and '..install.cmd' files; the
194 ;; latter contains store paths, which pulls in bootstrap
195 ;; binaries in the build environment, and prevents bit
196 ;; reproducibility for the bootstrap binaries.
197 (for-each delete-file (find-files out "\\.install"))
200 #:allowed-references ()
202 (home-page "https://www.gnu.org/software/linux-libre/")
203 (synopsis "GNU Linux-Libre kernel headers")
204 (description "Headers of the Linux-Libre kernel.")
205 (license license:gpl2)))
207 (define %boot-logo-patch
208 ;; Linux-Libre boot logo featuring Freedo and a gnu.
211 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
212 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
215 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
217 (define* (kernel-config arch #:key variant)
218 "Return the absolute file name of the Linux-Libre build configuration file
219 for ARCH and optionally VARIANT, or #f if there is no such configuration."
220 (let* ((name (string-append (if variant (string-append variant "-") "")
221 (if (string=? "i386" arch) "i686" arch) ".conf"))
222 (file (string-append "linux-libre/" name)))
223 (search-auxiliary-file file)))
225 (define %default-extra-linux-options
226 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
227 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
228 ;; Modules required for initrd:
229 ("CONFIG_NET_9P" . m)
230 ("CONFIG_NET_9P_VIRTIO" . m)
231 ("CONFIG_VIRTIO_BLK" . m)
232 ("CONFIG_VIRTIO_NET" . m)
233 ("CONFIG_VIRTIO_PCI" . m)
234 ("CONFIG_VIRTIO_BALLOON" . m)
235 ("CONFIG_VIRTIO_MMIO" . m)
236 ("CONFIG_FUSE_FS" . m)
238 ("CONFIG_9P_FS" . m)))
240 (define (config->string options)
241 (string-join (map (match-lambda
243 (string-append option "=m"))
245 (string-append option "=y"))
247 (string-append option "=n")))
251 (define* (make-linux-libre version hash supported-systems
253 ;; A function that takes an arch and a variant.
254 ;; See kernel-config for an example.
256 (configuration-file #f)
257 (defconfig "defconfig")
258 (extra-options %default-extra-linux-options)
259 (patches (list %boot-logo-patch)))
261 (name (if extra-version
262 (string-append "linux-libre-" extra-version)
267 (uri (linux-libre-urls version))
268 (sha256 (base32 hash))
270 (supported-systems supported-systems)
271 (build-system gnu-build-system)
277 ,@(match (and configuration-file
279 (system->linux-architecture
280 (or (%current-target-system) (%current-system)))
281 #:variant (version-major+minor version)))
282 (#f ;no config for this platform
285 `(("kconfig" ,config))))))
287 `(#:modules ((guix build gnu-build-system)
292 (modify-phases %standard-phases
294 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
295 ;; Avoid introducing timestamps
296 (setenv "KCONFIG_NOTIMESTAMP" "1")
297 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
299 ;; Set ARCH and CROSS_COMPILE
300 (let ((arch ,(system->linux-architecture
301 (or (%current-target-system)
302 (%current-system)))))
304 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
307 (setenv "CROSS_COMPILE" (string-append target "-"))
308 (format #t "`CROSS_COMPILE' set to `~a'~%"
309 (getenv "CROSS_COMPILE"))))
311 (setenv "EXTRA_VERSION" ,extra-version)
313 (let ((build (assoc-ref %standard-phases 'build))
314 (config (assoc-ref inputs "kconfig")))
316 ;; Use a custom kernel configuration file or a default
317 ;; configuration file.
320 (copy-file config ".config")
321 (chmod ".config" #o666))
322 (system* "make" ,defconfig))
324 ;; Appending works even when the option wasn't in the
325 ;; file. The last one prevails if duplicated.
326 (let ((port (open-file ".config" "a"))
327 (extra-configuration ,(config->string extra-options)))
328 (display extra-configuration port)
331 (zero? (system* "make" "oldconfig")))))
333 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
334 (let* ((out (assoc-ref outputs "out"))
335 (moddir (string-append out "/lib/modules"))
336 (dtbdir (string-append out "/lib/dtbs"))
337 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
338 ;; Install kernel image, kernel configuration and link map.
339 (for-each (lambda (file) (install-file file out))
340 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
341 ;; Install device tree files
342 (for-each (lambda (file) (install-file file dtbdir))
343 (find-files "." "\\.dtb$"))
344 ;; Install kernel modules
346 (zero? (system* "make"
347 (string-append "DEPMOD=" kmod "/bin/depmod")
348 (string-append "MODULE_DIR=" moddir)
349 (string-append "INSTALL_PATH=" out)
350 (string-append "INSTALL_MOD_PATH=" out)
351 "INSTALL_MOD_STRIP=1"
352 "modules_install"))))))
354 (home-page "https://www.gnu.org/software/linux-libre//")
355 (synopsis "100% free redistribution of a cleaned Linux kernel")
357 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
358 It has been modified to remove all non-free binary blobs.")
359 (license license:gpl2)))
361 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
363 (define %linux-libre-version "4.11.6")
364 (define %linux-libre-hash "0xay0m2a4la8aqc8ai8zqfh1c1i6sjgh0dywm7nis0g1gqirwrds")
366 (define-public linux-libre
367 (make-linux-libre %linux-libre-version
369 %intel-compatible-systems
370 #:configuration-file kernel-config
372 (list %boot-logo-patch
376 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/patch/?id=167ec8235f978d7af78c73e9490dae1af3fee67f")
377 (file-name "linux-libre-4.11-CVE-2017-1000364.patch")
380 "0hv3lxjgpssvsldkydg5q7znnzxv5ncpzrk6g11q01k3gkl0q689"))))))
382 (define-public linux-libre-4.9
383 (make-linux-libre "4.9.33"
384 "1dam6vqymhlx1vsl0lzxphamiifgyf97snxg18b2czqq402nz094"
385 %intel-compatible-systems
386 #:configuration-file kernel-config
388 (list %boot-logo-patch
392 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/patch/?id=37c40b6777f0bc8a63f616479c469b371097f333")
393 (file-name "linux-libre-4.9-CVE-2017-1000364.patch")
396 "0zhnh8ysiqldxlnd50bjrxagzx29kc8nlajdrikii2x2ibkbfb4i"))))))
398 (define-public linux-libre-4.4
399 (make-linux-libre "4.4.73"
400 "144ssqw1dr86z4cgl797pq5rggfibsxqk7wmfbl6j92l1cj6yjrz"
401 %intel-compatible-systems
402 #:configuration-file kernel-config
404 (list %boot-logo-patch
408 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/patch/?id=87422f5b9b4f43efef4eaf37d7d040aed96500cb")
409 (file-name "linux-libre-4.4-CVE-2017-1000364.patch")
412 "137p1cpiwlbvw4x12w1l23iy593xmdry60kd7j9kk690r9arfagw"))))))
414 (define-public linux-libre-4.1
415 (make-linux-libre "4.1.41"
416 "02mqfl899jxvrmxlh8lvcgvm3klwd8wbsdz4rr2gpchbggj4vgb2"
417 %intel-compatible-systems
418 #:configuration-file kernel-config))
420 (define-public linux-libre-arm-generic
421 (make-linux-libre %linux-libre-version
424 #:defconfig "multi_v7_defconfig"
425 #:extra-version "arm-generic"
427 (list %boot-logo-patch
431 https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/patch/?id=167ec8235f978d7af78c73e9490dae1af3fee67f")
432 (file-name "linux-libre-4.11-CVE-2017-1000364.patch")
435 "0hv3lxjgpssvsldkydg5q7znnzxv5ncpzrk6g11q01k3gkl0q689"))))))
439 ;;; Pluggable authentication modules (PAM).
442 (define-public linux-pam
450 "http://www.linux-pam.org/library/"
451 "Linux-PAM-" version ".tar.bz2"))
454 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
455 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
457 (build-system gnu-build-system)
461 ;; TODO: optional dependencies
462 ;; ("libxcrypt" ,libxcrypt)
463 ;; ("cracklib" ,cracklib)
466 '(;; Most users, such as `shadow', expect the headers to be under
468 #:configure-flags (list (string-append "--includedir="
469 (assoc-ref %outputs "out")
470 "/include/security"))
472 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
475 (home-page "http://www.linux-pam.org/")
476 (synopsis "Pluggable authentication modules for Linux")
478 "A *Free* project to implement OSF's RFC 86.0.
479 Pluggable authentication modules are small shared object files that can
480 be used through the PAM API to perform tasks, like authenticating a user
481 at login. Local and dynamic reconfiguration are its key features.")
482 (license license:bsd-3)))
484 (define-public linux-pam-1.2
492 "http://www.linux-pam.org/library/"
493 "Linux-PAM-" version ".tar.bz2"))
496 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
497 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
504 (define-public psmisc
511 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
515 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
516 (build-system gnu-build-system)
517 (inputs `(("ncurses" ,ncurses)))
518 (home-page "https://gitlab.com/psmisc/psmisc")
520 "Small utilities that use the proc file system")
522 "This PSmisc package is a set of some small useful utilities that
523 use the proc file system. We're not about changing the world, but
524 providing the system administrator with some help in common tasks.")
525 (license license:gpl2+)))
527 (define-public util-linux
533 (uri (string-append "mirror://kernel.org/linux/utils/"
534 name "/v" (version-major+minor version) "/"
535 name "-" version ".tar.xz"))
538 "13d0ax8bcapga8phj2nclx86w57ddqxbr98ajibpzjq6d7zs8262"))
539 (patches (search-patches "util-linux-tests.patch"))
540 (modules '((guix build utils)))
542 ;; We take the 'logger' program from GNU Inetutils and 'kill'
543 ;; from GNU Coreutils.
545 (substitute* "configure"
546 (("build_logger=yes") "build_logger=no")
547 (("build_kill=yes") "build_kill=no"))
549 (build-system gnu-build-system)
551 "static")) ; >2 MiB of static .a libraries
553 `(#:configure-flags (list "--disable-use-tty-group"
554 "--enable-fs-paths-default=/run/current-system/profile/sbin"
555 ;; Install completions where our
556 ;; bash-completion package expects them.
557 (string-append "--with-bashcompletiondir="
558 (assoc-ref %outputs "out")
559 "/etc/bash_completion.d"))
560 #:phases (modify-phases %standard-phases
562 'build 'set-umount-file-name
563 (lambda* (#:key outputs #:allow-other-keys)
564 ;; Tell 'eject' the right file name of 'umount'.
565 (let ((out (assoc-ref outputs "out")))
566 (substitute* "sys-utils/eject.c"
568 (string-append "\"" out "/bin/umount\"")))
572 (lambda* (#:key inputs outputs #:allow-other-keys)
573 (let ((out (assoc-ref outputs "out"))
574 (net (assoc-ref inputs "net-base")))
575 ;; Change the test to refer to the right file.
576 (substitute* "tests/ts/misc/mcookie"
578 (string-append net "/etc/services")))
581 'install 'move-static-libraries
582 (lambda* (#:key outputs #:allow-other-keys)
583 (let ((out (assoc-ref outputs "out"))
584 (static (assoc-ref outputs "static")))
585 (mkdir-p (string-append static "/lib"))
586 (with-directory-excursion out
587 (for-each (lambda (file)
589 (string-append static "/"
591 (find-files "lib" "\\.a$")))
593 (inputs `(("zlib" ,zlib)
594 ("ncurses" ,ncurses)))
597 ("net-base" ,net-base))) ;for tests
598 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
599 (synopsis "Collection of utilities for the Linux kernel")
600 (description "Util-linux is a diverse collection of Linux kernel
601 utilities. It provides dmesg and includes tools for working with file systems,
602 block devices, UUIDs, TTYs, and many other tools.")
604 ;; Note that util-linux doesn't use the same license for all the
605 ;; code. GPLv2+ is the default license for a code without an
606 ;; explicitly defined license.
607 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
608 license:bsd-4 license:public-domain))))
616 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
618 (file-name (string-append name "-" version ".tar.gz"))
620 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
621 (build-system cmake-build-system)
622 (arguments '(#:tests? #f))
623 (home-page "https://github.com/bo0ts/ddate")
624 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
626 "ddate displays the Discordian date and holidays of a given date.
627 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
628 by Robert Shea and Robert Anton Wilson.")
629 (license license:public-domain)))
631 (define-public procps
637 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
638 "procps-ng-" version ".tar.xz"))
641 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
642 (build-system gnu-build-system)
644 '(#:modules ((guix build utils)
645 (guix build gnu-build-system)
649 (modify-phases %standard-phases
650 (add-before 'check 'disable-strtod-test
652 ;; Disable the 'strtod' test, which fails on 32-bit systems.
653 ;; This is what upstream does:
654 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
655 (substitute* "Makefile"
656 (("^(TESTS|check_PROGRAMS) = .*$" all)
657 (string-append "# " all "\n")))
660 'install 'post-install
661 ;; Remove commands and man pages redudant with
663 (lambda* (#:key outputs #:allow-other-keys)
664 (let* ((out (assoc-ref outputs "out"))
665 (dup (append-map (cut find-files out <>)
666 '("^kill" "^uptime"))))
667 (for-each delete-file dup)
669 (inputs `(("ncurses" ,ncurses)))
670 (home-page "https://gitlab.com/procps-ng/procps/")
671 (synopsis "Utilities that give information about processes")
673 "Procps is the package that has a bunch of small useful utilities
674 that give information about processes using the Linux /proc file system.
675 The package includes the programs ps, top, vmstat, w, kill, free,
676 slabtop, and skill.")
677 (license license:gpl2)))
679 (define-public usbutils
686 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
687 "usbutils-" version ".tar.xz"))
690 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
691 (build-system gnu-build-system)
696 `(("pkg-config" ,pkg-config)))
697 (home-page "http://www.linux-usb.org/")
699 "Tools for working with USB devices, such as lsusb")
701 "Tools for working with USB devices, such as lsusb.")
702 (license license:gpl2+)))
704 (define-public e2fsprogs
711 "mirror://kernel.org/linux/kernel/people/tytso/"
712 name "/v" version "/"
713 name "-" version ".tar.xz"))
716 "092absr4vrlqrkdf9nwh4ykj40ab6hhwrkdr6sjsccd54c8z5csl"))))
717 (build-system gnu-build-system)
718 (inputs `(("util-linux" ,util-linux)))
719 (native-inputs `(("pkg-config" ,pkg-config)
720 ("texinfo" ,texinfo) ;for the libext2fs Info manual
726 '(;; util-linux is the preferred source for some of the libraries and
727 ;; commands, so disable them (see, e.g.,
728 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
729 #:configure-flags (list "--disable-libblkid"
730 "--disable-libuuid" "--disable-uuidd"
733 ;; Use symlinks instead of hard links for
734 ;; 'fsck.extN' etc. This makes the resulting nar
735 ;; smaller and is preserved across copies.
736 "--enable-symlink-install"
738 (string-append "LDFLAGS=-Wl,-rpath="
739 (assoc-ref %outputs "out")
742 ;; Install libext2fs et al.
743 "--enable-elf-shlibs")
746 (modify-phases %standard-phases
747 (add-before 'configure 'patch-shells
749 (substitute* "configure"
750 (("/bin/sh (.*)parse-types.sh" _ dir)
751 (string-append (which "sh") " " dir
753 (substitute* "MCONFIG.in"
754 (("INSTALL_SYMLINK = /bin/sh")
755 "INSTALL_SYMLINK = sh"))
756 (substitute* (find-files "." "^Makefile.in$")
758 (string-append "#!" (which "sh"))))
760 (add-after 'install 'install-libs
761 (lambda* (#:key outputs #:allow-other-keys)
762 (let* ((out (assoc-ref outputs "out"))
763 (lib (string-append out "/lib")))
764 (and (zero? (system* "make" "install-libs"))
766 ;; Make the .a writable so that 'strip' works.
767 ;; Failing to do that, due to debug symbols, we
768 ;; retain a reference to the final
769 ;; linux-libre-headers, which refer to the
770 ;; bootstrap binaries.
771 (let ((archives (find-files lib "\\.a$")))
772 (for-each (lambda (file)
776 (home-page "http://e2fsprogs.sourceforge.net/")
777 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
779 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
780 (license (list license:gpl2 ;programs
781 license:lgpl2.0 ;libext2fs
782 license:x11)))) ;libuuid
784 (define e2fsprogs/static
786 (package (inherit e2fsprogs)
788 ;; Do not build shared libraries.
789 (substitute-keyword-arguments (package-arguments e2fsprogs)
790 ((#:configure-flags _)
791 '(list "--disable-blkid"))
795 (define-public e2fsck/static
797 (name "e2fsck-static")
798 (version (package-version e2fsprogs))
799 (build-system trivial-build-system)
802 `(("e2fsprogs" ,e2fsprogs/static)))
804 `(#:modules ((guix build utils))
807 (use-modules (guix build utils)
811 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
813 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
815 (with-directory-excursion bin
816 (copy-file e2fsck "e2fsck")
817 (remove-store-references "e2fsck")
818 (chmod "e2fsck" #o555))))))
819 (home-page (package-home-page e2fsprogs))
820 (synopsis "Statically-linked e2fsck command from e2fsprogs")
821 (description "This package provides statically-linked e2fsck command taken
822 from the e2fsprogs package. It is meant to be used in initrds.")
823 (license (package-license e2fsprogs))))
825 (define-public extundelete
831 (uri (string-append "mirror://sourceforge/extundelete/"
832 "extundelete/" version "/extundelete-"
836 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
837 (build-system gnu-build-system)
838 (inputs `(("e2fsprogs" ,e2fsprogs)))
839 (home-page "http://extundelete.sourceforge.net/")
840 (synopsis "Recover deleted files from ext2/3/4 partitions")
842 "Extundelete is a set of tools that can recover deleted files from an
843 ext3 or ext4 partition.")
844 (license license:gpl2)))
846 (define-public zerofree
850 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
853 (uri (string-append home-page name "-" version
857 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
858 (build-system gnu-build-system)
860 '(#:phases (alist-replace
862 (lambda* (#:key outputs #:allow-other-keys)
863 (let* ((out (assoc-ref outputs "out"))
864 (bin (string-append out "/bin")))
866 (copy-file "zerofree"
867 (string-append bin "/zerofree"))
868 (chmod (string-append bin "/zerofree")
871 (alist-delete 'configure %standard-phases))
872 #:tests? #f)) ;no tests
873 (inputs `(("libext2fs" ,e2fsprogs)))
874 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
876 "The zerofree command scans the free blocks in an ext2 file system and
877 fills any non-zero blocks with zeroes. This is a useful way to make disk
878 images more compressible.")
879 (license license:gpl2)))
881 (define-public strace
887 (uri (string-append "mirror://sourceforge/strace/strace/" version
888 "/strace-" version ".tar.xz"))
891 "06bl4dld5fk4a3iiq4pyrkm6sh63599ah8dmds0glg5vbw45pww1"))))
892 (build-system gnu-build-system)
895 (modify-phases %standard-phases
896 (add-after 'unpack 'patch-/bin/sh
898 (substitute* "strace.c"
899 (("/bin/sh") (which "sh")))
901 (native-inputs `(("perl" ,perl)))
902 (home-page "https://strace.io/")
903 (synopsis "System call tracer for Linux")
905 "strace is a system call tracer, i.e. a debugging tool which prints out a
906 trace of all the system calls made by a another process/program.")
907 (license license:bsd-3)))
909 (define-public ltrace
915 (uri (string-append "http://www.ltrace.org/ltrace_" version
919 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
920 (build-system gnu-build-system)
921 (inputs `(("libelf" ,libelf)))
923 ;; Compilation uses -Werror by default, but it fails.
924 '(#:configure-flags '("--disable-werror")))
925 (home-page "http://www.ltrace.org/")
926 (synopsis "Library call tracer for Linux")
928 "ltrace intercepts and records dynamic library calls which are called by
929 an executed process and the signals received by that process. It can also
930 intercept and print the system calls executed by the program.")
931 (license license:gpl2+)))
933 (define-public alsa-lib
940 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
944 "0xjvi381105gldhv0z872a0x58sghznyx19j45lw5iyi2h68gfwi"))))
945 (build-system gnu-build-system)
946 (home-page "https://www.alsa-project.org/")
947 (synopsis "The Advanced Linux Sound Architecture libraries")
949 "The Advanced Linux Sound Architecture (ALSA) provides audio and
950 MIDI functionality to the Linux-based operating system.")
951 (license license:lgpl2.1+)))
953 (define-public alsa-utils
959 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
960 name "-" version ".tar.bz2"))
963 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
964 (build-system gnu-build-system)
966 ;; XXX: Disable man page creation until we have DocBook.
967 '(#:configure-flags (list "--disable-xmlto"
969 ;; The udev rule is responsible for restoring
971 (string-append "--with-udev-rules-dir="
972 (assoc-ref %outputs "out")
973 "/lib/udev/rules.d"))
975 (modify-phases %standard-phases
977 'install 'pre-install
979 ;; Don't try to mkdir /var/lib/alsa.
980 (substitute* "Makefile"
981 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
985 `(("libsamplerate" ,libsamplerate)
987 ("alsa-lib" ,alsa-lib)
989 ("gettext" ,gettext-minimal)))
990 (home-page "http://www.alsa-project.org/")
991 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
993 "The Advanced Linux Sound Architecture (ALSA) provides audio and
994 MIDI functionality to the Linux-based operating system.")
996 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
998 (license license:gpl2)))
1000 (define-public alsa-plugins
1002 (name "alsa-plugins")
1006 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1007 name "-" version ".tar.bz2"))
1010 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
1011 (build-system gnu-build-system)
1012 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1013 ;; be split, there are references to both in files.
1014 ;; TODO: Remove OSS related plugins, they add support to run native
1015 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1017 (outputs '("out" "pulseaudio"))
1020 (modify-phases %standard-phases
1021 (add-after 'install 'split
1022 (lambda* (#:key inputs outputs #:allow-other-keys)
1023 ;; Distribute the binaries to the various outputs.
1024 (let* ((out (assoc-ref outputs "out"))
1025 (pua (assoc-ref outputs "pulseaudio"))
1026 (pualib (string-append pua "/lib/alsa-lib"))
1027 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
1030 (chdir (string-append out "/share"))
1031 (for-each (lambda (file)
1032 (rename-file file (string-append puaconf "/" (basename file))))
1033 (find-files out "\\.(conf|example)"))
1034 (for-each (lambda (file)
1035 (rename-file file (string-append pualib "/" (basename file))))
1036 (find-files out ".*pulse\\.(la|so)"))
1038 ;; We have moved the files to output pulsaudio, the
1039 ;; directory is now empty.
1040 (delete-file-recursively (string-append out "/share"))
1043 `(("alsa-lib" ,alsa-lib)
1044 ("speex" ,speex) ; libspeexdsp resampling plugin
1045 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1046 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1047 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1049 `(("pkg-config" ,pkg-config)))
1050 (home-page "http://www.alsa-project.org/")
1051 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1053 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1054 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1055 by providing additional plugins which include: upmixing, downmixing, jackd and
1056 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1057 external rate conversion.")
1058 (license (list license:gpl2+
1059 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1060 license:lgpl2.1+))))
1062 (define-public iptables
1069 "mirror://netfilter.org/iptables/iptables-"
1070 version ".tar.bz2"))
1073 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
1074 (build-system gnu-build-system)
1076 `(("pkg-config" ,pkg-config)
1080 `(("libmnl" ,libmnl)
1081 ("libnftnl" ,libnftnl)))
1083 '(#:tests? #f ; no test suite
1084 #:configure-flags ; add $libdir to the RUNPATH of executables
1085 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1086 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1087 (synopsis "Program to configure the Linux IP packet filtering rules")
1089 "iptables is the userspace command line program used to configure the
1090 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1091 system administrators. Since Network Address Translation is also configured
1092 from the packet filter ruleset, iptables is used for this, too. The iptables
1093 package also includes ip6tables. ip6tables is used for configuring the IPv6
1095 (license license:gpl2+)))
1097 (define-public ebtables
1100 (version "2.0.10-4")
1104 "mirror://netfilter.org/ebtables/ebtables-v"
1108 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1109 (build-system gnu-build-system)
1111 '(#:tests? #f ; no test suite
1113 (let* ((out (assoc-ref %outputs "out"))
1114 (bin (string-append out "/sbin"))
1115 (lib (string-append out "/lib"))
1116 (man (string-append out "/share/man"))
1117 (iptables (assoc-ref %build-inputs "iptables"))
1118 (ethertypes (string-append iptables "/etc/ethertypes")))
1119 (list (string-append "LIBDIR=" lib)
1120 (string-append "MANDIR=" man)
1121 (string-append "BINDIR=" bin)
1122 (string-append "ETHERTYPESFILE=" ethertypes)
1123 ;; With the default CFLAGS, it falis with:
1124 ;; communication.c:259:58: error: variable ‘ret’ set but not
1125 ;; used [-Werror=unused-but-set-variable]
1128 (modify-phases %standard-phases
1130 ;; no configure script
1132 (substitute* "Makefile"
1133 ;; Remove user and group options from install commands,
1134 ;; otherwise it fails with: invalid user 'root'.
1135 (("-o root -g root") "")
1136 ;; Remove 'ethertypes' from the install target.
1138 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1142 ("iptables" ,iptables)))
1143 (synopsis "Ethernet bridge frame table administration")
1144 (home-page "http://ebtables.netfilter.org/")
1146 "ebtables is an application program used to set up and maintain the
1147 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1148 analogous to the iptables application, but less complicated, due to the fact
1149 that the Ethernet protocol is much simpler than the IP protocol.")
1150 (license license:gpl2+)))
1152 (define-public iproute
1159 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1163 "09l0phf09mw17bn3xlzfr80sbhw14mq8xv28iz5x15m6pll10rvj"))))
1164 (build-system gnu-build-system)
1166 `(#:tests? #f ; no test suite
1167 #:make-flags (let ((out (assoc-ref %outputs "out")))
1169 (string-append "BASH_COMPDIR=" out
1170 "/etc/bash_completion.d")
1171 (string-append "LIBDIR=" out "/lib")
1172 (string-append "HDRDIR=" out "/include")
1173 (string-append "SBINDIR=" out "/sbin")
1174 (string-append "CONFDIR=" out "/etc")
1175 (string-append "DOCDIR=" out "/share/doc/"
1177 (string-append "MANDIR=" out "/share/man")))
1178 #:phases (modify-phases %standard-phases
1179 (add-before 'install 'pre-install
1181 ;; Don't attempt to create /var/lib/arpd.
1182 (substitute* "Makefile"
1183 (("^.*ARPDDIR.*$") "")))))))
1185 `(("iptables" ,iptables)
1188 `(("pkg-config" ,pkg-config)
1192 "https://wiki.linuxfoundation.org/networking/iproute2")
1194 "Utilities for controlling TCP/IP networking and traffic in Linux")
1196 "Iproute2 is a collection of utilities for controlling TCP/IP
1197 networking and traffic with the Linux kernel.
1199 Most network configuration manuals still refer to ifconfig and route as the
1200 primary network configuration tools, but ifconfig is known to behave
1201 inadequately in modern network environments. They should be deprecated, but
1202 most distros still include them. Most network configuration systems make use
1203 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1204 to support most modern network technologies, as it doesn't use ifconfig and
1205 allows a system administrator to make use of all iproute2 features, including
1208 iproute2 is usually shipped in a package called iproute or iproute2 and
1209 consists of several tools, of which the most important are @command{ip} and
1210 @command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1211 @command{tc} stands for traffic control. Both tools print detailed usage
1212 messages and are accompanied by a set of manpages.")
1213 (license license:gpl2+)))
1215 (define-public net-tools
1216 ;; XXX: This package is basically unmaintained, but it provides a few
1217 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1222 (home-page "http://net-tools.sourceforge.net/")
1225 (uri (list (string-append
1226 "mirror://sourceforge/net-tools/net-tools-"
1229 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1230 "/base/net-tools/net-tools-1.60.tar.bz2")))
1233 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1234 (patches (search-patches "net-tools-bitrot.patch"))))
1235 (build-system gnu-build-system)
1237 '(#:modules ((guix build gnu-build-system)
1241 #:phases (alist-cons-after
1243 (lambda* (#:key inputs #:allow-other-keys)
1244 (define (apply-patch file)
1245 (zero? (system* "patch" "-p1" "--force"
1248 (let ((patch.gz (assoc-ref inputs "patch")))
1249 (format #t "applying Debian patch set '~a'...~%"
1251 (system (string-append "gunzip < " patch.gz " > the-patch"))
1252 (and (apply-patch "the-patch")
1253 (for-each apply-patch
1254 (find-files "debian/patches"
1258 (lambda* (#:key outputs #:allow-other-keys)
1259 (let ((out (assoc-ref outputs "out")))
1260 (mkdir-p (string-append out "/bin"))
1261 (mkdir-p (string-append out "/sbin"))
1263 ;; Pretend we have everything...
1264 (system "yes | make config")
1266 ;; ... except for the things we don't have.
1267 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1268 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1269 ;; that have been removed.
1270 (substitute* '("config.make" "config.h")
1271 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1273 'install 'remove-redundant-commands
1274 (lambda* (#:key outputs #:allow-other-keys)
1275 ;; Remove commands and man pages redundant with
1277 (let* ((out (assoc-ref outputs "out"))
1278 (dup (append-map (cut find-files out <>)
1280 "^(yp|nis|dns)?domainname"))))
1281 (for-each delete-file dup)
1285 ;; Binaries that depend on libnet-tools.a don't declare that
1286 ;; dependency, making it parallel-unsafe.
1287 #:parallel-build? #f
1289 #:tests? #f ; no test suite
1290 #:make-flags (let ((out (assoc-ref %outputs "out")))
1292 (string-append "BASEDIR=" out)
1293 (string-append "INSTALLNLSDIR=" out "/share/locale")
1294 (string-append "mandir=/share/man")))))
1296 ;; Use the big Debian patch set (the thing does not even compile out of
1298 (inputs `(("patch" ,(origin
1301 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1304 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1305 (native-inputs `(("gettext" ,gettext-minimal)))
1307 (synopsis "Tools for controlling the network subsystem in Linux")
1309 "This package includes the important tools for controlling the network
1310 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1311 netstat, rarp and route. Additionally, this package contains utilities
1312 relating to particular network hardware types (plipconfig, slattach) and
1313 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1314 (license license:gpl2+)))
1316 (define-public libcap
1323 "mirror://kernel.org/linux/libs/security/linux-privs/"
1324 "libcap2/libcap-" version ".tar.xz"))
1327 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1328 (build-system gnu-build-system)
1329 (arguments '(#:phases
1330 (modify-phases %standard-phases
1332 ;; Add $libdir to the RUNPATH of executables.
1334 (substitute* "Make.Rules"
1336 (string-append "LDFLAGS := -Wl,-rpath="
1337 %output "/lib"))))))
1338 #:tests? #f ; no 'check' target
1339 #:make-flags (list "lib=lib"
1340 (string-append "prefix="
1341 (assoc-ref %outputs "out"))
1342 "RAISE_SETFCAP=no")))
1343 (native-inputs `(("perl" ,perl)))
1344 (inputs `(("attr" ,attr)))
1345 (home-page "https://sites.google.com/site/fullycapable/")
1346 (synopsis "Library for working with POSIX capabilities")
1348 "Libcap2 provides a programming interface to POSIX capabilities on
1349 Linux-based operating systems.")
1351 ;; License is BSD-3 or GPLv2, at the user's choice.
1352 (license license:gpl2)))
1354 (define-public bridge-utils
1356 (name "bridge-utils")
1360 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1361 "bridge-utils-" version ".tar.gz"))
1364 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1365 (build-system gnu-build-system)
1367 ;; The tarball lacks all the generated files.
1368 (native-inputs `(("autoconf" ,autoconf)
1369 ("automake" ,automake)))
1371 '(#:phases (alist-cons-after
1374 ;; Fix "field ‘ip6’ has incomplete type" errors.
1375 (substitute* "libbridge/libbridge.h"
1376 (("#include <linux/if_bridge.h>")
1377 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1379 ;; Ensure that the entire build fails if one of the
1380 ;; sub-Makefiles fails.
1381 (substitute* "Makefile.in"
1382 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1383 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1385 (zero? (system* "autoreconf" "-vf")))
1387 #:tests? #f)) ; no 'check' target
1390 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1391 (synopsis "Manipulate Ethernet bridges")
1393 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1394 to connect two Ethernet segments together in a protocol independent way.
1395 Packets are forwarded based on Ethernet address, rather than IP address (like
1396 a router). Since forwarding is done at Layer 2, all protocols can go
1397 transparently through a bridge.")
1398 (license license:gpl2+)))
1400 (define-public libnl
1407 "https://github.com/thom311/libnl/releases/download/"
1408 "libnl" (string-join (string-split version #\.) "_")
1409 "/libnl-" version ".tar.gz"))
1412 "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
1413 (build-system gnu-build-system)
1414 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1415 (home-page "http://www.infradead.org/~tgr/libnl/")
1416 (synopsis "NetLink protocol library suite")
1418 "The libnl suite is a collection of libraries providing APIs to netlink
1419 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1420 between the kernel and user space processes. It was designed to be a more
1421 flexible successor to ioctl to provide mainly networking related kernel
1422 configuration and monitoring interfaces.")
1424 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1425 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1426 (license license:gpl2)))
1435 "mirror://kernel.org/software/network/iw/iw-"
1439 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1440 (build-system gnu-build-system)
1441 (native-inputs `(("pkg-config" ,pkg-config)))
1442 (inputs `(("libnl" ,libnl)))
1444 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1446 #:phases (alist-delete 'configure %standard-phases)))
1447 (home-page "https://wireless.wiki.kernel.org/")
1448 (synopsis "Tool for configuring wireless devices")
1450 "iw is a new nl80211 based CLI configuration utility for wireless
1451 devices. It replaces @code{iwconfig}, which is deprecated.")
1452 (license license:isc)))
1454 (define-public powertop
1462 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1466 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1467 (build-system gnu-build-system)
1470 (modify-phases %standard-phases
1471 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1472 ;; allow calibrating the network interface in GuixSD.
1473 (add-after 'unpack 'patch-absolute-file-names
1474 (lambda* (#:key inputs #:allow-other-keys)
1475 (let ((kmod (assoc-ref inputs "kmod")))
1476 (substitute* (find-files "src" "\\.cpp$")
1477 ;; Give the right 'modprobe' file name so that essential
1478 ;; modules such as msr.ko can be loaded.
1479 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1480 ;; These programs are only needed to calibrate, so using
1481 ;; relative file names avoids adding extra inputs. When they
1482 ;; are missing powertop gracefully handles it.
1483 (("/usr/bin/hcitool") "hcitool")
1484 (("/usr/bin/xset") "xset")
1485 (("/usr/sbin/hciconfig") "hciconfig"))
1490 ("ncurses" ,ncurses)
1491 ("pciutils" ,pciutils)
1494 `(("pkg-config" ,pkg-config)))
1495 (home-page "https://01.org/powertop/")
1496 (synopsis "Analyze power consumption on Intel-based laptops")
1498 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1499 power management. In addition to being a diagnostic tool, PowerTOP also has
1500 an interactive mode where the user can experiment various power management
1501 settings for cases where the operating system has not enabled these
1503 (license license:gpl2)))
1505 (define-public aumix
1512 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1513 version ".tar.bz2"))
1516 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1517 (build-system gnu-build-system)
1518 (inputs `(("ncurses" ,ncurses)))
1519 (home-page "http://www.jpj.net/~trevor/aumix.html")
1520 (synopsis "Audio mixer for X and the console")
1522 "Aumix adjusts an audio mixer from X, the console, a terminal,
1523 the command line or a script.")
1524 (license license:gpl2+)))
1526 (define-public iotop
1533 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1536 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1537 (build-system python-build-system)
1539 ;; The setup.py script expects python-2.
1540 `(#:python ,python-2
1541 ;; There are currently no checks in the package.
1543 (native-inputs `(("python" ,python-2)))
1544 (home-page "http://guichaz.free.fr/iotop/")
1546 "Displays the IO activity of running processes")
1548 "Iotop is a Python program with a top like user interface to show the
1549 processes currently causing I/O.")
1550 (license license:gpl2+)))
1558 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1559 "download/fuse-" version
1560 "/fuse-" version ".tar.gz"))
1563 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1564 (patches (search-patches "fuse-overlapping-headers.patch"))))
1565 (build-system gnu-build-system)
1566 (inputs `(("util-linux" ,util-linux)))
1568 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1569 (assoc-ref %outputs "out")
1571 (string-append "INIT_D_PATH="
1572 (assoc-ref %outputs "out")
1575 ;; The rule makes /dev/fuse 666.
1576 (string-append "UDEV_RULES_PATH="
1577 (assoc-ref %outputs "out")
1578 "/lib/udev/rules.d"))
1579 #:phases (alist-cons-before
1580 'build 'set-file-names
1581 (lambda* (#:key inputs #:allow-other-keys)
1582 ;; libfuse calls out to mount(8) and umount(8). Make sure
1583 ;; it refers to the right ones.
1584 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1585 (("/bin/(u?)mount" _ maybe-u)
1586 (string-append (assoc-ref inputs "util-linux")
1587 "/bin/" maybe-u "mount")))
1588 (substitute* '("util/mount.fuse.c")
1592 ;; This hack leads libfuse to search for 'fusermount' in
1593 ;; $PATH, where it may find a setuid-root binary, instead of
1594 ;; trying solely $out/sbin/fusermount and failing because
1596 (substitute* "lib/Makefile"
1597 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1598 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1600 (home-page "https://github.com/libfuse/libfuse")
1601 (synopsis "Support file systems implemented in user space")
1603 "As a consequence of its monolithic design, file system code for Linux
1604 normally goes into the kernel itself---which is not only a robustness issue,
1605 but also an impediment to system extensibility. FUSE, for \"file systems in
1606 user space\", is a kernel module and user-space library that tries to address
1607 part of this problem by allowing users to run file system implementations as
1608 user-space processes.")
1609 (license (list license:lgpl2.1 ;library
1610 license:gpl2+)))) ;command-line utilities
1612 (define-public unionfs-fuse
1614 (name "unionfs-fuse")
1619 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1621 (file-name (string-append name "-" version ".tar.gz"))
1624 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1625 (build-system cmake-build-system)
1627 `(("python" ,python)
1628 ("python-pytest" ,python-pytest)))
1629 (inputs `(("fuse" ,fuse)))
1632 (modify-phases %standard-phases
1634 ;; Borrowed from the Makefile
1635 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
1636 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1637 (synopsis "User-space union file system")
1639 "UnionFS-FUSE is a flexible union file system implementation in user
1640 space, using the FUSE library. Mounting a union file system allows you to
1641 \"aggregate\" the contents of several directories into a single mount point.
1642 UnionFS-FUSE additionally supports copy-on-write.")
1643 (license license:bsd-3)))
1646 (package (inherit fuse)
1647 (name "fuse-static")
1648 (source (origin (inherit (package-source fuse))
1649 (modules '((guix build utils)))
1651 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1652 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1653 ;; it doesn't do that, allowing us to remove the dependency on
1654 ;; util-linux (something that is useful in initrds.)
1655 '(substitute* '("lib/mount_util.c"
1656 "util/mount_util.c")
1657 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1662 (define-public unionfs-fuse/static
1663 (package (inherit unionfs-fuse)
1664 (synopsis "User-space union file system (statically linked)")
1665 (name (string-append (package-name unionfs-fuse) "-static"))
1666 (source (origin (inherit (package-source unionfs-fuse))
1667 (modules '((guix build utils)))
1669 ;; Add -ldl to the libraries, because libfuse.a needs that.
1670 '(substitute* "src/CMakeLists.txt"
1671 (("target_link_libraries(.*)\\)" _ libs)
1672 (string-append "target_link_libraries"
1676 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1677 #:phases (alist-cons-after
1678 'install 'post-install
1679 (lambda* (#:key outputs #:allow-other-keys)
1680 (let* ((out (assoc-ref outputs "out"))
1681 (exe (string-append out "/bin/unionfs")))
1682 ;; By default, 'unionfs' keeps references to
1683 ;; $glibc/share/locale and similar stuff. Remove them.
1684 (remove-store-references exe)
1686 ;; 'unionfsctl' has references to glibc as well. Since
1687 ;; we don't need it, remove it.
1688 (delete-file (string-append out "/bin/unionfsctl"))
1691 (inputs `(("fuse" ,fuse-static)))))
1693 (define-public sshfs-fuse
1699 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1700 "download/sshfs-" version "/sshfs-" version
1704 "1pp5wsl1jx11apkv2fpp559miifqhi8ka400npy5awp9ghlf3la6"))))
1705 (build-system gnu-build-system)
1710 `(("pkg-config" ,pkg-config)))
1711 (home-page "https://github.com/libfuse/sshfs")
1712 (synopsis "Mount remote file systems over SSH")
1714 "This is a file system client based on the SSH File Transfer Protocol.
1715 Since most SSH servers already support this protocol it is very easy to set
1716 up: on the server side there's nothing to do; on the client side mounting the
1717 file system is as easy as logging into the server with an SSH client.")
1718 (license license:gpl2+)))
1720 (define-public archivemount
1722 (name "archivemount")
1727 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1728 "archivemount-" version ".tar.gz"))
1731 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1732 (build-system gnu-build-system)
1733 (inputs `(("fuse", fuse)
1734 ("libarchive", libarchive)))
1735 (native-inputs `(("pkg-config", pkg-config)))
1736 (home-page "http://www.cybernoia.de/software/archivemount")
1737 (synopsis "Tool for mounting archive files with FUSE")
1738 (description "archivemount is a FUSE-based file system for Unix variants,
1739 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1740 mount point where it can be read from or written to as with any other file
1741 system. This makes accessing the contents of the archive, which may be
1742 compressed, transparent to other programs, without decompressing them.")
1743 (license license:lgpl2.0+)))
1745 (define-public numactl
1752 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1757 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1758 (build-system gnu-build-system)
1760 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1761 ;; to run, which we can't assume to have.
1764 ;; NUMA is apparently not supported on armhf, see
1765 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1766 (supported-systems (delete "armhf-linux" %supported-systems))
1767 (home-page "http://oss.sgi.com/projects/libnuma/")
1768 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1770 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1771 memory is not all in one place. The numactl program allows you to run your
1772 application program on specific CPU's and memory nodes. It does this by
1773 supplying a NUMA memory policy to the operating system before running your
1776 The package contains other commands, such as numademo, numastat and memhog.
1777 The numademo command provides a quick overview of NUMA performance on your
1779 (license (list license:gpl2 ;programs
1780 license:lgpl2.1)))) ;library
1782 (define-public kbd-neo
1789 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1790 version "/linux/console/neo.map"))
1791 (file-name (string-append name "-" version ".map"))
1794 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1795 (build-system trivial-build-system)
1797 `(#:modules ((guix build utils))
1799 (use-modules (guix build utils))
1800 (let ((out (string-append %output "/share/keymaps"))
1801 (source (assoc-ref %build-inputs "source")))
1803 (copy-file source (string-append out "/neo.map"))
1805 (home-page "https://neo-layout.org")
1806 (synopsis "Neo2 console layout")
1808 "Kbd-neo provides the Neo2 keyboard layout for use with
1809 @command{loadkeys(1)} from @code{kbd(4)}.")
1810 ;; The file is located in an svn directory, the entire content of
1811 ;; the directory is licensed as GPL3.
1812 (license license:gpl3+)))
1820 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1824 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1825 (modules '((guix build utils)))
1828 (substitute* "tests/Makefile.in"
1829 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1832 (substitute* '("src/unicode_start" "src/unicode_stop")
1833 ;; Assume the Coreutils are in $PATH.
1836 (build-system gnu-build-system)
1839 (modify-phases %standard-phases
1840 (add-before 'build 'pre-build
1841 (lambda* (#:key inputs #:allow-other-keys)
1842 (let ((gzip (assoc-ref %build-inputs "gzip"))
1843 (bzip2 (assoc-ref %build-inputs "bzip2")))
1844 (substitute* "src/libkeymap/findfile.c"
1846 (string-append gzip "/bin/gzip"))
1848 (string-append bzip2 "/bin/bzip2"))))))
1849 (add-after 'install 'post-install
1850 (lambda* (#:key outputs #:allow-other-keys)
1851 ;; Make sure these programs find their comrades.
1852 (let* ((out (assoc-ref outputs "out"))
1853 (bin (string-append out "/bin")))
1854 (for-each (lambda (prog)
1855 (wrap-program (string-append bin "/" prog)
1856 `("PATH" ":" prefix (,bin))))
1857 '("unicode_start" "unicode_stop"))))))))
1858 (inputs `(("check" ,check)
1861 ("pam" ,linux-pam)))
1862 (native-search-paths
1863 (list (search-path-specification
1864 (variable "LOADKEYS_KEYMAP_PATH")
1865 (files (list "share/keymaps")))))
1866 (native-inputs `(("pkg-config" ,pkg-config)))
1867 (home-page "http://kbd-project.org/")
1868 (synopsis "Linux keyboard utilities and keyboard maps")
1870 "This package contains keytable files and keyboard utilities compatible
1871 for systems using the Linux kernel. This includes commands such as
1872 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1873 (license license:gpl2+)))
1875 (define-public inotify-tools
1877 (name "inotify-tools")
1882 "mirror://sourceforge/inotify-tools/inotify-tools/"
1883 version "/inotify-tools-" version ".tar.gz"))
1886 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1887 (build-system gnu-build-system)
1888 (home-page "http://inotify-tools.sourceforge.net/")
1889 (synopsis "Monitor file accesses")
1891 "The inotify-tools packages provides a C library and command-line tools
1892 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1893 (license license:gpl2+)))
1902 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1903 "kmod-" version ".tar.xz"))
1906 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
1907 (patches (search-patches "kmod-module-directory.patch"))))
1908 (build-system gnu-build-system)
1910 `(("pkg-config" ,pkg-config)))
1915 `(#:tests? #f ; FIXME: Investigate test failures
1916 #:configure-flags '("--with-xz" "--with-zlib")
1917 #:phases (alist-cons-after
1918 'install 'install-modprobe&co
1919 (lambda* (#:key outputs #:allow-other-keys)
1920 (let* ((out (assoc-ref outputs "out"))
1921 (bin (string-append out "/bin")))
1922 (for-each (lambda (tool)
1924 (string-append bin "/" tool)))
1925 '("insmod" "rmmod" "lsmod" "modprobe"
1926 "modinfo" "depmod"))))
1928 (home-page "https://www.kernel.org/")
1929 (synopsis "Kernel module tools")
1930 (description "Kmod is a set of tools to handle common tasks with Linux
1931 kernel modules like insert, remove, list, check properties, resolve
1932 dependencies and aliases.
1934 These tools are designed on top of libkmod, a library that is shipped with
1935 kmod. The aim is to be compatible with tools, configurations and indices
1936 from the module-init-tools project.")
1937 (license license:gpl2+))) ; library under lgpl2.1+
1939 (define-public eudev
1940 ;; The post-systemd fork, maintained by Gentoo.
1947 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1951 "0qqgbgpm5wdllk0s04pf80nwc8pr93xazwri1bylm1f15zn5ck1y"))
1952 (patches (search-patches "eudev-rules-directory.patch"))))
1953 (build-system gnu-build-system)
1955 '(#:phases (modify-phases %standard-phases
1956 (add-after 'install 'build-hwdb
1957 (lambda* (#:key outputs #:allow-other-keys)
1958 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1959 ;; similar tools to display product names.
1960 (let ((out (assoc-ref outputs "out")))
1961 (zero? (system* (string-append out "/bin/udevadm")
1962 "hwdb" "--update"))))))))
1964 `(("pkg-config" ,pkg-config)
1968 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1969 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1970 ;; which contains the rules to do that.
1971 `(("util-linux" ,util-linux) ;for blkid
1973 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1974 (synopsis "Userspace device management")
1975 (description "Udev is a daemon which dynamically creates and removes
1976 device nodes from /dev/, handles hotplug events and loads drivers at boot
1978 (license license:gpl2+)))
1980 (define-public eudev-with-hwdb
1981 (deprecated-package "eudev-with-hwdb" eudev))
1986 (version "2.02.171")
1989 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1993 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
1994 (modules '((guix build utils)))
1997 (use-modules (guix build utils))
1999 ;; Honor sysconfdir.
2000 (substitute* "make.tmpl.in"
2002 "confdir = @sysconfdir@\n")
2003 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2004 "DEFAULT_SYS_DIR = @sysconfdir@"))))
2005 (patches (search-patches "lvm2-static-link.patch"))))
2006 (build-system gnu-build-system)
2008 `(("pkg-config" ,pkg-config)
2009 ("procps" ,procps))) ;tests use 'pgrep'
2014 (modify-phases %standard-phases
2015 (add-after 'configure 'set-makefile-shell
2017 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2019 (setenv "SHELL" (which "sh"))
2021 ;; Replace /bin/sh with the right file name.
2022 (patch-makefile-SHELL "make.tmpl")
2024 (add-before 'strip 'make-objects-writable
2025 (lambda* (#:key outputs #:allow-other-keys)
2026 ;; Make compiled objects writable so they can be stripped.
2027 (let ((out (assoc-ref outputs "out")))
2028 (for-each (lambda (file)
2031 (find-files (string-append out "/lib"))
2032 (find-files (string-append out "/sbin"))))
2035 #:configure-flags (list (string-append "--sysconfdir="
2036 (assoc-ref %outputs "out")
2038 "--enable-udev_sync"
2039 "--enable-udev_rules"
2041 ;; Make sure programs such as 'dmsetup' can
2042 ;; find libdevmapper.so.
2043 (string-append "LDFLAGS=-Wl,-rpath="
2044 (assoc-ref %outputs "out")
2047 ;; The tests use 'mknod', which requires root access.
2049 (home-page "https://sourceware.org/lvm2/")
2050 (synopsis "Logical volume management for Linux")
2052 "LVM2 is the logical volume management tool set for Linux-based systems.
2053 This package includes the user-space libraries and tools, including the device
2054 mapper. Kernel components are part of Linux-libre.")
2056 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2057 ;; Command-line tools are GPLv2.
2058 (license (list license:gpl2 license:lgpl2.1))))
2060 (define-public lvm2-static
2063 (name "lvm2-static")
2065 ;; Propagate udev because libdevmapper.a depends on libudev.
2066 (inputs (alist-delete "udev" (package-inputs lvm2)))
2067 (propagated-inputs `(("udev" ,eudev)))
2070 (substitute-keyword-arguments (package-arguments lvm2)
2071 ((#:configure-flags flags '())
2072 ;; LVM2 doesn't use Libtool, hence the custom option.
2073 `(cons "--enable-static_link" ,flags))))
2074 (synopsis "Logical volume management for Linux (statically linked)")))
2076 (define-public wireless-tools
2078 (name "wireless-tools")
2082 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2086 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2089 ;; Remove the older header files that are not free software.
2090 (for-each (lambda (n)
2091 (delete-file (format #f "wireless.~a.h" n)))
2092 '(10 11 12 13 14 15 16 17 18 19 20))
2094 (build-system gnu-build-system)
2097 (list (string-append "PREFIX=" %output)
2098 (string-append "INSTALL_MAN=" %output "/share/man")
2099 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2101 #:phases (modify-phases %standard-phases
2102 (delete 'configure))
2104 (synopsis "Tools for manipulating Linux Wireless Extensions")
2105 (description "Wireless Tools are used to manipulate the now-deprecated
2106 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2107 Extension was an interface allowing you to set Wireless LAN specific
2108 parameters and get the specific stats. It is deprecated in favor the nl80211
2110 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2111 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2112 ;; other files are distributed under gpl2.
2113 (license (list license:gpl2 license:lgpl2.1+))))
2121 (uri (string-append "mirror://kernel.org/software/network/crda/"
2122 "crda-" version ".tar.xz"))
2125 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2126 (patches (search-patches "crda-optional-gcrypt.patch"))))
2127 (build-system gnu-build-system)
2129 '(#:phases (modify-phases %standard-phases
2132 'build 'no-werror-no-ldconfig
2134 (substitute* "Makefile"
2136 (("ldconfig") "true"))
2139 'build 'set-regulator-db-file-name
2140 (lambda* (#:key inputs #:allow-other-keys)
2141 ;; Tell CRDA where to find our database.
2142 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2143 (substitute* "crda.c"
2144 (("\"/lib/crda/regulatory.bin\"")
2145 (string-append "\"" regdb
2146 "/lib/crda/regulatory.bin\"")))
2148 #:test-target "verify"
2149 #:make-flags (let ((out (assoc-ref %outputs "out"))
2150 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2151 (list "CC=gcc" "V=1"
2153 ;; Disable signature-checking on 'regulatory.bin'.
2154 ;; The reason is that this simplifies maintenance
2155 ;; on our side (no need to manage a distro key
2156 ;; pair), and we can guarantee integrity of
2157 ;; 'regulatory.bin' by other means anyway, such as
2158 ;; 'guix gc --verify'. See
2159 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2163 (string-append "PREFIX=" out)
2164 (string-append "SBINDIR=" out "/sbin/")
2165 (string-append "UDEV_RULE_DIR="
2166 out "/lib/udev/rules.d")
2167 (string-append "LDFLAGS=-Wl,-rpath="
2169 (string-append "REG_BIN=" regdb
2170 "/lib/crda/regulatory.bin")))))
2171 (native-inputs `(("pkg-config" ,pkg-config)
2172 ("python" ,python-2)
2173 ("wireless-regdb" ,wireless-regdb)))
2174 (inputs `(("libnl" ,libnl)))
2176 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2177 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2179 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2180 communication between the kernel Linux and user space for regulatory
2182 (license license:copyleft-next)))
2184 (define-public wireless-regdb
2186 (name "wireless-regdb")
2187 (version "2017.03.07")
2191 "mirror://kernel.org/software/network/wireless-regdb/"
2192 "wireless-regdb-" version ".tar.xz"))
2195 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2197 ;; We're building 'regulatory.bin' by ourselves.
2198 (snippet '(delete-file "regulatory.bin"))))
2199 (build-system gnu-build-system)
2201 '(#:phases (modify-phases %standard-phases
2202 (delete 'configure))
2204 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2205 ;; is computed and can be equal to 'maintainer-clean'; when that
2206 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2207 ;; just built. Thus, build things sequentially.
2208 #:parallel-build? #f
2210 #:tests? #f ;no tests
2211 #:make-flags (let ((out (assoc-ref %outputs "out")))
2212 (list (string-append "PREFIX=" out)
2213 (string-append "LSB_ID=GuixSD")
2214 (string-append "DISTRO_PUBKEY=/dev/null")
2215 (string-append "DISTRO_PRIVKEY=/dev/null")
2216 (string-append "REGDB_PUBKEY=/dev/null")
2218 ;; Leave that empty so that db2bin.py doesn't try
2219 ;; to sign 'regulatory.bin'. This allows us to
2220 ;; avoid managing a key pair for the whole distro.
2221 (string-append "REGDB_PRIVKEY=")))))
2222 (native-inputs `(("python" ,python-2)))
2224 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2225 (synopsis "Wireless regulatory database")
2227 "This package contains the wireless regulatory database Central
2228 Regulatory Database Agent (CRDA) daemon. The database contains information on
2229 country-specific regulations for the wireless spectrum.")
2230 (license license:isc)))
2232 (define-public lm-sensors
2238 (uri (list (string-append
2239 "https://github.com/groeck/lm-sensors/archive/V"
2240 (string-join (string-split version #\.) "-")
2242 (file-name (string-append name "-" version ".tar.gz"))
2245 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2246 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2247 (build-system gnu-build-system)
2248 (inputs `(("rrdtool" ,rrdtool)
2251 ("gnuplot" ,gnuplot)))
2252 (native-inputs `(("pkg-config" ,pkg-config)
2257 `(#:tests? #f ; no 'check' target
2258 #:make-flags (list (string-append "PREFIX=" %output)
2259 (string-append "ETCDIR=" %output "/etc")
2260 (string-append "MANDIR=" %output "/share/man"))
2265 'build 'patch-exec-paths
2266 (lambda* (#:key inputs outputs #:allow-other-keys)
2267 (substitute* "prog/detect/sensors-detect"
2269 (string-append "`" (assoc-ref inputs "coreutils")
2271 (("(`|\")modprobe" all open-quote)
2272 (string-append open-quote
2273 (assoc-ref inputs "kmod")
2275 (substitute* '("prog/pwm/pwmconfig"
2276 "prog/pwm/fancontrol")
2278 (string-append (assoc-ref inputs "gnuplot")
2281 (string-append (assoc-ref inputs "coreutils")
2284 (string-append (assoc-ref inputs "grep")
2287 (string-append (assoc-ref inputs "sed")
2290 (string-append (assoc-ref inputs "coreutils")
2293 (string-append (assoc-ref inputs "coreutils")
2296 (string-append (assoc-ref inputs "coreutils")
2297 "/bin/readlink -f"))))
2298 %standard-phases))))
2299 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2300 (synopsis "Utilities to read temperature/voltage/fan sensors")
2302 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2303 you to access information from temperature, voltage, and fan speed sensors.
2304 It works with most newer systems.")
2305 (license license:gpl2+)))
2307 (define-public i2c-tools
2314 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2315 version ".tar.bz2"))
2318 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2319 (build-system gnu-build-system)
2321 `(#:tests? #f ; no 'check' target
2322 #:make-flags (list (string-append "prefix=" %output)
2324 ;; no configure script
2325 #:phases (alist-delete 'configure %standard-phases)))
2328 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2329 (synopsis "I2C tools for Linux")
2331 "The i2c-tools package contains a heterogeneous set of I2C tools for
2332 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2333 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2335 (license license:gpl2+)))
2337 (define-public xsensors
2344 "http://www.linuxhardware.org/xsensors/xsensors-"
2348 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2349 (build-system gnu-build-system)
2350 (inputs `(("lm-sensors" ,lm-sensors)
2352 (native-inputs `(("pkg-config" ,pkg-config)))
2354 `(#:phases (alist-cons-before
2355 'configure 'enable-deprecated
2357 (substitute* "src/Makefile.in"
2358 (("-DGDK_DISABLE_DEPRECATED") "")
2359 (("-DGTK_DISABLE_DEPRECATED") "")))
2361 'configure 'remove-Werror
2363 (substitute* '("configure" "src/Makefile.in")
2365 %standard-phases))))
2366 (home-page "http://www.linuxhardware.org/xsensors/")
2367 (synopsis "Hardware health information viewer")
2369 "Xsensors reads data from the libsensors library regarding hardware
2370 health such as temperature, voltage and fan speed and displays the information
2371 in a digital read-out.")
2372 (license license:gpl2+)))
2377 (version (package-version linux-libre))
2378 (source (package-source linux-libre))
2379 (build-system gnu-build-system)
2381 '(#:phases (alist-replace
2383 (lambda* (#:key inputs #:allow-other-keys)
2384 (setenv "SHELL_PATH" (which "bash"))
2385 (chdir "tools/perf"))
2387 #:make-flags (list (string-append "DESTDIR="
2388 (assoc-ref %outputs "out"))
2391 ;; By default, 'config/Makefile' uses lib64 on
2392 ;; x86_64. Work around that.
2394 #:tests? #f)) ;no tests
2396 `(("pkg-config" ,pkg-config)
2400 ;; There are build scripts written in these languages.
2402 ("python" ,python-2)))
2404 `(("slang" ,slang) ;for the interactive TUI
2406 ("python" ,python-2) ;'perf' links against libpython
2407 ("elfutils" ,elfutils)
2408 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2411 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2412 ("docbook-xsl" ,docbook-xsl)
2414 ("asciidoc" ,asciidoc)))
2415 (home-page "https://perf.wiki.kernel.org/")
2416 (synopsis "Linux profiling with performance counters")
2418 "perf is a tool suite for profiling using hardware performance counters,
2419 with support in the Linux kernel. perf can instrument CPU performance
2420 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2421 of lightweight profiling. This package contains the user-land tools and in
2422 particular the 'perf' command.")
2423 (license (package-license linux-libre))))
2425 (define-public pflask
2431 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2433 (file-name (string-append name "-" version ".tar.gz"))
2436 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2437 (build-system cmake-build-system)
2439 '(#:tests? #f)) ; no tests
2440 (home-page "http://ghedo.github.io/pflask/")
2441 (synopsis "Simple tool for creating Linux namespace containers")
2442 (description "pflask is a simple tool for creating Linux namespace
2443 containers. It can be used for running a command or even booting an OS inside
2444 an isolated container, created with the help of Linux namespaces. It is
2445 similar in functionality to chroot, although pflask provides better isolation
2446 thanks to the use of namespaces.")
2447 (license license:bsd-2)))
2449 (define-public hdparm
2455 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2456 name "-" version ".tar.gz"))
2459 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
2460 (build-system gnu-build-system)
2462 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2463 (list (string-append "binprefix=" out)
2464 (string-append "manprefix=" out)
2467 (modify-phases %standard-phases
2468 (delete 'configure)) ; no configure script
2469 #:tests? #f)) ; no test suite
2470 (home-page "https://sourceforge.net/projects/hdparm/")
2471 (synopsis "View and tune ATA disk drive parameters")
2473 "@command{hdparm} is a command-line utility to control ATA controllers and
2474 disk drives. It can increase performance and/or reliability by careful tuning
2475 of hardware settings like power and acoustic management, DMA modes, and caching.
2476 It can also display detailed device information, or be used as a simple
2477 performance benchmarking tool.
2479 @command{hdparm} provides a command line interface to various Linux kernel
2480 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2481 IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2482 Command Translation} (SAT) are also supported.")
2483 (license (license:non-copyleft "file://LICENSE.TXT"))))
2485 (define-public rfkill
2491 (uri (string-append "mirror://kernel.org/software/network/"
2492 name "/" name "-" version ".tar.xz"))
2495 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2496 (build-system gnu-build-system)
2498 `(#:make-flags (list "CC=gcc"
2499 (string-append "PREFIX=" %output))
2500 #:phases (modify-phases %standard-phases
2501 (delete 'configure))
2503 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2504 (synopsis "Tool for enabling and disabling wireless devices")
2506 "rfkill is a simple tool for accessing the rfkill device interface,
2507 which is used to enable and disable wireless networking devices, typically
2508 WLAN, Bluetooth and mobile broadband.")
2509 (license (license:non-copyleft "file://COPYING"
2510 "See COPYING in the distribution."))))
2518 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2519 version "/" name "-" version ".tar.gz"))
2522 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2523 (build-system gnu-build-system)
2524 (home-page "http://acpiclient.sourceforge.net")
2525 (synopsis "Display information on ACPI devices")
2526 (description "@code{acpi} attempts to replicate the functionality of the
2527 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2528 information. It does not support ACPI suspending, only displays information
2529 about ACPI devices.")
2530 (license license:gpl2+)))
2532 (define-public acpid
2538 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2542 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2543 (build-system gnu-build-system)
2544 (home-page "https://sourceforge.net/projects/acpid2/")
2545 (synopsis "Daemon for delivering ACPI events to user-space programs")
2547 "acpid is designed to notify user-space programs of Advanced
2548 Configuration and Power Interface (ACPI) events. acpid should be started
2549 during the system boot, and will run as a background process. When an ACPI
2550 event is received from the kernel, acpid will examine the list of rules
2551 specified in /etc/acpi/events and execute the rules that match the event.")
2552 (license license:gpl2+)))
2554 (define-public sysfsutils
2563 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2566 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2567 (build-system gnu-build-system)
2568 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2569 (synopsis "System utilities based on Linux sysfs")
2571 "These are a set of utilities built upon sysfs, a virtual file system in
2572 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2573 also contains the libsysfs library.")
2574 ;; The library is under lgpl2.1+ (all files say "or any later version").
2575 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2576 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2578 (define-public sysfsutils-1
2580 (inherit sysfsutils)
2587 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2588 "/sysfsutils-" version ".tar.gz"))
2590 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2591 (modules '((guix build utils)))
2594 (substitute* "Makefile.in"
2595 (("includedir = /usr/include/sysfs")
2596 "includedir = @includedir@"))
2597 (substitute* "configure"
2598 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2599 (string-append "includedir='" orig "/sysfs'")))))))
2600 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2602 (define-public cpufrequtils
2604 (name "cpufrequtils")
2611 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2614 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2615 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2616 (build-system gnu-build-system)
2618 `(("sysfsutils" ,sysfsutils-1)))
2620 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2621 (assoc-ref %outputs "out") "/lib"))))
2622 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2623 (synopsis "Utilities to get and set CPU frequency on Linux")
2625 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2626 information, and set the CPU frequency if supported, using the cpufreq
2627 capabilities of the Linux kernel.")
2628 (license license:gpl2)))
2630 (define-public libraw1394
2637 "mirror://kernel.org/linux/libs/ieee1394/"
2638 name "-" version ".tar.xz"))
2641 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2642 (build-system gnu-build-system)
2643 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2644 (synopsis "Interface library for the Linux IEEE1394 drivers")
2646 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2647 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2648 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2649 send to and receive from other nodes without requiring a kernel driver for the
2650 protocol in question.")
2651 (license license:lgpl2.1+)))
2653 (define-public libavc1394
2659 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2660 name "-" version ".tar.gz"))
2663 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2664 (build-system gnu-build-system)
2666 `(("pkg-config" ,pkg-config)))
2668 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2669 (home-page "https://sourceforge.net/projects/libavc1394/")
2670 (synopsis "AV/C protocol library for IEEE 1394")
2672 "Libavc1394 is a programming interface to the AV/C specification from
2673 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2674 (license license:lgpl2.1+)))
2676 (define-public libiec61883
2678 (name "libiec61883")
2683 "mirror://kernel.org/linux/libs/ieee1394/"
2684 name "-" version ".tar.xz"))
2687 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2688 (build-system gnu-build-system)
2690 `(("pkg-config" ,pkg-config)))
2692 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2693 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2694 (synopsis "Isochronous streaming media library for IEEE 1394")
2696 "The libiec61883 library provides a higher level API for streaming DV,
2697 MPEG-2 and audio over Linux IEEE 1394.")
2698 (license license:lgpl2.1+)))
2700 (define-public mdadm
2707 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2711 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2712 (build-system gnu-build-system)
2716 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2720 ;; TODO: tell it where to find 'sendmail'
2721 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2722 (string-append "BINDIR=" out "/sbin")
2723 (string-append "MANDIR=" out "/share/man")
2724 (string-append "UDEVDIR=" out "/lib/udev")))
2725 #:phases (alist-cons-before
2726 'build 'patch-program-paths
2727 (lambda* (#:key inputs #:allow-other-keys)
2728 (let ((coreutils (assoc-ref inputs "coreutils")))
2729 (substitute* "udev-md-raid-arrays.rules"
2730 (("/usr/bin/(readlink|basename)" all program)
2731 (string-append coreutils "/bin/" program)))))
2733 'build 'remove-W-error
2735 ;; We cannot build with -Werror on i686 due to a
2736 ;; 'sign-compare' warning in util.c.
2737 (substitute* "Makefile"
2740 (alist-delete 'configure %standard-phases)))
2741 ;;tests must be done as root
2743 (home-page "http://neil.brown.name/blog/mdadm")
2744 (synopsis "Tool for managing Linux Software RAID arrays")
2746 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2747 assemble, report on, and monitor arrays. It can also move spares between raid
2748 arrays when needed.")
2749 (license license:gpl2+)))
2751 (define-public mdadm-static
2754 (name "mdadm-static")
2756 (substitute-keyword-arguments (package-arguments mdadm)
2757 ((#:make-flags flags)
2758 `(cons "LDFLAGS = -static" ,flags))
2760 `(modify-phases ,phases
2761 (add-after 'install 'remove-cruft
2762 (lambda* (#:key outputs #:allow-other-keys)
2763 (let* ((out (assoc-ref outputs "out"))
2764 (precious? (lambda (file)
2765 (member file '("." ".." "sbin"))))
2766 (directories (scandir out (negate precious?))))
2767 (with-directory-excursion out
2768 (for-each delete-file-recursively directories)
2769 (remove-store-references "sbin/mdadm")
2770 (delete-file "sbin/mdmon")
2772 ((#:modules modules %gnu-build-system-modules)
2773 `((ice-9 ftw) ,@modules))
2774 ((#:strip-flags _ '())
2775 ''("--strip-all")) ;strip a few extra KiB
2776 ((#:allowed-references _ '("out"))
2777 '("out")))) ;refer only self
2778 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2780 (define-public multipath-tools
2782 (name "multipath-tools")
2786 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2787 ".git;a=snapshot;h=" version ";sf=tgz"))
2788 (file-name (string-append name "-" version ".tar.gz"))
2791 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2792 (modules '((guix build utils)))
2795 ;; Drop bundled valgrind headers.
2796 (delete-file-recursively "third-party")
2797 (substitute* '("multipathd/main.c"
2798 "libmultipath/debug.c")
2799 (("#include \"../third-party/")
2802 (build-system gnu-build-system)
2804 '(#:tests? #f ; No tests.
2805 #:make-flags (list (string-append "DESTDIR="
2806 (assoc-ref %outputs "out"))
2808 (string-append "LDFLAGS=-Wl,-rpath="
2809 (assoc-ref %outputs "out")
2812 (modify-phases %standard-phases
2813 (add-after 'unpack 'patch-source
2814 (lambda* (#:key inputs #:allow-other-keys)
2815 (let ((lvm2 (assoc-ref inputs "lvm2"))
2816 (udev (assoc-ref inputs "udev")))
2817 (substitute* "Makefile.inc"
2818 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2819 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2820 (("/usr/include/libdevmapper.h")
2821 (string-append lvm2 "/include/libdevmapper.h"))
2822 (("/usr/include/libudev.h")
2823 (string-append udev "/include/libudev.h")))
2826 (add-before 'build 'set-CC
2832 ("pkg-config" ,pkg-config)
2833 ("valgrind" ,valgrind)))
2835 `(("ceph:lib" ,ceph "lib")
2838 ("liburcu" ,liburcu)
2840 ("readline" ,readline)
2842 (home-page "http://christophe.varoqui.free.fr/")
2843 (synopsis "Access block devices through multiple paths")
2845 "This package provides the following binaries to drive the
2846 Linux Device Mapper multipathing driver:
2848 @item @command{multipath} - Device mapper target autoconfig.
2849 @item @command{multipathd} - Multipath daemon.
2850 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2851 @code{dm} multipath devices.
2852 @item @command{kpartx} - Create device maps from partition tables.
2854 (license (list license:gpl2+ ; Main distribution.
2855 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2857 (define-public libaio
2864 (string-append "mirror://debian/pool/main/liba/libaio/"
2865 name "_" version ".orig.tar.gz")))
2868 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2869 (build-system gnu-build-system)
2872 (list "CC=gcc" (string-append "prefix=" %output))
2873 #:test-target "partcheck" ; need root for a full 'check'
2875 (alist-delete 'configure %standard-phases))) ; no configure script
2876 (home-page "http://lse.sourceforge.net/io/aio.html")
2877 (synopsis "Linux-native asynchronous I/O access library")
2879 "This library enables userspace to use Linux kernel asynchronous I/O
2880 system calls, important for the performance of databases and other advanced
2882 (license license:lgpl2.1+)))
2890 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2891 name "-" version ".tar.xz"))
2894 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2895 (build-system gnu-build-system)
2897 `(("libsndfile" ,libsndfile)))
2899 `(("pkg-config" ,pkg-config)))
2900 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2901 (synopsis "Bluetooth subband audio codec")
2903 "The SBC is a digital audio encoder and decoder used to transfer data to
2904 Bluetooth audio output devices like headphones or loudspeakers.")
2905 (license license:gpl2+)))
2907 (define-public bluez
2914 "mirror://kernel.org/linux/bluetooth/bluez-"
2918 "1sb4aflgyrl7apricjipa8wx95qm69yja0lmn2f19g560c3v1b2c"))))
2919 (build-system gnu-build-system)
2922 (let ((out (assoc-ref %outputs "out")))
2923 (list "--sysconfdir=/etc"
2924 "--localstatedir=/var"
2927 ;; Install dbus/udev files to the correct location.
2928 (string-append "--with-dbusconfdir=" out "/etc")
2929 (string-append "--with-udevdir=" out "/lib/udev")))
2931 (modify-phases %standard-phases
2932 (add-after 'install 'post-install
2933 (lambda* (#:key inputs outputs #:allow-other-keys)
2934 (let* ((out (assoc-ref outputs "out"))
2935 (servicedir (string-append out "/share/dbus-1/services"))
2936 (service "obexd/src/org.bluez.obex.service")
2937 (rule (string-append
2938 out "/lib/udev/rules.d/97-hid2hci.rules")))
2939 ;; Install the obex dbus service file.
2940 (substitute* service
2942 (string-append out "/libexec/bluetooth/obexd")))
2943 (install-file service servicedir)
2944 ;; Fix paths in the udev rule.
2946 (("hid2hci --method")
2947 (string-append out "/lib/udev/hid2hci --method"))
2949 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2952 `(("pkg-config" ,pkg-config)
2953 ("gettext" ,gettext-minimal)))
2958 ("libical" ,libical)
2959 ("readline" ,readline)))
2960 (home-page "http://www.bluez.org/")
2961 (synopsis "Linux Bluetooth protocol stack")
2963 "BlueZ provides support for the core Bluetooth layers and protocols. It
2964 is flexible, efficient and uses a modular implementation.")
2965 (license license:gpl2+)))
2967 (define-public fuse-exfat
2974 "https://github.com/relan/exfat/releases/download/v"
2975 version "/" name "-" version ".tar.gz"))
2978 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
2979 (build-system gnu-build-system)
2981 `(("pkg-config" ,pkg-config)))
2984 (home-page "https://github.com/relan/exfat")
2985 (synopsis "Mount exFAT file systems")
2987 "This package provides a FUSE-based file system that provides read and
2988 write access to exFAT devices.")
2989 (license license:gpl2+)))
2998 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2999 version ".tar.bz2"))
3002 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3003 (build-system gnu-build-system)
3005 '(#:phases (modify-phases %standard-phases
3006 (add-before 'configure 'bootstrap
3008 ;; The tarball was not generated with 'make dist' so we
3009 ;; need to bootstrap things ourselves.
3010 (and (zero? (system* "./autogen.sh"))
3012 (patch-makefile-SHELL "Makefile.include.in")
3015 ;; Make sure programs find libgpm.so.
3016 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3017 (assoc-ref %outputs "out")
3020 `(("texinfo" ,texinfo)
3023 ("autoconf" ,autoconf)
3024 ("automake" ,automake)
3025 ("libtool" ,libtool)))
3026 (home-page "http://www.nico.schottelius.org/software/gpm/")
3027 (synopsis "Mouse support for the Linux console")
3029 "The GPM (general-purpose mouse) daemon is a mouse server for
3030 applications running on the Linux console. It allows users to select items
3031 and copy/paste text in the console and in xterm.")
3032 (license license:gpl2+)))
3034 (define-public btrfs-progs
3036 (name "btrfs-progs")
3040 (uri (string-append "mirror://kernel.org/linux/kernel/"
3041 "people/kdave/btrfs-progs/"
3042 "btrfs-progs-v" version ".tar.xz"))
3045 "03mzv89f08gdsqv4ima793g44kdavcfyjialf5dr0zd2ab66hyp1"))))
3046 (build-system gnu-build-system)
3048 "static")) ; static versions of binaries in "out" (~16MiB!)
3050 '(#:phases (modify-phases %standard-phases
3051 (add-after 'build 'build-static
3052 (lambda _ (zero? (system* "make" "static"))))
3053 (add-after 'install 'install-static
3054 (let ((staticbin (string-append (assoc-ref %outputs "static")
3057 (zero? (system* "make"
3058 (string-append "bindir=" staticbin)
3059 "install-static"))))))
3060 #:test-target "test"
3061 #:parallel-tests? #f)) ; tests fail when run in parallel
3062 (inputs `(("e2fsprogs" ,e2fsprogs)
3063 ("libblkid" ,util-linux)
3064 ("libblkid:static" ,util-linux "static")
3065 ("libuuid" ,util-linux)
3066 ("libuuid:static" ,util-linux "static")
3069 (native-inputs `(("pkg-config" ,pkg-config)
3070 ("asciidoc" ,asciidoc)
3072 ;; For building documentation.
3073 ("libxml2" ,libxml2)
3074 ("docbook-xsl" ,docbook-xsl)
3077 (home-page "https://btrfs.wiki.kernel.org/")
3078 (synopsis "Create and manage btrfs copy-on-write file systems")
3079 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3080 aimed at implementing advanced features while focusing on fault tolerance,
3081 repair and easy administration.")
3082 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3083 ;; GPL2: Everything else.
3084 (license (list license:gpl2 license:gpl2+))))
3086 (define-public btrfs-progs/static
3088 (name "btrfs-progs-static")
3089 (version (package-version btrfs-progs))
3091 (build-system trivial-build-system)
3093 `(("btrfs-progs:static" ,btrfs-progs "static")))
3095 `(#:modules ((guix build utils))
3098 (use-modules (guix build utils)
3102 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3103 (out (assoc-ref %outputs "out"))
3104 (source (string-append btrfs "/bin/btrfs.static"))
3105 (target (string-append out "/bin/btrfs")))
3106 (mkdir-p (dirname target))
3107 (copy-file source target)
3108 (remove-store-references target)
3109 (chmod target #o555)))))
3110 (home-page (package-home-page btrfs-progs))
3111 (synopsis "Statically-linked btrfs command from btrfs-progs")
3112 (description "This package provides the statically-linked @command{btrfs}
3113 from the btrfs-progs package. It is meant to be used in initrds.")
3114 (license (package-license btrfs-progs))))
3116 (define-public freefall
3119 (version (package-version linux-libre))
3120 (source (package-source linux-libre))
3121 (build-system gnu-build-system)
3123 '(#:phases (modify-phases %standard-phases
3124 (add-after 'unpack 'enter-subdirectory
3126 (chdir "tools/laptop/freefall")))
3128 (add-before 'build 'increase-timeout
3130 ;; The default of 2 seconds is too low: it assumes an
3131 ;; open lid and AC power without actually checking.
3132 (substitute* "freefall.c"
3133 (("alarm\\(2\\)") "alarm(5)")))))
3134 #:make-flags (list (string-append "PREFIX="
3135 (assoc-ref %outputs "out")))
3136 #:tests? #f)) ;no tests
3137 (home-page (package-home-page linux-libre))
3138 (synopsis "Free-fall protection for spinning laptop hard drives")
3140 "Prevents shock damage to the internal spinning hard drive(s) of some
3141 HP and Dell laptops. When sudden movement is detected, all input/output
3142 operations on the drive are suspended and its heads are parked on the ramp,
3143 where they are less likely to cause damage to the spinning disc. Requires a
3144 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3145 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3146 (license license:gpl2)))
3148 (define-public thinkfan
3154 (uri (string-append "mirror://sourceforge/thinkfan/"
3155 "/thinkfan-" version ".tar.gz"))
3158 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3159 (modules '((guix build utils)))
3160 ;; Fix erroneous man page location in Makefile leading to
3161 ;; a compilation failure.
3163 '(substitute* "CMakeLists.txt"
3164 (("thinkfan\\.1") "src/thinkfan.1")))))
3165 (build-system cmake-build-system)
3167 `(#:modules ((guix build cmake-build-system)
3170 #:tests? #f ;no test target
3172 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3173 `("-DUSE_ATASMART:BOOL=ON")
3175 (modify-phases %standard-phases
3176 ;; Install scripts for various foreign init systems. Also fix
3177 ;; hard-coded path for daemon.
3178 (add-after 'install 'install-rc-scripts
3179 (lambda* (#:key outputs #:allow-other-keys)
3180 (let ((out (assoc-ref outputs "out"))
3182 (string-append "../thinkfan-" ,version "/rcscripts")
3185 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3186 (string-append out "/sbin/" name)))
3187 (for-each (cute install-file <>
3188 (string-append out "/share/thinkfan"))
3192 `(("libatasmart" ,libatasmart)))
3193 (home-page "http://thinkfan.sourceforge.net/")
3194 (synopsis "Simple fan control program")
3196 "Thinkfan is a simple fan control program. It reads temperatures,
3197 checks them against configured limits and switches to appropriate (also
3198 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3199 other @code{hwmon} driver that enables temperature reading and fan control
3201 (license license:gpl3+)))
3203 (define-public ntfs-3g
3206 (version "2016.2.22")
3209 (uri (string-append "https://tuxera.com/opensource/"
3210 "ntfs-3g_ntfsprogs-" version ".tgz"))
3213 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3214 (modules '((guix build utils)))
3215 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
3217 ;; Install under $prefix.
3218 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3221 (build-system gnu-build-system)
3222 (inputs `(("util-linux" ,util-linux)
3223 ("fuse" ,fuse))) ;libuuid
3224 (native-inputs `(("pkg-config" ,pkg-config)))
3226 '(#:configure-flags (list "--exec-prefix=${prefix}"
3227 "--with-fuse=external" ;use our own FUSE
3228 "--enable-mount-helper"
3229 "--enable-posix-acls"
3230 "--enable-xattr-mappings")))
3231 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3232 (synopsis "Read-write access to NTFS file systems")
3234 "NTFS-3G provides read-write access to NTFS file systems, which are
3235 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3236 The package provides additional NTFS tools.")
3237 (license license:gpl2+)))
3239 (define-public rdma-core
3245 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3246 "/releases/download/v" version "/rdma-core-"
3250 "15qdfqkia22vab1dh41s88vgi70yifi40ar5s4x7a456rpbhy8z5"))))
3251 (build-system cmake-build-system)
3253 '(#:tests? #f ; no tests
3254 ;; Upstream uses the "ninja" build system and encourage distros
3255 ;; to do the same for consistency. They also recommend using the
3256 ;; "Release" build type.
3257 #:configure-flags (list "-GNinja"
3258 ;; Defaults to "lib64" on 64-bit archs.
3259 (string-append "-DCMAKE_INSTALL_LIBDIR="
3260 (assoc-ref %outputs "out") "/lib")
3261 "-DCMAKE_BUILD_TYPE=Release")
3263 (modify-phases %standard-phases
3266 (zero? (system* "ninja"
3267 "-j" (number->string (parallel-job-count))))))
3270 (zero? (system* "ninja" "install")))))))
3273 ("pkg-config" ,pkg-config)
3274 ("python" ,python-wrapper)))
3278 (home-page "https://github.com/linux-rdma/rdma-core")
3279 (synopsis "Utilities and libraries for working with RDMA devices")
3281 "This package provides userspace components for the InfiniBand
3282 subsystem of the Linux kernel. Specifically it contains userspace
3283 libraries for the following device nodes:
3286 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3287 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3288 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3291 The following service daemons are also provided:
3293 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3294 @item @code{iwpmd} (for iWARP kernel providers)
3295 @item @code{ibacm} (for InfiniBand communication management assistant)
3297 ;; All library code is dual licensed under GPL2 and a custom MIT
3298 ;; variant. The package also includes some components covered by
3299 ;; other licenses. Consult COPYING.md for full details.
3302 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3303 license:bsd-2 ; Files referring to COPYING.BSD_FB
3304 license:cc0 ; most files in ccan/
3305 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3307 (define-public rng-tools
3314 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3315 "rng-tools-" version ".tar.gz"))
3318 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3319 (build-system gnu-build-system)
3320 (synopsis "Random number generator daemon")
3322 "Monitor a hardware random number generator, and supply entropy
3323 from that to the system kernel's @file{/dev/random} machinery.")
3324 (home-page "https://sourceforge.net/projects/gkernel")
3325 ;; The source package is offered under the GPL2+, but the files
3326 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3327 (license (list license:gpl2 license:gpl2+))))
3329 (define-public cpupower
3332 (version (package-version linux-libre))
3333 (source (package-source linux-libre))
3334 (build-system gnu-build-system)
3336 '(#:phases (modify-phases %standard-phases
3337 (add-after 'unpack 'enter-subdirectory
3339 (chdir "tools/power/cpupower")))
3341 (add-before 'build 'fix-makefiles
3343 (substitute* "Makefile"
3345 (("/bin/(install|pwd)" _ command) command))
3346 (substitute* "bench/Makefile"
3347 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3348 #:make-flags (let ((out (assoc-ref %outputs "out")))
3349 (list (string-append "DESTDIR=" out)
3350 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3351 "docdir=/share/doc/cpupower"
3352 "confdir=$(docdir)/examples"
3353 ;; The Makefile recommends the following changes
3355 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3356 #:tests? #f)) ;no tests
3357 (native-inputs `(("gettext" ,gettext-minimal)))
3358 (inputs `(("pciutils" ,pciutils)))
3359 (home-page (package-home-page linux-libre))
3360 (synopsis "CPU frequency and voltage scaling tools for Linux")
3362 "cpupower is a set of user-space tools that use the cpufreq feature of the
3363 Linux kernel to retrieve and control processor features related to power saving,
3364 such as frequency and voltage scaling.")
3365 (license license:gpl2)))
3367 (define-public haveged
3374 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3378 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3379 (build-system gnu-build-system)
3380 (home-page "http://www.issihosts.com/haveged")
3381 (synopsis "Entropy source for the Linux random number generator")
3383 "haveged generates an unpredictable stream of random numbers for use by
3384 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3385 standard mechanisms for filling the entropy pool may not be sufficient for
3386 systems with high needs or limited user interaction, such as headless servers.
3387 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3388 indirect effects of hardware events on hidden processor state using the HArdware
3389 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3390 its environment and provides the same built-in test suite for the output stream
3391 as used on certified hardware security devices.")
3392 (license (list (license:non-copyleft "file://nist/mconf.h")
3393 (license:non-copyleft "file://nist/packtest.c")
3394 license:public-domain ; nist/dfft.c
3395 license:gpl3+)))) ; everything else
3397 (define-public ecryptfs-utils
3399 (name "ecryptfs-utils")
3404 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3405 version "/+download/ecryptfs-utils_"
3406 version ".orig.tar.gz"))
3409 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3410 (build-system gnu-build-system)
3412 `(#:configure-flags (list "--disable-pywrap")))
3414 `(("intltool" ,intltool)
3415 ("perl" ,perl) ; for pod2man
3416 ("pkg-config" ,pkg-config)))
3418 `(("keyutils" ,keyutils)
3419 ("linux-pam" ,linux-pam)
3421 (home-page "http://ecryptfs.org/")
3422 (synopsis "eCryptfs cryptographic file system utilities")
3424 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3425 Each file's cryptographic meta-data is stored inside the file itself, along
3426 with the encrypted contents. This allows individual encrypted files to be
3427 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3428 native Linux file system, and has been part of the Linux kernel since version
3429 2.6.19. This package contains the userland utilities to manage it.")
3430 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3431 ;; grant additional permission to link with OpenSSL.
3432 (license license:gpl2+)))
3434 (define-public libnfsidmap
3436 (name "libnfsidmap")
3441 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3442 name "/" name "-" version ".tar.gz"))
3445 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3446 (build-system gnu-build-system)
3448 `(#:configure-flags (list
3449 (string-append "--with-pluginpath="
3450 (assoc-ref %outputs "out")
3451 "/lib/libnfsidmap"))))
3453 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3455 "NFSv4 support library for name/ID mapping")
3456 (description "Libnfsidmap is a library holding mulitiple methods of
3457 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3458 extensible array of mapping functions, currently consisting of two choices:
3459 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3460 (license (license:non-copyleft "file://COPYING"
3461 "See COPYING in the distribution."))))
3463 (define-public module-init-tools
3465 (name "module-init-tools")
3470 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3471 "module-init-tools-" version ".tar.bz2"))
3474 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3475 (patches (search-patches "module-init-tools-moduledir.patch"))))
3476 (build-system gnu-build-system)
3478 ;; FIXME: The upstream tarball lacks man pages, and building them would
3479 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3480 ;; but they vanished. In the meantime, fake it.
3481 '(#:phases (alist-cons-before
3482 'configure 'fake-docbook
3484 (substitute* "Makefile.in"
3485 (("^DOCBOOKTOMAN.*$")
3486 "DOCBOOKTOMAN = true\n")))
3488 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3489 (synopsis "Tools for loading and managing Linux kernel modules")
3491 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3492 `insmod', `lsmod', and more.")
3493 (license license:gpl2+)))
3495 (define-public mcelog
3501 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3502 "mcelog.git/snapshot/v" version ".tar.gz"))
3505 "0q40d60p1klzg0aznvxhxgjlddwcxfj2q59s4q86sf9ild6rcdhl"))
3506 (file-name (string-append name "-" version ".tar.gz"))
3507 (modules '((guix build utils)))
3509 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3510 `(substitute* "Makefile"
3511 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3512 (build-system gnu-build-system)
3514 `(#:phases (modify-phases %standard-phases
3515 (delete 'configure)) ; no configure script
3516 #:make-flags (let ((out (assoc-ref %outputs "out")))
3518 (string-append "prefix=" out)
3519 (string-append "DOCDIR=" out "/share/doc/mcelog")
3520 "etcprefix=$(DOCDIR)/examples"))
3521 ;; The tests will only run as root on certain supported CPU models.
3523 (supported-systems (list "i686-linux" "x86_64-linux"))
3524 (home-page "http://mcelog.org/")
3525 (synopsis "Machine check monitor for x86 Linux systems")
3527 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3528 and other hardware errors on x86 systems. It can also perform user-defined
3529 tasks, such as bringing bad pages off-line, when configurable error thresholds
3531 (license license:gpl2)))
3533 (define-public mtd-utils
3540 "ftp://ftp.infradead.org/pub/mtd-utils/"
3541 "mtd-utils-" version ".tar.bz2"))
3544 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3547 ("libuuid" ,util-linux)
3550 (build-system gnu-build-system)
3552 `(#:test-target "tests"
3553 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3554 #:phases (modify-phases %standard-phases
3555 (delete 'configure))))
3556 (synopsis "MTD Flash Storage Utilities")
3557 (description "This package provides utilities for testing, partitioning, etc
3559 (home-page "http://www.linux-mtd.infradead.org/")
3561 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3562 license:mpl1.1 ; All ftl* files
3563 license:expat)))) ; libiniparser
3565 (define-public libseccomp
3571 (uri (string-append "https://github.com/seccomp/libseccomp/"
3572 "releases/download/v" version
3573 "/libseccomp-" version ".tar.gz"))
3576 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3577 (build-system gnu-build-system)
3579 `(("which" ,which)))
3580 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3581 (description "The libseccomp library provides an easy to use, platform
3582 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3583 libseccomp API is designed to abstract away the underlying BPF based syscall
3584 filter language and present a more conventional function-call based filtering
3585 interface that should be familiar to, and easily adopted by, application
3587 (home-page "https://github.com/seccomp/libseccomp")
3588 (license license:lgpl2.1)))
3590 (define-public radeontop
3594 (home-page "https://github.com/clbr/radeontop/")
3597 (uri (string-append home-page "archive/v" version ".tar.gz"))
3598 (file-name (string-append name "-" version ".tar.gz"))
3601 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3602 (build-system gnu-build-system)
3604 `(#:phases (modify-phases %standard-phases
3605 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3606 ;; dependency, and doesn't even work on release(!) tarballs.
3607 (add-after 'unpack 'report-correct-version
3608 (lambda _ (substitute* "getver.sh"
3610 (string-append "ver=" ,version)))))
3611 (delete 'configure)) ; no configure script
3612 #:make-flags (list "CC=gcc"
3613 (string-append "PREFIX=" %output))
3614 #:tests? #f)) ; no tests
3616 `(("gettext" ,gettext-minimal)
3617 ("pkg-config" ,pkg-config)))
3619 `(("libdrm" ,libdrm)
3620 ("libpciaccess" ,libpciaccess)
3622 ("ncurses" ,ncurses)))
3623 (synopsis "Usage monitor for AMD Radeon graphics")
3624 (description "RadeonTop monitors resource consumption on supported AMD
3625 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3626 a terminal or saved to a file for further processing. It measures both the
3627 activity of the GPU as a whole, which is also accurate during OpenCL
3628 computations, as well as separate component statistics that are only meaningful
3629 under OpenGL graphics workloads.")
3630 (license license:gpl3)))
3632 (define-public efivar
3638 (uri (string-append "https://github.com/rhinstaller/" name
3639 "/releases/download/" version "/" name
3640 "-" version ".tar.bz2"))
3643 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3644 (build-system gnu-build-system)
3646 `(;; Tests require a UEFI system and is not detected in the chroot.
3648 #:make-flags (list (string-append "prefix=" %output)
3649 (string-append "libdir=" %output "/lib")
3650 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3652 (modify-phases %standard-phases
3653 (delete 'configure))))
3655 `(("pkg-config" ,pkg-config)))
3658 (home-page "https://github.com/rhinstaller/efivar")
3659 (synopsis "Tool and library to manipulate EFI variables")
3660 (description "This package provides a library and a command line
3661 interface to the variable facility of UEFI boot firmware.")
3662 (license license:lgpl2.1+)))
3664 (define-public efibootmgr
3670 (uri (string-append "https://github.com/rhinstaller/" name
3671 "/releases/download/" version "/" name
3672 "-" version ".tar.bz2"))
3675 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3676 (build-system gnu-build-system)
3678 `(#:tests? #f ; No tests.
3679 #:make-flags (list (string-append "prefix=" %output)
3680 (string-append "libdir=" %output "/lib")
3681 ;; Override CFLAGS to add efivar include directory.
3682 (string-append "CFLAGS=-O2 -g -flto -I"
3683 (assoc-ref %build-inputs "efivar")
3686 (modify-phases %standard-phases
3687 (add-after 'unpack 'branding
3688 ;; Replace default loader path with something more familiar.
3690 (substitute* "src/efibootmgr.c"
3691 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3694 (delete 'configure))))
3696 `(("pkg-config" ,pkg-config)))
3698 `(("efivar" ,efivar)
3700 (home-page "https://github.com/rhinstaller/efibootmgr")
3701 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3703 "@code{efibootmgr} is a user-space application to modify the Intel
3704 Extensible Firmware Interface (EFI) Boot Manager. This application can
3705 create and destroy boot entries, change the boot order, change the next
3706 running boot option, and more.")
3707 (license license:gpl2+)))
3709 (define-public sysstat
3715 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3716 "sysstat-" version ".tar.xz"))
3719 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3720 (build-system gnu-build-system)
3722 `(#:tests? #f ; No test suite.
3723 ;; Without this flag, it tries to install the man pages with group 'root'
3724 ;; and fails because /etc/passwd lacks an entry for the root user.
3726 (list "--disable-file-attr"
3727 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3729 (modify-phases %standard-phases
3730 ;; The build process tries to create '/var/lib/sa', so we skip that
3732 (add-after 'build 'skip-touching-var
3734 (substitute* "Makefile"
3735 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3738 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3739 (synopsis "Performance monitoring tools for Linux")
3740 (description "The sysstat utilities are a collection of performance
3741 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3742 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3743 @code{sadf} and @code{sa}.")
3744 (license license:gpl2+)))
3746 (define-public light
3752 (uri (string-append "https://github.com/haikarainen/" name
3753 "/archive/v" version ".tar.gz"))
3756 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3757 (file-name (string-append name "-" version ".tar.gz"))))
3758 (build-system gnu-build-system)
3760 '(#:tests? #f ; no tests
3761 #:make-flags (list "CC=gcc"
3762 (string-append "PREFIX=" %output))
3764 (modify-phases %standard-phases
3766 (add-after 'unpack 'patch-makefile
3768 (substitute* "Makefile" (("chown") "#")))))))
3770 `(("help2man" ,help2man)))
3771 (home-page "https://haikarainen.github.io/light")
3772 (synopsis "GNU/Linux application to control backlights")
3774 "Light is a program to send commands to screen backlight controllers
3775 under GNU/Linux. Features include:
3778 @item It does not rely on X.
3779 @item Light can automatically figure out the best controller to use, making
3780 full use of underlying hardware.
3781 @item It is possible to set a minimum brightness value, as some controllers
3782 set the screen to be pitch black at a vaĺue of 0 (or higher).
3785 Light is the successor of lightscript.")
3786 (license license:gpl3+)))
3795 "https://github.com/linrunner/"
3796 (string-upcase name)
3797 "/archive/" version ".tar.gz"))
3798 (file-name (string-append name "-" version ".tar.gz"))
3801 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3802 (inputs `(("bash" ,bash)
3804 ("ethtool" ,ethtool)
3808 ("inetutils" ,inetutils)
3811 ("pciutils" ,pciutils)
3815 ("usbutils" ,usbutils)
3816 ("util-linux" ,util-linux)
3817 ("wireless-tools" ,wireless-tools)))
3818 (build-system gnu-build-system)
3821 (modify-phases %standard-phases
3822 (delete 'configure) ; no configure script
3823 (add-before 'build 'setenv
3824 (lambda* (#:key outputs #:allow-other-keys)
3825 (let ((out (assoc-ref outputs "out")))
3826 (setenv "TLP_WITH_SYSTEMD" "0")
3827 (setenv "TLP_NO_INIT" "1")
3828 (setenv "TLP_NO_PMUTILS" "1")
3829 (setenv "TLP_SBIN" (string-append out "/bin"))
3830 (setenv "TLP_BIN" (string-append out "/bin"))
3831 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3832 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3833 (setenv "TLP_CONF" "/etc/tlp")
3835 (string-append out "/share/bash-completion/completions"))
3836 (setenv "TLP_MAN" (string-append out "/share/man")))))
3837 (delete 'check) ; no tests
3838 (add-before 'install 'fix-installation
3840 ;; Stop the Makefile from trying to create system directories.
3841 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
3844 (zero? (system* "make" "install-tlp" "install-man"))))
3845 (add-after 'install 'wrap
3846 (lambda* (#:key inputs outputs #:allow-other-keys)
3847 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3848 (bin-files (find-files bin ".*")))
3849 (define (bin-directory input-name)
3850 (string-append (assoc-ref inputs input-name) "/bin"))
3851 (define (sbin-directory input-name)
3852 (string-append (assoc-ref inputs input-name) "/sbin"))
3853 (for-each (lambda (program)
3854 (wrap-program program
3857 (map bin-directory '("bash"
3868 (map sbin-directory '("ethtool"
3873 "wireless-tools"))))))
3875 (home-page "http://linrunner.de/en/tlp/tlp.html")
3876 (synopsis "Power management tool for Linux")
3877 (description "TLP is a power management tool for Linux. It comes with
3878 a default configuration already optimized for battery life. Nevertheless,
3879 TLP is customizable to fulfil system requirements. TLP settings are applied
3880 every time the power supply source is changed.")
3882 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3884 (license (list license:gpl2+ license:gpl3+))))
3892 (uri (string-append "https://www.ezix.org/software/"
3893 "files/lshw-" version
3897 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3898 (build-system gnu-build-system)
3900 `(#:phases (modify-phases %standard-phases (delete 'configure))
3901 #:tests? #f ; no tests
3903 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3904 (synopsis "List hardware information")
3906 "@command{lshw} (Hardware Lister) is a small tool to provide
3907 detailed information on the hardware configuration of the machine.
3908 It can report exact memory configuration, firmware version, mainboard
3909 configuration, CPU version and speed, cache configuration, bus speed,
3910 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3911 machines (PowerMac G4 is known to work).")
3912 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3913 (license license:gpl2+)))
3915 (define-public libmnl
3922 (uri (string-append "mirror://netfilter.org/libmnl/"
3923 "libmnl-" version ".tar.bz2"))
3926 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
3927 (build-system gnu-build-system)
3928 (home-page "https://www.netfilter.org/projects/libmnl/")
3929 (synopsis "Netlink utility library")
3930 (description "Libmnl is a minimalistic user-space library oriented to
3931 Netlink developers. There are a lot of common tasks in parsing, validating,
3932 constructing of both the Netlink header and TLVs that are repetitive and easy to
3933 get wrong. This library aims to provide simple helpers that allows you to
3934 re-use code and to avoid re-inventing the wheel.")
3935 (license license:lgpl2.1+)))
3937 (define-public libnftnl
3944 (uri (string-append "mirror://netfilter.org/libnftnl/"
3945 "libnftnl-" version ".tar.bz2"))
3948 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
3949 (build-system gnu-build-system)
3951 `(("pkg-config" ,pkg-config)))
3953 `(("libmnl" ,libmnl)))
3954 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
3955 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
3956 (description "Libnftnl is a userspace library providing a low-level netlink
3957 programming interface to the in-kernel nf_tables subsystem. The library
3958 libnftnl has been previously known as libnftables. This library is currently
3960 (license license:gpl2+)))
3962 (define-public nftables
3969 (uri (string-append "http://www.nftables.org/projects/nftables"
3970 "/files/nftables-" version ".tar.bz2"))
3973 "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy"))))
3974 (build-system gnu-build-system)
3975 (inputs `(("bison", bison)
3979 ("libnftnl", libnftnl)
3980 ("readline", readline)))
3981 (native-inputs `(("pkg-config", pkg-config)))
3982 (home-page "http://www.nftables.org")
3983 (synopsis "Userspace utility for Linux packet filtering")
3984 (description "nftables is the project that aims to replace the existing
3985 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
3986 filtering framework, a new userspace utility and also a compatibility layer for
3987 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
3988 infrastructure such as the existing hooks, the connection tracking system, the
3989 userspace queueing component and the logging subsystem.")
3990 (license license:gpl2)))
3992 (define-public proot
3996 (home-page "https://github.com/proot-me/PRoot")
3999 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4000 (file-name (string-append name "-" version ".tar.gz"))
4003 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4004 (patches (search-patches "proot-test-fhs.patch"))))
4005 (build-system gnu-build-system)
4007 '(#:make-flags '("-C" "src")
4009 #:phases (modify-phases %standard-phases
4011 (add-before 'build 'set-shell-file-name
4012 (lambda* (#:key inputs #:allow-other-keys)
4013 (substitute* (find-files "src" "\\.[ch]$")
4016 (assoc-ref inputs "bash")
4019 (add-before 'check 'fix-fhs-assumptions-in-tests
4021 (substitute* "tests/test-c6b77b77.mk"
4022 (("/bin/bash") (which "bash"))
4023 (("/usr/bin/test") (which "test")))
4024 (substitute* '("tests/test-16573e73.c")
4025 (("/bin/([a-z-]+)" _ program)
4028 (substitute* (find-files "tests" "\\.sh$")
4029 ;; Some of the tests try to "bind-mount" /bin/true.
4031 (string-append "-b " (which "true") ":"))
4032 ;; Likewise for /bin.
4033 (("-b /bin:") "-b /gnu:")
4034 ;; Others try to run /bin/sh.
4035 (("/bin/sh") (which "sh"))
4036 ;; Others assume /etc/fstab exists.
4037 (("/etc/fstab") "/etc/passwd"))
4039 (substitute* "tests/GNUmakefile"
4040 (("-b /bin:") "-b /gnu:"))
4042 ;; XXX: This test fails in an obscure corner case, just
4044 (delete-file "tests/test-kkkkkkkk.c")
4049 (let ((n (parallel-job-count)))
4050 ;; For some reason we get lots of segfaults with
4051 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4052 (setenv "PROOT_NO_SECCOMP" "1")
4054 ;; Most of the tests expect "/bin" to be in $PATH so
4055 ;; they can run things that live in $ROOTFS/bin.
4057 (string-append (getenv "PATH") ":/bin"))
4059 (zero? (system* "make" "check" "-C" "tests"
4061 "-j" (number->string n))))))
4063 (lambda* (#:key outputs #:allow-other-keys)
4064 ;; The 'install' rule does nearly nothing.
4065 (let ((out (assoc-ref outputs "out")))
4067 ;; TODO: 'make install-care' (does not even
4068 ;; build currently.)
4069 (system* "make" "-C" "src" "install"
4070 (string-append "PREFIX=" out)))
4071 (let ((man1 (string-append out
4072 "/share/man/man1")))
4074 (copy-file "doc/proot/man.1"
4075 (string-append man1 "/proot.1"))
4077 (native-inputs `(("which" ,which)
4079 ;; For 'mcookie', used by some of the tests.
4080 ("util-linux" ,util-linux)))
4081 (inputs `(("talloc" ,talloc)))
4082 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4084 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4085 and @code{binfmt_misc}. This means that users don't need any privileges or
4086 setup to do things like using an arbitrary directory as the new root
4087 filesystem, making files accessible somewhere else in the file system
4088 hierarchy, or executing programs built for another CPU architecture
4089 transparently through QEMU user-mode. Also, developers can use PRoot as a
4090 generic process instrumentation engine thanks to its extension mechanism.
4091 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4092 available in the kernel Linux.")
4093 (license license:gpl2+)))
4095 (define-public proot-static
4098 (name "proot-static")
4100 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4101 (inputs `(("talloc" ,talloc/static)))
4103 (substitute-keyword-arguments (package-arguments proot)
4104 ((#:make-flags flags)
4105 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4107 `(modify-phases ,phases
4108 (add-after 'strip 'remove-store-references
4109 (lambda* (#:key outputs #:allow-other-keys)
4110 (let* ((out (assoc-ref outputs "out")))
4111 (with-directory-excursion out
4112 (remove-store-references "bin/proot")
4114 ((#:allowed-references _ '("out"))
4117 (define-public cpuid
4120 (version "20170122")
4123 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4124 version ".src.tar.gz"))
4127 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4128 (build-system gnu-build-system)
4130 '(#:make-flags '("CC=gcc")
4131 #:tests? #f ; no tests
4132 #:phases (modify-phases %standard-phases
4134 (add-before 'install 'fix-makefile
4135 (lambda* (#:key outputs #:allow-other-keys)
4136 (substitute* "Makefile"
4137 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4138 ;; Make the compressed manpages writable so that the
4139 ;; reset-gzip-timestamps phase does not error out.
4140 (substitute* "Makefile"
4141 (("-m 444") "-m 644"))
4143 (inputs `(("perl" ,perl)))
4144 (supported-systems '("i686-linux" "x86_64-linux"))
4145 (home-page "http://www.etallen.com/cpuid.html")
4146 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4147 (description "cpuid dumps detailed information about the CPU(s) gathered
4148 from the CPUID instruction, and also determines the exact model of CPU(s). It
4149 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4150 NexGen, Rise, and SiS CPUs.")
4151 (license license:gpl2+)))
4153 (define-public jmtpfs
4160 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4162 (file-name (string-append name "-" version ".tar.gz"))
4165 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4166 (build-system gnu-build-system)
4170 ("libmtp" ,libmtp)))
4172 `(("pkg-config" ,pkg-config)))
4173 (home-page "https://github.com/JasonFerrara/jmtpfs")
4174 (synopsis "Use a FUSE filesystem to access data over MTP")
4175 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4176 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4177 the MTP device as a filesystem.")
4178 (license license:gpl3)))