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, 2018 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, 2018 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017, 2018 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, 2018 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, 2018 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
22 ;;; Copyright © 2017, 2018 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, 2018 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
32 ;;; This file is part of GNU Guix.
34 ;;; GNU Guix is free software; you can redistribute it and/or modify it
35 ;;; under the terms of the GNU General Public License as published by
36 ;;; the Free Software Foundation; either version 3 of the License, or (at
37 ;;; your option) any later version.
39 ;;; GNU Guix is distributed in the hope that it will be useful, but
40 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
41 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 ;;; GNU General Public License for more details.
44 ;;; You should have received a copy of the GNU General Public License
45 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
47 (define-module (gnu packages linux)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages acl)
50 #:use-module (gnu packages admin)
51 #:use-module (gnu packages algebra)
52 #:use-module (gnu packages attr)
53 #:use-module (gnu packages autotools)
54 #:use-module (gnu packages backup)
55 #:use-module (gnu packages base)
56 #:use-module (gnu packages bash)
57 #:use-module (gnu packages bison)
58 #:use-module (gnu packages calendar)
59 #:use-module (gnu packages check)
60 #:use-module (gnu packages crypto)
61 #:use-module (gnu packages compression)
62 #:use-module (gnu packages databases)
63 #:use-module (gnu packages datastructures)
64 #:use-module (gnu packages docbook)
65 #:use-module (gnu packages documentation)
66 #:use-module (gnu packages elf)
67 #:use-module (gnu packages flex)
68 #:use-module (gnu packages file)
69 #:use-module (gnu packages freedesktop)
70 #:use-module (gnu packages gcc)
71 #:use-module (gnu packages gettext)
72 #:use-module (gnu packages glib)
73 #:use-module (gnu packages gnuzilla)
74 #:use-module (gnu packages gperf)
75 #:use-module (gnu packages gtk)
76 #:use-module (gnu packages libunwind)
77 #:use-module (gnu packages libusb)
78 #:use-module (gnu packages man)
79 #:use-module (gnu packages maths)
80 #:use-module (gnu packages multiprecision)
81 #:use-module (gnu packages ncurses)
82 #:use-module (gnu packages netpbm)
83 #:use-module (gnu packages networking)
84 #:use-module (gnu packages ninja)
85 #:use-module (gnu packages perl)
86 #:use-module (gnu packages pciutils)
87 #:use-module (gnu packages pkg-config)
88 #:use-module (gnu packages popt)
89 #:use-module (gnu packages pulseaudio)
90 #:use-module (gnu packages python)
91 #:use-module (gnu packages readline)
92 #:use-module (gnu packages rrdtool)
93 #:use-module (gnu packages samba)
94 #:use-module (gnu packages slang)
95 #:use-module (gnu packages storage)
96 #:use-module (gnu packages texinfo)
97 #:use-module (gnu packages tls)
98 #:use-module (gnu packages valgrind)
99 #:use-module (gnu packages video)
100 #:use-module (gnu packages web)
101 #:use-module (gnu packages xiph)
102 #:use-module (gnu packages xml)
103 #:use-module (gnu packages xdisorg)
104 #:use-module (gnu packages xorg)
105 #:use-module (gnu packages groff)
106 #:use-module (gnu packages selinux)
107 #:use-module (gnu packages swig)
108 #:use-module (guix build-system cmake)
109 #:use-module (guix build-system gnu)
110 #:use-module (guix build-system python)
111 #:use-module (guix build-system trivial)
112 #:use-module (guix download)
113 #:use-module (guix git-download)
114 #:use-module ((guix licenses) #:prefix license:)
115 #:use-module (guix packages)
116 #:use-module (guix utils)
117 #:use-module (srfi srfi-1)
118 #:use-module (srfi srfi-2)
119 #:use-module (srfi srfi-26)
120 #:use-module (ice-9 match))
122 (define-public (system->linux-architecture arch)
123 "Return the Linux architecture name for ARCH, a Guix system name such as
124 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
125 (let ((arch (car (string-split arch #\-))))
126 (cond ((string=? arch "i686") "i386")
127 ((string-prefix? "mips" arch) "mips")
128 ((string-prefix? "arm" arch) "arm")
129 ((string-prefix? "aarch64" arch) "arm64")
130 ((string-prefix? "alpha" arch) "alpha")
131 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
132 ((string-prefix? "s390" arch) "s390")
135 (define-public (system->defconfig system)
136 "Some systems (notably powerpc-linux) require a special target for kernel
137 defconfig. Return the appropriate make target if applicable, otherwise return
139 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
140 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
143 (define (linux-libre-urls version)
144 "Return a list of URLs for Linux-Libre VERSION."
146 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
147 version "-gnu/linux-libre-" version "-gnu.tar.xz")
149 ;; XXX: Work around <http://bugs.gnu.org/14851>.
151 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
152 version "-gnu.tar.xz")
154 ;; Maybe this URL will become valid eventually.
156 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
157 version "-gnu.tar.xz")))
159 (define-public linux-libre-headers
161 (name "linux-libre-headers")
165 (uri (linux-libre-urls version))
168 "0z8hq8a6ic38xh33idzl0k0yi4isgd7ncl2g1d6mzf9ixw5krhvc"))))
169 (build-system gnu-build-system)
170 (native-inputs `(("perl" ,perl)))
172 `(#:modules ((guix build gnu-build-system)
176 (modify-phases %standard-phases
180 (let ((arch ,(system->linux-architecture
181 (or (%current-target-system)
183 (defconfig ,(system->defconfig
184 (or (%current-target-system)
185 (%current-system)))))
187 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
188 (and (zero? (system* "make" defconfig))
189 (zero? (system* "make" "mrproper" "headers_check"))))))
191 (lambda* (#:key outputs #:allow-other-keys)
192 (let ((out (assoc-ref outputs "out")))
193 (and (zero? (system* "make"
194 (string-append "INSTALL_HDR_PATH=" out)
197 (mkdir (string-append out "/include/config"))
198 (call-with-output-file
200 "/include/config/kernel.release")
202 (format p "~a-default~%" ,version)))
204 ;; Remove the '.install' and '..install.cmd' files; the
205 ;; latter contains store paths, which pulls in bootstrap
206 ;; binaries in the build environment, and prevents bit
207 ;; reproducibility for the bootstrap binaries.
208 (for-each delete-file (find-files out "\\.install"))
211 #:allowed-references ()
213 (home-page "https://www.gnu.org/software/linux-libre/")
214 (synopsis "GNU Linux-Libre kernel headers")
215 (description "Headers of the Linux-Libre kernel.")
216 (license license:gpl2)))
218 (define %boot-logo-patch
219 ;; Linux-Libre boot logo featuring Freedo and a gnu.
222 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
223 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
226 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
228 (define* (kernel-config arch #:key variant)
229 "Return the absolute file name of the Linux-Libre build configuration file
230 for ARCH and optionally VARIANT, or #f if there is no such configuration."
231 (let* ((name (string-append (if variant (string-append variant "-") "")
232 (if (string=? "i386" arch) "i686" arch) ".conf"))
233 (file (string-append "linux-libre/" name)))
234 (search-auxiliary-file file)))
236 (define %default-extra-linux-options
237 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
238 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
239 ;; Modules required for initrd:
240 ("CONFIG_NET_9P" . m)
241 ("CONFIG_NET_9P_VIRTIO" . m)
242 ("CONFIG_VIRTIO_BLK" . m)
243 ("CONFIG_VIRTIO_NET" . m)
244 ("CONFIG_VIRTIO_PCI" . m)
245 ("CONFIG_VIRTIO_BALLOON" . m)
246 ("CONFIG_VIRTIO_MMIO" . m)
247 ("CONFIG_FUSE_FS" . m)
249 ("CONFIG_9P_FS" . m)))
251 (define (config->string options)
252 (string-join (map (match-lambda
254 (string-append option "=m"))
256 (string-append option "=y"))
258 (string-append option "=n")))
262 (define* (make-linux-libre version hash supported-systems
264 ;; A function that takes an arch and a variant.
265 ;; See kernel-config for an example.
267 (configuration-file #f)
268 (defconfig "defconfig")
269 (extra-options %default-extra-linux-options)
270 (patches (list %boot-logo-patch)))
272 (name (if extra-version
273 (string-append "linux-libre-" extra-version)
278 (uri (linux-libre-urls version))
279 (sha256 (base32 hash))
281 (supported-systems supported-systems)
282 (build-system gnu-build-system)
288 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
291 ;; On x86, build with GCC-7 for full retpoline support.
292 ;; FIXME: Remove this when our default compiler has retpoline support.
293 ,@(match (system->linux-architecture
294 (or (%current-target-system) (%current-system)))
295 ((or "x86_64" "i386")
299 ,@(match (and configuration-file
301 (system->linux-architecture
302 (or (%current-target-system) (%current-system)))
303 #:variant (version-major+minor version)))
304 (#f ;no config for this platform
307 `(("kconfig" ,config))))))
309 `(#:modules ((guix build gnu-build-system)
314 (modify-phases %standard-phases
315 (add-after 'unpack 'patch-/bin/pwd
317 (substitute* (find-files "." "^Makefile(\\.include)?$")
318 (("/bin/pwd") "pwd"))
321 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
322 ;; Avoid introducing timestamps
323 (setenv "KCONFIG_NOTIMESTAMP" "1")
324 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
326 ;; Set ARCH and CROSS_COMPILE
327 (let ((arch ,(system->linux-architecture
328 (or (%current-target-system)
329 (%current-system)))))
331 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
334 (setenv "CROSS_COMPILE" (string-append target "-"))
335 (format #t "`CROSS_COMPILE' set to `~a'~%"
336 (getenv "CROSS_COMPILE"))))
338 (setenv "EXTRA_VERSION" ,extra-version)
340 (let ((build (assoc-ref %standard-phases 'build))
341 (config (assoc-ref (or native-inputs inputs) "kconfig")))
343 ;; Use a custom kernel configuration file or a default
344 ;; configuration file.
347 (copy-file config ".config")
348 (chmod ".config" #o666))
349 (invoke "make" ,defconfig))
351 ;; Appending works even when the option wasn't in the
352 ;; file. The last one prevails if duplicated.
353 (let ((port (open-file ".config" "a"))
354 (extra-configuration ,(config->string extra-options)))
355 (display extra-configuration port)
358 (invoke "make" "oldconfig"))))
360 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
361 (let* ((out (assoc-ref outputs "out"))
362 (moddir (string-append out "/lib/modules"))
363 (dtbdir (string-append out "/lib/dtbs"))
364 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
365 ;; Install kernel image, kernel configuration and link map.
366 (for-each (lambda (file) (install-file file out))
367 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map)$"))
368 ;; Install device tree files
369 (unless (null? (find-files "." "\\.dtb$"))
371 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
373 ;; Install kernel modules
376 (string-append "DEPMOD=" kmod "/bin/depmod")
377 (string-append "MODULE_DIR=" moddir)
378 (string-append "INSTALL_PATH=" out)
379 (string-append "INSTALL_MOD_PATH=" out)
380 "INSTALL_MOD_STRIP=1"
381 "modules_install")))))
383 (home-page "https://www.gnu.org/software/linux-libre/")
384 (synopsis "100% free redistribution of a cleaned Linux kernel")
386 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
387 It has been modified to remove all non-free binary blobs.")
388 (license license:gpl2)))
390 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
391 (define %linux-compatible-systems '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux"))
393 ;; linux-libre configuration for armhf-linux is derived from Debian armmp. It
394 ;; supports qemu "virt" machine and possibly a large number of ARM boards.
395 ;; See : https://wiki.debian.org/DebianKernel/ARMMP.
397 (define %linux-libre-version "4.16.12")
398 (define %linux-libre-hash "1zjq16z5cdcpa4acqdilavjjv2xbqnh3fmn400n9hd5pzyll817m")
400 (define-public linux-libre
401 (make-linux-libre %linux-libre-version
403 %linux-compatible-systems
404 #:configuration-file kernel-config))
406 (define %linux-libre-4.14-version "4.14.44")
407 (define %linux-libre-4.14-hash "0w89y22by17yqk89l1mmhlvz0i4dkp1mjc347nq3zy1llbwiwvnf")
409 (define-public linux-libre-4.14
410 (make-linux-libre %linux-libre-4.14-version
411 %linux-libre-4.14-hash
412 '("x86_64-linux" "i686-linux" "armhf-linux")
413 #:configuration-file kernel-config))
415 (define-public linux-libre-4.9
416 (make-linux-libre "4.9.103"
417 "00g58y92pmb6xf9lhjrab2jrjv3naw3857pf9s43dvh6fwlbccbf"
418 %intel-compatible-systems
419 #:configuration-file kernel-config))
421 (define-public linux-libre-4.4
422 (make-linux-libre "4.4.133"
423 "05qc9smcvxd68d46l5gjhvihhnidkiymqh4fv4nyagzv555q7na7"
424 %intel-compatible-systems
425 #:configuration-file kernel-config))
427 (define-public linux-libre-4.1
428 (make-linux-libre "4.1.51"
429 "0l8lpwjpckp44hjyx5qrxqdwwi97gyyc1n6pmk66cr3fpdhnk540"
430 %intel-compatible-systems
431 #:configuration-file kernel-config))
433 (define-public linux-libre-arm-generic
434 (make-linux-libre %linux-libre-version
437 #:defconfig "multi_v7_defconfig"
438 #:extra-version "arm-generic"))
440 (define-public linux-libre-arm-generic-4.14
441 (make-linux-libre %linux-libre-4.14-version
442 %linux-libre-4.14-hash
444 #:defconfig "multi_v7_defconfig"
445 #:extra-version "arm-generic"))
447 (define-public linux-libre-arm-omap2plus
448 (make-linux-libre %linux-libre-version
451 #:defconfig "omap2plus_defconfig"
452 #:extra-version "arm-omap2plus"))
454 (define-public linux-libre-arm-omap2plus-4.14
455 (make-linux-libre %linux-libre-4.14-version
456 %linux-libre-4.14-hash
458 #:defconfig "omap2plus_defconfig"
459 #:extra-version "arm-omap2plus"))
463 ;;; Pluggable authentication modules (PAM).
466 (define-public linux-pam
474 "http://www.linux-pam.org/library/"
475 "Linux-PAM-" version ".tar.bz2"))
478 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
479 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
481 (build-system gnu-build-system)
485 ;; TODO: optional dependencies
486 ;; ("libxcrypt" ,libxcrypt)
487 ;; ("cracklib" ,cracklib)
490 `(;; Most users, such as `shadow', expect the headers to be under
492 #:configure-flags (list (string-append "--includedir="
493 (assoc-ref %outputs "out")
496 ;; XXX: <rpc/rpc.h> is missing from glibc when
497 ;; cross-compiling, so we have to disable NIS
498 ;; support altogether.
499 ,@(if (%current-target-system)
503 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
506 (home-page "http://www.linux-pam.org/")
507 (synopsis "Pluggable authentication modules for Linux")
509 "A *Free* project to implement OSF's RFC 86.0.
510 Pluggable authentication modules are small shared object files that can
511 be used through the PAM API to perform tasks, like authenticating a user
512 at login. Local and dynamic reconfiguration are its key features.")
513 (license license:bsd-3)))
515 (define-public linux-pam-1.2
523 "http://www.linux-pam.org/library/"
524 "Linux-PAM-" version ".tar.bz2"))
527 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
528 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
535 (define-public psmisc
542 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
546 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
547 (build-system gnu-build-system)
548 (inputs `(("ncurses" ,ncurses)))
549 (home-page "https://gitlab.com/psmisc/psmisc")
551 "Small utilities that use the proc file system")
553 "This PSmisc package is a set of some small useful utilities that
554 use the proc file system. We're not about changing the world, but
555 providing the system administrator with some help in common tasks.")
556 (license license:gpl2+)))
558 (define-public util-linux
564 (uri (string-append "mirror://kernel.org/linux/utils/"
565 name "/v" (version-major+minor version) "/"
566 name "-" version ".tar.xz"))
569 "12nw108xjhm63sh2n5a0qs33vpvbvb6rln96l9j50p7wykf7rgpr"))
570 (patches (search-patches "util-linux-tests.patch"))
571 (modules '((guix build utils)))
573 ;; We take the 'logger' program from GNU Inetutils and 'kill'
574 ;; from GNU Coreutils.
576 (substitute* "configure"
577 (("build_logger=yes") "build_logger=no")
578 (("build_kill=yes") "build_kill=no"))
580 (build-system gnu-build-system)
582 "static")) ; >2 MiB of static .a libraries
584 `(#:configure-flags (list "--disable-use-tty-group"
585 "--enable-fs-paths-default=/run/current-system/profile/sbin"
586 ;; Don't try to chown root:root mount and umount
587 "--disable-makeinstall-chown"
588 ;; Install completions where our
589 ;; bash-completion package expects them.
590 (string-append "--with-bashcompletiondir="
591 (assoc-ref %outputs "out")
592 "/etc/bash_completion.d"))
593 #:phases (modify-phases %standard-phases
595 'build 'set-umount-file-name
596 (lambda* (#:key outputs #:allow-other-keys)
597 ;; Tell 'eject' the right file name of 'umount'.
598 (let ((out (assoc-ref outputs "out")))
599 (substitute* "sys-utils/eject.c"
601 (string-append "\"" out "/bin/umount\"")))
605 (lambda* (#:key inputs outputs #:allow-other-keys)
606 (let ((out (assoc-ref outputs "out"))
607 (net (assoc-ref inputs "net-base")))
608 ;; Change the test to refer to the right file.
609 (substitute* "tests/ts/misc/mcookie"
611 (string-append net "/etc/services")))
614 'install 'move-static-libraries
615 (lambda* (#:key outputs #:allow-other-keys)
616 (let ((out (assoc-ref outputs "out"))
617 (static (assoc-ref outputs "static")))
618 (mkdir-p (string-append static "/lib"))
619 (with-directory-excursion out
620 (for-each (lambda (file)
622 (string-append static "/"
624 (find-files "lib" "\\.a$")))
626 (inputs `(("zlib" ,zlib)
629 ;; XXX: This is so that the 'pre-check' phase can find it.
630 ,@(if (%current-target-system)
631 `(("net-base" ,net-base))
635 ("net-base" ,net-base))) ;for tests
636 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
637 (synopsis "Collection of utilities for the Linux kernel")
638 (description "Util-linux is a diverse collection of Linux kernel
639 utilities. It provides dmesg and includes tools for working with file systems,
640 block devices, UUIDs, TTYs, and many other tools.")
642 ;; Note that util-linux doesn't use the same license for all the
643 ;; code. GPLv2+ is the default license for a code without an
644 ;; explicitly defined license.
645 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
646 license:bsd-4 license:public-domain))))
648 ;; The patch 'util-linux-CVE-2018-7738.patch' fixes a security bug in
649 ;; the Bash completions for `mount`. Since this bug doesn't affect
650 ;; other programs that link against libraries from util-linux, we don't
651 ;; need to use a graft to make the fix available. Instead, users
652 ;; installing util-linux will get the fix in this newer version, and
653 ;; (@ (gnu system) %base-packages) takes care to use this package.
654 ;; This solution was suggested here:
655 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=30827#13>
656 (define-public util-linux-2.31.1
660 ;; XXX Don't update this without also updating %base-packages!
663 (inherit (package-source util-linux))
664 (uri (string-append "mirror://kernel.org/linux/utils/"
665 name "/v" (version-major+minor version) "/"
666 name "-" version ".tar.xz"))
669 "04fzrnrr3pvqskvjn9f81y0knh0jvvqx4lmbz5pd4lfdm5pv2l8s"))
671 (append (origin-patches (package-source util-linux))
672 (search-patches "util-linux-CVE-2018-7738.patch")))))))
680 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
682 (file-name (string-append name "-" version ".tar.gz"))
684 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
685 (build-system cmake-build-system)
686 (arguments '(#:tests? #f))
687 (home-page "https://github.com/bo0ts/ddate")
688 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
690 "ddate displays the Discordian date and holidays of a given date.
691 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
692 by Robert Shea and Robert Anton Wilson.")
693 (license license:public-domain)))
695 (define-public procps
701 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
702 "procps-ng-" version ".tar.xz"))
705 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
706 (build-system gnu-build-system)
708 '(#:modules ((guix build utils)
709 (guix build gnu-build-system)
713 (modify-phases %standard-phases
715 'install 'post-install
716 ;; Remove commands and man pages redudant with
718 (lambda* (#:key outputs #:allow-other-keys)
719 (let* ((out (assoc-ref outputs "out"))
720 (dup (append-map (cut find-files out <>)
721 '("^kill" "^uptime"))))
722 (for-each delete-file dup)
724 (inputs `(("ncurses" ,ncurses)))
725 (home-page "https://gitlab.com/procps-ng/procps/")
726 (synopsis "Utilities that give information about processes")
728 "Procps is the package that has a bunch of small useful utilities
729 that give information about processes using the Linux /proc file system.
730 The package includes the programs ps, top, vmstat, w, kill, free,
731 slabtop, and skill.")
732 (license license:gpl2)))
734 (define-public usbutils
741 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
742 "usbutils-" version ".tar.xz"))
745 "06aag4jfgsfjxk563xsp9ik9nadihmasrr37a1gb0vwqni5kdiv1"))))
746 (build-system gnu-build-system)
751 `(("pkg-config" ,pkg-config)))
752 (home-page "http://www.linux-usb.org/")
754 "Tools for working with USB devices, such as lsusb")
756 "Tools for working with USB devices, such as lsusb.")
757 (license license:gpl2+)))
759 (define-public e2fsprogs
766 "mirror://kernel.org/linux/kernel/people/tytso/"
767 name "/v" version "/"
768 name "-" version ".tar.xz"))
771 "00ilv65dzcgiap435j89xk86shf7rrav3wsik7cahy789qijdcn9"))))
772 (build-system gnu-build-system)
773 (inputs `(("util-linux" ,util-linux)))
774 (native-inputs `(("pkg-config" ,pkg-config)
775 ("texinfo" ,texinfo) ;for the libext2fs Info manual
781 '(;; util-linux is the preferred source for some of the libraries and
782 ;; commands, so disable them (see, e.g.,
783 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
784 #:configure-flags (list "--disable-libblkid"
785 "--disable-libuuid" "--disable-uuidd"
788 ;; Use symlinks instead of hard links for
789 ;; 'fsck.extN' etc. This makes the resulting nar
790 ;; smaller and is preserved across copies.
791 "--enable-symlink-install"
793 (string-append "LDFLAGS=-Wl,-rpath="
794 (assoc-ref %outputs "out")
797 ;; Install libext2fs et al.
798 "--enable-elf-shlibs")
801 (modify-phases %standard-phases
802 (add-before 'configure 'patch-shells
804 (substitute* "configure"
805 (("/bin/sh (.*)parse-types.sh" _ dir)
806 (string-append (which "sh") " " dir
808 (substitute* "MCONFIG.in"
809 (("INSTALL_SYMLINK = /bin/sh")
810 "INSTALL_SYMLINK = sh"))
811 (substitute* (find-files "." "^Makefile.in$")
813 (string-append "#!" (which "sh"))))
815 (add-after 'install 'install-libs
816 (lambda* (#:key outputs #:allow-other-keys)
817 (let* ((out (assoc-ref outputs "out"))
818 (lib (string-append out "/lib")))
819 (and (zero? (system* "make" "install-libs"))
821 ;; Make the .a writable so that 'strip' works.
822 ;; Failing to do that, due to debug symbols, we
823 ;; retain a reference to the final
824 ;; linux-libre-headers, which refer to the
825 ;; bootstrap binaries.
826 (let ((archives (find-files lib "\\.a$")))
827 (for-each (lambda (file)
831 (home-page "http://e2fsprogs.sourceforge.net/")
832 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
834 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
835 (license (list license:gpl2 ;programs
836 license:lgpl2.0 ;libext2fs
837 license:x11)))) ;libuuid
839 (define e2fsprogs/static
841 (package (inherit e2fsprogs)
843 ;; Do not build shared libraries.
844 (substitute-keyword-arguments (package-arguments e2fsprogs)
845 ((#:configure-flags _)
846 '(list "--disable-blkid"))
850 (define-public e2fsck/static
852 (name "e2fsck-static")
853 (version (package-version e2fsprogs))
854 (build-system trivial-build-system)
857 `(("e2fsprogs" ,e2fsprogs/static)))
859 `(#:modules ((guix build utils))
862 (use-modules (guix build utils)
866 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
868 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
870 (with-directory-excursion bin
871 (copy-file e2fsck "e2fsck")
872 (remove-store-references "e2fsck")
873 (chmod "e2fsck" #o555))))))
874 (home-page (package-home-page e2fsprogs))
875 (synopsis "Statically-linked e2fsck command from e2fsprogs")
876 (description "This package provides statically-linked e2fsck command taken
877 from the e2fsprogs package. It is meant to be used in initrds.")
878 (license (package-license e2fsprogs))))
880 (define-public extundelete
886 (uri (string-append "mirror://sourceforge/extundelete/"
887 "extundelete/" version "/extundelete-"
891 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
892 (build-system gnu-build-system)
893 (inputs `(("e2fsprogs" ,e2fsprogs)))
894 (home-page "http://extundelete.sourceforge.net/")
895 (synopsis "Recover deleted files from ext2/3/4 partitions")
897 "Extundelete is a set of tools that can recover deleted files from an
898 ext3 or ext4 partition.")
899 (license license:gpl2)))
901 (define-public zerofree
905 (home-page "https://frippery.org/uml/")
908 (uri (string-append home-page name "-" version
912 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
913 (build-system gnu-build-system)
916 (modify-phases %standard-phases
917 (delete 'configure) ; no configure script
919 ;; The Makefile lacks an ‘install’ target.
920 (lambda* (#:key outputs #:allow-other-keys)
921 (let* ((out (assoc-ref outputs "out"))
922 (bin (string-append out "/bin")))
923 (chmod "zerofree" #o555)
924 (install-file "zerofree" bin)
926 #:tests? #f)) ; no tests
927 (inputs `(("libext2fs" ,e2fsprogs)))
928 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
930 "Zerofree finds the unallocated blocks with non-zero value content in an
931 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
932 This is a simple way to make disk images more compressible.
933 Zerofree requires the file system to be unmounted or mounted read-only.")
934 (license license:gpl2)))
936 (define-public strace
940 (home-page "https://strace.io")
943 (uri (string-append home-page "/files/" version
944 "/strace-" version ".tar.xz"))
945 (patches (search-patches "strace-kernel-4.16.patch"))
948 "17dkpnsjxmys1ydidm9wcvc3wscsz44fmlxw3dclspn9cj9d1306"))))
949 (build-system gnu-build-system)
952 (modify-phases %standard-phases
953 (add-after 'unpack 'patch-/bin/sh
955 (substitute* "strace.c"
956 (("/bin/sh") (which "sh")))
958 (native-inputs `(("perl" ,perl)))
959 (synopsis "System call tracer for Linux")
961 "strace is a system call tracer, i.e. a debugging tool which prints out a
962 trace of all the system calls made by a another process/program.")
963 (license license:bsd-3)))
965 (define-public ltrace
971 (uri (string-append "http://www.ltrace.org/ltrace_" version
975 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
976 (build-system gnu-build-system)
977 (inputs `(("libelf" ,libelf)))
979 ;; Compilation uses -Werror by default, but it fails.
980 '(#:configure-flags '("--disable-werror")))
981 (home-page "https://www.ltrace.org/")
982 (synopsis "Library call tracer for Linux")
984 "ltrace intercepts and records dynamic library calls which are called by
985 an executed process and the signals received by that process. It can also
986 intercept and print the system calls executed by the program.")
987 (license license:gpl2+)))
989 (define-public alsa-lib
996 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1000 "096pwrnhj36yndldvs2pj4r871zhcgisks0is78f1jkjn9sd4b2z"))))
1001 (build-system gnu-build-system)
1002 (home-page "https://www.alsa-project.org/")
1003 (synopsis "The Advanced Linux Sound Architecture libraries")
1005 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1006 MIDI functionality to the Linux-based operating system.")
1007 (license license:lgpl2.1+)))
1009 (define-public alsa-utils
1015 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1016 name "-" version ".tar.bz2"))
1019 "0vnkyymgwj9rfdb11nvab30dnfrylmakdfildxl0y8mj836awp0m"))))
1020 (build-system gnu-build-system)
1022 ;; XXX: Disable man page creation until we have DocBook.
1023 '(#:configure-flags (list "--disable-xmlto"
1025 ;; The udev rule is responsible for restoring
1027 (string-append "--with-udev-rules-dir="
1028 (assoc-ref %outputs "out")
1029 "/lib/udev/rules.d"))
1031 (modify-phases %standard-phases
1033 'install 'pre-install
1035 ;; Don't try to mkdir /var/lib/alsa.
1036 (substitute* "Makefile"
1037 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1041 `(("libsamplerate" ,libsamplerate)
1042 ("ncurses" ,ncurses)
1043 ("alsa-lib" ,alsa-lib)
1045 ("gettext" ,gettext-minimal)))
1046 (home-page "http://www.alsa-project.org/")
1047 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1049 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1050 MIDI functionality to the Linux-based operating system.")
1052 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1054 (license license:gpl2)))
1056 (define-public alsa-plugins
1058 (name "alsa-plugins")
1062 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1063 name "-" version ".tar.bz2"))
1066 "04qcwkisbh0d6lnh0rw1k6n869fbs6zbfq6yvb41rymiwgmk27bg"))))
1067 (build-system gnu-build-system)
1068 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1069 ;; be split, there are references to both in files.
1070 ;; TODO: Remove OSS related plugins, they add support to run native
1071 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1073 (outputs '("out" "pulseaudio"))
1076 (modify-phases %standard-phases
1077 (add-after 'install 'split
1078 (lambda* (#:key inputs outputs #:allow-other-keys)
1079 ;; Distribute the binaries to the various outputs.
1080 (let* ((out (assoc-ref outputs "out"))
1081 (pua (assoc-ref outputs "pulseaudio"))
1082 (pualib (string-append pua "/lib/alsa-lib"))
1083 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
1086 (chdir (string-append out "/share"))
1087 (for-each (lambda (file)
1088 (rename-file file (string-append puaconf "/" (basename file))))
1089 (find-files out "\\.(conf|example)"))
1090 (for-each (lambda (file)
1091 (rename-file file (string-append pualib "/" (basename file))))
1092 (find-files out ".*pulse\\.(la|so)"))
1094 ;; We have moved the files to output pulsaudio, the
1095 ;; directory is now empty.
1096 (delete-file-recursively (string-append out "/share"))
1099 `(("alsa-lib" ,alsa-lib)
1100 ("speex" ,speex) ; libspeexdsp resampling plugin
1101 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1102 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1103 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1105 `(("pkg-config" ,pkg-config)))
1106 (home-page "http://www.alsa-project.org/")
1107 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1109 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1110 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1111 by providing additional plugins which include: upmixing, downmixing, jackd and
1112 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1113 external rate conversion.")
1114 (license (list license:gpl2+
1115 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1116 license:lgpl2.1+))))
1118 (define-public iptables
1125 "mirror://netfilter.org/iptables/iptables-"
1126 version ".tar.bz2"))
1129 "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
1130 (build-system gnu-build-system)
1132 `(("pkg-config" ,pkg-config)
1136 `(("libmnl" ,libmnl)
1137 ("libnftnl" ,libnftnl)))
1139 '(#:tests? #f ; no test suite
1140 #:configure-flags ; add $libdir to the RUNPATH of executables
1141 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1142 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1143 (synopsis "Programs to configure Linux IP packet filtering rules")
1145 "@command{iptables} is the user-space command line program used to
1146 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1147 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1149 This package also includes @command{ip6tables}, which is used to configure the
1152 Both commands are targeted at system administrators.")
1153 (license license:gpl2+)))
1155 (define-public ebtables
1158 (version "2.0.10-4")
1162 "mirror://netfilter.org/ebtables/ebtables-v"
1166 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1167 (build-system gnu-build-system)
1169 '(#:tests? #f ; no test suite
1171 (let* ((out (assoc-ref %outputs "out"))
1172 (bin (string-append out "/sbin"))
1173 (lib (string-append out "/lib"))
1174 (man (string-append out "/share/man"))
1175 (iptables (assoc-ref %build-inputs "iptables"))
1176 (ethertypes (string-append iptables "/etc/ethertypes")))
1177 (list (string-append "LIBDIR=" lib)
1178 (string-append "MANDIR=" man)
1179 (string-append "BINDIR=" bin)
1180 (string-append "ETHERTYPESFILE=" ethertypes)
1181 ;; With the default CFLAGS, it falis with:
1182 ;; communication.c:259:58: error: variable ‘ret’ set but not
1183 ;; used [-Werror=unused-but-set-variable]
1186 (modify-phases %standard-phases
1188 ;; no configure script
1190 (substitute* "Makefile"
1191 ;; Remove user and group options from install commands,
1192 ;; otherwise it fails with: invalid user 'root'.
1193 (("-o root -g root") "")
1194 ;; Remove 'ethertypes' from the install target.
1196 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1200 ("iptables" ,iptables)))
1201 (synopsis "Ethernet bridge frame table administration")
1202 (home-page "http://ebtables.netfilter.org/")
1204 "ebtables is an application program used to set up and maintain the
1205 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1206 analogous to the iptables application, but less complicated, due to the fact
1207 that the Ethernet protocol is much simpler than the IP protocol.")
1208 (license license:gpl2+)))
1210 (define-public iproute
1217 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1221 "02pfalg319jpbjz273ph725br8dnkzpfvi98azi9yd6p1w128p0c"))))
1222 (build-system gnu-build-system)
1224 `(#:tests? #f ; no test suite
1225 #:make-flags (let ((out (assoc-ref %outputs "out")))
1227 (string-append "BASH_COMPDIR=" out
1228 "/etc/bash_completion.d")
1229 (string-append "LIBDIR=" out "/lib")
1230 (string-append "HDRDIR=" out "/include")
1231 (string-append "SBINDIR=" out "/sbin")
1232 (string-append "CONFDIR=" out "/etc")
1233 (string-append "DOCDIR=" out "/share/doc/"
1235 (string-append "MANDIR=" out "/share/man")))
1236 #:phases (modify-phases %standard-phases
1237 (add-before 'install 'pre-install
1239 ;; Don't attempt to create /var/lib/arpd.
1240 (substitute* "Makefile"
1241 (("^.*ARPDDIR.*$") "")))))))
1243 `(("iptables" ,iptables)
1246 `(("pkg-config" ,pkg-config)
1250 "https://wiki.linuxfoundation.org/networking/iproute2")
1252 "Utilities for controlling TCP/IP networking and traffic in Linux")
1254 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1255 and traffic with the Linux kernel. The most important of these are
1256 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1259 Most network configuration manuals still refer to ifconfig and route as the
1260 primary network configuration tools, but ifconfig is known to behave
1261 inadequately in modern network environments, and both should be deprecated.")
1262 (license license:gpl2+)))
1264 (define-public net-tools
1265 ;; XXX: This package is basically unmaintained, but it provides a few
1266 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1268 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1272 (version (string-append "1.60-" revision "." (string-take commit 7)))
1275 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1276 "n/ne/net-tools/code.git/net-tools-code-"
1278 (file-name (string-append name "-" version ".zip"))
1281 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1282 (home-page "http://net-tools.sourceforge.net/")
1283 (build-system gnu-build-system)
1285 '(#:modules ((guix build gnu-build-system)
1290 (modify-phases %standard-phases
1292 (lambda* (#:key outputs #:allow-other-keys)
1293 (let ((out (assoc-ref outputs "out")))
1294 (mkdir-p (string-append out "/bin"))
1295 (mkdir-p (string-append out "/sbin"))
1297 ;; Pretend we have everything...
1298 (system "yes | make config")
1300 ;; ... except for the things we don't have.
1301 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1302 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1303 ;; that have been removed.
1304 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1305 ;; think about adding them later.
1306 (substitute* '("config.make" "config.h")
1307 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1309 (add-after 'install 'remove-redundant-commands
1310 (lambda* (#:key outputs #:allow-other-keys)
1311 ;; Remove commands and man pages redundant with Inetutils.
1312 (let* ((out (assoc-ref outputs "out"))
1313 (dup (append-map (cut find-files out <>)
1315 "^(yp|nis|dns)?domainname"))))
1316 (for-each delete-file dup)
1318 ;; Binaries that depend on libnet-tools.a don't declare that
1319 ;; dependency, making it parallel-unsafe.
1320 #:parallel-build? #f
1322 #:tests? #f ; no test suite
1323 #:make-flags (let ((out (assoc-ref %outputs "out")))
1325 (string-append "BASEDIR=" out)
1326 (string-append "INSTALLNLSDIR=" out "/share/locale")
1327 (string-append "mandir=/share/man")))))
1328 (native-inputs `(("gettext" ,gettext-minimal)
1330 (synopsis "Tools for controlling the network subsystem in Linux")
1332 "This package includes the important tools for controlling the network
1333 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1334 route. Additionally, this package contains utilities relating to particular
1335 network hardware types (plipconfig, slattach) and advanced aspects of IP
1336 configuration (iptunnel, ipmaddr).")
1337 (license license:gpl2+))))
1339 (define-public libcap
1346 "mirror://kernel.org/linux/libs/security/linux-privs/"
1347 "libcap2/libcap-" version ".tar.xz"))
1350 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1351 (build-system gnu-build-system)
1352 (arguments '(#:phases
1353 (modify-phases %standard-phases
1355 ;; Add $libdir to the RUNPATH of executables.
1357 (substitute* "Make.Rules"
1359 (string-append "LDFLAGS := -Wl,-rpath="
1360 %output "/lib"))))))
1361 #:tests? #f ; no 'check' target
1362 #:make-flags (list "lib=lib"
1363 (string-append "prefix="
1364 (assoc-ref %outputs "out"))
1365 "RAISE_SETFCAP=no")))
1366 (native-inputs `(("perl" ,perl)))
1367 (inputs `(("attr" ,attr)))
1368 (home-page "https://sites.google.com/site/fullycapable/")
1369 (synopsis "Library for working with POSIX capabilities")
1371 "Libcap2 provides a programming interface to POSIX capabilities on
1372 Linux-based operating systems.")
1374 ;; License is BSD-3 or GPLv2, at the user's choice.
1375 (license license:gpl2)))
1377 (define-public bridge-utils
1379 (name "bridge-utils")
1383 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1384 "bridge-utils-" version ".tar.gz"))
1387 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1388 (build-system gnu-build-system)
1390 ;; The tarball lacks all the generated files.
1391 (native-inputs `(("autoconf" ,autoconf)
1392 ("automake" ,automake)))
1395 (modify-phases %standard-phases
1396 (add-after 'unpack 'bootstrap
1398 ;; Fix "field ‘ip6’ has incomplete type" errors.
1399 (substitute* "libbridge/libbridge.h"
1400 (("#include <linux/if_bridge.h>")
1401 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1403 ;; Ensure that the entire build fails if one of the
1404 ;; sub-Makefiles fails.
1405 (substitute* "Makefile.in"
1406 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1407 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1409 (zero? (system* "autoreconf" "-vf")))))
1410 #:tests? #f)) ; no 'check' target
1413 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1414 (synopsis "Manipulate Ethernet bridges")
1416 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1417 to connect two Ethernet segments together in a protocol independent way.
1418 Packets are forwarded based on Ethernet address, rather than IP address (like
1419 a router). Since forwarding is done at Layer 2, all protocols can go
1420 transparently through a bridge.")
1421 (license license:gpl2+)))
1423 (define-public libnl
1430 "https://github.com/thom311/libnl/releases/download/"
1431 "libnl" (string-join (string-split version #\.) "_")
1432 "/libnl-" version ".tar.gz"))
1435 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
1436 (build-system gnu-build-system)
1440 ("pkg-config" ,pkg-config)
1446 "https://github.com/thom311/libnl/releases/download/libnl"
1447 (string-join (string-split version #\.) "_")
1448 "/libnl-doc-" version ".tar.gz"))
1450 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
1452 `(("python-2" ,python-2)
1453 ("python-3" ,python-3)))
1454 (outputs '("out" "doc" "python2" "python3"))
1456 `(#:modules ((guix build gnu-build-system)
1460 (modify-phases %standard-phases
1461 (add-after 'install 'install-python
1462 (lambda* (#:key outputs #:allow-other-keys)
1463 (define (python-inst python)
1464 (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
1465 (assoc-ref %outputs "out")))
1466 (pyout (assoc-ref %outputs python)))
1468 (zero? (system (format #f "~a ~a setup.py build"
1469 ldflags python pyout)))
1471 (system (format #f "~a ~a setup.py install --prefix=~a"
1472 ldflags python pyout)))
1473 (zero? (system* python "setup.py" "clean")))))
1474 (with-directory-excursion "./python"
1475 (every python-inst '("python2" "python3")))))
1476 (add-after 'install 'install-doc
1477 (lambda* (#:key inputs outputs #:allow-other-keys)
1478 (let ((dest (string-append (assoc-ref outputs "doc")
1479 "/share/doc/libnl")))
1481 (zero? (system* "tar" "xf" (assoc-ref inputs "libnl3-doc")
1482 "--strip-components=1" "-C" dest))))))))
1483 (home-page "https://www.infradead.org/~tgr/libnl/")
1484 (synopsis "NetLink protocol library suite")
1486 "The libnl suite is a collection of libraries providing APIs to netlink
1487 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1488 between the kernel and user space processes. It was designed to be a more
1489 flexible successor to ioctl to provide mainly networking related kernel
1490 configuration and monitoring interfaces.")
1492 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1493 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1494 (license license:gpl2)))
1503 "mirror://kernel.org/software/network/iw/iw-"
1507 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
1508 (build-system gnu-build-system)
1509 (native-inputs `(("pkg-config" ,pkg-config)))
1510 (inputs `(("libnl" ,libnl)))
1512 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1514 #:phases (modify-phases %standard-phases (delete 'configure))))
1515 (home-page "https://wireless.wiki.kernel.org/")
1516 (synopsis "Tool for configuring wireless devices")
1518 "iw is a new nl80211 based CLI configuration utility for wireless
1519 devices. It replaces @code{iwconfig}, which is deprecated.")
1520 (license license:isc)))
1522 (define-public powertop
1530 "https://01.org/sites/default/files/downloads/powertop/powertop-v"
1534 "0l4jjlf05li2mc6g8nrss3h435wjhmnqd8m7v3kha3x0x7cbfzxa"))))
1535 (build-system gnu-build-system)
1538 (modify-phases %standard-phases
1539 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1540 ;; allow calibrating the network interface in GuixSD.
1541 (add-after 'unpack 'patch-absolute-file-names
1542 (lambda* (#:key inputs #:allow-other-keys)
1543 (let ((kmod (assoc-ref inputs "kmod")))
1544 (substitute* (find-files "src" "\\.cpp$")
1545 ;; Give the right 'modprobe' file name so that essential
1546 ;; modules such as msr.ko can be loaded.
1547 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1548 ;; These programs are only needed to calibrate, so using
1549 ;; relative file names avoids adding extra inputs. When they
1550 ;; are missing powertop gracefully handles it.
1551 (("/usr/bin/hcitool") "hcitool")
1552 (("/usr/bin/xset") "xset")
1553 (("/usr/sbin/hciconfig") "hciconfig"))
1558 ("ncurses" ,ncurses)
1559 ("pciutils" ,pciutils)
1562 `(("pkg-config" ,pkg-config)))
1563 (home-page "https://01.org/powertop/")
1564 (synopsis "Analyze power consumption on Intel-based laptops")
1566 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1567 power management. In addition to being a diagnostic tool, PowerTOP also has
1568 an interactive mode where the user can experiment various power management
1569 settings for cases where the operating system has not enabled these
1571 (license license:gpl2)))
1573 (define-public aumix
1580 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1581 version ".tar.bz2"))
1584 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1585 (build-system gnu-build-system)
1586 (inputs `(("ncurses" ,ncurses)))
1587 (home-page "http://www.jpj.net/~trevor/aumix.html")
1588 (synopsis "Audio mixer for X and the console")
1590 "Aumix adjusts an audio mixer from X, the console, a terminal,
1591 the command line or a script.")
1592 (license license:gpl2+)))
1594 (define-public iotop
1601 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1604 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1605 (build-system python-build-system)
1607 ;; The setup.py script expects python-2.
1608 `(#:python ,python-2
1609 ;; There are currently no checks in the package.
1611 (native-inputs `(("python" ,python-2)))
1612 (home-page "http://guichaz.free.fr/iotop/")
1614 "Displays the IO activity of running processes")
1616 "Iotop is a Python program with a top like user interface to show the
1617 processes currently causing I/O.")
1618 (license license:gpl2+)))
1626 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1627 "download/fuse-" version
1628 "/fuse-" version ".tar.gz"))
1631 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1632 (patches (search-patches "fuse-overlapping-headers.patch"))))
1633 (build-system gnu-build-system)
1634 (inputs `(("util-linux" ,util-linux)))
1636 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1637 (assoc-ref %outputs "out")
1639 (string-append "INIT_D_PATH="
1640 (assoc-ref %outputs "out")
1643 ;; The rule makes /dev/fuse 666.
1644 (string-append "UDEV_RULES_PATH="
1645 (assoc-ref %outputs "out")
1646 "/lib/udev/rules.d"))
1648 (modify-phases %standard-phases
1649 (add-before 'build 'set-file-names
1650 (lambda* (#:key inputs #:allow-other-keys)
1651 ;; libfuse calls out to mount(8) and umount(8). Make sure
1652 ;; it refers to the right ones.
1653 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1654 (("/bin/(u?)mount" _ maybe-u)
1655 (string-append (assoc-ref inputs "util-linux")
1656 "/bin/" maybe-u "mount")))
1657 (substitute* '("util/mount.fuse.c")
1661 ;; This hack leads libfuse to search for 'fusermount' in
1662 ;; $PATH, where it may find a setuid-root binary, instead of
1663 ;; trying solely $out/sbin/fusermount and failing because
1665 (substitute* "lib/Makefile"
1666 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1667 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
1669 (home-page "https://github.com/libfuse/libfuse")
1670 (synopsis "Support file systems implemented in user space")
1672 "As a consequence of its monolithic design, file system code for Linux
1673 normally goes into the kernel itself---which is not only a robustness issue,
1674 but also an impediment to system extensibility. FUSE, for \"file systems in
1675 user space\", is a kernel module and user-space library that tries to address
1676 part of this problem by allowing users to run file system implementations as
1677 user-space processes.")
1678 (license (list license:lgpl2.1 ;library
1679 license:gpl2+)))) ;command-line utilities
1681 (define-public unionfs-fuse
1683 (name "unionfs-fuse")
1688 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1690 (file-name (string-append name "-" version ".tar.gz"))
1693 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1694 (build-system cmake-build-system)
1696 `(("python" ,python)))
1697 (inputs `(("fuse" ,fuse)))
1699 ;; The tests were never actually run ("collected 0 items"), but in recent
1700 ;; versions of pytest that causes an error.
1702 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1703 (synopsis "User-space union file system")
1705 "UnionFS-FUSE is a flexible union file system implementation in user
1706 space, using the FUSE library. Mounting a union file system allows you to
1707 \"aggregate\" the contents of several directories into a single mount point.
1708 UnionFS-FUSE additionally supports copy-on-write.")
1709 (license license:bsd-3)))
1712 (package (inherit fuse)
1713 (name "fuse-static")
1714 (source (origin (inherit (package-source fuse))
1715 (modules '((guix build utils)))
1717 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1718 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1719 ;; it doesn't do that, allowing us to remove the dependency on
1720 ;; util-linux (something that is useful in initrds.)
1721 '(substitute* '("lib/mount_util.c"
1722 "util/mount_util.c")
1723 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1728 (define-public unionfs-fuse/static
1729 (package (inherit unionfs-fuse)
1730 (synopsis "User-space union file system (statically linked)")
1731 (name (string-append (package-name unionfs-fuse) "-static"))
1732 (source (origin (inherit (package-source unionfs-fuse))
1733 (modules '((guix build utils)))
1735 ;; Add -ldl to the libraries, because libfuse.a needs that.
1736 '(substitute* "src/CMakeLists.txt"
1737 (("target_link_libraries(.*)\\)" _ libs)
1738 (string-append "target_link_libraries"
1742 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1744 (modify-phases %standard-phases
1745 (add-after 'install 'post-install
1746 (lambda* (#:key outputs #:allow-other-keys)
1747 (let* ((out (assoc-ref outputs "out"))
1748 (exe (string-append out "/bin/unionfs")))
1749 ;; By default, 'unionfs' keeps references to
1750 ;; $glibc/share/locale and similar stuff. Remove them.
1751 (remove-store-references exe)
1753 ;; 'unionfsctl' has references to glibc as well. Since
1754 ;; we don't need it, remove it.
1755 (delete-file (string-append out "/bin/unionfsctl"))
1757 (inputs `(("fuse" ,fuse-static)))))
1759 (define-public sshfs-fuse
1765 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1766 "download/sshfs-" version "/sshfs-" version
1770 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
1771 (build-system gnu-build-system)
1776 `(("pkg-config" ,pkg-config)))
1777 (home-page "https://github.com/libfuse/sshfs")
1778 (synopsis "Mount remote file systems over SSH")
1780 "This is a file system client based on the SSH File Transfer Protocol.
1781 Since most SSH servers already support this protocol it is very easy to set
1782 up: on the server side there's nothing to do; on the client side mounting the
1783 file system is as easy as logging into the server with an SSH client.")
1784 (license license:gpl2+)))
1786 (define-public archivemount
1788 (name "archivemount")
1793 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1794 "archivemount-" version ".tar.gz"))
1797 "0v4si1ri6lhnq9q87gkx7fsh6lv6xz4bynknwndqncpvfp5cy1jg"))))
1798 (build-system gnu-build-system)
1799 (inputs `(("fuse" ,fuse)
1800 ("libarchive" ,libarchive)))
1801 (native-inputs `(("pkg-config" ,pkg-config)))
1802 (home-page "http://www.cybernoia.de/software/archivemount")
1803 (synopsis "Tool for mounting archive files with FUSE")
1804 (description "archivemount is a FUSE-based file system for Unix variants,
1805 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1806 mount point where it can be read from or written to as with any other file
1807 system. This makes accessing the contents of the archive, which may be
1808 compressed, transparent to other programs, without decompressing them.")
1809 (license license:lgpl2.0+)))
1811 (define-public numactl
1818 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1823 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1824 (build-system gnu-build-system)
1826 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1827 ;; to run, which we can't assume to have.
1830 ;; NUMA is apparently not supported on armhf, see
1831 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1832 (supported-systems (delete "armhf-linux" %supported-systems))
1833 (home-page "http://oss.sgi.com/projects/libnuma/")
1834 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1836 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1837 memory is not all in one place. The numactl program allows you to run your
1838 application program on specific CPU's and memory nodes. It does this by
1839 supplying a NUMA memory policy to the operating system before running your
1842 The package contains other commands, such as numademo, numastat and memhog.
1843 The numademo command provides a quick overview of NUMA performance on your
1845 (license (list license:gpl2 ;programs
1846 license:lgpl2.1)))) ;library
1848 (define-public kbd-neo
1855 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1856 version "/linux/console/neo.map"))
1857 (file-name (string-append name "-" version ".map"))
1860 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1861 (build-system trivial-build-system)
1863 `(#:modules ((guix build utils))
1865 (use-modules (guix build utils))
1866 (let ((out (string-append %output "/share/keymaps"))
1867 (source (assoc-ref %build-inputs "source")))
1869 (copy-file source (string-append out "/neo.map"))
1871 (home-page "https://neo-layout.org")
1872 (synopsis "Neo2 console layout")
1874 "Kbd-neo provides the Neo2 keyboard layout for use with
1875 @command{loadkeys(1)} from @code{kbd(4)}.")
1876 ;; The file is located in an svn directory, the entire content of
1877 ;; the directory is licensed as GPL3.
1878 (license license:gpl3+)))
1886 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1890 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1891 (modules '((guix build utils)))
1894 (substitute* "tests/Makefile.in"
1895 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1898 (substitute* '("src/unicode_start" "src/unicode_stop")
1899 ;; Assume the Coreutils are in $PATH.
1902 (build-system gnu-build-system)
1905 (modify-phases %standard-phases
1906 (add-before 'build 'pre-build
1907 (lambda* (#:key inputs #:allow-other-keys)
1908 (let ((gzip (assoc-ref %build-inputs "gzip"))
1909 (bzip2 (assoc-ref %build-inputs "bzip2")))
1910 (substitute* "src/libkeymap/findfile.c"
1912 (string-append gzip "/bin/gzip"))
1914 (string-append bzip2 "/bin/bzip2"))))))
1915 (add-after 'install 'post-install
1916 (lambda* (#:key outputs #:allow-other-keys)
1917 ;; Make sure these programs find their comrades.
1918 (let* ((out (assoc-ref outputs "out"))
1919 (bin (string-append out "/bin")))
1920 (for-each (lambda (prog)
1921 (wrap-program (string-append bin "/" prog)
1922 `("PATH" ":" prefix (,bin))))
1923 '("unicode_start" "unicode_stop"))))))))
1924 (inputs `(("check" ,check)
1927 ("pam" ,linux-pam)))
1928 (native-search-paths
1929 (list (search-path-specification
1930 (variable "LOADKEYS_KEYMAP_PATH")
1931 ;; Append ‘/**’ to recursively search all directories. One can then
1932 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
1933 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
1934 (files (list "share/keymaps/**")))))
1935 (native-inputs `(("pkg-config" ,pkg-config)))
1936 (home-page "http://kbd-project.org/")
1937 (synopsis "Linux keyboard utilities and keyboard maps")
1939 "This package contains keytable files and keyboard utilities compatible
1940 for systems using the Linux kernel. This includes commands such as
1941 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1942 (license license:gpl2+)))
1944 (define-public inotify-tools
1946 (name "inotify-tools")
1951 "https://github.com/rvoicilas/inotify-tools/archive/"
1953 (file-name (string-append name "-" version ".tar.gz"))
1956 "1b22c8x4pjnz3abx4dikpbj43zprjw79pdkd4xw111dsxlfwqcx4"))))
1957 (build-system gnu-build-system)
1959 `(#:phases (modify-phases %standard-phases
1960 (add-after 'unpack 'bootstrap
1962 (invoke "autoreconf" "-vif"))))))
1964 `(("autoconf" ,autoconf)
1965 ("automake" ,automake)
1966 ("libtool" ,libtool)))
1967 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
1968 (synopsis "Monitor file accesses")
1970 "The inotify-tools packages provides a C library and command-line tools
1971 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1972 (license license:gpl2+)))
1981 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1982 "kmod-" version ".tar.xz"))
1985 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
1986 (patches (search-patches "kmod-module-directory.patch"))))
1987 (build-system gnu-build-system)
1989 `(("pkg-config" ,pkg-config)))
1994 `(#:tests? #f ; FIXME: Investigate test failures
1995 #:configure-flags '("--with-xz" "--with-zlib")
1996 #:phases (alist-cons-after
1997 'install 'install-modprobe&co
1998 (lambda* (#:key outputs #:allow-other-keys)
1999 (let* ((out (assoc-ref outputs "out"))
2000 (bin (string-append out "/bin")))
2001 (for-each (lambda (tool)
2003 (string-append bin "/" tool)))
2004 '("insmod" "rmmod" "lsmod" "modprobe"
2005 "modinfo" "depmod"))))
2007 (home-page "https://www.kernel.org/")
2008 (synopsis "Kernel module tools")
2009 (description "Kmod is a set of tools to handle common tasks with Linux
2010 kernel modules like insert, remove, list, check properties, resolve
2011 dependencies and aliases.
2013 These tools are designed on top of libkmod, a library that is shipped with
2014 kmod. The aim is to be compatible with tools, configurations and indices
2015 from the module-init-tools project.")
2016 (license license:gpl2+))) ; library under lgpl2.1+
2018 (define-public eudev
2019 ;; The post-systemd fork, maintained by Gentoo.
2025 (uri (string-append "https://github.com/gentoo/eudev/archive/v"
2027 (file-name (string-append name "-" version ".tar.gz"))
2030 "0dlkcgy7j4fdcksqrpc373zfybiif1bal3n6lpy1kfc5280j02c7"))
2031 (patches (search-patches "eudev-rules-directory.patch"))))
2032 (build-system gnu-build-system)
2035 (modify-phases %standard-phases
2036 (add-before 'configure 'bootstrap
2037 (lambda* (#:key inputs #:allow-other-keys)
2038 (substitute* "man/make.sh"
2039 (("/usr/bin/xsltproc")
2040 (string-append (assoc-ref inputs "xsltproc")
2042 ;; Manual pages are regenerated here.
2043 (zero? (system* "./autogen.sh"))))
2044 (add-after 'install 'build-hwdb
2045 (lambda* (#:key outputs #:allow-other-keys)
2046 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2047 ;; similar tools to display product names.
2048 (let ((out (assoc-ref outputs "out")))
2049 (zero? (system* (string-append out "/bin/udevadm")
2050 "hwdb" "--update"))))))
2051 #:configure-flags (list "--enable-manpages")))
2053 `(("autoconf" ,autoconf)
2054 ("automake" ,automake)
2056 ("libtool" ,libtool)
2057 ("pkg-config" ,pkg-config)
2060 ("python" ,python-wrapper)
2061 ;; For documentation.
2062 ("docbook-xml" ,docbook-xml-4.2)
2063 ("docbook-xsl" ,docbook-xsl)
2064 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2065 ("xsltproc" ,libxslt)))
2067 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2068 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2069 ;; which contains the rules to do that.
2070 `(("util-linux" ,util-linux) ;for blkid
2072 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2073 (synopsis "Userspace device management")
2074 (description "Udev is a daemon which dynamically creates and removes
2075 device nodes from /dev/, handles hotplug events and loads drivers at boot
2077 (license license:gpl2+)))
2079 (define-public eudev-with-hwdb
2080 (deprecated-package "eudev-with-hwdb" eudev))
2085 (version "2.02.177")
2088 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2092 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2093 (modules '((guix build utils)))
2096 (use-modules (guix build utils))
2098 ;; Honor sysconfdir.
2099 (substitute* "make.tmpl.in"
2101 "confdir = @sysconfdir@\n")
2102 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2103 "DEFAULT_SYS_DIR = @sysconfdir@"))))
2104 (patches (search-patches "lvm2-static-link.patch"))))
2105 (build-system gnu-build-system)
2107 `(("pkg-config" ,pkg-config)
2108 ("procps" ,procps))) ;tests use 'pgrep'
2113 (modify-phases %standard-phases
2114 (add-after 'configure 'set-makefile-shell
2116 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2118 (setenv "SHELL" (which "sh"))
2120 ;; Replace /bin/sh with the right file name.
2121 (patch-makefile-SHELL "make.tmpl")
2124 #:configure-flags (list (string-append "--sysconfdir="
2125 (assoc-ref %outputs "out")
2127 "--enable-udev_sync"
2128 "--enable-udev_rules"
2129 "--enable-pkgconfig"
2131 ;; Make sure programs such as 'dmsetup' can
2132 ;; find libdevmapper.so.
2133 (string-append "LDFLAGS=-Wl,-rpath="
2134 (assoc-ref %outputs "out")
2137 ;; The tests use 'mknod', which requires root access.
2139 (home-page "https://sourceware.org/lvm2/")
2140 (synopsis "Logical volume management for Linux")
2142 "LVM2 is the logical volume management tool set for Linux-based systems.
2143 This package includes the user-space libraries and tools, including the device
2144 mapper. Kernel components are part of Linux-libre.")
2146 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2147 ;; Command-line tools are GPLv2.
2148 (license (list license:gpl2 license:lgpl2.1))))
2150 (define-public lvm2-static
2153 (name "lvm2-static")
2155 ;; Propagate udev because libdevmapper.a depends on libudev.
2156 (inputs (alist-delete "udev" (package-inputs lvm2)))
2157 (propagated-inputs `(("udev" ,eudev)))
2160 (substitute-keyword-arguments (package-arguments lvm2)
2161 ((#:configure-flags flags '())
2162 ;; LVM2 doesn't use Libtool, hence the custom option.
2163 `(cons "--enable-static_link" ,flags))))
2164 (synopsis "Logical volume management for Linux (statically linked)")))
2166 (define-public wireless-tools
2168 (name "wireless-tools")
2172 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2176 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2179 ;; Remove the older header files that are not free software.
2180 (for-each (lambda (n)
2181 (delete-file (format #f "wireless.~a.h" n)))
2182 '(10 11 12 13 14 15 16 17 18 19 20))
2184 (build-system gnu-build-system)
2187 (list (string-append "PREFIX=" %output)
2188 (string-append "INSTALL_MAN=" %output "/share/man")
2189 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2191 #:phases (modify-phases %standard-phases
2192 (delete 'configure))
2194 (synopsis "Tools for manipulating Linux Wireless Extensions")
2195 (description "Wireless Tools are used to manipulate the now-deprecated
2196 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2197 Extension was an interface allowing you to set Wireless LAN specific
2198 parameters and get the specific stats. It is deprecated in favor the nl80211
2200 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2201 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2202 ;; other files are distributed under gpl2.
2203 (license (list license:gpl2 license:lgpl2.1+))))
2211 (uri (string-append "mirror://kernel.org/software/network/crda/"
2212 "crda-" version ".tar.xz"))
2215 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2216 (patches (search-patches "crda-optional-gcrypt.patch"))))
2217 (build-system gnu-build-system)
2219 '(#:phases (modify-phases %standard-phases
2222 'build 'no-werror-no-ldconfig
2224 (substitute* "Makefile"
2226 (("ldconfig") "true"))
2229 'build 'set-regulator-db-file-name
2230 (lambda* (#:key inputs #:allow-other-keys)
2231 ;; Tell CRDA where to find our database.
2232 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2233 (substitute* "crda.c"
2234 (("\"/lib/crda/regulatory.bin\"")
2235 (string-append "\"" regdb
2236 "/lib/crda/regulatory.bin\"")))
2238 #:test-target "verify"
2239 #:make-flags (let ((out (assoc-ref %outputs "out"))
2240 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2241 (list "CC=gcc" "V=1"
2243 ;; Disable signature-checking on 'regulatory.bin'.
2244 ;; The reason is that this simplifies maintenance
2245 ;; on our side (no need to manage a distro key
2246 ;; pair), and we can guarantee integrity of
2247 ;; 'regulatory.bin' by other means anyway, such as
2248 ;; 'guix gc --verify'. See
2249 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2253 (string-append "PREFIX=" out)
2254 (string-append "SBINDIR=" out "/sbin/")
2255 (string-append "UDEV_RULE_DIR="
2256 out "/lib/udev/rules.d")
2257 (string-append "LDFLAGS=-Wl,-rpath="
2259 (string-append "REG_BIN=" regdb
2260 "/lib/crda/regulatory.bin")))))
2261 (native-inputs `(("pkg-config" ,pkg-config)
2262 ("python" ,python-2)
2263 ("wireless-regdb" ,wireless-regdb)))
2264 (inputs `(("libnl" ,libnl)))
2266 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2267 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2269 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2270 communication between the kernel Linux and user space for regulatory
2272 (license license:copyleft-next)))
2274 (define-public wireless-regdb
2276 (name "wireless-regdb")
2277 (version "2017.03.07")
2281 "mirror://kernel.org/software/network/wireless-regdb/"
2282 "wireless-regdb-" version ".tar.xz"))
2285 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2287 ;; We're building 'regulatory.bin' by ourselves.
2288 (snippet '(delete-file "regulatory.bin"))))
2289 (build-system gnu-build-system)
2291 '(#:phases (modify-phases %standard-phases
2292 (delete 'configure))
2294 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2295 ;; is computed and can be equal to 'maintainer-clean'; when that
2296 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2297 ;; just built. Thus, build things sequentially.
2298 #:parallel-build? #f
2300 #:tests? #f ;no tests
2301 #:make-flags (let ((out (assoc-ref %outputs "out")))
2302 (list (string-append "PREFIX=" out)
2303 (string-append "LSB_ID=GuixSD")
2304 (string-append "DISTRO_PUBKEY=/dev/null")
2305 (string-append "DISTRO_PRIVKEY=/dev/null")
2306 (string-append "REGDB_PUBKEY=/dev/null")
2308 ;; Leave that empty so that db2bin.py doesn't try
2309 ;; to sign 'regulatory.bin'. This allows us to
2310 ;; avoid managing a key pair for the whole distro.
2311 (string-append "REGDB_PRIVKEY=")))))
2312 (native-inputs `(("python" ,python-2)))
2314 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2315 (synopsis "Wireless regulatory database")
2317 "This package contains the wireless regulatory database Central
2318 Regulatory Database Agent (CRDA) daemon. The database contains information on
2319 country-specific regulations for the wireless spectrum.")
2320 (license license:isc)))
2322 (define-public lm-sensors
2328 (uri (list (string-append
2329 "https://github.com/groeck/lm-sensors/archive/V"
2330 (string-join (string-split version #\.) "-")
2332 (file-name (string-append name "-" version ".tar.gz"))
2335 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2336 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2337 (build-system gnu-build-system)
2338 (inputs `(("rrdtool" ,rrdtool)
2341 ("gnuplot" ,gnuplot)))
2342 (native-inputs `(("pkg-config" ,pkg-config)
2346 (outputs '("lib" ;avoid perl in closure
2349 `(#:tests? #f ; no 'check' target
2350 #:make-flags (list (string-append "PREFIX=" %output)
2351 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2352 (string-append "INCLUDEDIR="
2353 (assoc-ref %outputs "lib") "/include")
2354 (string-append "MANDIR=" %output "/share/man")
2355 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2357 (modify-phases %standard-phases
2359 (add-before 'build 'patch-exec-paths
2360 (lambda* (#:key inputs outputs #:allow-other-keys)
2361 (substitute* "prog/detect/sensors-detect"
2363 (string-append "`" (assoc-ref inputs "coreutils")
2365 (("(`|\")modprobe" all open-quote)
2366 (string-append open-quote
2367 (assoc-ref inputs "kmod")
2369 (substitute* '("prog/pwm/pwmconfig"
2370 "prog/pwm/fancontrol")
2372 (string-append (assoc-ref inputs "gnuplot")
2375 (string-append (assoc-ref inputs "coreutils")
2378 (string-append (assoc-ref inputs "grep")
2381 (string-append (assoc-ref inputs "sed")
2384 (string-append (assoc-ref inputs "coreutils")
2387 (string-append (assoc-ref inputs "coreutils")
2390 (string-append (assoc-ref inputs "coreutils")
2391 "/bin/readlink -f")))
2393 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2394 (synopsis "Utilities to read temperature/voltage/fan sensors")
2396 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2397 you to access information from temperature, voltage, and fan speed sensors.
2398 It works with most newer systems.")
2399 (license license:gpl2+)))
2401 (define-public iucode-tool
2403 (name "iucode-tool")
2407 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2408 "/raw/latest/iucode-tool_" version ".tar.xz"))
2411 "0w99k1aq1xw148ffk1xykqf60rdbphb1jknw98jcmadq4pwxl44q"))))
2412 (build-system gnu-build-system)
2413 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2414 (synopsis "Manipulate Intel microcode bundles")
2416 "@command{iucode_tool} is a utility to work with microcode packages for
2417 Intel processors. It can convert between formats, extract specific versions,
2418 create a firmware image suitable for the Linux kernel, and more.")
2419 ;; cpuid.h is available for i686, x86_64, and ia64.
2420 (supported-systems '("i686-linux" "x86_64-linux"))
2421 (license license:gpl2+)))
2423 (define-public i2c-tools
2430 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2431 version ".tar.bz2"))
2434 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2435 (build-system gnu-build-system)
2437 `(#:tests? #f ; no 'check' target
2438 #:make-flags (list (string-append "prefix=" %output)
2440 ;; no configure script
2441 #:phases (modify-phases %standard-phases (delete 'configure))))
2444 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2445 (synopsis "I2C tools for Linux")
2447 "The i2c-tools package contains a heterogeneous set of I2C tools for
2448 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2449 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2451 (license license:gpl2+)))
2453 (define-public xsensors
2460 "http://www.linuxhardware.org/xsensors/xsensors-"
2464 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2465 (build-system gnu-build-system)
2466 (inputs `(("lm-sensors" ,lm-sensors "lib")
2468 (native-inputs `(("pkg-config" ,pkg-config)))
2471 (modify-phases %standard-phases
2472 (add-before 'configure 'enable-deprecated
2474 (substitute* "src/Makefile.in"
2475 (("-DGDK_DISABLE_DEPRECATED") "")
2476 (("-DGTK_DISABLE_DEPRECATED") ""))
2478 (add-before 'configure 'remove-Werror
2480 (substitute* '("configure" "src/Makefile.in")
2483 (home-page "http://www.linuxhardware.org/xsensors/")
2484 (synopsis "Hardware health information viewer")
2486 "Xsensors reads data from the libsensors library regarding hardware
2487 health such as temperature, voltage and fan speed and displays the information
2488 in a digital read-out.")
2489 (license license:gpl2+)))
2494 (version (package-version linux-libre))
2495 (source (package-source linux-libre))
2496 (build-system gnu-build-system)
2499 (modify-phases %standard-phases
2501 (lambda* (#:key inputs #:allow-other-keys)
2502 (setenv "SHELL_PATH" (which "bash"))
2503 (chdir "tools/perf")
2505 #:make-flags (list (string-append "prefix="
2506 (assoc-ref %outputs "out"))
2509 ;; By default, 'config/Makefile' uses lib64 on
2510 ;; x86_64. Work around that.
2512 #:tests? #f)) ;no tests
2514 `(("pkg-config" ,pkg-config)
2518 ;; There are build scripts written in these languages.
2520 ("python" ,python-2)))
2522 `(("slang" ,slang) ;for the interactive TUI
2524 ("python" ,python-2) ;'perf' links against libpython
2525 ("elfutils" ,elfutils)
2526 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2527 ("libunwind" ,libunwind) ;better stack walking
2528 ("numactl" ,numactl) ;for 'perf bench numa mem'
2531 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2532 ("docbook-xsl" ,docbook-xsl)
2534 ("asciidoc" ,asciidoc)))
2535 (home-page "https://perf.wiki.kernel.org/")
2536 (synopsis "Linux profiling with performance counters")
2538 "perf is a tool suite for profiling using hardware performance counters,
2539 with support in the Linux kernel. perf can instrument CPU performance
2540 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2541 of lightweight profiling. This package contains the user-land tools and in
2542 particular the 'perf' command.")
2543 (license (package-license linux-libre))))
2545 (define-public pflask
2551 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2553 (file-name (string-append name "-" version ".tar.gz"))
2556 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2557 (build-system cmake-build-system)
2559 '(#:tests? #f)) ; no tests
2560 (home-page "https://ghedo.github.io/pflask/")
2561 (synopsis "Simple tool for creating Linux namespace containers")
2562 (description "pflask is a simple tool for creating Linux namespace
2563 containers. It can be used for running a command or even booting an OS inside
2564 an isolated container, created with the help of Linux namespaces. It is
2565 similar in functionality to chroot, although pflask provides better isolation
2566 thanks to the use of namespaces.")
2567 (license license:bsd-2)))
2569 (define-public hdparm
2575 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2576 name "-" version ".tar.gz"))
2579 "1ivdvrzimaayiq03by8mcq0mhmdljndj06h012zkdpw34irnpixm"))))
2580 (build-system gnu-build-system)
2582 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2583 (list (string-append "binprefix=" out)
2584 (string-append "manprefix=" out)
2587 (modify-phases %standard-phases
2588 (delete 'configure)) ; no configure script
2589 #:tests? #f)) ; no test suite
2590 (home-page "https://sourceforge.net/projects/hdparm/")
2591 (synopsis "View and tune ATA disk drive parameters")
2593 "@command{hdparm} is a command-line utility to control ATA controllers and
2594 disk drives. It can increase performance and/or reliability by careful tuning
2595 of hardware settings like power and acoustic management, DMA modes, and caching.
2596 It can also display detailed device information, or be used as a simple
2597 performance benchmarking tool.
2599 @command{hdparm} provides a command line interface to various Linux kernel
2600 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2601 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2602 Translation (@dfn{SAT}) are also supported.")
2603 (license (license:non-copyleft "file://LICENSE.TXT"))))
2605 (define-public rfkill
2611 (uri (string-append "mirror://kernel.org/software/network/"
2612 name "/" name "-" version ".tar.xz"))
2615 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2616 (build-system gnu-build-system)
2618 `(#:make-flags (list "CC=gcc"
2619 (string-append "PREFIX=" %output))
2620 #:phases (modify-phases %standard-phases
2621 (delete 'configure))
2623 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2624 (synopsis "Tool for enabling and disabling wireless devices")
2626 "rfkill is a simple tool for accessing the rfkill device interface,
2627 which is used to enable and disable wireless networking devices, typically
2628 WLAN, Bluetooth and mobile broadband.")
2629 (license (license:non-copyleft "file://COPYING"
2630 "See COPYING in the distribution."))
2631 ;; rfkill is part of util-linux as of 2.31.
2632 (properties `((superseded . ,util-linux)))))
2640 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2641 version "/" name "-" version ".tar.gz"))
2644 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2645 (build-system gnu-build-system)
2646 (home-page "http://acpiclient.sourceforge.net")
2647 (synopsis "Display information on ACPI devices")
2648 (description "@code{acpi} attempts to replicate the functionality of the
2649 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2650 information. It does not support ACPI suspending, only displays information
2651 about ACPI devices.")
2652 (license license:gpl2+)))
2654 (define-public acpid
2660 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2664 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2665 (build-system gnu-build-system)
2666 (home-page "https://sourceforge.net/projects/acpid2/")
2667 (synopsis "Daemon for delivering ACPI events to user-space programs")
2669 "acpid is designed to notify user-space programs of Advanced
2670 Configuration and Power Interface (ACPI) events. acpid should be started
2671 during the system boot, and will run as a background process. When an ACPI
2672 event is received from the kernel, acpid will examine the list of rules
2673 specified in /etc/acpi/events and execute the rules that match the event.")
2674 (license license:gpl2+)))
2676 (define-public sysfsutils
2685 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2688 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2689 (build-system gnu-build-system)
2690 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2691 (synopsis "System utilities based on Linux sysfs")
2693 "These are a set of utilities built upon sysfs, a virtual file system in
2694 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2695 also contains the libsysfs library.")
2696 ;; The library is under lgpl2.1+ (all files say "or any later version").
2697 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2698 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2700 (define-public sysfsutils-1
2702 (inherit sysfsutils)
2709 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2710 "/sysfsutils-" version ".tar.gz"))
2712 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2713 (modules '((guix build utils)))
2716 (substitute* "Makefile.in"
2717 (("includedir = /usr/include/sysfs")
2718 "includedir = @includedir@"))
2719 (substitute* "configure"
2720 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2721 (string-append "includedir='" orig "/sysfs'")))))))
2722 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2724 (define-public cpufrequtils
2726 (name "cpufrequtils")
2733 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2736 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2737 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2738 (build-system gnu-build-system)
2740 `(("sysfsutils" ,sysfsutils-1)))
2742 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2743 (assoc-ref %outputs "out") "/lib"))))
2744 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2745 (synopsis "Utilities to get and set CPU frequency on Linux")
2747 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2748 information, and set the CPU frequency if supported, using the cpufreq
2749 capabilities of the Linux kernel.")
2750 (license license:gpl2)))
2752 (define-public libraw1394
2759 "mirror://kernel.org/linux/libs/ieee1394/"
2760 name "-" version ".tar.xz"))
2763 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2764 (build-system gnu-build-system)
2765 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2766 (synopsis "Interface library for the Linux IEEE1394 drivers")
2768 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2769 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2770 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2771 send to and receive from other nodes without requiring a kernel driver for the
2772 protocol in question.")
2773 (license license:lgpl2.1+)))
2775 (define-public libavc1394
2781 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2782 name "-" version ".tar.gz"))
2785 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2786 (build-system gnu-build-system)
2788 `(("pkg-config" ,pkg-config)))
2790 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2791 (home-page "https://sourceforge.net/projects/libavc1394/")
2792 (synopsis "AV/C protocol library for IEEE 1394")
2794 "Libavc1394 is a programming interface to the AV/C specification from
2795 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2796 (license license:lgpl2.1+)))
2798 (define-public libiec61883
2800 (name "libiec61883")
2805 "mirror://kernel.org/linux/libs/ieee1394/"
2806 name "-" version ".tar.xz"))
2809 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2810 (build-system gnu-build-system)
2812 `(("pkg-config" ,pkg-config)))
2814 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2815 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2816 (synopsis "Isochronous streaming media library for IEEE 1394")
2818 "The libiec61883 library provides a higher level API for streaming DV,
2819 MPEG-2 and audio over Linux IEEE 1394.")
2820 (license license:lgpl2.1+)))
2822 (define-public mdadm
2829 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2833 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2834 (build-system gnu-build-system)
2838 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2842 ;; TODO: tell it where to find 'sendmail'
2843 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2844 (string-append "BINDIR=" out "/sbin")
2845 (string-append "MANDIR=" out "/share/man")
2846 (string-append "UDEVDIR=" out "/lib/udev")))
2848 (modify-phases %standard-phases
2849 (add-before 'build 'patch-program-paths
2850 (lambda* (#:key inputs #:allow-other-keys)
2851 (let ((coreutils (assoc-ref inputs "coreutils")))
2852 (substitute* "udev-md-raid-arrays.rules"
2853 (("/usr/bin/(readlink|basename)" all program)
2854 (string-append coreutils "/bin/" program))))
2856 (add-before 'build 'remove-W-error
2858 ;; We cannot build with -Werror on i686 due to a
2859 ;; 'sign-compare' warning in util.c.
2860 (substitute* "Makefile"
2863 (delete 'configure))
2864 ;;tests must be done as root
2866 (home-page "http://neil.brown.name/blog/mdadm")
2867 (synopsis "Tool for managing Linux Software RAID arrays")
2869 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2870 assemble, report on, and monitor arrays. It can also move spares between raid
2871 arrays when needed.")
2872 (license license:gpl2+)))
2874 (define-public mdadm-static
2877 (name "mdadm-static")
2879 (substitute-keyword-arguments (package-arguments mdadm)
2880 ((#:make-flags flags)
2881 `(cons "LDFLAGS = -static" ,flags))
2883 `(modify-phases ,phases
2884 (add-after 'install 'remove-cruft
2885 (lambda* (#:key outputs #:allow-other-keys)
2886 (let* ((out (assoc-ref outputs "out"))
2887 (precious? (lambda (file)
2888 (member file '("." ".." "sbin"))))
2889 (directories (scandir out (negate precious?))))
2890 (with-directory-excursion out
2891 (for-each delete-file-recursively directories)
2892 (remove-store-references "sbin/mdadm")
2893 (delete-file "sbin/mdmon")
2895 ((#:modules modules %gnu-build-system-modules)
2896 `((ice-9 ftw) ,@modules))
2897 ((#:strip-flags _ '())
2898 ''("--strip-all")) ;strip a few extra KiB
2899 ((#:allowed-references _ '("out"))
2900 '("out")))) ;refer only self
2901 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2903 (define-public multipath-tools
2905 (name "multipath-tools")
2909 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
2910 ".git;a=snapshot;h=" version ";sf=tgz"))
2911 (file-name (string-append name "-" version ".tar.gz"))
2914 "0zkcayi3mmp43ji2zid1gprgsvqhjjapsw7jjd60sf75prf50h2r"))
2915 (modules '((guix build utils)))
2918 ;; Drop bundled valgrind headers.
2919 (delete-file-recursively "third-party")
2920 (substitute* '("multipathd/main.c"
2921 "libmultipath/debug.c")
2922 (("#include \"../third-party/")
2925 (build-system gnu-build-system)
2927 '(#:tests? #f ; No tests.
2928 #:make-flags (list (string-append "DESTDIR="
2929 (assoc-ref %outputs "out"))
2931 (string-append "LDFLAGS=-Wl,-rpath="
2932 (assoc-ref %outputs "out")
2935 (modify-phases %standard-phases
2936 (add-after 'unpack 'patch-source
2937 (lambda* (#:key inputs #:allow-other-keys)
2938 (let ((lvm2 (assoc-ref inputs "lvm2"))
2939 (udev (assoc-ref inputs "udev")))
2940 (substitute* "Makefile.inc"
2941 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2942 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2943 (("/usr/include/libdevmapper.h")
2944 (string-append lvm2 "/include/libdevmapper.h"))
2945 (("/usr/include/libudev.h")
2946 (string-append udev "/include/libudev.h")))
2949 (add-before 'build 'set-CC
2955 ("pkg-config" ,pkg-config)
2956 ("valgrind" ,valgrind)))
2958 `(("ceph:lib" ,ceph "lib")
2961 ("liburcu" ,liburcu)
2963 ("readline" ,readline)
2965 (home-page "http://christophe.varoqui.free.fr/")
2966 (synopsis "Access block devices through multiple paths")
2968 "This package provides the following binaries to drive the
2969 Linux Device Mapper multipathing driver:
2971 @item @command{multipath} - Device mapper target autoconfig.
2972 @item @command{multipathd} - Multipath daemon.
2973 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2974 @code{dm} multipath devices.
2975 @item @command{kpartx} - Create device maps from partition tables.
2977 (license (list license:gpl2+ ; Main distribution.
2978 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2980 (define-public libaio
2987 (string-append "mirror://debian/pool/main/liba/libaio/"
2988 name "_" version ".orig.tar.gz")))
2991 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2992 (build-system gnu-build-system)
2995 (list "CC=gcc" (string-append "prefix=" %output))
2996 #:test-target "partcheck" ; need root for a full 'check'
2998 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
2999 (home-page "http://lse.sourceforge.net/io/aio.html")
3000 (synopsis "Linux-native asynchronous I/O access library")
3002 "This library enables userspace to use Linux kernel asynchronous I/O
3003 system calls, important for the performance of databases and other advanced
3005 (license license:lgpl2.1+)))
3013 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
3014 name "-" version ".tar.xz"))
3017 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
3018 (build-system gnu-build-system)
3020 `(("libsndfile" ,libsndfile)))
3022 `(("pkg-config" ,pkg-config)))
3023 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3024 (synopsis "Bluetooth subband audio codec")
3026 "The SBC is a digital audio encoder and decoder used to transfer data to
3027 Bluetooth audio output devices like headphones or loudspeakers.")
3028 (license license:gpl2+)))
3030 (define-public bluez
3037 "mirror://kernel.org/linux/bluetooth/bluez-"
3041 "15ffsaz7l3fgdg03l7g1xx9jw7xgs6pc548zxqsxawsca5x1sc1k"))))
3042 (build-system gnu-build-system)
3045 (let ((out (assoc-ref %outputs "out")))
3046 (list "--sysconfdir=/etc"
3047 "--localstatedir=/var"
3050 ;; Install dbus/udev files to the correct location.
3051 (string-append "--with-dbusconfdir=" out "/etc")
3052 (string-append "--with-udevdir=" out "/lib/udev")))
3054 (modify-phases %standard-phases
3055 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3056 ;; issue (discussion on upstream mailing list:
3057 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3058 (add-before 'check 'skip-wonky-test
3060 (substitute* "unit/test-gatt.c"
3061 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3063 (add-after 'install 'post-install
3064 (lambda* (#:key inputs outputs #:allow-other-keys)
3065 (let* ((out (assoc-ref outputs "out"))
3066 (servicedir (string-append out "/share/dbus-1/services"))
3067 (service "obexd/src/org.bluez.obex.service")
3068 (rule (string-append
3069 out "/lib/udev/rules.d/97-hid2hci.rules")))
3070 ;; Install the obex dbus service file.
3071 (substitute* service
3073 (string-append out "/libexec/bluetooth/obexd")))
3074 (install-file service servicedir)
3075 ;; Fix paths in the udev rule.
3077 (("hid2hci --method")
3078 (string-append out "/lib/udev/hid2hci --method"))
3080 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3083 `(("pkg-config" ,pkg-config)
3084 ("gettext" ,gettext-minimal)))
3089 ("libical" ,libical)
3090 ("readline" ,readline)))
3091 (home-page "http://www.bluez.org/")
3092 (synopsis "Linux Bluetooth protocol stack")
3094 "BlueZ provides support for the core Bluetooth layers and protocols. It
3095 is flexible, efficient and uses a modular implementation.")
3096 (license license:gpl2+)))
3098 (define-public fuse-exfat
3105 "https://github.com/relan/exfat/releases/download/v"
3106 version "/" name "-" version ".tar.gz"))
3109 "1jwnxw0bg9v5ij8xvbg4xpjr50nykq8a1lmc2xkblz204rq7wd8z"))))
3110 (build-system gnu-build-system)
3112 `(("pkg-config" ,pkg-config)))
3115 (home-page "https://github.com/relan/exfat")
3116 (synopsis "Mount exFAT file systems")
3118 "This package provides a FUSE-based file system that provides read and
3119 write access to exFAT devices.")
3120 (license license:gpl2+)))
3129 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3130 version ".tar.bz2"))
3131 (patches (search-patches "gpm-glibc-2.26.patch"))
3134 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3135 (build-system gnu-build-system)
3137 '(#:phases (modify-phases %standard-phases
3138 (add-after 'unpack 'bootstrap
3140 ;; The tarball was not generated with 'make dist' so we
3141 ;; need to bootstrap things ourselves.
3142 (substitute* "autogen.sh"
3143 (("/bin/sh") (which "sh")))
3144 (and (zero? (system* "./autogen.sh"))
3146 (patch-makefile-SHELL "Makefile.include.in")
3149 ;; Make sure programs find libgpm.so.
3150 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3151 (assoc-ref %outputs "out")
3154 `(("texinfo" ,texinfo)
3157 ("autoconf" ,autoconf)
3158 ("automake" ,automake)
3159 ("libtool" ,libtool)))
3160 (home-page "http://www.nico.schottelius.org/software/gpm/")
3161 (synopsis "Mouse support for the Linux console")
3163 "The GPM (general-purpose mouse) daemon is a mouse server for
3164 applications running on the Linux console. It allows users to select items
3165 and copy/paste text in the console and in xterm.")
3166 (license license:gpl2+)))
3168 (define-public btrfs-progs
3170 (name "btrfs-progs")
3174 (uri (string-append "mirror://kernel.org/linux/kernel/"
3175 "people/kdave/btrfs-progs/"
3176 "btrfs-progs-v" version ".tar.xz"))
3179 "1palnddw3d50kyflwk1j4xapbc6jniid6j5i9dsr8l8a7nkv7ich"))))
3180 (build-system gnu-build-system)
3182 "static")) ; static versions of the binaries in "out"
3184 '(#:phases (modify-phases %standard-phases
3185 (add-after 'build 'build-static
3186 (lambda _ (zero? (system* "make" "static"))))
3187 (add-after 'install 'install-bash-completion
3188 (lambda* (#:key outputs #:allow-other-keys)
3189 (let* ((out (assoc-ref outputs "out"))
3190 (bashcomp (string-append out "/etc/bash_completion.d")))
3192 (copy-file "btrfs-completion"
3193 (string-append bashcomp "/btrfs"))
3195 (add-after 'install 'install-static
3196 (let ((staticbin (string-append (assoc-ref %outputs "static")
3199 (zero? (system* "make"
3200 (string-append "bindir=" staticbin)
3201 "install-static"))))))
3202 #:test-target "test"
3203 #:parallel-tests? #f)) ; tests fail when run in parallel
3204 (inputs `(("e2fsprogs" ,e2fsprogs)
3205 ("libblkid" ,util-linux)
3206 ("libblkid:static" ,util-linux "static")
3207 ("libuuid" ,util-linux)
3208 ("libuuid:static" ,util-linux "static")
3212 (native-inputs `(("pkg-config" ,pkg-config)
3213 ("asciidoc" ,asciidoc)
3215 ;; For building documentation.
3216 ("libxml2" ,libxml2)
3217 ("docbook-xsl" ,docbook-xsl)
3221 (home-page "https://btrfs.wiki.kernel.org/")
3222 (synopsis "Create and manage btrfs copy-on-write file systems")
3223 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3224 aimed at implementing advanced features while focusing on fault tolerance,
3225 repair and easy administration.")
3226 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3227 ;; GPL2: Everything else.
3228 (license (list license:gpl2 license:gpl2+))))
3230 (define-public btrfs-progs/static
3232 (name "btrfs-progs-static")
3233 (version (package-version btrfs-progs))
3235 (build-system trivial-build-system)
3237 `(("btrfs-progs:static" ,btrfs-progs "static")))
3239 `(#:modules ((guix build utils))
3242 (use-modules (guix build utils)
3246 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3247 (out (assoc-ref %outputs "out"))
3248 (source (string-append btrfs "/bin/btrfs.static"))
3249 (target (string-append out "/bin/btrfs")))
3250 (mkdir-p (dirname target))
3251 (copy-file source target)
3252 (remove-store-references target)
3253 (chmod target #o555)))))
3254 (home-page (package-home-page btrfs-progs))
3255 (synopsis "Statically-linked btrfs command from btrfs-progs")
3256 (description "This package provides the statically-linked @command{btrfs}
3257 from the btrfs-progs package. It is meant to be used in initrds.")
3258 (license (package-license btrfs-progs))))
3260 (define-public f2fs-tools-1.7
3267 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3268 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3271 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
3273 (build-system gnu-build-system)
3276 (modify-phases %standard-phases
3277 (add-after 'unpack 'bootstrap
3279 (zero? (system* "autoreconf" "-vif"))))
3280 (add-after 'install 'install-headers
3281 (lambda* (#:key outputs #:allow-other-keys)
3282 (let* ((out (assoc-ref outputs "out"))
3283 (out-include (string-append out "/include")))
3284 (install-file "include/f2fs_fs.h" out-include)
3285 (install-file "mkfs/f2fs_format_utils.h" out-include)
3288 `(("autoconf" ,autoconf)
3289 ("automake" ,automake)
3290 ("libtool" ,libtool)
3291 ("pkg-config" ,pkg-config)))
3293 `(("libuuid" ,util-linux)
3294 ("libselinux" ,libselinux)))
3295 (home-page "https://f2fs.wiki.kernel.org/")
3296 (synopsis "Userland tools for f2fs")
3298 "F2FS, the Flash-Friendly File System, is a modern file system
3299 designed to be fast and durable on flash devices such as solid-state
3300 disks and SD cards. This package provides the userland utilities.")
3301 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3302 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3303 (license (list license:gpl2 license:lgpl2.1))))
3305 (define-public f2fs-tools
3307 (inherit f2fs-tools-1.7)
3313 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3314 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3317 "1bir9ladb58ijlcvrjrq1fb1xv5ys50zdjaq0yzliib0apsyrnyl"))))
3319 `(("libuuid" ,util-linux)))))
3321 (define-public freefall
3324 (version (package-version linux-libre))
3325 (source (package-source linux-libre))
3326 (build-system gnu-build-system)
3328 '(#:phases (modify-phases %standard-phases
3329 (add-after 'unpack 'enter-subdirectory
3331 (chdir "tools/laptop/freefall")))
3333 (add-before 'build 'increase-timeout
3335 ;; The default of 2 seconds is too low: it assumes an
3336 ;; open lid and AC power without actually checking.
3337 (substitute* "freefall.c"
3338 (("alarm\\(2\\)") "alarm(5)")))))
3339 #:make-flags (list (string-append "PREFIX="
3340 (assoc-ref %outputs "out"))
3342 #:tests? #f)) ;no tests
3343 (home-page (package-home-page linux-libre))
3344 (synopsis "Free-fall protection for spinning laptop hard drives")
3346 "Prevents shock damage to the internal spinning hard drive(s) of some
3347 HP and Dell laptops. When sudden movement is detected, all input/output
3348 operations on the drive are suspended and its heads are parked on the ramp,
3349 where they are less likely to cause damage to the spinning disc. Requires a
3350 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3351 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3352 (license license:gpl2)))
3354 (define-public thinkfan
3360 (uri (string-append "mirror://sourceforge/thinkfan/"
3361 "/thinkfan-" version ".tar.gz"))
3364 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3365 (modules '((guix build utils)))
3366 ;; Fix erroneous man page location in Makefile leading to
3367 ;; a compilation failure.
3369 '(substitute* "CMakeLists.txt"
3370 (("thinkfan\\.1") "src/thinkfan.1")))))
3371 (build-system cmake-build-system)
3373 `(#:modules ((guix build cmake-build-system)
3376 #:tests? #f ;no test target
3378 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3379 `("-DUSE_ATASMART:BOOL=ON")
3381 (modify-phases %standard-phases
3382 ;; Install scripts for various foreign init systems. Also fix
3383 ;; hard-coded path for daemon.
3384 (add-after 'install 'install-rc-scripts
3385 (lambda* (#:key outputs #:allow-other-keys)
3386 (let ((out (assoc-ref outputs "out"))
3388 (string-append "../thinkfan-" ,version "/rcscripts")
3391 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3392 (string-append out "/sbin/" name)))
3393 (for-each (cute install-file <>
3394 (string-append out "/share/thinkfan"))
3398 `(("libatasmart" ,libatasmart)))
3399 (home-page "http://thinkfan.sourceforge.net/")
3400 (synopsis "Simple fan control program")
3402 "Thinkfan is a simple fan control program. It reads temperatures,
3403 checks them against configured limits and switches to appropriate (also
3404 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3405 other @code{hwmon} driver that enables temperature reading and fan control
3407 (license license:gpl3+)))
3409 (define-public ntfs-3g
3412 (version "2017.3.23")
3415 (uri (string-append "https://tuxera.com/opensource/"
3416 "ntfs-3g_ntfsprogs-" version ".tgz"))
3419 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
3420 (modules '((guix build utils)))
3422 ;; Install under $prefix.
3423 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3426 (build-system gnu-build-system)
3427 (inputs `(("util-linux" ,util-linux)
3428 ("fuse" ,fuse))) ;libuuid
3429 (native-inputs `(("pkg-config" ,pkg-config)))
3431 '(#:configure-flags (list "--exec-prefix=${prefix}"
3432 "--with-fuse=external" ;use our own FUSE
3433 "--enable-mount-helper"
3434 "--enable-posix-acls"
3435 "--enable-xattr-mappings")
3437 (modify-phases %standard-phases
3438 ;; If users install ntfs-3g, they probably want to make it the
3439 ;; default driver as well, so we opt for sensible defaults and link
3440 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
3441 ;; mount NTFS filesystems.)
3442 (add-after 'install 'install-link
3443 (lambda* (#:key outputs #:allow-other-keys)
3444 (let* ((out (assoc-ref outputs "out"))
3445 (sbin (string-append out "/sbin")))
3446 (symlink "mount.ntfs-3g"
3447 (string-append sbin "/mount.ntfs"))))))))
3448 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
3449 (synopsis "Read-write access to NTFS file systems")
3451 "NTFS-3G provides read-write access to NTFS file systems, which are
3452 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3453 The package provides additional NTFS tools.")
3454 (license license:gpl2+)))
3456 (define-public rdma-core
3462 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3463 "/releases/download/v" version "/rdma-core-"
3467 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3468 (build-system cmake-build-system)
3470 '(#:tests? #f ; no tests
3471 ;; Upstream uses the "ninja" build system and encourage distros
3472 ;; to do the same for consistency. They also recommend using the
3473 ;; "Release" build type.
3474 #:build-type "Release"
3475 #:configure-flags (list "-GNinja")
3477 (modify-phases %standard-phases
3480 (zero? (system* "ninja"
3481 "-j" (number->string (parallel-job-count))))))
3484 (zero? (system* "ninja" "install")))))))
3487 ("pkg-config" ,pkg-config)
3488 ("python" ,python-wrapper)))
3492 (home-page "https://github.com/linux-rdma/rdma-core")
3493 (synopsis "Utilities and libraries for working with RDMA devices")
3495 "This package provides userspace components for the InfiniBand
3496 subsystem of the Linux kernel. Specifically it contains userspace
3497 libraries for the following device nodes:
3500 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3501 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3502 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3505 The following service daemons are also provided:
3507 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3508 @item @code{iwpmd} (for iWARP kernel providers)
3509 @item @code{ibacm} (for InfiniBand communication management assistant)
3511 ;; All library code is dual licensed under GPL2 and a custom MIT
3512 ;; variant. The package also includes some components covered by
3513 ;; other licenses. Consult COPYING.md for full details.
3516 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3517 license:bsd-2 ; Files referring to COPYING.BSD_FB
3518 license:cc0 ; most files in ccan/
3519 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3521 (define-public rng-tools
3527 (uri (string-append "https://github.com/nhorman/rng-tools/"
3528 "archive/v" version ".tar.gz"))
3529 (file-name (string-append name "-" version ".tar.gz"))
3532 "0xy4qmfhvkr5z4jr9j55dn5gnajr2jccdp6n0xsxkipjcgag342j"))))
3533 (build-system gnu-build-system)
3535 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
3536 #:configure-flags '("--without-nistbeacon")
3538 (modify-phases %standard-phases
3539 (add-after 'unpack 'bootstrap
3541 (invoke "sh" "autogen.sh")
3544 `(("autoconf" ,autoconf)
3545 ("automake" ,automake)
3546 ("pkg-config" ,pkg-config)))
3548 `(("libsysfs" ,sysfsutils)))
3549 (synopsis "Random number generator daemon")
3551 "Monitor a hardware random number generator, and supply entropy
3552 from that to the system kernel's @file{/dev/random} machinery.")
3553 (home-page "https://sourceforge.net/projects/gkernel")
3554 ;; The source package is offered under the GPL2+, but the files
3555 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3556 (license (list license:gpl2 license:gpl2+))))
3558 (define-public cpupower
3561 (version (package-version linux-libre))
3562 (source (package-source linux-libre))
3563 (build-system gnu-build-system)
3565 '(#:phases (modify-phases %standard-phases
3566 (add-after 'unpack 'enter-subdirectory
3568 (chdir "tools/power/cpupower")))
3570 (add-before 'build 'fix-makefiles
3572 (substitute* "Makefile"
3574 (("/bin/(install|pwd)" _ command) command))
3575 (substitute* "bench/Makefile"
3576 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3577 #:make-flags (let ((out (assoc-ref %outputs "out")))
3578 (list (string-append "DESTDIR=" out)
3579 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3580 "docdir=/share/doc/cpupower"
3581 "confdir=$(docdir)/examples"
3582 ;; The Makefile recommends the following changes
3584 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3585 #:tests? #f)) ;no tests
3586 (native-inputs `(("gettext" ,gettext-minimal)))
3587 (inputs `(("pciutils" ,pciutils)))
3588 (home-page (package-home-page linux-libre))
3589 (synopsis "CPU frequency and voltage scaling tools for Linux")
3591 "cpupower is a set of user-space tools that use the cpufreq feature of the
3592 Linux kernel to retrieve and control processor features related to power saving,
3593 such as frequency and voltage scaling.")
3594 (license license:gpl2)))
3596 (define-public haveged
3603 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3607 "0w5ypz6451msckivjriwyw8djydlwffam7x23xh626s2vzdrlzgp"))))
3608 (build-system gnu-build-system)
3609 (home-page "http://www.issihosts.com/haveged")
3610 (synopsis "Entropy source for the Linux random number generator")
3612 "haveged generates an unpredictable stream of random numbers for use by
3613 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3614 standard mechanisms for filling the entropy pool may not be sufficient for
3615 systems with high needs or limited user interaction, such as headless servers.
3616 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3617 indirect effects of hardware events on hidden processor state using the HArdware
3618 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3619 its environment and provides the same built-in test suite for the output stream
3620 as used on certified hardware security devices.")
3621 (license (list (license:non-copyleft "file://nist/mconf.h")
3622 (license:non-copyleft "file://nist/packtest.c")
3623 license:public-domain ; nist/dfft.c
3624 license:gpl3+)))) ; everything else
3626 (define-public ecryptfs-utils
3628 (name "ecryptfs-utils")
3633 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3634 version "/+download/ecryptfs-utils_"
3635 version ".orig.tar.gz"))
3638 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3639 (build-system gnu-build-system)
3641 `(#:configure-flags (list "--disable-pywrap")))
3643 `(("intltool" ,intltool)
3644 ("perl" ,perl) ; for pod2man
3645 ("pkg-config" ,pkg-config)))
3647 `(("keyutils" ,keyutils)
3648 ("linux-pam" ,linux-pam)
3650 (home-page "http://ecryptfs.org/")
3651 (synopsis "eCryptfs cryptographic file system utilities")
3653 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3654 Each file's cryptographic meta-data is stored inside the file itself, along
3655 with the encrypted contents. This allows individual encrypted files to be
3656 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3657 native Linux file system, and has been part of the Linux kernel since version
3658 2.6.19. This package contains the userland utilities to manage it.")
3659 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3660 ;; grant additional permission to link with OpenSSL.
3661 (license license:gpl2+)))
3663 (define-public libnfsidmap
3665 (name "libnfsidmap")
3670 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3671 name "/" name "-" version ".tar.gz"))
3674 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3675 (build-system gnu-build-system)
3677 `(#:configure-flags (list
3678 (string-append "--with-pluginpath="
3679 (assoc-ref %outputs "out")
3680 "/lib/libnfsidmap"))))
3682 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3684 "NFSv4 support library for name/ID mapping")
3685 (description "Libnfsidmap is a library holding mulitiple methods of
3686 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3687 extensible array of mapping functions, currently consisting of two choices:
3688 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3689 (license (license:non-copyleft "file://COPYING"
3690 "See COPYING in the distribution."))))
3692 (define-public module-init-tools
3694 (name "module-init-tools")
3699 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3700 "module-init-tools-" version ".tar.bz2"))
3703 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3704 (patches (search-patches "module-init-tools-moduledir.patch"))))
3705 (build-system gnu-build-system)
3707 ;; FIXME: The upstream tarball lacks man pages, and building them would
3708 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3709 ;; but they vanished. In the meantime, fake it.
3711 (modify-phases %standard-phases
3712 (add-before 'configure 'fake-docbook
3714 (substitute* "Makefile.in"
3715 (("^DOCBOOKTOMAN.*$")
3716 "DOCBOOKTOMAN = true\n"))
3718 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3719 (synopsis "Tools for loading and managing Linux kernel modules")
3721 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3722 `insmod', `lsmod', and more.")
3723 (license license:gpl2+)))
3725 (define-public mcelog
3731 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3732 "mcelog.git/snapshot/v" version ".tar.gz"))
3735 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
3736 (file-name (string-append name "-" version ".tar.gz"))
3737 (modules '((guix build utils)))
3739 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3740 `(substitute* "Makefile"
3741 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3742 (build-system gnu-build-system)
3744 `(#:phases (modify-phases %standard-phases
3745 (delete 'configure)) ; no configure script
3746 #:make-flags (let ((out (assoc-ref %outputs "out")))
3748 (string-append "prefix=" out)
3749 (string-append "DOCDIR=" out "/share/doc/mcelog")
3750 "etcprefix=$(DOCDIR)/examples"))
3751 ;; The tests will only run as root on certain supported CPU models.
3753 (supported-systems (list "i686-linux" "x86_64-linux"))
3754 (home-page "https://mcelog.org/")
3755 (synopsis "Machine check monitor for x86 Linux systems")
3757 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3758 and other hardware errors on x86 systems. It can also perform user-defined
3759 tasks, such as bringing bad pages off-line, when configurable error thresholds
3761 (license license:gpl2)))
3763 (define-public mtd-utils
3770 "ftp://ftp.infradead.org/pub/mtd-utils/"
3771 "mtd-utils-" version ".tar.bz2"))
3774 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3777 ("libuuid" ,util-linux)
3780 (build-system gnu-build-system)
3782 `(#:test-target "tests"
3783 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3784 #:phases (modify-phases %standard-phases
3785 (delete 'configure))))
3786 (synopsis "MTD Flash Storage Utilities")
3787 (description "This package provides utilities for testing, partitioning, etc
3789 (home-page "http://www.linux-mtd.infradead.org/")
3791 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3792 license:mpl1.1 ; All ftl* files
3793 license:expat)))) ; libiniparser
3795 (define-public libseccomp
3801 (uri (string-append "https://github.com/seccomp/libseccomp/"
3802 "releases/download/v" version
3803 "/libseccomp-" version ".tar.gz"))
3806 "0mdiyfljrkfl50q1m3ws8yfcyfjwf1zgkvcva8ffcwncji18zhkz"))))
3807 (build-system gnu-build-system)
3809 `(("which" ,which)))
3810 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3811 (description "The libseccomp library provides an easy to use, platform
3812 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3813 libseccomp API is designed to abstract away the underlying BPF based syscall
3814 filter language and present a more conventional function-call based filtering
3815 interface that should be familiar to, and easily adopted by, application
3817 (home-page "https://github.com/seccomp/libseccomp")
3818 (license license:lgpl2.1)))
3820 (define-public radeontop
3824 (home-page "https://github.com/clbr/radeontop/")
3827 (uri (string-append home-page "archive/v" version ".tar.gz"))
3828 (file-name (string-append name "-" version ".tar.gz"))
3831 "1fv06j5c99imvzkac3j40lgjhr5b2i77fnyffhlvj92bli1fm1c6"))))
3832 (build-system gnu-build-system)
3834 `(#:phases (modify-phases %standard-phases
3835 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3836 ;; dependency, and doesn't even work on release(!) tarballs.
3837 (add-after 'unpack 'report-correct-version
3838 (lambda _ (substitute* "getver.sh"
3840 (string-append "ver=" ,version)))))
3841 (delete 'configure)) ; no configure script
3842 #:make-flags (list "CC=gcc"
3843 (string-append "PREFIX=" %output))
3844 #:tests? #f)) ; no tests
3846 `(("gettext" ,gettext-minimal)
3847 ("pkg-config" ,pkg-config)))
3849 `(("libdrm" ,libdrm)
3850 ("libpciaccess" ,libpciaccess)
3852 ("ncurses" ,ncurses)))
3853 (synopsis "Usage monitor for AMD Radeon graphics")
3854 (description "RadeonTop monitors resource consumption on supported AMD
3855 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3856 a terminal or saved to a file for further processing. It measures both the
3857 activity of the GPU as a whole, which is also accurate during OpenCL
3858 computations, as well as separate component statistics that are only meaningful
3859 under OpenGL graphics workloads.")
3860 (license license:gpl3)))
3862 (define-public efivar
3868 (uri (string-append "https://github.com/rhinstaller/" name
3869 "/releases/download/" version "/" name
3870 "-" version ".tar.bz2"))
3873 "153k2ifyl4giz5fkryxhz8z621diqjy7v25hfga4z94rs32ks0qy"))))
3874 (build-system gnu-build-system)
3876 `(;; Tests require a UEFI system and is not detected in the chroot.
3878 #:make-flags (list (string-append "prefix=" %output)
3879 (string-append "libdir=" %output "/lib")
3881 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3883 (modify-phases %standard-phases
3884 (delete 'configure))))
3886 `(("pkg-config" ,pkg-config)))
3889 (home-page "https://github.com/rhinstaller/efivar")
3890 (synopsis "Tool and library to manipulate EFI variables")
3891 (description "This package provides a library and a command line
3892 interface to the variable facility of UEFI boot firmware.")
3893 (license license:lgpl2.1+)))
3895 (define-public efibootmgr
3901 (uri (string-append "https://github.com/rhinstaller/" name
3902 "/releases/download/" version "/" name
3903 "-" version ".tar.bz2"))
3906 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
3907 (build-system gnu-build-system)
3909 `(#:tests? #f ; No tests.
3910 #:make-flags (list (string-append "prefix=" %output)
3911 (string-append "libdir=" %output "/lib")
3912 ;; EFIDIR denotes a subdirectory relative to the
3913 ;; EFI System Partition where the loader will be
3914 ;; installed (known as OS_VENDOR in the code).
3915 ;; GRUB overrides this, as such it's only used if
3916 ;; nothing else is specified on the command line.
3918 ;; Override CFLAGS to add efivar include directory.
3919 (string-append "CFLAGS=-O2 -g -flto -I"
3920 (assoc-ref %build-inputs "efivar")
3922 #:phases (modify-phases %standard-phases (delete 'configure))))
3924 `(("pkg-config" ,pkg-config)))
3926 `(("efivar" ,efivar)
3928 (home-page "https://github.com/rhinstaller/efibootmgr")
3929 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3931 "@code{efibootmgr} is a user-space application to modify the Intel
3932 Extensible Firmware Interface (EFI) Boot Manager. This application can
3933 create and destroy boot entries, change the boot order, change the next
3934 running boot option, and more.")
3935 (license license:gpl2+)))
3937 (define-public sysstat
3943 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3944 "sysstat-" version ".tar.xz"))
3947 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3948 (build-system gnu-build-system)
3950 `(#:tests? #f ; No test suite.
3951 ;; Without this flag, it tries to install the man pages with group 'root'
3952 ;; and fails because /etc/passwd lacks an entry for the root user.
3954 (list "--disable-file-attr"
3955 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3957 (modify-phases %standard-phases
3958 ;; The build process tries to create '/var/lib/sa', so we skip that
3960 (add-after 'build 'skip-touching-var
3962 (substitute* "Makefile"
3963 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3966 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3967 (synopsis "Performance monitoring tools for Linux")
3968 (description "The sysstat utilities are a collection of performance
3969 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3970 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3971 @code{sadf} and @code{sa}.")
3972 (license license:gpl2+)))
3974 (define-public light
3980 (uri (string-append "https://github.com/haikarainen/" name
3981 "/archive/v" version ".tar.gz"))
3984 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3985 (file-name (string-append name "-" version ".tar.gz"))))
3986 (build-system gnu-build-system)
3988 '(#:tests? #f ; no tests
3989 #:make-flags (list "CC=gcc"
3990 (string-append "PREFIX=" %output))
3992 (modify-phases %standard-phases
3994 (add-after 'unpack 'patch-makefile
3996 (substitute* "Makefile" (("chown") "#")))))))
3998 `(("help2man" ,help2man)))
3999 (home-page "https://haikarainen.github.io/light")
4000 (synopsis "GNU/Linux application to control backlights")
4002 "Light is a program to send commands to screen backlight controllers
4003 under GNU/Linux. Features include:
4006 @item It does not rely on X.
4007 @item Light can automatically figure out the best controller to use, making
4008 full use of underlying hardware.
4009 @item It is possible to set a minimum brightness value, as some controllers
4010 set the screen to be pitch black at a vaĺue of 0 (or higher).
4013 Light is the successor of lightscript.")
4014 (license license:gpl3+)))
4023 "https://github.com/linrunner/"
4024 (string-upcase name)
4025 "/archive/" version ".tar.gz"))
4026 (file-name (string-append name "-" version ".tar.gz"))
4029 "068hzmh90x600saynbl7iwg1pm0ywldn4jazyxx5y1fixs8s1qbn"))))
4030 (inputs `(("bash" ,bash)
4032 ("ethtool" ,ethtool)
4036 ("inetutils" ,inetutils)
4039 ("pciutils" ,pciutils)
4043 ("usbutils" ,usbutils)
4044 ("util-linux" ,util-linux)
4045 ("wireless-tools" ,wireless-tools)))
4046 (build-system gnu-build-system)
4049 (modify-phases %standard-phases
4050 (delete 'configure) ; no configure script
4051 (add-before 'build 'setenv
4052 (lambda* (#:key outputs #:allow-other-keys)
4053 (let ((out (assoc-ref outputs "out")))
4054 (setenv "TLP_WITH_SYSTEMD" "0")
4055 (setenv "TLP_NO_INIT" "1")
4056 (setenv "TLP_NO_PMUTILS" "1")
4057 (setenv "TLP_SBIN" (string-append out "/bin"))
4058 (setenv "TLP_BIN" (string-append out "/bin"))
4059 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
4060 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
4061 (setenv "TLP_CONF" "/etc/tlp")
4063 (string-append out "/share/bash-completion/completions"))
4064 (setenv "TLP_MAN" (string-append out "/share/man"))
4065 (setenv "TLP_META" (string-append out "/share/metainfo")))))
4066 (delete 'check) ; no tests
4067 (add-before 'install 'fix-installation
4069 ;; Stop the Makefile from trying to create system directories.
4070 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
4073 (invoke "make" "install-tlp" "install-man")
4075 (add-after 'install 'wrap
4076 (lambda* (#:key inputs outputs #:allow-other-keys)
4077 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4078 (bin-files (find-files bin ".*")))
4079 (define (bin-directory input-name)
4080 (string-append (assoc-ref inputs input-name) "/bin"))
4081 (define (sbin-directory input-name)
4082 (string-append (assoc-ref inputs input-name) "/sbin"))
4083 (for-each (lambda (program)
4084 (wrap-program program
4087 (map bin-directory '("bash"
4098 (map sbin-directory '("ethtool"
4103 "wireless-tools"))))))
4105 (home-page "http://linrunner.de/en/tlp/tlp.html")
4106 (synopsis "Power management tool for Linux")
4107 (description "TLP is a power management tool for Linux. It comes with
4108 a default configuration already optimized for battery life. Nevertheless,
4109 TLP is customizable to fulfil system requirements. TLP settings are applied
4110 every time the power supply source is changed.")
4112 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4114 (license (list license:gpl2+ license:gpl3+))))
4122 (uri (string-append "https://www.ezix.org/software/"
4123 "files/lshw-" version
4127 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4128 (build-system gnu-build-system)
4130 `(#:phases (modify-phases %standard-phases (delete 'configure))
4131 #:tests? #f ; no tests
4133 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4134 (synopsis "List hardware information")
4136 "@command{lshw} (Hardware Lister) is a small tool to provide
4137 detailed information on the hardware configuration of the machine.
4138 It can report exact memory configuration, firmware version, mainboard
4139 configuration, CPU version and speed, cache configuration, bus speed,
4140 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4141 machines (PowerMac G4 is known to work).")
4142 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4143 (license license:gpl2+)))
4145 (define-public libmnl
4152 (uri (string-append "mirror://netfilter.org/libmnl/"
4153 "libmnl-" version ".tar.bz2"))
4156 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4157 (build-system gnu-build-system)
4158 (home-page "https://www.netfilter.org/projects/libmnl/")
4159 (synopsis "Netlink utility library")
4160 (description "Libmnl is a minimalistic user-space library oriented to
4161 Netlink developers. There are a lot of common tasks in parsing, validating,
4162 constructing of both the Netlink header and TLVs that are repetitive and easy to
4163 get wrong. This library aims to provide simple helpers that allows you to
4164 re-use code and to avoid re-inventing the wheel.")
4165 (license license:lgpl2.1+)))
4167 (define-public libnftnl
4174 (uri (string-append "mirror://netfilter.org/libnftnl/"
4175 "libnftnl-" version ".tar.bz2"))
4178 "0v4gywcjvv2vg4zk632al1zv3ad0lx87nshynv110l8n3fhsq3pc"))))
4179 (build-system gnu-build-system)
4181 `(("pkg-config" ,pkg-config)))
4183 `(("libmnl" ,libmnl)))
4184 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4185 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4186 (description "Libnftnl is a userspace library providing a low-level netlink
4187 programming interface to the in-kernel nf_tables subsystem. The library
4188 libnftnl has been previously known as libnftables. This library is currently
4190 (license license:gpl2+)))
4192 (define-public nftables
4199 (uri (string-append "http://www.nftables.org/projects/nftables"
4200 "/files/nftables-" version ".tar.bz2"))
4203 "1i1gfy8l7qyhc5vlrpp63s0n5kybmc9pi4dywiq8rmkhrrnddsla"))))
4204 (build-system gnu-build-system)
4205 (inputs `(("bison" ,bison)
4209 ("libnftnl" ,libnftnl)
4210 ("readline" ,readline)))
4211 (native-inputs `(("pkg-config" ,pkg-config)))
4212 (home-page "http://www.nftables.org")
4213 (synopsis "Userspace utility for Linux packet filtering")
4214 (description "nftables is the project that aims to replace the existing
4215 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4216 filtering framework, a new userspace utility and also a compatibility layer for
4217 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4218 infrastructure such as the existing hooks, the connection tracking system, the
4219 userspace queueing component and the logging subsystem.")
4220 (license license:gpl2)))
4222 (define-public proot
4226 (home-page "https://github.com/proot-me/PRoot")
4229 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4230 (file-name (string-append name "-" version ".tar.gz"))
4233 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4234 (patches (search-patches "proot-test-fhs.patch"))))
4235 (build-system gnu-build-system)
4237 '(#:make-flags '("-C" "src")
4239 #:phases (modify-phases %standard-phases
4241 (add-before 'build 'set-shell-file-name
4242 (lambda* (#:key inputs #:allow-other-keys)
4243 (substitute* (find-files "src" "\\.[ch]$")
4246 (assoc-ref inputs "bash")
4249 (add-before 'check 'fix-fhs-assumptions-in-tests
4251 (substitute* "tests/test-c6b77b77.mk"
4252 (("/bin/bash") (which "bash"))
4253 (("/usr/bin/test") (which "test")))
4254 (substitute* '("tests/test-16573e73.c")
4255 (("/bin/([a-z-]+)" _ program)
4258 (substitute* (find-files "tests" "\\.sh$")
4259 ;; Some of the tests try to "bind-mount" /bin/true.
4261 (string-append "-b " (which "true") ":"))
4262 ;; Likewise for /bin.
4263 (("-b /bin:") "-b /gnu:")
4264 ;; Others try to run /bin/sh.
4265 (("/bin/sh") (which "sh"))
4266 ;; Others assume /etc/fstab exists.
4267 (("/etc/fstab") "/etc/passwd"))
4269 (substitute* "tests/GNUmakefile"
4270 (("-b /bin:") "-b /gnu:"))
4272 ;; XXX: This test fails in an obscure corner case, just
4274 (delete-file "tests/test-kkkkkkkk.c")
4279 (let ((n (parallel-job-count)))
4280 ;; For some reason we get lots of segfaults with
4281 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4282 (setenv "PROOT_NO_SECCOMP" "1")
4284 ;; Most of the tests expect "/bin" to be in $PATH so
4285 ;; they can run things that live in $ROOTFS/bin.
4287 (string-append (getenv "PATH") ":/bin"))
4289 (zero? (system* "make" "check" "-C" "tests"
4291 "-j" (number->string n))))))
4293 (lambda* (#:key outputs #:allow-other-keys)
4294 ;; The 'install' rule does nearly nothing.
4295 (let ((out (assoc-ref outputs "out")))
4297 ;; TODO: 'make install-care' (does not even
4298 ;; build currently.)
4299 (system* "make" "-C" "src" "install"
4300 (string-append "PREFIX=" out)))
4301 (let ((man1 (string-append out
4302 "/share/man/man1")))
4304 (copy-file "doc/proot/man.1"
4305 (string-append man1 "/proot.1"))
4307 (native-inputs `(("which" ,which)
4309 ;; For 'mcookie', used by some of the tests.
4310 ("util-linux" ,util-linux)))
4311 (inputs `(("talloc" ,talloc)))
4312 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4314 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4315 and @code{binfmt_misc}. This means that users don't need any privileges or
4316 setup to do things like using an arbitrary directory as the new root
4317 file system, making files accessible somewhere else in the file system
4318 hierarchy, or executing programs built for another CPU architecture
4319 transparently through QEMU user-mode. Also, developers can use PRoot as a
4320 generic process instrumentation engine thanks to its extension mechanism.
4321 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4322 available in the kernel Linux.")
4323 (license license:gpl2+)))
4325 (define-public proot-static
4328 (name "proot-static")
4330 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4331 (inputs `(("talloc" ,talloc/static)))
4333 (substitute-keyword-arguments (package-arguments proot)
4334 ((#:make-flags flags)
4335 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4337 `(modify-phases ,phases
4338 (add-after 'strip 'remove-store-references
4339 (lambda* (#:key outputs #:allow-other-keys)
4340 (let* ((out (assoc-ref outputs "out")))
4341 (with-directory-excursion out
4342 (remove-store-references "bin/proot")
4344 ((#:allowed-references _ '("out"))
4347 (define-public cpuid
4350 (version "20180419")
4353 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4354 version ".src.tar.gz"))
4357 "0cnxj72pjalsszhn862r6shw64zbrkw0k3mm36fn93bivswjnj12"))))
4358 (build-system gnu-build-system)
4360 '(#:make-flags '("CC=gcc")
4361 #:tests? #f ; no tests
4362 #:phases (modify-phases %standard-phases
4363 (delete 'configure) ; no configure script
4364 (add-before 'install 'fix-makefile
4365 (lambda* (#:key outputs #:allow-other-keys)
4366 (substitute* "Makefile"
4367 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4368 ;; Make the compressed manpages writable so that the
4369 ;; reset-gzip-timestamps phase does not error out.
4370 (substitute* "Makefile"
4371 (("-m 444") "-m 644"))
4373 (inputs `(("perl" ,perl)))
4374 (supported-systems '("i686-linux" "x86_64-linux"))
4375 (home-page "http://www.etallen.com/cpuid.html")
4376 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4377 (description "cpuid dumps detailed information about the CPU(s) gathered
4378 from the CPUID instruction, and also determines the exact model of CPU(s). It
4379 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4380 NexGen, Rise, and SiS CPUs.")
4381 (license license:gpl2+)))
4383 (define-public jmtpfs
4390 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4392 (file-name (string-append name "-" version ".tar.gz"))
4395 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4396 (build-system gnu-build-system)
4400 ("libmtp" ,libmtp)))
4402 `(("pkg-config" ,pkg-config)))
4403 (home-page "https://github.com/JasonFerrara/jmtpfs")
4404 (synopsis "Use a FUSE file system to access data over MTP")
4405 (description "jmtpfs uses FUSE (file system in userspace) to provide access
4406 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4407 the MTP device as a file system.")
4408 (license license:gpl3)))
4410 (define-public procenv
4417 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4419 (file-name (string-append name "-" version ".tar.gz"))
4421 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
4422 (build-system gnu-build-system)
4423 (arguments `(#:configure-flags '("--disable-silent-rules")))
4424 (native-inputs `(("pkg-config" ,pkg-config)))
4425 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4426 ("groff" ,groff) ; for tests
4427 ("libselinux" ,libselinux)))
4428 (synopsis "Utility to show process environment")
4429 (description "Procenv is a command-line tool that displays as much detail about
4430 itself and its environment as possible. It can be used as a test
4431 tool, to understand the type of environment a process runs in, and for
4432 comparing system environments.")
4433 (home-page "http://github.com/jamesodhunt/procenv/")
4434 (license license:gpl3+)))
4436 (define-public libfabric
4444 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4445 version "/libfabric-" version ".tar.bz2"))
4447 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4448 (build-system gnu-build-system)
4449 (inputs `(("rdma-core" ,rdma-core)
4450 ,@(match (%current-system)
4451 ((member (package-supported-systems psm))
4455 (home-page "https://ofiwg.github.io/libfabric/")
4456 (synopsis "Open Fabric Interfaces")
4458 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4459 communication services to applications. OFI is best described as a collection
4460 of libraries and applications used to export fabric services. The key
4461 components of OFI are: application interfaces, provider libraries, kernel
4462 services, daemons, and test applications.
4464 Libfabric is a core component of OFI. It is the library that defines and
4465 exports the user-space API of OFI, and is typically the only software that
4466 applications deal with directly. It works in conjunction with provider
4467 libraries, which are often integrated directly into libfabric.")
4468 (license (list license:bsd-2 license:gpl2)))) ;dual
4473 (version "3.3.20170428")
4474 (home-page "https://github.com/intel/psm")
4478 (uri (git-reference (url home-page)
4479 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
4480 (file-name (string-append "psm-" version ".tar.gz"))
4482 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
4483 (patches (search-patches
4484 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
4485 "psm-ldflags.patch" ; build shared lib with LDFLAGS
4486 "psm-repro.patch")))) ; reproducibility
4487 (build-system gnu-build-system)
4488 (inputs `(("libuuid" ,util-linux)))
4490 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
4491 ,(string-append "INSTALL_PREFIX=" %output)
4492 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4494 #:phases (modify-phases %standard-phases
4496 (add-after 'unpack 'patch-/usr/include
4498 (substitute* "Makefile"
4499 (("\\$\\{DESTDIR}/usr/include")
4500 (string-append %output "/include")))
4501 (substitute* "Makefile"
4502 (("/lib64") "/lib"))
4504 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
4506 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
4507 communications interface for the True Scale family of products. PSM users are
4508 enabled with mechanisms necessary to implement higher level communications
4509 interfaces in parallel environments.")
4510 ;; Only Intel-compatable processors are supported.
4511 (supported-systems '("i686-linux" "x86_64-linux"))
4512 (license (list license:bsd-2 license:gpl2)))) ;dual
4514 (define-public snapscreenshot
4516 (name "snapscreenshot")
4517 (version "1.0.14.3")
4521 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
4522 name "-" version ".tar.bz2"))
4524 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
4525 (build-system gnu-build-system)
4528 (let ((out (assoc-ref %outputs "out")))
4529 (list (string-append "BINDIR=" out "/bin")
4530 (string-append "MANDIR=" out "/share/man")))
4531 #:tests? #f ; no test suite
4533 (modify-phases %standard-phases
4534 (delete 'configure) ; ./configure is a snarky no-op
4535 (add-before 'install 'fix-ownership
4536 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
4538 (substitute* "depfun.mak"
4539 ((" -o bin -g bin ") " "))
4541 (add-before 'install 'create-output-directories
4542 (lambda* (#:key outputs #:allow-other-keys)
4543 (let ((out (assoc-ref outputs "out")))
4544 (mkdir-p (string-append out "/share/man/man1"))
4546 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
4547 (synopsis "Take screenshots of one or more Linux text consoles")
4549 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
4550 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
4551 relevant @file{/dev/vcs*} file(s).")
4552 (license license:gpl2)))
4554 (define-public fbcat
4561 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
4562 version "/" name "-" version ".tar.gz"))
4564 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
4565 (build-system gnu-build-system)
4567 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
4568 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
4569 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
4570 `(("pnmtopng" ,netpbm)))
4571 (outputs (list "out" "fbgrab"))
4575 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4576 #:tests? #f ; no tests
4578 (modify-phases %standard-phases
4579 (delete 'configure) ; no configure script
4580 (add-after 'build 'qualify-references
4581 (lambda* (#:key inputs outputs #:allow-other-keys)
4582 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
4583 (out (assoc-ref outputs "out")))
4584 (substitute* "fbgrab"
4586 (string-append out "/bin/" all))
4588 (string-append pnmtopng "/bin/" all)))
4590 (add-after 'install 'split-fbgrab-output
4591 (lambda* (#:key outputs #:allow-other-keys)
4592 (let* ((out (assoc-ref outputs "out"))
4593 (out:fbgrab (assoc-ref outputs "fbgrab")))
4594 (for-each (lambda (file)
4595 (let ((old (string-append out "/" file))
4596 (new (string-append out:fbgrab "/" file)))
4597 (mkdir-p (dirname new))
4598 (rename-file old new)))
4600 "share/man/man1/fbgrab.1"))
4602 (home-page "https://jwilk.net/software/fbcat")
4603 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
4605 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
4606 a dump therof. It supports a wide range of drivers and pixel formats.
4607 @command{fbcat} can take screenshots of virtually any application that can be
4608 made to write its output to the framebuffer, including (but not limited to)
4609 text-mode or graphical applications that don't use a display server.
4611 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
4612 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
4613 (license license:gpl2)))
4615 (define-public libcgroup
4623 "mirror://sourceforge/libcg/" name "/"
4624 version "/" name "-" version ".tar.bz2"))
4626 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
4627 (build-system gnu-build-system)
4634 `(("linux-pam" ,linux-pam)))
4635 (home-page "https://sourceforge.net/projects/libcg/")
4636 (synopsis "Control groups management tools")
4637 (description "Control groups is Linux kernel method for process resource
4638 restriction, permission handling and more. This package provides userspace
4639 interface to this kernel feature.")
4640 (license license:lgpl2.1)))
4642 (define-public mbpfan
4649 (uri (string-append "https://github.com/dgraziotin/mbpfan/archive/v"
4651 (file-name (string-append name "-" version ".tar.gz"))
4654 "0wifsws9icki95hhfh4zw1hmk07ddmkcz9mg5a9jr7q2kkrk01cx"))))
4655 (build-system gnu-build-system)
4657 '(#:tests? #f ; no tests
4658 #:make-flags (let ((out (assoc-ref %outputs "out")))
4659 (list (string-append "DESTDIR=" out)
4662 (modify-phases %standard-phases
4663 (add-after 'unpack 'patch-paths
4665 (substitute* "Makefile"
4668 (delete 'configure)))) ; There's no configure phase.
4669 (home-page "https://github.com/dgraziotin/mbpfan")
4670 (synopsis "Control fan speed on Macbooks")
4672 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
4673 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
4674 module. It can be executed as a daemon or in the foreground with root
4676 (license license:gpl3+)))
4685 (url "https://github.com/intel/opa-psm2.git")
4686 (commit (string-append "PSM2_" version))))
4687 (file-name (git-file-name name version))
4690 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
4691 (build-system gnu-build-system)
4694 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4696 #:phases (modify-phases %standard-phases
4698 (add-after 'unpack 'patch-Makefiles
4700 (substitute* "Makefile"
4703 (substitute* "compat/Makefile"
4709 (setenv "DESTDIR" %output)
4710 (invoke "make" "install")
4713 `(("rdma-core" ,rdma-core)
4714 ("numactl" ,numactl)))
4715 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
4717 "This package is low-level user-level Intel's communications interface.
4718 The PSM2 API is a high-performance vendor-specific protocol that provides a
4719 low-level communications interface for the Intel Omni-Path family of
4720 high-speed networking devices.")
4721 (home-page "https://github.com/intel/opa-psm2")
4722 ;; Only the x86_64 architecure is supported.
4723 (supported-systems '("x86_64-linux"))
4724 (license (list license:bsd-3 license:gpl2)))) ; dual
4726 (define-public libpfm4
4732 (uri (string-append "mirror://sourceforge/perfmon2/"
4733 name "/libpfm-" version ".tar.gz"))
4736 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
4737 (build-system gnu-build-system)
4739 '(#:modules ((guix build utils)
4740 (guix build gnu-build-system))
4741 #:phases (modify-phases %standard-phases
4745 (lambda* (#:key inputs outputs #:allow-other-keys)
4746 (let* ((out (assoc-ref outputs "out")))
4751 (lambda* (#:key outputs #:allow-other-keys)
4752 (let* ((out (assoc-ref outputs "out")))
4754 (string-append "PREFIX=" out)
4757 (synopsis "Performance event monitoring library")
4759 "This package provides a library called libpfm4, which is used to develop
4760 monitoring tools exploiting the performance monitoring events such as those
4761 provided by the Performance Monitoring Unit (PMU) of modern processors.
4763 Libpfm4 helps convert from an event name, expressed as a string, to the event
4764 encoding that is either the raw event as documented by the hardware vendor or
4765 the OS-specific encoding. In the latter case, the library is able to prepare
4766 the OS-specific data structures needed by the kernel to setup the event.
4768 libpfm4 provides support for the @code{perf_events} interface, which was
4769 introduced in Linux 2.6.31.")
4770 (home-page "http://perfmon2.sourceforge.net/")
4771 (license license:expat)))