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 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 Rene Saavedra <rennes@openmailbox.org>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
22 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
31 ;;; This file is part of GNU Guix.
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46 (define-module (gnu packages linux)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages acl)
49 #:use-module (gnu packages admin)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages attr)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages bash)
56 #:use-module (gnu packages bison)
57 #:use-module (gnu packages calendar)
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages crypto)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages databases)
62 #:use-module (gnu packages datastructures)
63 #:use-module (gnu packages docbook)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages elf)
66 #:use-module (gnu packages flex)
67 #:use-module (gnu packages file)
68 #:use-module (gnu packages freedesktop)
69 #:use-module (gnu packages gcc)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages glib)
72 #:use-module (gnu packages gnuzilla)
73 #:use-module (gnu packages gperf)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages libunwind)
76 #:use-module (gnu packages libusb)
77 #:use-module (gnu packages man)
78 #:use-module (gnu packages maths)
79 #:use-module (gnu packages multiprecision)
80 #:use-module (gnu packages ncurses)
81 #:use-module (gnu packages netpbm)
82 #:use-module (gnu packages networking)
83 #:use-module (gnu packages ninja)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages pciutils)
86 #:use-module (gnu packages pkg-config)
87 #:use-module (gnu packages popt)
88 #:use-module (gnu packages pulseaudio)
89 #:use-module (gnu packages python)
90 #:use-module (gnu packages readline)
91 #:use-module (gnu packages rrdtool)
92 #:use-module (gnu packages samba)
93 #:use-module (gnu packages slang)
94 #:use-module (gnu packages storage)
95 #:use-module (gnu packages texinfo)
96 #:use-module (gnu packages tls)
97 #:use-module (gnu packages valgrind)
98 #:use-module (gnu packages video)
99 #:use-module (gnu packages web)
100 #:use-module (gnu packages xiph)
101 #:use-module (gnu packages xml)
102 #:use-module (gnu packages xdisorg)
103 #:use-module (gnu packages xorg)
104 #:use-module (gnu packages groff)
105 #:use-module (gnu packages selinux)
106 #:use-module (gnu packages swig)
107 #:use-module (guix build-system cmake)
108 #:use-module (guix build-system gnu)
109 #:use-module (guix build-system python)
110 #:use-module (guix build-system trivial)
111 #:use-module (guix download)
112 #:use-module (guix git-download)
113 #:use-module ((guix licenses) #:prefix license:)
114 #:use-module (guix packages)
115 #:use-module (guix utils)
116 #:use-module (srfi srfi-1)
117 #:use-module (srfi srfi-2)
118 #:use-module (srfi srfi-26)
119 #:use-module (ice-9 match))
121 (define-public (system->linux-architecture arch)
122 "Return the Linux architecture name for ARCH, a Guix system name such as
123 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
124 (let ((arch (car (string-split arch #\-))))
125 (cond ((string=? arch "i686") "i386")
126 ((string-prefix? "mips" arch) "mips")
127 ((string-prefix? "arm" arch) "arm")
128 ((string-prefix? "aarch64" arch) "arm64")
129 ((string-prefix? "alpha" arch) "alpha")
130 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
133 (define-public (system->defconfig system)
134 "Some systems (notably powerpc-linux) require a special target for kernel
135 defconfig. Return the appropriate make target if applicable, otherwise return
137 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
138 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
141 (define (linux-libre-urls version)
142 "Return a list of URLs for Linux-Libre VERSION."
144 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
145 version "-gnu/linux-libre-" version "-gnu.tar.xz")
147 ;; XXX: Work around <http://bugs.gnu.org/14851>.
149 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
150 version "-gnu.tar.xz")
152 ;; Maybe this URL will become valid eventually.
154 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
155 version "-gnu.tar.xz")))
157 (define-public linux-libre-headers
159 (name "linux-libre-headers")
163 (uri (linux-libre-urls version))
166 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
167 (build-system gnu-build-system)
168 (native-inputs `(("perl" ,perl)))
170 `(#:modules ((guix build gnu-build-system)
174 (modify-phases %standard-phases
178 (let ((arch ,(system->linux-architecture
179 (or (%current-target-system)
181 (defconfig ,(system->defconfig
182 (or (%current-target-system)
183 (%current-system)))))
185 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
186 (and (zero? (system* "make" defconfig))
187 (zero? (system* "make" "mrproper" "headers_check"))))))
189 (lambda* (#:key outputs #:allow-other-keys)
190 (let ((out (assoc-ref outputs "out")))
191 (and (zero? (system* "make"
192 (string-append "INSTALL_HDR_PATH=" out)
195 (mkdir (string-append out "/include/config"))
196 (call-with-output-file
198 "/include/config/kernel.release")
200 (format p "~a-default~%" ,version)))
202 ;; Remove the '.install' and '..install.cmd' files; the
203 ;; latter contains store paths, which pulls in bootstrap
204 ;; binaries in the build environment, and prevents bit
205 ;; reproducibility for the bootstrap binaries.
206 (for-each delete-file (find-files out "\\.install"))
209 #:allowed-references ()
211 (home-page "https://www.gnu.org/software/linux-libre/")
212 (synopsis "GNU Linux-Libre kernel headers")
213 (description "Headers of the Linux-Libre kernel.")
214 (license license:gpl2)))
216 (define %boot-logo-patch
217 ;; Linux-Libre boot logo featuring Freedo and a gnu.
220 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
221 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
224 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
226 (define* (kernel-config arch #:key variant)
227 "Return the absolute file name of the Linux-Libre build configuration file
228 for ARCH and optionally VARIANT, or #f if there is no such configuration."
229 (let* ((name (string-append (if variant (string-append variant "-") "")
230 (if (string=? "i386" arch) "i686" arch) ".conf"))
231 (file (string-append "linux-libre/" name)))
232 (search-auxiliary-file file)))
234 (define %default-extra-linux-options
235 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
236 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
237 ;; Modules required for initrd:
238 ("CONFIG_NET_9P" . m)
239 ("CONFIG_NET_9P_VIRTIO" . m)
240 ("CONFIG_VIRTIO_BLK" . m)
241 ("CONFIG_VIRTIO_NET" . m)
242 ("CONFIG_VIRTIO_PCI" . m)
243 ("CONFIG_VIRTIO_BALLOON" . m)
244 ("CONFIG_VIRTIO_MMIO" . m)
245 ("CONFIG_FUSE_FS" . m)
247 ("CONFIG_9P_FS" . m)))
249 (define (config->string options)
250 (string-join (map (match-lambda
252 (string-append option "=m"))
254 (string-append option "=y"))
256 (string-append option "=n")))
260 (define* (make-linux-libre version hash supported-systems
262 ;; A function that takes an arch and a variant.
263 ;; See kernel-config for an example.
265 (configuration-file #f)
266 (defconfig "defconfig")
267 (extra-options %default-extra-linux-options)
268 (patches (list %boot-logo-patch)))
270 (name (if extra-version
271 (string-append "linux-libre-" extra-version)
276 (uri (linux-libre-urls version))
277 (sha256 (base32 hash))
279 (supported-systems supported-systems)
280 (build-system gnu-build-system)
286 ;; On x86, build with GCC-7 for full retpoline support.
287 ;; FIXME: Remove this when our default compiler has retpoline support.
288 ,@(match (system->linux-architecture
289 (or (%current-target-system) (%current-system)))
290 ((or "x86_64" "i386")
294 ,@(match (and configuration-file
296 (system->linux-architecture
297 (or (%current-target-system) (%current-system)))
298 #:variant (version-major+minor version)))
299 (#f ;no config for this platform
302 `(("kconfig" ,config))))))
304 `(#:modules ((guix build gnu-build-system)
309 (modify-phases %standard-phases
311 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
312 ;; Avoid introducing timestamps
313 (setenv "KCONFIG_NOTIMESTAMP" "1")
314 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
316 ;; Set ARCH and CROSS_COMPILE
317 (let ((arch ,(system->linux-architecture
318 (or (%current-target-system)
319 (%current-system)))))
321 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
324 (setenv "CROSS_COMPILE" (string-append target "-"))
325 (format #t "`CROSS_COMPILE' set to `~a'~%"
326 (getenv "CROSS_COMPILE"))))
328 (setenv "EXTRA_VERSION" ,extra-version)
330 (let ((build (assoc-ref %standard-phases 'build))
331 (config (assoc-ref (or native-inputs inputs) "kconfig")))
333 ;; Use a custom kernel configuration file or a default
334 ;; configuration file.
337 (copy-file config ".config")
338 (chmod ".config" #o666))
339 (system* "make" ,defconfig))
341 ;; Appending works even when the option wasn't in the
342 ;; file. The last one prevails if duplicated.
343 (let ((port (open-file ".config" "a"))
344 (extra-configuration ,(config->string extra-options)))
345 (display extra-configuration port)
348 (zero? (system* "make" "oldconfig")))))
350 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
351 (let* ((out (assoc-ref outputs "out"))
352 (moddir (string-append out "/lib/modules"))
353 (dtbdir (string-append out "/lib/dtbs"))
354 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
355 ;; Install kernel image, kernel configuration and link map.
356 (for-each (lambda (file) (install-file file out))
357 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map)$"))
358 ;; Install device tree files
359 (for-each (lambda (file) (install-file file dtbdir))
360 (find-files "." "\\.dtb$"))
361 ;; Install kernel modules
363 (zero? (system* "make"
364 (string-append "DEPMOD=" kmod "/bin/depmod")
365 (string-append "MODULE_DIR=" moddir)
366 (string-append "INSTALL_PATH=" out)
367 (string-append "INSTALL_MOD_PATH=" out)
368 "INSTALL_MOD_STRIP=1"
369 "modules_install"))))))
371 (home-page "https://www.gnu.org/software/linux-libre/")
372 (synopsis "100% free redistribution of a cleaned Linux kernel")
374 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
375 It has been modified to remove all non-free binary blobs.")
376 (license license:gpl2)))
378 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
379 (define %linux-compatible-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
381 ;; linux-libre configuration for armhf-linux is derived from Debian armmp. It
382 ;; supports qemu "virt" machine and possibly a large number of ARM boards.
383 ;; See : https://wiki.debian.org/DebianKernel/ARMMP.
385 (define %linux-libre-version "4.15.2")
386 (define %linux-libre-hash "0rzncbk513a8q60z9psb9yz7liadsb7nghj12s1kmwn441z1zv93")
388 (define-public linux-libre
389 (make-linux-libre %linux-libre-version
391 %linux-compatible-systems
392 #:configuration-file kernel-config))
394 (define %linux-libre-4.14-version "4.14.18")
395 (define %linux-libre-4.14-hash "1kl6zc9dzi02hzxwmzskxb4cqh5lph4afy94677bj5ribanmizn5")
397 (define-public linux-libre-4.14
398 (make-linux-libre %linux-libre-4.14-version
399 %linux-libre-4.14-hash
400 %linux-compatible-systems
401 #:configuration-file kernel-config))
403 (define-public linux-libre-4.9
404 (make-linux-libre "4.9.80"
405 "094c66sh4h1n46as20n0ip2clp89khsn91ngxwg5p85gf3jqk1h9"
406 %intel-compatible-systems
407 #:configuration-file kernel-config))
409 (define-public linux-libre-4.4
410 (make-linux-libre "4.4.115"
411 "1jjq33jgixkljp3ngxhra0khmfd4mjmp08kw84h422gldb1n2j0q"
412 %intel-compatible-systems
413 #:configuration-file kernel-config))
415 (define-public linux-libre-4.1
416 (make-linux-libre "4.1.49"
417 "0dklmqj6ayjlkz97b811zdvpgb3yppahinji9l9jmkz4ssi7a1gs"
418 %intel-compatible-systems
419 #:configuration-file kernel-config))
421 (define-public linux-libre-arm-generic
422 (make-linux-libre %linux-libre-version
425 #:defconfig "multi_v7_defconfig"
426 #:extra-version "arm-generic"))
428 (define-public linux-libre-arm-generic-4.14
429 (make-linux-libre %linux-libre-4.14-version
430 %linux-libre-4.14-hash
432 #:defconfig "multi_v7_defconfig"
433 #:extra-version "arm-generic"))
435 (define-public linux-libre-arm-omap2plus
436 (make-linux-libre %linux-libre-version
439 #:defconfig "omap2plus_defconfig"
440 #:extra-version "arm-omap2plus"))
442 (define-public linux-libre-arm-omap2plus-4.14
443 (make-linux-libre %linux-libre-4.14-version
444 %linux-libre-4.14-hash
446 #:defconfig "omap2plus_defconfig"
447 #:extra-version "arm-omap2plus"))
451 ;;; Pluggable authentication modules (PAM).
454 (define-public linux-pam
462 "http://www.linux-pam.org/library/"
463 "Linux-PAM-" version ".tar.bz2"))
466 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
467 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
469 (build-system gnu-build-system)
473 ;; TODO: optional dependencies
474 ;; ("libxcrypt" ,libxcrypt)
475 ;; ("cracklib" ,cracklib)
478 `(;; Most users, such as `shadow', expect the headers to be under
480 #:configure-flags (list (string-append "--includedir="
481 (assoc-ref %outputs "out")
484 ;; XXX: <rpc/rpc.h> is missing from glibc when
485 ;; cross-compiling, so we have to disable NIS
486 ;; support altogether.
487 ,@(if (%current-target-system)
491 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
494 (home-page "http://www.linux-pam.org/")
495 (synopsis "Pluggable authentication modules for Linux")
497 "A *Free* project to implement OSF's RFC 86.0.
498 Pluggable authentication modules are small shared object files that can
499 be used through the PAM API to perform tasks, like authenticating a user
500 at login. Local and dynamic reconfiguration are its key features.")
501 (license license:bsd-3)))
503 (define-public linux-pam-1.2
511 "http://www.linux-pam.org/library/"
512 "Linux-PAM-" version ".tar.bz2"))
515 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
516 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
523 (define-public psmisc
530 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
534 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
535 (build-system gnu-build-system)
536 (inputs `(("ncurses" ,ncurses)))
537 (home-page "https://gitlab.com/psmisc/psmisc")
539 "Small utilities that use the proc file system")
541 "This PSmisc package is a set of some small useful utilities that
542 use the proc file system. We're not about changing the world, but
543 providing the system administrator with some help in common tasks.")
544 (license license:gpl2+)))
546 (define-public util-linux
552 (uri (string-append "mirror://kernel.org/linux/utils/"
553 name "/v" (version-major+minor version) "/"
554 name "-" version ".tar.xz"))
557 "0hdq2fz405a89fyha4bgwg0rx8b65inxq17w8fg8qhmcj4x3dr0v"))
558 (patches (search-patches "util-linux-tests.patch"))
559 (modules '((guix build utils)))
561 ;; We take the 'logger' program from GNU Inetutils and 'kill'
562 ;; from GNU Coreutils.
564 (substitute* "configure"
565 (("build_logger=yes") "build_logger=no")
566 (("build_kill=yes") "build_kill=no"))
568 (build-system gnu-build-system)
570 "static")) ; >2 MiB of static .a libraries
572 `(#:configure-flags (list "--disable-use-tty-group"
573 "--enable-fs-paths-default=/run/current-system/profile/sbin"
574 ;; Install completions where our
575 ;; bash-completion package expects them.
576 (string-append "--with-bashcompletiondir="
577 (assoc-ref %outputs "out")
578 "/etc/bash_completion.d"))
579 #:phases (modify-phases %standard-phases
581 'build 'set-umount-file-name
582 (lambda* (#:key outputs #:allow-other-keys)
583 ;; Tell 'eject' the right file name of 'umount'.
584 (let ((out (assoc-ref outputs "out")))
585 (substitute* "sys-utils/eject.c"
587 (string-append "\"" out "/bin/umount\"")))
591 (lambda* (#:key inputs outputs #:allow-other-keys)
592 (let ((out (assoc-ref outputs "out"))
593 (net (assoc-ref inputs "net-base")))
594 ;; Change the test to refer to the right file.
595 (substitute* "tests/ts/misc/mcookie"
597 (string-append net "/etc/services")))
600 'install 'move-static-libraries
601 (lambda* (#:key outputs #:allow-other-keys)
602 (let ((out (assoc-ref outputs "out"))
603 (static (assoc-ref outputs "static")))
604 (mkdir-p (string-append static "/lib"))
605 (with-directory-excursion out
606 (for-each (lambda (file)
608 (string-append static "/"
610 (find-files "lib" "\\.a$")))
612 (inputs `(("zlib" ,zlib)
615 ;; XXX: This is so that the 'pre-check' phase can find it.
616 ,@(if (%current-target-system)
617 `(("net-base" ,net-base))
621 ("net-base" ,net-base))) ;for tests
622 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
623 (synopsis "Collection of utilities for the Linux kernel")
624 (description "Util-linux is a diverse collection of Linux kernel
625 utilities. It provides dmesg and includes tools for working with file systems,
626 block devices, UUIDs, TTYs, and many other tools.")
628 ;; Note that util-linux doesn't use the same license for all the
629 ;; code. GPLv2+ is the default license for a code without an
630 ;; explicitly defined license.
631 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
632 license:bsd-4 license:public-domain))))
640 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
642 (file-name (string-append name "-" version ".tar.gz"))
644 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
645 (build-system cmake-build-system)
646 (arguments '(#:tests? #f))
647 (home-page "https://github.com/bo0ts/ddate")
648 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
650 "ddate displays the Discordian date and holidays of a given date.
651 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
652 by Robert Shea and Robert Anton Wilson.")
653 (license license:public-domain)))
655 (define-public procps
661 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
662 "procps-ng-" version ".tar.xz"))
665 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
666 (build-system gnu-build-system)
668 '(#:modules ((guix build utils)
669 (guix build gnu-build-system)
673 (modify-phases %standard-phases
674 (add-before 'check 'disable-strtod-test
676 ;; Disable the 'strtod' test, which fails on 32-bit systems.
677 ;; This is what upstream does:
678 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
679 (substitute* "Makefile"
680 (("^(TESTS|check_PROGRAMS) = .*$" all)
681 (string-append "# " all "\n")))
684 'install 'post-install
685 ;; Remove commands and man pages redudant with
687 (lambda* (#:key outputs #:allow-other-keys)
688 (let* ((out (assoc-ref outputs "out"))
689 (dup (append-map (cut find-files out <>)
690 '("^kill" "^uptime"))))
691 (for-each delete-file dup)
693 (inputs `(("ncurses" ,ncurses)))
694 (home-page "https://gitlab.com/procps-ng/procps/")
695 (synopsis "Utilities that give information about processes")
697 "Procps is the package that has a bunch of small useful utilities
698 that give information about processes using the Linux /proc file system.
699 The package includes the programs ps, top, vmstat, w, kill, free,
700 slabtop, and skill.")
701 (license license:gpl2)))
703 (define-public usbutils
710 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
711 "usbutils-" version ".tar.xz"))
714 "0q3iavmak2bs9xw486w4xfbjl0hbzii93ssgpr95mxmm9kjz1gwb"))))
715 (build-system gnu-build-system)
720 `(("pkg-config" ,pkg-config)))
721 (home-page "http://www.linux-usb.org/")
723 "Tools for working with USB devices, such as lsusb")
725 "Tools for working with USB devices, such as lsusb.")
726 (license license:gpl2+)))
728 (define-public e2fsprogs
735 "mirror://kernel.org/linux/kernel/people/tytso/"
736 name "/v" version "/"
737 name "-" version ".tar.xz"))
740 "00ilv65dzcgiap435j89xk86shf7rrav3wsik7cahy789qijdcn9"))))
741 (build-system gnu-build-system)
742 (inputs `(("util-linux" ,util-linux)))
743 (native-inputs `(("pkg-config" ,pkg-config)
744 ("texinfo" ,texinfo) ;for the libext2fs Info manual
750 '(;; util-linux is the preferred source for some of the libraries and
751 ;; commands, so disable them (see, e.g.,
752 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
753 #:configure-flags (list "--disable-libblkid"
754 "--disable-libuuid" "--disable-uuidd"
757 ;; Use symlinks instead of hard links for
758 ;; 'fsck.extN' etc. This makes the resulting nar
759 ;; smaller and is preserved across copies.
760 "--enable-symlink-install"
762 (string-append "LDFLAGS=-Wl,-rpath="
763 (assoc-ref %outputs "out")
766 ;; Install libext2fs et al.
767 "--enable-elf-shlibs")
770 (modify-phases %standard-phases
771 (add-before 'configure 'patch-shells
773 (substitute* "configure"
774 (("/bin/sh (.*)parse-types.sh" _ dir)
775 (string-append (which "sh") " " dir
777 (substitute* "MCONFIG.in"
778 (("INSTALL_SYMLINK = /bin/sh")
779 "INSTALL_SYMLINK = sh"))
780 (substitute* (find-files "." "^Makefile.in$")
782 (string-append "#!" (which "sh"))))
784 (add-after 'install 'install-libs
785 (lambda* (#:key outputs #:allow-other-keys)
786 (let* ((out (assoc-ref outputs "out"))
787 (lib (string-append out "/lib")))
788 (and (zero? (system* "make" "install-libs"))
790 ;; Make the .a writable so that 'strip' works.
791 ;; Failing to do that, due to debug symbols, we
792 ;; retain a reference to the final
793 ;; linux-libre-headers, which refer to the
794 ;; bootstrap binaries.
795 (let ((archives (find-files lib "\\.a$")))
796 (for-each (lambda (file)
800 (home-page "http://e2fsprogs.sourceforge.net/")
801 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
803 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
804 (license (list license:gpl2 ;programs
805 license:lgpl2.0 ;libext2fs
806 license:x11)))) ;libuuid
808 (define e2fsprogs/static
810 (package (inherit e2fsprogs)
812 ;; Do not build shared libraries.
813 (substitute-keyword-arguments (package-arguments e2fsprogs)
814 ((#:configure-flags _)
815 '(list "--disable-blkid"))
819 (define-public e2fsck/static
821 (name "e2fsck-static")
822 (version (package-version e2fsprogs))
823 (build-system trivial-build-system)
826 `(("e2fsprogs" ,e2fsprogs/static)))
828 `(#:modules ((guix build utils))
831 (use-modules (guix build utils)
835 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
837 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
839 (with-directory-excursion bin
840 (copy-file e2fsck "e2fsck")
841 (remove-store-references "e2fsck")
842 (chmod "e2fsck" #o555))))))
843 (home-page (package-home-page e2fsprogs))
844 (synopsis "Statically-linked e2fsck command from e2fsprogs")
845 (description "This package provides statically-linked e2fsck command taken
846 from the e2fsprogs package. It is meant to be used in initrds.")
847 (license (package-license e2fsprogs))))
849 (define-public extundelete
855 (uri (string-append "mirror://sourceforge/extundelete/"
856 "extundelete/" version "/extundelete-"
860 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
861 (build-system gnu-build-system)
862 (inputs `(("e2fsprogs" ,e2fsprogs)))
863 (home-page "http://extundelete.sourceforge.net/")
864 (synopsis "Recover deleted files from ext2/3/4 partitions")
866 "Extundelete is a set of tools that can recover deleted files from an
867 ext3 or ext4 partition.")
868 (license license:gpl2)))
870 (define-public zerofree
874 (home-page "https://frippery.org/uml/")
877 (uri (string-append home-page name "-" version
881 "059g29x5r1xj6wcj4xj85l8w6qrxyl86yqbybjqqz6nxz4falxzf"))))
882 (build-system gnu-build-system)
885 (modify-phases %standard-phases
886 (delete 'configure) ; no configure script
888 ;; The Makefile lacks an ‘install’ target.
889 (lambda* (#:key outputs #:allow-other-keys)
890 (let* ((out (assoc-ref outputs "out"))
891 (bin (string-append out "/bin")))
892 (chmod "zerofree" #o555)
893 (install-file "zerofree" bin)
895 #:tests? #f)) ; no tests
896 (inputs `(("libext2fs" ,e2fsprogs)))
897 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
899 "Zerofree finds the unallocated blocks with non-zero value content in an
900 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
901 This is a simple way to make disk images more compressible.
902 Zerofree requires the file system to be unmounted or mounted read-only.")
903 (license license:gpl2)))
905 (define-public strace
911 (uri (string-append "mirror://sourceforge/strace/strace/" version
912 "/strace-" version ".tar.xz"))
915 "08y5b07vb8jc7ak5xc3x2kx1ly6xiwv1gnppcqjs81kks66i9wsv"))))
916 (build-system gnu-build-system)
919 (modify-phases %standard-phases
920 (add-after 'unpack 'patch-/bin/sh
922 (substitute* "strace.c"
923 (("/bin/sh") (which "sh")))
925 (native-inputs `(("perl" ,perl)))
926 (home-page "https://strace.io/")
927 (synopsis "System call tracer for Linux")
929 "strace is a system call tracer, i.e. a debugging tool which prints out a
930 trace of all the system calls made by a another process/program.")
931 (license license:bsd-3)))
933 (define-public ltrace
939 (uri (string-append "http://www.ltrace.org/ltrace_" version
943 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
944 (build-system gnu-build-system)
945 (inputs `(("libelf" ,libelf)))
947 ;; Compilation uses -Werror by default, but it fails.
948 '(#:configure-flags '("--disable-werror")))
949 (home-page "https://www.ltrace.org/")
950 (synopsis "Library call tracer for Linux")
952 "ltrace intercepts and records dynamic library calls which are called by
953 an executed process and the signals received by that process. It can also
954 intercept and print the system calls executed by the program.")
955 (license license:gpl2+)))
957 (define-public alsa-lib
964 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
968 "0xjvi381105gldhv0z872a0x58sghznyx19j45lw5iyi2h68gfwi"))))
969 (build-system gnu-build-system)
970 (home-page "https://www.alsa-project.org/")
971 (synopsis "The Advanced Linux Sound Architecture libraries")
973 "The Advanced Linux Sound Architecture (ALSA) provides audio and
974 MIDI functionality to the Linux-based operating system.")
975 (license license:lgpl2.1+)))
977 (define-public alsa-utils
983 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
984 name "-" version ".tar.bz2"))
987 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
988 (build-system gnu-build-system)
990 ;; XXX: Disable man page creation until we have DocBook.
991 '(#:configure-flags (list "--disable-xmlto"
993 ;; The udev rule is responsible for restoring
995 (string-append "--with-udev-rules-dir="
996 (assoc-ref %outputs "out")
997 "/lib/udev/rules.d"))
999 (modify-phases %standard-phases
1001 'install 'pre-install
1003 ;; Don't try to mkdir /var/lib/alsa.
1004 (substitute* "Makefile"
1005 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1009 `(("libsamplerate" ,libsamplerate)
1010 ("ncurses" ,ncurses)
1011 ("alsa-lib" ,alsa-lib)
1013 ("gettext" ,gettext-minimal)))
1014 (home-page "http://www.alsa-project.org/")
1015 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1017 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1018 MIDI functionality to the Linux-based operating system.")
1020 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1022 (license license:gpl2)))
1024 (define-public alsa-plugins
1026 (name "alsa-plugins")
1030 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1031 name "-" version ".tar.bz2"))
1034 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
1035 (build-system gnu-build-system)
1036 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1037 ;; be split, there are references to both in files.
1038 ;; TODO: Remove OSS related plugins, they add support to run native
1039 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1041 (outputs '("out" "pulseaudio"))
1044 (modify-phases %standard-phases
1045 (add-after 'install 'split
1046 (lambda* (#:key inputs outputs #:allow-other-keys)
1047 ;; Distribute the binaries to the various outputs.
1048 (let* ((out (assoc-ref outputs "out"))
1049 (pua (assoc-ref outputs "pulseaudio"))
1050 (pualib (string-append pua "/lib/alsa-lib"))
1051 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
1054 (chdir (string-append out "/share"))
1055 (for-each (lambda (file)
1056 (rename-file file (string-append puaconf "/" (basename file))))
1057 (find-files out "\\.(conf|example)"))
1058 (for-each (lambda (file)
1059 (rename-file file (string-append pualib "/" (basename file))))
1060 (find-files out ".*pulse\\.(la|so)"))
1062 ;; We have moved the files to output pulsaudio, the
1063 ;; directory is now empty.
1064 (delete-file-recursively (string-append out "/share"))
1067 `(("alsa-lib" ,alsa-lib)
1068 ("speex" ,speex) ; libspeexdsp resampling plugin
1069 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1070 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1071 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1073 `(("pkg-config" ,pkg-config)))
1074 (home-page "http://www.alsa-project.org/")
1075 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1077 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1078 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1079 by providing additional plugins which include: upmixing, downmixing, jackd and
1080 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1081 external rate conversion.")
1082 (license (list license:gpl2+
1083 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1084 license:lgpl2.1+))))
1086 (define-public iptables
1093 "mirror://netfilter.org/iptables/iptables-"
1094 version ".tar.bz2"))
1097 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
1098 (build-system gnu-build-system)
1100 `(("pkg-config" ,pkg-config)
1104 `(("libmnl" ,libmnl)
1105 ("libnftnl" ,libnftnl)))
1107 '(#:tests? #f ; no test suite
1108 #:configure-flags ; add $libdir to the RUNPATH of executables
1109 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1110 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1111 (synopsis "Program to configure the Linux IP packet filtering rules")
1113 "iptables is the userspace command line program used to configure the
1114 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1115 system administrators. Since Network Address Translation is also configured
1116 from the packet filter ruleset, iptables is used for this, too. The iptables
1117 package also includes ip6tables. ip6tables is used for configuring the IPv6
1119 (license license:gpl2+)))
1121 (define-public ebtables
1124 (version "2.0.10-4")
1128 "mirror://netfilter.org/ebtables/ebtables-v"
1132 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1133 (build-system gnu-build-system)
1135 '(#:tests? #f ; no test suite
1137 (let* ((out (assoc-ref %outputs "out"))
1138 (bin (string-append out "/sbin"))
1139 (lib (string-append out "/lib"))
1140 (man (string-append out "/share/man"))
1141 (iptables (assoc-ref %build-inputs "iptables"))
1142 (ethertypes (string-append iptables "/etc/ethertypes")))
1143 (list (string-append "LIBDIR=" lib)
1144 (string-append "MANDIR=" man)
1145 (string-append "BINDIR=" bin)
1146 (string-append "ETHERTYPESFILE=" ethertypes)
1147 ;; With the default CFLAGS, it falis with:
1148 ;; communication.c:259:58: error: variable ‘ret’ set but not
1149 ;; used [-Werror=unused-but-set-variable]
1152 (modify-phases %standard-phases
1154 ;; no configure script
1156 (substitute* "Makefile"
1157 ;; Remove user and group options from install commands,
1158 ;; otherwise it fails with: invalid user 'root'.
1159 (("-o root -g root") "")
1160 ;; Remove 'ethertypes' from the install target.
1162 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1166 ("iptables" ,iptables)))
1167 (synopsis "Ethernet bridge frame table administration")
1168 (home-page "http://ebtables.netfilter.org/")
1170 "ebtables is an application program used to set up and maintain the
1171 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1172 analogous to the iptables application, but less complicated, due to the fact
1173 that the Ethernet protocol is much simpler than the IP protocol.")
1174 (license license:gpl2+)))
1176 (define-public iproute
1183 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1187 "0mc3g4kj7h3jhwz2b2gdf41gp6bhqn7axh4mnyvhkdnpk5m63m28"))))
1188 (build-system gnu-build-system)
1190 `(#:tests? #f ; no test suite
1191 #:make-flags (let ((out (assoc-ref %outputs "out")))
1193 (string-append "BASH_COMPDIR=" out
1194 "/etc/bash_completion.d")
1195 (string-append "LIBDIR=" out "/lib")
1196 (string-append "HDRDIR=" out "/include")
1197 (string-append "SBINDIR=" out "/sbin")
1198 (string-append "CONFDIR=" out "/etc")
1199 (string-append "DOCDIR=" out "/share/doc/"
1201 (string-append "MANDIR=" out "/share/man")))
1202 #:phases (modify-phases %standard-phases
1203 (add-before 'install 'pre-install
1205 ;; Don't attempt to create /var/lib/arpd.
1206 (substitute* "Makefile"
1207 (("^.*ARPDDIR.*$") "")))))))
1209 `(("iptables" ,iptables)
1212 `(("pkg-config" ,pkg-config)
1216 "https://wiki.linuxfoundation.org/networking/iproute2")
1218 "Utilities for controlling TCP/IP networking and traffic in Linux")
1220 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1221 and traffic with the Linux kernel. The most important of these are
1222 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1225 Most network configuration manuals still refer to ifconfig and route as the
1226 primary network configuration tools, but ifconfig is known to behave
1227 inadequately in modern network environments, and both should be deprecated.")
1228 (license license:gpl2+)))
1230 ;; There are two packages for net-tools. The first, net-tools, is more recent
1231 ;; and probably safer to use with untrusted inputs (i.e. the internet). The
1232 ;; second, net-tools-for-tests, is relatively old and buggy. It can be used in
1233 ;; package test suites and should never be referred to by a built package. Use
1234 ;; #:disallowed-references to enforce this.
1236 ;; When we are able to rebuild many packages (i.e. core-updates), we can update
1237 ;; net-tools-for-tests if appropriate.
1239 ;; See <https://bugs.gnu.org/27811> for more information.
1240 (define-public net-tools
1241 ;; XXX: This package is basically unmaintained, but it provides a few
1242 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1244 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1248 (version (string-append "1.60-" revision "." (string-take commit 7)))
1251 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1252 "n/ne/net-tools/code.git/net-tools-code-"
1254 (file-name (string-append name "-" version ".zip"))
1257 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1258 (home-page "http://net-tools.sourceforge.net/")
1259 (build-system gnu-build-system)
1261 '(#:modules ((guix build gnu-build-system)
1266 (modify-phases %standard-phases
1268 (lambda* (#:key outputs #:allow-other-keys)
1269 (let ((out (assoc-ref outputs "out")))
1270 (mkdir-p (string-append out "/bin"))
1271 (mkdir-p (string-append out "/sbin"))
1273 ;; Pretend we have everything...
1274 (system "yes | make config")
1276 ;; ... except for the things we don't have.
1277 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1278 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1279 ;; that have been removed.
1280 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1281 ;; think about adding them later.
1282 (substitute* '("config.make" "config.h")
1283 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1285 (add-after 'install 'remove-redundant-commands
1286 (lambda* (#:key outputs #:allow-other-keys)
1287 ;; Remove commands and man pages redundant with Inetutils.
1288 (let* ((out (assoc-ref outputs "out"))
1289 (dup (append-map (cut find-files out <>)
1291 "^(yp|nis|dns)?domainname"))))
1292 (for-each delete-file dup)
1294 ;; Binaries that depend on libnet-tools.a don't declare that
1295 ;; dependency, making it parallel-unsafe.
1296 #:parallel-build? #f
1298 #:tests? #f ; no test suite
1299 #:make-flags (let ((out (assoc-ref %outputs "out")))
1301 (string-append "BASEDIR=" out)
1302 (string-append "INSTALLNLSDIR=" out "/share/locale")
1303 (string-append "mandir=/share/man")))))
1304 (native-inputs `(("gettext" ,gettext-minimal)
1306 (synopsis "Tools for controlling the network subsystem in Linux")
1308 "This package includes the important tools for controlling the network
1309 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1310 route. Additionally, this package contains utilities relating to particular
1311 network hardware types (plipconfig, slattach) and advanced aspects of IP
1312 configuration (iptunnel, ipmaddr).")
1313 (license license:gpl2+))))
1315 (define-public net-tools-for-tests
1316 (hidden-package (package (inherit net-tools)
1318 ;; Git depends on net-tools-for-tests via GnuTLS, so we can't use git-fetch
1319 ;; here. We should find a better workaround for this problem so that we can
1320 ;; use the latest upstream source.
1323 (uri (list (string-append
1324 "mirror://sourceforge/net-tools/net-tools-"
1327 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1328 "/base/net-tools/net-tools-1.60.tar.bz2")))
1331 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1332 (patches (search-patches "net-tools-bitrot.patch"))))
1333 (build-system gnu-build-system)
1335 '(#:modules ((guix build gnu-build-system)
1339 #:phases (alist-cons-after
1341 (lambda* (#:key inputs #:allow-other-keys)
1342 (define (apply-patch file)
1343 (zero? (system* "patch" "-p1" "--force"
1346 (let ((patch.gz (assoc-ref inputs "patch")))
1347 (format #t "applying Debian patch set '~a'...~%"
1349 (system (string-append "gunzip < " patch.gz " > the-patch"))
1350 (and (apply-patch "the-patch")
1351 (for-each apply-patch
1352 (find-files "debian/patches"
1356 (lambda* (#:key outputs #:allow-other-keys)
1357 (let ((out (assoc-ref outputs "out")))
1358 (mkdir-p (string-append out "/bin"))
1359 (mkdir-p (string-append out "/sbin"))
1361 ;; Pretend we have everything...
1362 (system "yes | make config")
1364 ;; ... except for the things we don't have.
1365 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1366 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1367 ;; that have been removed.
1368 (substitute* '("config.make" "config.h")
1369 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1371 'install 'remove-redundant-commands
1372 (lambda* (#:key outputs #:allow-other-keys)
1373 ;; Remove commands and man pages redundant with
1375 (let* ((out (assoc-ref outputs "out"))
1376 (dup (append-map (cut find-files out <>)
1378 "^(yp|nis|dns)?domainname"))))
1379 (for-each delete-file dup)
1383 ;; Binaries that depend on libnet-tools.a don't declare that
1384 ;; dependency, making it parallel-unsafe.
1385 #:parallel-build? #f
1387 #:tests? #f ; no test suite
1388 #:make-flags (let ((out (assoc-ref %outputs "out")))
1390 (string-append "BASEDIR=" out)
1391 (string-append "INSTALLNLSDIR=" out "/share/locale")
1392 (string-append "mandir=/share/man")))))
1394 ;; We added unzip to the net-tools package's native-inputs when
1395 ;; switching its source from a Git checkout to a zip archive. We
1396 ;; need to specify the native-inputs here to keep unzip out of the
1397 ;; build of net-tools-for-tests, so that we don't have to rebuild
1398 ;; many packages on the master branch. We can make
1399 ;; net-tools-for-tests inherit directly from net-tools in the next
1400 ;; core-updates cycle.
1401 (native-inputs `(("gettext" ,gettext-minimal)))
1403 ;; Use the big Debian patch set (the thing does not even compile out of
1405 ;; XXX The patch is not actually applied, due to a bug in the 'patch' phase
1406 ;; above. However, this package variant is only used in GnuTLS's tests. It
1407 ;; will be adjusted when convenient for the build farm.
1408 ;; See <https://bugs.gnu.org/27811> for more information.
1409 (inputs `(("patch" ,(origin
1412 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1415 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p")))))))))
1417 (define-public libcap
1424 "mirror://kernel.org/linux/libs/security/linux-privs/"
1425 "libcap2/libcap-" version ".tar.xz"))
1428 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1429 (build-system gnu-build-system)
1430 (arguments '(#:phases
1431 (modify-phases %standard-phases
1433 ;; Add $libdir to the RUNPATH of executables.
1435 (substitute* "Make.Rules"
1437 (string-append "LDFLAGS := -Wl,-rpath="
1438 %output "/lib"))))))
1439 #:tests? #f ; no 'check' target
1440 #:make-flags (list "lib=lib"
1441 (string-append "prefix="
1442 (assoc-ref %outputs "out"))
1443 "RAISE_SETFCAP=no")))
1444 (native-inputs `(("perl" ,perl)))
1445 (inputs `(("attr" ,attr)))
1446 (home-page "https://sites.google.com/site/fullycapable/")
1447 (synopsis "Library for working with POSIX capabilities")
1449 "Libcap2 provides a programming interface to POSIX capabilities on
1450 Linux-based operating systems.")
1452 ;; License is BSD-3 or GPLv2, at the user's choice.
1453 (license license:gpl2)))
1455 (define-public bridge-utils
1457 (name "bridge-utils")
1461 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1462 "bridge-utils-" version ".tar.gz"))
1465 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1466 (build-system gnu-build-system)
1468 ;; The tarball lacks all the generated files.
1469 (native-inputs `(("autoconf" ,autoconf)
1470 ("automake" ,automake)))
1473 (modify-phases %standard-phases
1474 (add-after 'unpack 'bootstrap
1476 ;; Fix "field ‘ip6’ has incomplete type" errors.
1477 (substitute* "libbridge/libbridge.h"
1478 (("#include <linux/if_bridge.h>")
1479 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1481 ;; Ensure that the entire build fails if one of the
1482 ;; sub-Makefiles fails.
1483 (substitute* "Makefile.in"
1484 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1485 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1487 (zero? (system* "autoreconf" "-vf")))))
1488 #:tests? #f)) ; no 'check' target
1491 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1492 (synopsis "Manipulate Ethernet bridges")
1494 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1495 to connect two Ethernet segments together in a protocol independent way.
1496 Packets are forwarded based on Ethernet address, rather than IP address (like
1497 a router). Since forwarding is done at Layer 2, all protocols can go
1498 transparently through a bridge.")
1499 (license license:gpl2+)))
1501 (define-public libnl
1508 "https://github.com/thom311/libnl/releases/download/"
1509 "libnl" (string-join (string-split version #\.) "_")
1510 "/libnl-" version ".tar.gz"))
1513 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
1514 (build-system gnu-build-system)
1518 ("pkg-config" ,pkg-config)
1524 "https://github.com/thom311/libnl/releases/download/libnl"
1525 (string-join (string-split version #\.) "_")
1526 "/libnl-doc-" version ".tar.gz"))
1528 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
1530 `(("python-2" ,python-2)
1531 ("python-3" ,python-3)))
1532 (outputs '("out" "doc" "python2" "python3"))
1534 `(#:modules ((guix build gnu-build-system)
1538 (modify-phases %standard-phases
1539 (add-after 'install 'install-python
1540 (lambda* (#:key outputs #:allow-other-keys)
1541 (define (python-inst python)
1542 (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
1543 (assoc-ref %outputs "out")))
1544 (pyout (assoc-ref %outputs python)))
1546 (zero? (system (format #f "~a ~a setup.py build"
1547 ldflags python pyout)))
1549 (system (format #f "~a ~a setup.py install --prefix=~a"
1550 ldflags python pyout)))
1551 (zero? (system* python "setup.py" "clean")))))
1552 (with-directory-excursion "./python"
1553 (every python-inst '("python2" "python3")))))
1554 (add-after 'install 'install-doc
1555 (lambda* (#:key inputs outputs #:allow-other-keys)
1556 (let ((dest (string-append (assoc-ref outputs "doc")
1557 "/share/doc/libnl")))
1559 (zero? (system* "tar" "xf" (assoc-ref inputs "libnl3-doc")
1560 "--strip-components=1" "-C" dest))))))))
1561 (home-page "https://www.infradead.org/~tgr/libnl/")
1562 (synopsis "NetLink protocol library suite")
1564 "The libnl suite is a collection of libraries providing APIs to netlink
1565 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1566 between the kernel and user space processes. It was designed to be a more
1567 flexible successor to ioctl to provide mainly networking related kernel
1568 configuration and monitoring interfaces.")
1570 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1571 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1572 (license license:gpl2)))
1581 "mirror://kernel.org/software/network/iw/iw-"
1585 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
1586 (build-system gnu-build-system)
1587 (native-inputs `(("pkg-config" ,pkg-config)))
1588 (inputs `(("libnl" ,libnl)))
1590 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1592 #:phases (modify-phases %standard-phases (delete 'configure))))
1593 (home-page "https://wireless.wiki.kernel.org/")
1594 (synopsis "Tool for configuring wireless devices")
1596 "iw is a new nl80211 based CLI configuration utility for wireless
1597 devices. It replaces @code{iwconfig}, which is deprecated.")
1598 (license license:isc)))
1600 (define-public powertop
1608 "https://01.org/sites/default/files/downloads/powertop/powertop-v"
1612 "0l4jjlf05li2mc6g8nrss3h435wjhmnqd8m7v3kha3x0x7cbfzxa"))))
1613 (build-system gnu-build-system)
1616 (modify-phases %standard-phases
1617 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1618 ;; allow calibrating the network interface in GuixSD.
1619 (add-after 'unpack 'patch-absolute-file-names
1620 (lambda* (#:key inputs #:allow-other-keys)
1621 (let ((kmod (assoc-ref inputs "kmod")))
1622 (substitute* (find-files "src" "\\.cpp$")
1623 ;; Give the right 'modprobe' file name so that essential
1624 ;; modules such as msr.ko can be loaded.
1625 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1626 ;; These programs are only needed to calibrate, so using
1627 ;; relative file names avoids adding extra inputs. When they
1628 ;; are missing powertop gracefully handles it.
1629 (("/usr/bin/hcitool") "hcitool")
1630 (("/usr/bin/xset") "xset")
1631 (("/usr/sbin/hciconfig") "hciconfig"))
1636 ("ncurses" ,ncurses)
1637 ("pciutils" ,pciutils)
1640 `(("pkg-config" ,pkg-config)))
1641 (home-page "https://01.org/powertop/")
1642 (synopsis "Analyze power consumption on Intel-based laptops")
1644 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1645 power management. In addition to being a diagnostic tool, PowerTOP also has
1646 an interactive mode where the user can experiment various power management
1647 settings for cases where the operating system has not enabled these
1649 (license license:gpl2)))
1651 (define-public aumix
1658 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1659 version ".tar.bz2"))
1662 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1663 (build-system gnu-build-system)
1664 (inputs `(("ncurses" ,ncurses)))
1665 (home-page "http://www.jpj.net/~trevor/aumix.html")
1666 (synopsis "Audio mixer for X and the console")
1668 "Aumix adjusts an audio mixer from X, the console, a terminal,
1669 the command line or a script.")
1670 (license license:gpl2+)))
1672 (define-public iotop
1679 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1682 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1683 (build-system python-build-system)
1685 ;; The setup.py script expects python-2.
1686 `(#:python ,python-2
1687 ;; There are currently no checks in the package.
1689 (native-inputs `(("python" ,python-2)))
1690 (home-page "http://guichaz.free.fr/iotop/")
1692 "Displays the IO activity of running processes")
1694 "Iotop is a Python program with a top like user interface to show the
1695 processes currently causing I/O.")
1696 (license license:gpl2+)))
1704 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1705 "download/fuse-" version
1706 "/fuse-" version ".tar.gz"))
1709 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1710 (patches (search-patches "fuse-overlapping-headers.patch"))))
1711 (build-system gnu-build-system)
1712 (inputs `(("util-linux" ,util-linux)))
1714 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1715 (assoc-ref %outputs "out")
1717 (string-append "INIT_D_PATH="
1718 (assoc-ref %outputs "out")
1721 ;; The rule makes /dev/fuse 666.
1722 (string-append "UDEV_RULES_PATH="
1723 (assoc-ref %outputs "out")
1724 "/lib/udev/rules.d"))
1726 (modify-phases %standard-phases
1727 (add-before 'build 'set-file-names
1728 (lambda* (#:key inputs #:allow-other-keys)
1729 ;; libfuse calls out to mount(8) and umount(8). Make sure
1730 ;; it refers to the right ones.
1731 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1732 (("/bin/(u?)mount" _ maybe-u)
1733 (string-append (assoc-ref inputs "util-linux")
1734 "/bin/" maybe-u "mount")))
1735 (substitute* '("util/mount.fuse.c")
1739 ;; This hack leads libfuse to search for 'fusermount' in
1740 ;; $PATH, where it may find a setuid-root binary, instead of
1741 ;; trying solely $out/sbin/fusermount and failing because
1743 (substitute* "lib/Makefile"
1744 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1745 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
1747 (home-page "https://github.com/libfuse/libfuse")
1748 (synopsis "Support file systems implemented in user space")
1750 "As a consequence of its monolithic design, file system code for Linux
1751 normally goes into the kernel itself---which is not only a robustness issue,
1752 but also an impediment to system extensibility. FUSE, for \"file systems in
1753 user space\", is a kernel module and user-space library that tries to address
1754 part of this problem by allowing users to run file system implementations as
1755 user-space processes.")
1756 (license (list license:lgpl2.1 ;library
1757 license:gpl2+)))) ;command-line utilities
1759 (define-public unionfs-fuse
1761 (name "unionfs-fuse")
1766 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1768 (file-name (string-append name "-" version ".tar.gz"))
1771 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1772 (build-system cmake-build-system)
1774 `(("python" ,python)
1775 ("python-pytest" ,python-pytest)))
1776 (inputs `(("fuse" ,fuse)))
1779 (modify-phases %standard-phases
1781 ;; Borrowed from the Makefile
1782 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
1783 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1784 (synopsis "User-space union file system")
1786 "UnionFS-FUSE is a flexible union file system implementation in user
1787 space, using the FUSE library. Mounting a union file system allows you to
1788 \"aggregate\" the contents of several directories into a single mount point.
1789 UnionFS-FUSE additionally supports copy-on-write.")
1790 (license license:bsd-3)))
1793 (package (inherit fuse)
1794 (name "fuse-static")
1795 (source (origin (inherit (package-source fuse))
1796 (modules '((guix build utils)))
1798 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1799 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1800 ;; it doesn't do that, allowing us to remove the dependency on
1801 ;; util-linux (something that is useful in initrds.)
1802 '(substitute* '("lib/mount_util.c"
1803 "util/mount_util.c")
1804 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1809 (define-public unionfs-fuse/static
1810 (package (inherit unionfs-fuse)
1811 (synopsis "User-space union file system (statically linked)")
1812 (name (string-append (package-name unionfs-fuse) "-static"))
1813 (source (origin (inherit (package-source unionfs-fuse))
1814 (modules '((guix build utils)))
1816 ;; Add -ldl to the libraries, because libfuse.a needs that.
1817 '(substitute* "src/CMakeLists.txt"
1818 (("target_link_libraries(.*)\\)" _ libs)
1819 (string-append "target_link_libraries"
1823 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1825 (modify-phases %standard-phases
1826 (add-after 'install 'post-install
1827 (lambda* (#:key outputs #:allow-other-keys)
1828 (let* ((out (assoc-ref outputs "out"))
1829 (exe (string-append out "/bin/unionfs")))
1830 ;; By default, 'unionfs' keeps references to
1831 ;; $glibc/share/locale and similar stuff. Remove them.
1832 (remove-store-references exe)
1834 ;; 'unionfsctl' has references to glibc as well. Since
1835 ;; we don't need it, remove it.
1836 (delete-file (string-append out "/bin/unionfsctl"))
1838 (inputs `(("fuse" ,fuse-static)))))
1840 (define-public sshfs-fuse
1846 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1847 "download/sshfs-" version "/sshfs-" version
1851 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
1852 (build-system gnu-build-system)
1857 `(("pkg-config" ,pkg-config)))
1858 (home-page "https://github.com/libfuse/sshfs")
1859 (synopsis "Mount remote file systems over SSH")
1861 "This is a file system client based on the SSH File Transfer Protocol.
1862 Since most SSH servers already support this protocol it is very easy to set
1863 up: on the server side there's nothing to do; on the client side mounting the
1864 file system is as easy as logging into the server with an SSH client.")
1865 (license license:gpl2+)))
1867 (define-public archivemount
1869 (name "archivemount")
1874 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1875 "archivemount-" version ".tar.gz"))
1878 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1879 (build-system gnu-build-system)
1880 (inputs `(("fuse", fuse)
1881 ("libarchive", libarchive)))
1882 (native-inputs `(("pkg-config", pkg-config)))
1883 (home-page "http://www.cybernoia.de/software/archivemount")
1884 (synopsis "Tool for mounting archive files with FUSE")
1885 (description "archivemount is a FUSE-based file system for Unix variants,
1886 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1887 mount point where it can be read from or written to as with any other file
1888 system. This makes accessing the contents of the archive, which may be
1889 compressed, transparent to other programs, without decompressing them.")
1890 (license license:lgpl2.0+)))
1892 (define-public numactl
1899 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1904 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1905 (build-system gnu-build-system)
1907 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1908 ;; to run, which we can't assume to have.
1911 ;; NUMA is apparently not supported on armhf, see
1912 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1913 (supported-systems (delete "armhf-linux" %supported-systems))
1914 (home-page "http://oss.sgi.com/projects/libnuma/")
1915 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1917 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1918 memory is not all in one place. The numactl program allows you to run your
1919 application program on specific CPU's and memory nodes. It does this by
1920 supplying a NUMA memory policy to the operating system before running your
1923 The package contains other commands, such as numademo, numastat and memhog.
1924 The numademo command provides a quick overview of NUMA performance on your
1926 (license (list license:gpl2 ;programs
1927 license:lgpl2.1)))) ;library
1929 (define-public kbd-neo
1936 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1937 version "/linux/console/neo.map"))
1938 (file-name (string-append name "-" version ".map"))
1941 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1942 (build-system trivial-build-system)
1944 `(#:modules ((guix build utils))
1946 (use-modules (guix build utils))
1947 (let ((out (string-append %output "/share/keymaps"))
1948 (source (assoc-ref %build-inputs "source")))
1950 (copy-file source (string-append out "/neo.map"))
1952 (home-page "https://neo-layout.org")
1953 (synopsis "Neo2 console layout")
1955 "Kbd-neo provides the Neo2 keyboard layout for use with
1956 @command{loadkeys(1)} from @code{kbd(4)}.")
1957 ;; The file is located in an svn directory, the entire content of
1958 ;; the directory is licensed as GPL3.
1959 (license license:gpl3+)))
1967 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1971 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1972 (modules '((guix build utils)))
1975 (substitute* "tests/Makefile.in"
1976 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1979 (substitute* '("src/unicode_start" "src/unicode_stop")
1980 ;; Assume the Coreutils are in $PATH.
1983 (build-system gnu-build-system)
1986 (modify-phases %standard-phases
1987 (add-before 'build 'pre-build
1988 (lambda* (#:key inputs #:allow-other-keys)
1989 (let ((gzip (assoc-ref %build-inputs "gzip"))
1990 (bzip2 (assoc-ref %build-inputs "bzip2")))
1991 (substitute* "src/libkeymap/findfile.c"
1993 (string-append gzip "/bin/gzip"))
1995 (string-append bzip2 "/bin/bzip2"))))))
1996 (add-after 'install 'post-install
1997 (lambda* (#:key outputs #:allow-other-keys)
1998 ;; Make sure these programs find their comrades.
1999 (let* ((out (assoc-ref outputs "out"))
2000 (bin (string-append out "/bin")))
2001 (for-each (lambda (prog)
2002 (wrap-program (string-append bin "/" prog)
2003 `("PATH" ":" prefix (,bin))))
2004 '("unicode_start" "unicode_stop"))))))))
2005 (inputs `(("check" ,check)
2008 ("pam" ,linux-pam)))
2009 (native-search-paths
2010 (list (search-path-specification
2011 (variable "LOADKEYS_KEYMAP_PATH")
2012 ;; Append ‘/**’ to recursively search all directories. One can then
2013 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2014 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2015 (files (list "share/keymaps/**")))))
2016 (native-inputs `(("pkg-config" ,pkg-config)))
2017 (home-page "http://kbd-project.org/")
2018 (synopsis "Linux keyboard utilities and keyboard maps")
2020 "This package contains keytable files and keyboard utilities compatible
2021 for systems using the Linux kernel. This includes commands such as
2022 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
2023 (license license:gpl2+)))
2025 (define-public inotify-tools
2027 (name "inotify-tools")
2032 "mirror://sourceforge/inotify-tools/inotify-tools/"
2033 version "/inotify-tools-" version ".tar.gz"))
2036 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
2037 (build-system gnu-build-system)
2038 (home-page "http://inotify-tools.sourceforge.net/")
2039 (synopsis "Monitor file accesses")
2041 "The inotify-tools packages provides a C library and command-line tools
2042 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2043 (license license:gpl2+)))
2052 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2053 "kmod-" version ".tar.xz"))
2056 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
2057 (patches (search-patches "kmod-module-directory.patch"))))
2058 (build-system gnu-build-system)
2060 `(("pkg-config" ,pkg-config)))
2065 `(#:tests? #f ; FIXME: Investigate test failures
2066 #:configure-flags '("--with-xz" "--with-zlib")
2067 #:phases (alist-cons-after
2068 'install 'install-modprobe&co
2069 (lambda* (#:key outputs #:allow-other-keys)
2070 (let* ((out (assoc-ref outputs "out"))
2071 (bin (string-append out "/bin")))
2072 (for-each (lambda (tool)
2074 (string-append bin "/" tool)))
2075 '("insmod" "rmmod" "lsmod" "modprobe"
2076 "modinfo" "depmod"))))
2078 (home-page "https://www.kernel.org/")
2079 (synopsis "Kernel module tools")
2080 (description "Kmod is a set of tools to handle common tasks with Linux
2081 kernel modules like insert, remove, list, check properties, resolve
2082 dependencies and aliases.
2084 These tools are designed on top of libkmod, a library that is shipped with
2085 kmod. The aim is to be compatible with tools, configurations and indices
2086 from the module-init-tools project.")
2087 (license license:gpl2+))) ; library under lgpl2.1+
2089 (define-public eudev
2090 ;; The post-systemd fork, maintained by Gentoo.
2097 "http://dev.gentoo.org/~blueness/eudev/eudev-"
2101 "0qqgbgpm5wdllk0s04pf80nwc8pr93xazwri1bylm1f15zn5ck1y"))
2102 (patches (search-patches "eudev-rules-directory.patch"))))
2103 (build-system gnu-build-system)
2105 '(#:phases (modify-phases %standard-phases
2106 (add-after 'install 'build-hwdb
2107 (lambda* (#:key outputs #:allow-other-keys)
2108 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2109 ;; similar tools to display product names.
2110 (let ((out (assoc-ref outputs "out")))
2111 (zero? (system* (string-append out "/bin/udevadm")
2112 "hwdb" "--update"))))))))
2114 `(("pkg-config" ,pkg-config)
2118 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2119 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2120 ;; which contains the rules to do that.
2121 `(("util-linux" ,util-linux) ;for blkid
2123 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2124 (synopsis "Userspace device management")
2125 (description "Udev is a daemon which dynamically creates and removes
2126 device nodes from /dev/, handles hotplug events and loads drivers at boot
2128 (license license:gpl2+)))
2130 (define-public eudev-with-hwdb
2131 (deprecated-package "eudev-with-hwdb" eudev))
2136 (version "2.02.177")
2139 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2143 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2144 (modules '((guix build utils)))
2147 (use-modules (guix build utils))
2149 ;; Honor sysconfdir.
2150 (substitute* "make.tmpl.in"
2152 "confdir = @sysconfdir@\n")
2153 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2154 "DEFAULT_SYS_DIR = @sysconfdir@"))))
2155 (patches (search-patches "lvm2-static-link.patch"))))
2156 (build-system gnu-build-system)
2158 `(("pkg-config" ,pkg-config)
2159 ("procps" ,procps))) ;tests use 'pgrep'
2164 (modify-phases %standard-phases
2165 (add-after 'configure 'set-makefile-shell
2167 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2169 (setenv "SHELL" (which "sh"))
2171 ;; Replace /bin/sh with the right file name.
2172 (patch-makefile-SHELL "make.tmpl")
2174 (add-before 'strip 'make-objects-writable
2175 (lambda* (#:key outputs #:allow-other-keys)
2176 ;; Make compiled objects writable so they can be stripped.
2177 (let ((out (assoc-ref outputs "out")))
2178 (for-each (lambda (file)
2181 (find-files (string-append out "/lib"))
2182 (find-files (string-append out "/sbin"))))
2185 #:configure-flags (list (string-append "--sysconfdir="
2186 (assoc-ref %outputs "out")
2188 "--enable-udev_sync"
2189 "--enable-udev_rules"
2191 ;; Make sure programs such as 'dmsetup' can
2192 ;; find libdevmapper.so.
2193 (string-append "LDFLAGS=-Wl,-rpath="
2194 (assoc-ref %outputs "out")
2197 ;; The tests use 'mknod', which requires root access.
2199 (home-page "https://sourceware.org/lvm2/")
2200 (synopsis "Logical volume management for Linux")
2202 "LVM2 is the logical volume management tool set for Linux-based systems.
2203 This package includes the user-space libraries and tools, including the device
2204 mapper. Kernel components are part of Linux-libre.")
2206 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2207 ;; Command-line tools are GPLv2.
2208 (license (list license:gpl2 license:lgpl2.1))))
2210 (define-public lvm2-static
2213 (name "lvm2-static")
2215 ;; Propagate udev because libdevmapper.a depends on libudev.
2216 (inputs (alist-delete "udev" (package-inputs lvm2)))
2217 (propagated-inputs `(("udev" ,eudev)))
2220 (substitute-keyword-arguments (package-arguments lvm2)
2221 ((#:configure-flags flags '())
2222 ;; LVM2 doesn't use Libtool, hence the custom option.
2223 `(cons "--enable-static_link" ,flags))))
2224 (synopsis "Logical volume management for Linux (statically linked)")))
2226 (define-public wireless-tools
2228 (name "wireless-tools")
2232 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2236 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2239 ;; Remove the older header files that are not free software.
2240 (for-each (lambda (n)
2241 (delete-file (format #f "wireless.~a.h" n)))
2242 '(10 11 12 13 14 15 16 17 18 19 20))
2244 (build-system gnu-build-system)
2247 (list (string-append "PREFIX=" %output)
2248 (string-append "INSTALL_MAN=" %output "/share/man")
2249 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2251 #:phases (modify-phases %standard-phases
2252 (delete 'configure))
2254 (synopsis "Tools for manipulating Linux Wireless Extensions")
2255 (description "Wireless Tools are used to manipulate the now-deprecated
2256 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2257 Extension was an interface allowing you to set Wireless LAN specific
2258 parameters and get the specific stats. It is deprecated in favor the nl80211
2260 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2261 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2262 ;; other files are distributed under gpl2.
2263 (license (list license:gpl2 license:lgpl2.1+))))
2271 (uri (string-append "mirror://kernel.org/software/network/crda/"
2272 "crda-" version ".tar.xz"))
2275 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2276 (patches (search-patches "crda-optional-gcrypt.patch"))))
2277 (build-system gnu-build-system)
2279 '(#:phases (modify-phases %standard-phases
2282 'build 'no-werror-no-ldconfig
2284 (substitute* "Makefile"
2286 (("ldconfig") "true"))
2289 'build 'set-regulator-db-file-name
2290 (lambda* (#:key inputs #:allow-other-keys)
2291 ;; Tell CRDA where to find our database.
2292 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2293 (substitute* "crda.c"
2294 (("\"/lib/crda/regulatory.bin\"")
2295 (string-append "\"" regdb
2296 "/lib/crda/regulatory.bin\"")))
2298 #:test-target "verify"
2299 #:make-flags (let ((out (assoc-ref %outputs "out"))
2300 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2301 (list "CC=gcc" "V=1"
2303 ;; Disable signature-checking on 'regulatory.bin'.
2304 ;; The reason is that this simplifies maintenance
2305 ;; on our side (no need to manage a distro key
2306 ;; pair), and we can guarantee integrity of
2307 ;; 'regulatory.bin' by other means anyway, such as
2308 ;; 'guix gc --verify'. See
2309 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2313 (string-append "PREFIX=" out)
2314 (string-append "SBINDIR=" out "/sbin/")
2315 (string-append "UDEV_RULE_DIR="
2316 out "/lib/udev/rules.d")
2317 (string-append "LDFLAGS=-Wl,-rpath="
2319 (string-append "REG_BIN=" regdb
2320 "/lib/crda/regulatory.bin")))))
2321 (native-inputs `(("pkg-config" ,pkg-config)
2322 ("python" ,python-2)
2323 ("wireless-regdb" ,wireless-regdb)))
2324 (inputs `(("libnl" ,libnl)))
2326 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2327 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2329 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2330 communication between the kernel Linux and user space for regulatory
2332 (license license:copyleft-next)))
2334 (define-public wireless-regdb
2336 (name "wireless-regdb")
2337 (version "2017.03.07")
2341 "mirror://kernel.org/software/network/wireless-regdb/"
2342 "wireless-regdb-" version ".tar.xz"))
2345 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2347 ;; We're building 'regulatory.bin' by ourselves.
2348 (snippet '(delete-file "regulatory.bin"))))
2349 (build-system gnu-build-system)
2351 '(#:phases (modify-phases %standard-phases
2352 (delete 'configure))
2354 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2355 ;; is computed and can be equal to 'maintainer-clean'; when that
2356 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2357 ;; just built. Thus, build things sequentially.
2358 #:parallel-build? #f
2360 #:tests? #f ;no tests
2361 #:make-flags (let ((out (assoc-ref %outputs "out")))
2362 (list (string-append "PREFIX=" out)
2363 (string-append "LSB_ID=GuixSD")
2364 (string-append "DISTRO_PUBKEY=/dev/null")
2365 (string-append "DISTRO_PRIVKEY=/dev/null")
2366 (string-append "REGDB_PUBKEY=/dev/null")
2368 ;; Leave that empty so that db2bin.py doesn't try
2369 ;; to sign 'regulatory.bin'. This allows us to
2370 ;; avoid managing a key pair for the whole distro.
2371 (string-append "REGDB_PRIVKEY=")))))
2372 (native-inputs `(("python" ,python-2)))
2374 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2375 (synopsis "Wireless regulatory database")
2377 "This package contains the wireless regulatory database Central
2378 Regulatory Database Agent (CRDA) daemon. The database contains information on
2379 country-specific regulations for the wireless spectrum.")
2380 (license license:isc)))
2382 (define-public lm-sensors
2388 (uri (list (string-append
2389 "https://github.com/groeck/lm-sensors/archive/V"
2390 (string-join (string-split version #\.) "-")
2392 (file-name (string-append name "-" version ".tar.gz"))
2395 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2396 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2397 (build-system gnu-build-system)
2398 (inputs `(("rrdtool" ,rrdtool)
2401 ("gnuplot" ,gnuplot)))
2402 (native-inputs `(("pkg-config" ,pkg-config)
2406 (outputs '("lib" ;avoid perl in closure
2409 `(#:tests? #f ; no 'check' target
2410 #:make-flags (list (string-append "PREFIX=" %output)
2411 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2412 (string-append "INCLUDEDIR="
2413 (assoc-ref %outputs "lib") "/include")
2414 (string-append "MANDIR=" %output "/share/man")
2415 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2417 (modify-phases %standard-phases
2419 (add-before 'build 'patch-exec-paths
2420 (lambda* (#:key inputs outputs #:allow-other-keys)
2421 (substitute* "prog/detect/sensors-detect"
2423 (string-append "`" (assoc-ref inputs "coreutils")
2425 (("(`|\")modprobe" all open-quote)
2426 (string-append open-quote
2427 (assoc-ref inputs "kmod")
2429 (substitute* '("prog/pwm/pwmconfig"
2430 "prog/pwm/fancontrol")
2432 (string-append (assoc-ref inputs "gnuplot")
2435 (string-append (assoc-ref inputs "coreutils")
2438 (string-append (assoc-ref inputs "grep")
2441 (string-append (assoc-ref inputs "sed")
2444 (string-append (assoc-ref inputs "coreutils")
2447 (string-append (assoc-ref inputs "coreutils")
2450 (string-append (assoc-ref inputs "coreutils")
2451 "/bin/readlink -f")))
2453 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2454 (synopsis "Utilities to read temperature/voltage/fan sensors")
2456 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2457 you to access information from temperature, voltage, and fan speed sensors.
2458 It works with most newer systems.")
2459 (license license:gpl2+)))
2461 (define-public iucode-tool
2463 (name "iucode-tool")
2467 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2468 "/raw/latest/iucode-tool_" version ".tar.xz"))
2471 "0w99k1aq1xw148ffk1xykqf60rdbphb1jknw98jcmadq4pwxl44q"))))
2472 (build-system gnu-build-system)
2473 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2474 (synopsis "Manipulate Intel microcode bundles")
2476 "@command{iucode_tool} is a utility to work with microcode packages for
2477 Intel processors. It can convert between formats, extract specific versions,
2478 create a firmware image suitable for the Linux kernel, and more.")
2479 ;; cpuid.h is available for i686, x86_64, and ia64.
2480 (supported-systems '("i686-linux" "x86_64-linux"))
2481 (license license:gpl2+)))
2483 (define-public i2c-tools
2490 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2491 version ".tar.bz2"))
2494 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2495 (build-system gnu-build-system)
2497 `(#:tests? #f ; no 'check' target
2498 #:make-flags (list (string-append "prefix=" %output)
2500 ;; no configure script
2501 #:phases (modify-phases %standard-phases (delete 'configure))))
2504 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2505 (synopsis "I2C tools for Linux")
2507 "The i2c-tools package contains a heterogeneous set of I2C tools for
2508 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2509 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2511 (license license:gpl2+)))
2513 (define-public xsensors
2520 "http://www.linuxhardware.org/xsensors/xsensors-"
2524 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2525 (build-system gnu-build-system)
2526 (inputs `(("lm-sensors" ,lm-sensors "lib")
2528 (native-inputs `(("pkg-config" ,pkg-config)))
2531 (modify-phases %standard-phases
2532 (add-before 'configure 'enable-deprecated
2534 (substitute* "src/Makefile.in"
2535 (("-DGDK_DISABLE_DEPRECATED") "")
2536 (("-DGTK_DISABLE_DEPRECATED") ""))
2538 (add-before 'configure 'remove-Werror
2540 (substitute* '("configure" "src/Makefile.in")
2543 (home-page "http://www.linuxhardware.org/xsensors/")
2544 (synopsis "Hardware health information viewer")
2546 "Xsensors reads data from the libsensors library regarding hardware
2547 health such as temperature, voltage and fan speed and displays the information
2548 in a digital read-out.")
2549 (license license:gpl2+)))
2554 (version (package-version linux-libre))
2555 (source (package-source linux-libre))
2556 (build-system gnu-build-system)
2559 (modify-phases %standard-phases
2561 (lambda* (#:key inputs #:allow-other-keys)
2562 (setenv "SHELL_PATH" (which "bash"))
2563 (chdir "tools/perf")
2565 #:make-flags (list (string-append "prefix="
2566 (assoc-ref %outputs "out"))
2569 ;; By default, 'config/Makefile' uses lib64 on
2570 ;; x86_64. Work around that.
2572 #:tests? #f)) ;no tests
2574 `(("pkg-config" ,pkg-config)
2578 ;; There are build scripts written in these languages.
2580 ("python" ,python-2)))
2582 `(("slang" ,slang) ;for the interactive TUI
2584 ("python" ,python-2) ;'perf' links against libpython
2585 ("elfutils" ,elfutils)
2586 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2587 ("libunwind" ,libunwind) ;better stack walking
2588 ("numactl" ,numactl) ;for 'perf bench numa mem'
2591 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2592 ("docbook-xsl" ,docbook-xsl)
2594 ("asciidoc" ,asciidoc)))
2595 (home-page "https://perf.wiki.kernel.org/")
2596 (synopsis "Linux profiling with performance counters")
2598 "perf is a tool suite for profiling using hardware performance counters,
2599 with support in the Linux kernel. perf can instrument CPU performance
2600 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2601 of lightweight profiling. This package contains the user-land tools and in
2602 particular the 'perf' command.")
2603 (license (package-license linux-libre))))
2605 (define-public pflask
2611 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2613 (file-name (string-append name "-" version ".tar.gz"))
2616 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2617 (build-system cmake-build-system)
2619 '(#:tests? #f)) ; no tests
2620 (home-page "https://ghedo.github.io/pflask/")
2621 (synopsis "Simple tool for creating Linux namespace containers")
2622 (description "pflask is a simple tool for creating Linux namespace
2623 containers. It can be used for running a command or even booting an OS inside
2624 an isolated container, created with the help of Linux namespaces. It is
2625 similar in functionality to chroot, although pflask provides better isolation
2626 thanks to the use of namespaces.")
2627 (license license:bsd-2)))
2629 (define-public hdparm
2635 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2636 name "-" version ".tar.gz"))
2639 "1rb5086gp4l1h1fn2nk10ziqxjxigsd0c1zczahwc5k9vy8zawr6"))))
2640 (build-system gnu-build-system)
2642 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2643 (list (string-append "binprefix=" out)
2644 (string-append "manprefix=" out)
2647 (modify-phases %standard-phases
2648 (delete 'configure)) ; no configure script
2649 #:tests? #f)) ; no test suite
2650 (home-page "https://sourceforge.net/projects/hdparm/")
2651 (synopsis "View and tune ATA disk drive parameters")
2653 "@command{hdparm} is a command-line utility to control ATA controllers and
2654 disk drives. It can increase performance and/or reliability by careful tuning
2655 of hardware settings like power and acoustic management, DMA modes, and caching.
2656 It can also display detailed device information, or be used as a simple
2657 performance benchmarking tool.
2659 @command{hdparm} provides a command line interface to various Linux kernel
2660 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2661 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2662 Translation (@dfn{SAT}) are also supported.")
2663 (license (license:non-copyleft "file://LICENSE.TXT"))))
2665 (define-public rfkill
2671 (uri (string-append "mirror://kernel.org/software/network/"
2672 name "/" name "-" version ".tar.xz"))
2675 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2676 (build-system gnu-build-system)
2678 `(#:make-flags (list "CC=gcc"
2679 (string-append "PREFIX=" %output))
2680 #:phases (modify-phases %standard-phases
2681 (delete 'configure))
2683 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2684 (synopsis "Tool for enabling and disabling wireless devices")
2686 "rfkill is a simple tool for accessing the rfkill device interface,
2687 which is used to enable and disable wireless networking devices, typically
2688 WLAN, Bluetooth and mobile broadband.")
2689 (license (license:non-copyleft "file://COPYING"
2690 "See COPYING in the distribution."))))
2698 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2699 version "/" name "-" version ".tar.gz"))
2702 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2703 (build-system gnu-build-system)
2704 (home-page "http://acpiclient.sourceforge.net")
2705 (synopsis "Display information on ACPI devices")
2706 (description "@code{acpi} attempts to replicate the functionality of the
2707 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2708 information. It does not support ACPI suspending, only displays information
2709 about ACPI devices.")
2710 (license license:gpl2+)))
2712 (define-public acpid
2718 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2722 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2723 (build-system gnu-build-system)
2724 (home-page "https://sourceforge.net/projects/acpid2/")
2725 (synopsis "Daemon for delivering ACPI events to user-space programs")
2727 "acpid is designed to notify user-space programs of Advanced
2728 Configuration and Power Interface (ACPI) events. acpid should be started
2729 during the system boot, and will run as a background process. When an ACPI
2730 event is received from the kernel, acpid will examine the list of rules
2731 specified in /etc/acpi/events and execute the rules that match the event.")
2732 (license license:gpl2+)))
2734 (define-public sysfsutils
2743 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2746 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2747 (build-system gnu-build-system)
2748 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2749 (synopsis "System utilities based on Linux sysfs")
2751 "These are a set of utilities built upon sysfs, a virtual file system in
2752 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2753 also contains the libsysfs library.")
2754 ;; The library is under lgpl2.1+ (all files say "or any later version").
2755 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2756 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2758 (define-public sysfsutils-1
2760 (inherit sysfsutils)
2767 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2768 "/sysfsutils-" version ".tar.gz"))
2770 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2771 (modules '((guix build utils)))
2774 (substitute* "Makefile.in"
2775 (("includedir = /usr/include/sysfs")
2776 "includedir = @includedir@"))
2777 (substitute* "configure"
2778 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2779 (string-append "includedir='" orig "/sysfs'")))))))
2780 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2782 (define-public cpufrequtils
2784 (name "cpufrequtils")
2791 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2794 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2795 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2796 (build-system gnu-build-system)
2798 `(("sysfsutils" ,sysfsutils-1)))
2800 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2801 (assoc-ref %outputs "out") "/lib"))))
2802 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2803 (synopsis "Utilities to get and set CPU frequency on Linux")
2805 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2806 information, and set the CPU frequency if supported, using the cpufreq
2807 capabilities of the Linux kernel.")
2808 (license license:gpl2)))
2810 (define-public libraw1394
2817 "mirror://kernel.org/linux/libs/ieee1394/"
2818 name "-" version ".tar.xz"))
2821 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2822 (build-system gnu-build-system)
2823 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2824 (synopsis "Interface library for the Linux IEEE1394 drivers")
2826 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2827 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2828 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2829 send to and receive from other nodes without requiring a kernel driver for the
2830 protocol in question.")
2831 (license license:lgpl2.1+)))
2833 (define-public libavc1394
2839 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2840 name "-" version ".tar.gz"))
2843 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2844 (build-system gnu-build-system)
2846 `(("pkg-config" ,pkg-config)))
2848 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2849 (home-page "https://sourceforge.net/projects/libavc1394/")
2850 (synopsis "AV/C protocol library for IEEE 1394")
2852 "Libavc1394 is a programming interface to the AV/C specification from
2853 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2854 (license license:lgpl2.1+)))
2856 (define-public libiec61883
2858 (name "libiec61883")
2863 "mirror://kernel.org/linux/libs/ieee1394/"
2864 name "-" version ".tar.xz"))
2867 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2868 (build-system gnu-build-system)
2870 `(("pkg-config" ,pkg-config)))
2872 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2873 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2874 (synopsis "Isochronous streaming media library for IEEE 1394")
2876 "The libiec61883 library provides a higher level API for streaming DV,
2877 MPEG-2 and audio over Linux IEEE 1394.")
2878 (license license:lgpl2.1+)))
2880 (define-public mdadm
2887 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2891 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2892 (build-system gnu-build-system)
2896 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2900 ;; TODO: tell it where to find 'sendmail'
2901 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2902 (string-append "BINDIR=" out "/sbin")
2903 (string-append "MANDIR=" out "/share/man")
2904 (string-append "UDEVDIR=" out "/lib/udev")))
2906 (modify-phases %standard-phases
2907 (add-before 'build 'patch-program-paths
2908 (lambda* (#:key inputs #:allow-other-keys)
2909 (let ((coreutils (assoc-ref inputs "coreutils")))
2910 (substitute* "udev-md-raid-arrays.rules"
2911 (("/usr/bin/(readlink|basename)" all program)
2912 (string-append coreutils "/bin/" program))))
2914 (add-before 'build 'remove-W-error
2916 ;; We cannot build with -Werror on i686 due to a
2917 ;; 'sign-compare' warning in util.c.
2918 (substitute* "Makefile"
2921 (delete 'configure))
2922 ;;tests must be done as root
2924 (home-page "http://neil.brown.name/blog/mdadm")
2925 (synopsis "Tool for managing Linux Software RAID arrays")
2927 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2928 assemble, report on, and monitor arrays. It can also move spares between raid
2929 arrays when needed.")
2930 (license license:gpl2+)))
2932 (define-public mdadm-static
2935 (name "mdadm-static")
2937 (substitute-keyword-arguments (package-arguments mdadm)
2938 ((#:make-flags flags)
2939 `(cons "LDFLAGS = -static" ,flags))
2941 `(modify-phases ,phases
2942 (add-after 'install 'remove-cruft
2943 (lambda* (#:key outputs #:allow-other-keys)
2944 (let* ((out (assoc-ref outputs "out"))
2945 (precious? (lambda (file)
2946 (member file '("." ".." "sbin"))))
2947 (directories (scandir out (negate precious?))))
2948 (with-directory-excursion out
2949 (for-each delete-file-recursively directories)
2950 (remove-store-references "sbin/mdadm")
2951 (delete-file "sbin/mdmon")
2953 ((#:modules modules %gnu-build-system-modules)
2954 `((ice-9 ftw) ,@modules))
2955 ((#:strip-flags _ '())
2956 ''("--strip-all")) ;strip a few extra KiB
2957 ((#:allowed-references _ '("out"))
2958 '("out")))) ;refer only self
2959 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2961 (define-public multipath-tools
2963 (name "multipath-tools")
2967 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2968 ".git;a=snapshot;h=" version ";sf=tgz"))
2969 (file-name (string-append name "-" version ".tar.gz"))
2972 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2973 (modules '((guix build utils)))
2976 ;; Drop bundled valgrind headers.
2977 (delete-file-recursively "third-party")
2978 (substitute* '("multipathd/main.c"
2979 "libmultipath/debug.c")
2980 (("#include \"../third-party/")
2983 (build-system gnu-build-system)
2985 '(#:tests? #f ; No tests.
2986 #:make-flags (list (string-append "DESTDIR="
2987 (assoc-ref %outputs "out"))
2989 (string-append "LDFLAGS=-Wl,-rpath="
2990 (assoc-ref %outputs "out")
2993 (modify-phases %standard-phases
2994 (add-after 'unpack 'patch-source
2995 (lambda* (#:key inputs #:allow-other-keys)
2996 (let ((lvm2 (assoc-ref inputs "lvm2"))
2997 (udev (assoc-ref inputs "udev")))
2998 (substitute* "Makefile.inc"
2999 (("\\$\\(prefix\\)/usr") "$(prefix)"))
3000 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3001 (("/usr/include/libdevmapper.h")
3002 (string-append lvm2 "/include/libdevmapper.h"))
3003 (("/usr/include/libudev.h")
3004 (string-append udev "/include/libudev.h")))
3007 (add-before 'build 'set-CC
3013 ("pkg-config" ,pkg-config)
3014 ("valgrind" ,valgrind)))
3016 `(("ceph:lib" ,ceph "lib")
3019 ("liburcu" ,liburcu)
3021 ("readline" ,readline)
3023 (home-page "http://christophe.varoqui.free.fr/")
3024 (synopsis "Access block devices through multiple paths")
3026 "This package provides the following binaries to drive the
3027 Linux Device Mapper multipathing driver:
3029 @item @command{multipath} - Device mapper target autoconfig.
3030 @item @command{multipathd} - Multipath daemon.
3031 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3032 @code{dm} multipath devices.
3033 @item @command{kpartx} - Create device maps from partition tables.
3035 (license (list license:gpl2+ ; Main distribution.
3036 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3038 (define-public libaio
3045 (string-append "mirror://debian/pool/main/liba/libaio/"
3046 name "_" version ".orig.tar.gz")))
3049 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
3050 (build-system gnu-build-system)
3053 (list "CC=gcc" (string-append "prefix=" %output))
3054 #:test-target "partcheck" ; need root for a full 'check'
3056 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3057 (home-page "http://lse.sourceforge.net/io/aio.html")
3058 (synopsis "Linux-native asynchronous I/O access library")
3060 "This library enables userspace to use Linux kernel asynchronous I/O
3061 system calls, important for the performance of databases and other advanced
3063 (license license:lgpl2.1+)))
3071 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
3072 name "-" version ".tar.xz"))
3075 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
3076 (build-system gnu-build-system)
3078 `(("libsndfile" ,libsndfile)))
3080 `(("pkg-config" ,pkg-config)))
3081 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3082 (synopsis "Bluetooth subband audio codec")
3084 "The SBC is a digital audio encoder and decoder used to transfer data to
3085 Bluetooth audio output devices like headphones or loudspeakers.")
3086 (license license:gpl2+)))
3088 (define-public bluez
3095 "mirror://kernel.org/linux/bluetooth/bluez-"
3099 "1j22hfjz0fp4pgclgz9mfcwjbr4wqgah3gd2qhfg4r6msmybyxfg"))))
3100 (build-system gnu-build-system)
3103 (let ((out (assoc-ref %outputs "out")))
3104 (list "--sysconfdir=/etc"
3105 "--localstatedir=/var"
3108 ;; Install dbus/udev files to the correct location.
3109 (string-append "--with-dbusconfdir=" out "/etc")
3110 (string-append "--with-udevdir=" out "/lib/udev")))
3112 (modify-phases %standard-phases
3113 ,@(if (string=? (%current-system) "armhf-linux")
3114 ;; This test fails unpredictably.
3115 ;; TODO: skip it for all architectures.
3116 `((add-before 'check 'skip-wonky-test
3118 (substitute* "unit/test-gatt.c"
3119 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3123 (add-after 'install 'post-install
3124 (lambda* (#:key inputs outputs #:allow-other-keys)
3125 (let* ((out (assoc-ref outputs "out"))
3126 (servicedir (string-append out "/share/dbus-1/services"))
3127 (service "obexd/src/org.bluez.obex.service")
3128 (rule (string-append
3129 out "/lib/udev/rules.d/97-hid2hci.rules")))
3130 ;; Install the obex dbus service file.
3131 (substitute* service
3133 (string-append out "/libexec/bluetooth/obexd")))
3134 (install-file service servicedir)
3135 ;; Fix paths in the udev rule.
3137 (("hid2hci --method")
3138 (string-append out "/lib/udev/hid2hci --method"))
3140 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3143 `(("pkg-config" ,pkg-config)
3144 ("gettext" ,gettext-minimal)))
3149 ("libical" ,libical)
3150 ("readline" ,readline)))
3151 (home-page "http://www.bluez.org/")
3152 (synopsis "Linux Bluetooth protocol stack")
3154 "BlueZ provides support for the core Bluetooth layers and protocols. It
3155 is flexible, efficient and uses a modular implementation.")
3156 (license license:gpl2+)))
3158 (define-public fuse-exfat
3165 "https://github.com/relan/exfat/releases/download/v"
3166 version "/" name "-" version ".tar.gz"))
3169 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
3170 (build-system gnu-build-system)
3172 `(("pkg-config" ,pkg-config)))
3175 (home-page "https://github.com/relan/exfat")
3176 (synopsis "Mount exFAT file systems")
3178 "This package provides a FUSE-based file system that provides read and
3179 write access to exFAT devices.")
3180 (license license:gpl2+)))
3189 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3190 version ".tar.bz2"))
3193 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3194 (build-system gnu-build-system)
3196 '(#:phases (modify-phases %standard-phases
3197 (add-after 'unpack 'bootstrap
3199 ;; The tarball was not generated with 'make dist' so we
3200 ;; need to bootstrap things ourselves.
3201 (substitute* "autogen.sh"
3202 (("/bin/sh") (which "sh")))
3203 (and (zero? (system* "./autogen.sh"))
3205 (patch-makefile-SHELL "Makefile.include.in")
3208 ;; Make sure programs find libgpm.so.
3209 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3210 (assoc-ref %outputs "out")
3213 `(("texinfo" ,texinfo)
3216 ("autoconf" ,autoconf)
3217 ("automake" ,automake)
3218 ("libtool" ,libtool)))
3219 (home-page "http://www.nico.schottelius.org/software/gpm/")
3220 (synopsis "Mouse support for the Linux console")
3222 "The GPM (general-purpose mouse) daemon is a mouse server for
3223 applications running on the Linux console. It allows users to select items
3224 and copy/paste text in the console and in xterm.")
3225 (license license:gpl2+)))
3227 (define-public btrfs-progs
3229 (name "btrfs-progs")
3233 (uri (string-append "mirror://kernel.org/linux/kernel/"
3234 "people/kdave/btrfs-progs/"
3235 "btrfs-progs-v" version ".tar.xz"))
3238 "1palnddw3d50kyflwk1j4xapbc6jniid6j5i9dsr8l8a7nkv7ich"))))
3239 (build-system gnu-build-system)
3241 "static")) ; static versions of the binaries in "out"
3243 '(#:phases (modify-phases %standard-phases
3244 (add-after 'build 'build-static
3245 (lambda _ (zero? (system* "make" "static"))))
3246 (add-after 'install 'install-bash-completion
3247 (lambda* (#:key outputs #:allow-other-keys)
3248 (install-file "btrfs-completion"
3249 (string-append (assoc-ref outputs "out")
3250 "/etc/bash_completion.d"))
3252 (add-after 'install 'install-static
3253 (let ((staticbin (string-append (assoc-ref %outputs "static")
3256 (zero? (system* "make"
3257 (string-append "bindir=" staticbin)
3258 "install-static"))))))
3259 #:test-target "test"
3260 #:parallel-tests? #f)) ; tests fail when run in parallel
3261 (inputs `(("e2fsprogs" ,e2fsprogs)
3262 ("libblkid" ,util-linux)
3263 ("libblkid:static" ,util-linux "static")
3264 ("libuuid" ,util-linux)
3265 ("libuuid:static" ,util-linux "static")
3269 (native-inputs `(("pkg-config" ,pkg-config)
3270 ("asciidoc" ,asciidoc)
3272 ;; For building documentation.
3273 ("libxml2" ,libxml2)
3274 ("docbook-xsl" ,docbook-xsl)
3278 (home-page "https://btrfs.wiki.kernel.org/")
3279 (synopsis "Create and manage btrfs copy-on-write file systems")
3280 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3281 aimed at implementing advanced features while focusing on fault tolerance,
3282 repair and easy administration.")
3283 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3284 ;; GPL2: Everything else.
3285 (license (list license:gpl2 license:gpl2+))))
3287 (define-public btrfs-progs/static
3289 (name "btrfs-progs-static")
3290 (version (package-version btrfs-progs))
3292 (build-system trivial-build-system)
3294 `(("btrfs-progs:static" ,btrfs-progs "static")))
3296 `(#:modules ((guix build utils))
3299 (use-modules (guix build utils)
3303 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3304 (out (assoc-ref %outputs "out"))
3305 (source (string-append btrfs "/bin/btrfs.static"))
3306 (target (string-append out "/bin/btrfs")))
3307 (mkdir-p (dirname target))
3308 (copy-file source target)
3309 (remove-store-references target)
3310 (chmod target #o555)))))
3311 (home-page (package-home-page btrfs-progs))
3312 (synopsis "Statically-linked btrfs command from btrfs-progs")
3313 (description "This package provides the statically-linked @command{btrfs}
3314 from the btrfs-progs package. It is meant to be used in initrds.")
3315 (license (package-license btrfs-progs))))
3317 (define-public f2fs-tools
3324 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3325 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3328 "1bir9ladb58ijlcvrjrq1fb1xv5ys50zdjaq0yzliib0apsyrnyl"))))
3329 (build-system gnu-build-system)
3332 (modify-phases %standard-phases
3333 (add-after 'unpack 'bootstrap
3335 (zero? (system* "autoreconf" "-vif")))))))
3337 `(("autoconf" ,autoconf)
3338 ("automake" ,automake)
3339 ("libtool" ,libtool)
3340 ("pkg-config" ,pkg-config)))
3342 `(("libuuid" ,util-linux)))
3343 (home-page "https://f2fs.wiki.kernel.org/")
3344 (synopsis "Userland tools for f2fs")
3346 "F2FS, the Flash-Friendly File System, is a modern file system
3347 designed to be fast and durable on flash devices such as solid-state
3348 disks and SD cards. This package provides the userland utilities.")
3349 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3350 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3351 (license (list license:gpl2 license:lgpl2.1))))
3353 (define-public freefall
3356 (version (package-version linux-libre))
3357 (source (package-source linux-libre))
3358 (build-system gnu-build-system)
3360 '(#:phases (modify-phases %standard-phases
3361 (add-after 'unpack 'enter-subdirectory
3363 (chdir "tools/laptop/freefall")))
3365 (add-before 'build 'increase-timeout
3367 ;; The default of 2 seconds is too low: it assumes an
3368 ;; open lid and AC power without actually checking.
3369 (substitute* "freefall.c"
3370 (("alarm\\(2\\)") "alarm(5)")))))
3371 #:make-flags (list (string-append "PREFIX="
3372 (assoc-ref %outputs "out")))
3373 #:tests? #f)) ;no tests
3374 (home-page (package-home-page linux-libre))
3375 (synopsis "Free-fall protection for spinning laptop hard drives")
3377 "Prevents shock damage to the internal spinning hard drive(s) of some
3378 HP and Dell laptops. When sudden movement is detected, all input/output
3379 operations on the drive are suspended and its heads are parked on the ramp,
3380 where they are less likely to cause damage to the spinning disc. Requires a
3381 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3382 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3383 (license license:gpl2)))
3385 (define-public thinkfan
3391 (uri (string-append "mirror://sourceforge/thinkfan/"
3392 "/thinkfan-" version ".tar.gz"))
3395 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3396 (modules '((guix build utils)))
3397 ;; Fix erroneous man page location in Makefile leading to
3398 ;; a compilation failure.
3400 '(substitute* "CMakeLists.txt"
3401 (("thinkfan\\.1") "src/thinkfan.1")))))
3402 (build-system cmake-build-system)
3404 `(#:modules ((guix build cmake-build-system)
3407 #:tests? #f ;no test target
3409 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3410 `("-DUSE_ATASMART:BOOL=ON")
3412 (modify-phases %standard-phases
3413 ;; Install scripts for various foreign init systems. Also fix
3414 ;; hard-coded path for daemon.
3415 (add-after 'install 'install-rc-scripts
3416 (lambda* (#:key outputs #:allow-other-keys)
3417 (let ((out (assoc-ref outputs "out"))
3419 (string-append "../thinkfan-" ,version "/rcscripts")
3422 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3423 (string-append out "/sbin/" name)))
3424 (for-each (cute install-file <>
3425 (string-append out "/share/thinkfan"))
3429 `(("libatasmart" ,libatasmart)))
3430 (home-page "http://thinkfan.sourceforge.net/")
3431 (synopsis "Simple fan control program")
3433 "Thinkfan is a simple fan control program. It reads temperatures,
3434 checks them against configured limits and switches to appropriate (also
3435 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3436 other @code{hwmon} driver that enables temperature reading and fan control
3438 (license license:gpl3+)))
3440 (define-public ntfs-3g
3443 (version "2017.3.23")
3446 (uri (string-append "https://tuxera.com/opensource/"
3447 "ntfs-3g_ntfsprogs-" version ".tgz"))
3450 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
3451 (modules '((guix build utils)))
3453 ;; Install under $prefix.
3454 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3457 (build-system gnu-build-system)
3458 (inputs `(("util-linux" ,util-linux)
3459 ("fuse" ,fuse))) ;libuuid
3460 (native-inputs `(("pkg-config" ,pkg-config)))
3462 '(#:configure-flags (list "--exec-prefix=${prefix}"
3463 "--with-fuse=external" ;use our own FUSE
3464 "--enable-mount-helper"
3465 "--enable-posix-acls"
3466 "--enable-xattr-mappings")))
3467 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
3468 (synopsis "Read-write access to NTFS file systems")
3470 "NTFS-3G provides read-write access to NTFS file systems, which are
3471 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3472 The package provides additional NTFS tools.")
3473 (license license:gpl2+)))
3475 (define-public rdma-core
3481 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3482 "/releases/download/v" version "/rdma-core-"
3486 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3487 (build-system cmake-build-system)
3489 '(#:tests? #f ; no tests
3490 ;; Upstream uses the "ninja" build system and encourage distros
3491 ;; to do the same for consistency. They also recommend using the
3492 ;; "Release" build type.
3493 #:configure-flags (list "-GNinja"
3494 ;; Defaults to "lib64" on 64-bit archs.
3495 (string-append "-DCMAKE_INSTALL_LIBDIR="
3496 (assoc-ref %outputs "out") "/lib")
3497 "-DCMAKE_BUILD_TYPE=Release")
3499 (modify-phases %standard-phases
3502 (zero? (system* "ninja"
3503 "-j" (number->string (parallel-job-count))))))
3506 (zero? (system* "ninja" "install")))))))
3509 ("pkg-config" ,pkg-config)
3510 ("python" ,python-wrapper)))
3514 (home-page "https://github.com/linux-rdma/rdma-core")
3515 (synopsis "Utilities and libraries for working with RDMA devices")
3517 "This package provides userspace components for the InfiniBand
3518 subsystem of the Linux kernel. Specifically it contains userspace
3519 libraries for the following device nodes:
3522 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3523 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3524 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3527 The following service daemons are also provided:
3529 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3530 @item @code{iwpmd} (for iWARP kernel providers)
3531 @item @code{ibacm} (for InfiniBand communication management assistant)
3533 ;; All library code is dual licensed under GPL2 and a custom MIT
3534 ;; variant. The package also includes some components covered by
3535 ;; other licenses. Consult COPYING.md for full details.
3538 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3539 license:bsd-2 ; Files referring to COPYING.BSD_FB
3540 license:cc0 ; most files in ccan/
3541 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3543 (define-public rng-tools
3549 (uri (string-append "https://github.com/nhorman/rng-tools/"
3550 "archive/v" version ".tar.gz"))
3551 (file-name (string-append name "-" version ".tar.gz"))
3554 "00ywsknjpc9jd9kfmz2syk9l0xkiiwyx5qhl5zvhhc69v6682i31"))))
3555 (build-system gnu-build-system)
3557 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
3558 #:configure-flags '("--without-nistbeacon")
3560 (modify-phases %standard-phases
3561 (add-after 'unpack 'bootstrap
3563 (zero? (system* "sh" "autogen.sh")))))))
3565 `(("autoconf" ,autoconf)
3566 ("automake" ,automake)
3567 ("pkg-config" ,pkg-config)))
3569 `(("libsysfs" ,sysfsutils)))
3570 (synopsis "Random number generator daemon")
3572 "Monitor a hardware random number generator, and supply entropy
3573 from that to the system kernel's @file{/dev/random} machinery.")
3574 (home-page "https://sourceforge.net/projects/gkernel")
3575 ;; The source package is offered under the GPL2+, but the files
3576 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3577 (license (list license:gpl2 license:gpl2+))))
3579 (define-public cpupower
3582 (version (package-version linux-libre))
3583 (source (package-source linux-libre))
3584 (build-system gnu-build-system)
3586 '(#:phases (modify-phases %standard-phases
3587 (add-after 'unpack 'enter-subdirectory
3589 (chdir "tools/power/cpupower")))
3591 (add-before 'build 'fix-makefiles
3593 (substitute* "Makefile"
3595 (("/bin/(install|pwd)" _ command) command))
3596 (substitute* "bench/Makefile"
3597 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3598 #:make-flags (let ((out (assoc-ref %outputs "out")))
3599 (list (string-append "DESTDIR=" out)
3600 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3601 "docdir=/share/doc/cpupower"
3602 "confdir=$(docdir)/examples"
3603 ;; The Makefile recommends the following changes
3605 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3606 #:tests? #f)) ;no tests
3607 (native-inputs `(("gettext" ,gettext-minimal)))
3608 (inputs `(("pciutils" ,pciutils)))
3609 (home-page (package-home-page linux-libre))
3610 (synopsis "CPU frequency and voltage scaling tools for Linux")
3612 "cpupower is a set of user-space tools that use the cpufreq feature of the
3613 Linux kernel to retrieve and control processor features related to power saving,
3614 such as frequency and voltage scaling.")
3615 (license license:gpl2)))
3617 (define-public haveged
3624 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3628 "0w5ypz6451msckivjriwyw8djydlwffam7x23xh626s2vzdrlzgp"))))
3629 (build-system gnu-build-system)
3630 (home-page "http://www.issihosts.com/haveged")
3631 (synopsis "Entropy source for the Linux random number generator")
3633 "haveged generates an unpredictable stream of random numbers for use by
3634 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3635 standard mechanisms for filling the entropy pool may not be sufficient for
3636 systems with high needs or limited user interaction, such as headless servers.
3637 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3638 indirect effects of hardware events on hidden processor state using the HArdware
3639 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3640 its environment and provides the same built-in test suite for the output stream
3641 as used on certified hardware security devices.")
3642 (license (list (license:non-copyleft "file://nist/mconf.h")
3643 (license:non-copyleft "file://nist/packtest.c")
3644 license:public-domain ; nist/dfft.c
3645 license:gpl3+)))) ; everything else
3647 (define-public ecryptfs-utils
3649 (name "ecryptfs-utils")
3654 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3655 version "/+download/ecryptfs-utils_"
3656 version ".orig.tar.gz"))
3659 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3660 (build-system gnu-build-system)
3662 `(#:configure-flags (list "--disable-pywrap")))
3664 `(("intltool" ,intltool)
3665 ("perl" ,perl) ; for pod2man
3666 ("pkg-config" ,pkg-config)))
3668 `(("keyutils" ,keyutils)
3669 ("linux-pam" ,linux-pam)
3671 (home-page "http://ecryptfs.org/")
3672 (synopsis "eCryptfs cryptographic file system utilities")
3674 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3675 Each file's cryptographic meta-data is stored inside the file itself, along
3676 with the encrypted contents. This allows individual encrypted files to be
3677 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3678 native Linux file system, and has been part of the Linux kernel since version
3679 2.6.19. This package contains the userland utilities to manage it.")
3680 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3681 ;; grant additional permission to link with OpenSSL.
3682 (license license:gpl2+)))
3684 (define-public libnfsidmap
3686 (name "libnfsidmap")
3691 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3692 name "/" name "-" version ".tar.gz"))
3695 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3696 (build-system gnu-build-system)
3698 `(#:configure-flags (list
3699 (string-append "--with-pluginpath="
3700 (assoc-ref %outputs "out")
3701 "/lib/libnfsidmap"))))
3703 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3705 "NFSv4 support library for name/ID mapping")
3706 (description "Libnfsidmap is a library holding mulitiple methods of
3707 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3708 extensible array of mapping functions, currently consisting of two choices:
3709 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3710 (license (license:non-copyleft "file://COPYING"
3711 "See COPYING in the distribution."))))
3713 (define-public module-init-tools
3715 (name "module-init-tools")
3720 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3721 "module-init-tools-" version ".tar.bz2"))
3724 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3725 (patches (search-patches "module-init-tools-moduledir.patch"))))
3726 (build-system gnu-build-system)
3728 ;; FIXME: The upstream tarball lacks man pages, and building them would
3729 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3730 ;; but they vanished. In the meantime, fake it.
3732 (modify-phases %standard-phases
3733 (add-before 'configure 'fake-docbook
3735 (substitute* "Makefile.in"
3736 (("^DOCBOOKTOMAN.*$")
3737 "DOCBOOKTOMAN = true\n"))
3739 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3740 (synopsis "Tools for loading and managing Linux kernel modules")
3742 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3743 `insmod', `lsmod', and more.")
3744 (license license:gpl2+)))
3746 (define-public mcelog
3752 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3753 "mcelog.git/snapshot/v" version ".tar.gz"))
3756 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
3757 (file-name (string-append name "-" version ".tar.gz"))
3758 (modules '((guix build utils)))
3760 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3761 `(substitute* "Makefile"
3762 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3763 (build-system gnu-build-system)
3765 `(#:phases (modify-phases %standard-phases
3766 (delete 'configure)) ; no configure script
3767 #:make-flags (let ((out (assoc-ref %outputs "out")))
3769 (string-append "prefix=" out)
3770 (string-append "DOCDIR=" out "/share/doc/mcelog")
3771 "etcprefix=$(DOCDIR)/examples"))
3772 ;; The tests will only run as root on certain supported CPU models.
3774 (supported-systems (list "i686-linux" "x86_64-linux"))
3775 (home-page "https://mcelog.org/")
3776 (synopsis "Machine check monitor for x86 Linux systems")
3778 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3779 and other hardware errors on x86 systems. It can also perform user-defined
3780 tasks, such as bringing bad pages off-line, when configurable error thresholds
3782 (license license:gpl2)))
3784 (define-public mtd-utils
3791 "ftp://ftp.infradead.org/pub/mtd-utils/"
3792 "mtd-utils-" version ".tar.bz2"))
3795 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3798 ("libuuid" ,util-linux)
3801 (build-system gnu-build-system)
3803 `(#:test-target "tests"
3804 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3805 #:phases (modify-phases %standard-phases
3806 (delete 'configure))))
3807 (synopsis "MTD Flash Storage Utilities")
3808 (description "This package provides utilities for testing, partitioning, etc
3810 (home-page "http://www.linux-mtd.infradead.org/")
3812 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3813 license:mpl1.1 ; All ftl* files
3814 license:expat)))) ; libiniparser
3816 (define-public libseccomp
3822 (uri (string-append "https://github.com/seccomp/libseccomp/"
3823 "releases/download/v" version
3824 "/libseccomp-" version ".tar.gz"))
3827 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3828 (build-system gnu-build-system)
3830 `(("which" ,which)))
3831 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3832 (description "The libseccomp library provides an easy to use, platform
3833 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3834 libseccomp API is designed to abstract away the underlying BPF based syscall
3835 filter language and present a more conventional function-call based filtering
3836 interface that should be familiar to, and easily adopted by, application
3838 (home-page "https://github.com/seccomp/libseccomp")
3839 (license license:lgpl2.1)))
3841 (define-public radeontop
3845 (home-page "https://github.com/clbr/radeontop/")
3848 (uri (string-append home-page "archive/v" version ".tar.gz"))
3849 (file-name (string-append name "-" version ".tar.gz"))
3852 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3853 (build-system gnu-build-system)
3855 `(#:phases (modify-phases %standard-phases
3856 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3857 ;; dependency, and doesn't even work on release(!) tarballs.
3858 (add-after 'unpack 'report-correct-version
3859 (lambda _ (substitute* "getver.sh"
3861 (string-append "ver=" ,version)))))
3862 (delete 'configure)) ; no configure script
3863 #:make-flags (list "CC=gcc"
3864 (string-append "PREFIX=" %output))
3865 #:tests? #f)) ; no tests
3867 `(("gettext" ,gettext-minimal)
3868 ("pkg-config" ,pkg-config)))
3870 `(("libdrm" ,libdrm)
3871 ("libpciaccess" ,libpciaccess)
3873 ("ncurses" ,ncurses)))
3874 (synopsis "Usage monitor for AMD Radeon graphics")
3875 (description "RadeonTop monitors resource consumption on supported AMD
3876 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3877 a terminal or saved to a file for further processing. It measures both the
3878 activity of the GPU as a whole, which is also accurate during OpenCL
3879 computations, as well as separate component statistics that are only meaningful
3880 under OpenGL graphics workloads.")
3881 (license license:gpl3)))
3883 (define-public efivar
3889 (uri (string-append "https://github.com/rhinstaller/" name
3890 "/releases/download/" version "/" name
3891 "-" version ".tar.bz2"))
3894 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3895 (build-system gnu-build-system)
3897 `(;; Tests require a UEFI system and is not detected in the chroot.
3899 #:make-flags (list (string-append "prefix=" %output)
3900 (string-append "libdir=" %output "/lib")
3901 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3903 (modify-phases %standard-phases
3904 (delete 'configure))))
3906 `(("pkg-config" ,pkg-config)))
3909 (home-page "https://github.com/rhinstaller/efivar")
3910 (synopsis "Tool and library to manipulate EFI variables")
3911 (description "This package provides a library and a command line
3912 interface to the variable facility of UEFI boot firmware.")
3913 (license license:lgpl2.1+)))
3915 (define-public efibootmgr
3921 (uri (string-append "https://github.com/rhinstaller/" name
3922 "/releases/download/" version "/" name
3923 "-" version ".tar.bz2"))
3926 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3927 (build-system gnu-build-system)
3929 `(#:tests? #f ; No tests.
3930 #:make-flags (list (string-append "prefix=" %output)
3931 (string-append "libdir=" %output "/lib")
3932 ;; Override CFLAGS to add efivar include directory.
3933 (string-append "CFLAGS=-O2 -g -flto -I"
3934 (assoc-ref %build-inputs "efivar")
3937 (modify-phases %standard-phases
3938 (add-after 'unpack 'branding
3939 ;; Replace default loader path with something more familiar.
3941 (substitute* "src/efibootmgr.c"
3942 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3945 (delete 'configure))))
3947 `(("pkg-config" ,pkg-config)))
3949 `(("efivar" ,efivar)
3951 (home-page "https://github.com/rhinstaller/efibootmgr")
3952 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3954 "@code{efibootmgr} is a user-space application to modify the Intel
3955 Extensible Firmware Interface (EFI) Boot Manager. This application can
3956 create and destroy boot entries, change the boot order, change the next
3957 running boot option, and more.")
3958 (license license:gpl2+)))
3960 (define-public sysstat
3966 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3967 "sysstat-" version ".tar.xz"))
3970 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3971 (build-system gnu-build-system)
3973 `(#:tests? #f ; No test suite.
3974 ;; Without this flag, it tries to install the man pages with group 'root'
3975 ;; and fails because /etc/passwd lacks an entry for the root user.
3977 (list "--disable-file-attr"
3978 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3980 (modify-phases %standard-phases
3981 ;; The build process tries to create '/var/lib/sa', so we skip that
3983 (add-after 'build 'skip-touching-var
3985 (substitute* "Makefile"
3986 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3989 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3990 (synopsis "Performance monitoring tools for Linux")
3991 (description "The sysstat utilities are a collection of performance
3992 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3993 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3994 @code{sadf} and @code{sa}.")
3995 (license license:gpl2+)))
3997 (define-public light
4003 (uri (string-append "https://github.com/haikarainen/" name
4004 "/archive/v" version ".tar.gz"))
4007 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
4008 (file-name (string-append name "-" version ".tar.gz"))))
4009 (build-system gnu-build-system)
4011 '(#:tests? #f ; no tests
4012 #:make-flags (list "CC=gcc"
4013 (string-append "PREFIX=" %output))
4015 (modify-phases %standard-phases
4017 (add-after 'unpack 'patch-makefile
4019 (substitute* "Makefile" (("chown") "#")))))))
4021 `(("help2man" ,help2man)))
4022 (home-page "https://haikarainen.github.io/light")
4023 (synopsis "GNU/Linux application to control backlights")
4025 "Light is a program to send commands to screen backlight controllers
4026 under GNU/Linux. Features include:
4029 @item It does not rely on X.
4030 @item Light can automatically figure out the best controller to use, making
4031 full use of underlying hardware.
4032 @item It is possible to set a minimum brightness value, as some controllers
4033 set the screen to be pitch black at a vaĺue of 0 (or higher).
4036 Light is the successor of lightscript.")
4037 (license license:gpl3+)))
4046 "https://github.com/linrunner/"
4047 (string-upcase name)
4048 "/archive/" version ".tar.gz"))
4049 (file-name (string-append name "-" version ".tar.gz"))
4052 "1v3qpj9kp4rxwqapayd0i9419wwv4bikyrzjvqn0r9xkgnr1f9v4"))))
4053 (inputs `(("bash" ,bash)
4055 ("ethtool" ,ethtool)
4059 ("inetutils" ,inetutils)
4062 ("pciutils" ,pciutils)
4066 ("usbutils" ,usbutils)
4067 ("util-linux" ,util-linux)
4068 ("wireless-tools" ,wireless-tools)))
4069 (build-system gnu-build-system)
4072 (modify-phases %standard-phases
4073 (delete 'configure) ; no configure script
4074 (add-before 'build 'setenv
4075 (lambda* (#:key outputs #:allow-other-keys)
4076 (let ((out (assoc-ref outputs "out")))
4077 (setenv "TLP_WITH_SYSTEMD" "0")
4078 (setenv "TLP_NO_INIT" "1")
4079 (setenv "TLP_NO_PMUTILS" "1")
4080 (setenv "TLP_SBIN" (string-append out "/bin"))
4081 (setenv "TLP_BIN" (string-append out "/bin"))
4082 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
4083 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
4084 (setenv "TLP_CONF" "/etc/tlp")
4086 (string-append out "/share/bash-completion/completions"))
4087 (setenv "TLP_MAN" (string-append out "/share/man")))))
4088 (delete 'check) ; no tests
4089 (add-before 'install 'fix-installation
4091 ;; Stop the Makefile from trying to create system directories.
4092 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
4095 (zero? (system* "make" "install-tlp" "install-man"))))
4096 (add-after 'install 'wrap
4097 (lambda* (#:key inputs outputs #:allow-other-keys)
4098 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4099 (bin-files (find-files bin ".*")))
4100 (define (bin-directory input-name)
4101 (string-append (assoc-ref inputs input-name) "/bin"))
4102 (define (sbin-directory input-name)
4103 (string-append (assoc-ref inputs input-name) "/sbin"))
4104 (for-each (lambda (program)
4105 (wrap-program program
4108 (map bin-directory '("bash"
4119 (map sbin-directory '("ethtool"
4124 "wireless-tools"))))))
4126 (home-page "http://linrunner.de/en/tlp/tlp.html")
4127 (synopsis "Power management tool for Linux")
4128 (description "TLP is a power management tool for Linux. It comes with
4129 a default configuration already optimized for battery life. Nevertheless,
4130 TLP is customizable to fulfil system requirements. TLP settings are applied
4131 every time the power supply source is changed.")
4133 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4135 (license (list license:gpl2+ license:gpl3+))))
4143 (uri (string-append "https://www.ezix.org/software/"
4144 "files/lshw-" version
4148 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4149 (build-system gnu-build-system)
4151 `(#:phases (modify-phases %standard-phases (delete 'configure))
4152 #:tests? #f ; no tests
4154 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4155 (synopsis "List hardware information")
4157 "@command{lshw} (Hardware Lister) is a small tool to provide
4158 detailed information on the hardware configuration of the machine.
4159 It can report exact memory configuration, firmware version, mainboard
4160 configuration, CPU version and speed, cache configuration, bus speed,
4161 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4162 machines (PowerMac G4 is known to work).")
4163 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4164 (license license:gpl2+)))
4166 (define-public libmnl
4173 (uri (string-append "mirror://netfilter.org/libmnl/"
4174 "libmnl-" version ".tar.bz2"))
4177 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4178 (build-system gnu-build-system)
4179 (home-page "https://www.netfilter.org/projects/libmnl/")
4180 (synopsis "Netlink utility library")
4181 (description "Libmnl is a minimalistic user-space library oriented to
4182 Netlink developers. There are a lot of common tasks in parsing, validating,
4183 constructing of both the Netlink header and TLVs that are repetitive and easy to
4184 get wrong. This library aims to provide simple helpers that allows you to
4185 re-use code and to avoid re-inventing the wheel.")
4186 (license license:lgpl2.1+)))
4188 (define-public libnftnl
4195 (uri (string-append "mirror://netfilter.org/libnftnl/"
4196 "libnftnl-" version ".tar.bz2"))
4199 "0d9nkdbdck8sg6msysqyv3m9kjr9sjif5amf26dfa0g3mqjdihgy"))))
4200 (build-system gnu-build-system)
4202 `(("pkg-config" ,pkg-config)))
4204 `(("libmnl" ,libmnl)))
4205 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4206 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4207 (description "Libnftnl is a userspace library providing a low-level netlink
4208 programming interface to the in-kernel nf_tables subsystem. The library
4209 libnftnl has been previously known as libnftables. This library is currently
4211 (license license:gpl2+)))
4213 (define-public nftables
4220 (uri (string-append "http://www.nftables.org/projects/nftables"
4221 "/files/nftables-" version ".tar.bz2"))
4224 "1i1gfy8l7qyhc5vlrpp63s0n5kybmc9pi4dywiq8rmkhrrnddsla"))))
4225 (build-system gnu-build-system)
4226 (inputs `(("bison", bison)
4230 ("libnftnl", libnftnl)
4231 ("readline", readline)))
4232 (native-inputs `(("pkg-config", pkg-config)))
4233 (home-page "http://www.nftables.org")
4234 (synopsis "Userspace utility for Linux packet filtering")
4235 (description "nftables is the project that aims to replace the existing
4236 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4237 filtering framework, a new userspace utility and also a compatibility layer for
4238 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4239 infrastructure such as the existing hooks, the connection tracking system, the
4240 userspace queueing component and the logging subsystem.")
4241 (license license:gpl2)))
4243 (define-public proot
4247 (home-page "https://github.com/proot-me/PRoot")
4250 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4251 (file-name (string-append name "-" version ".tar.gz"))
4254 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4255 (patches (search-patches "proot-test-fhs.patch"))))
4256 (build-system gnu-build-system)
4258 '(#:make-flags '("-C" "src")
4260 #:phases (modify-phases %standard-phases
4262 (add-before 'build 'set-shell-file-name
4263 (lambda* (#:key inputs #:allow-other-keys)
4264 (substitute* (find-files "src" "\\.[ch]$")
4267 (assoc-ref inputs "bash")
4270 (add-before 'check 'fix-fhs-assumptions-in-tests
4272 (substitute* "tests/test-c6b77b77.mk"
4273 (("/bin/bash") (which "bash"))
4274 (("/usr/bin/test") (which "test")))
4275 (substitute* '("tests/test-16573e73.c")
4276 (("/bin/([a-z-]+)" _ program)
4279 (substitute* (find-files "tests" "\\.sh$")
4280 ;; Some of the tests try to "bind-mount" /bin/true.
4282 (string-append "-b " (which "true") ":"))
4283 ;; Likewise for /bin.
4284 (("-b /bin:") "-b /gnu:")
4285 ;; Others try to run /bin/sh.
4286 (("/bin/sh") (which "sh"))
4287 ;; Others assume /etc/fstab exists.
4288 (("/etc/fstab") "/etc/passwd"))
4290 (substitute* "tests/GNUmakefile"
4291 (("-b /bin:") "-b /gnu:"))
4293 ;; XXX: This test fails in an obscure corner case, just
4295 (delete-file "tests/test-kkkkkkkk.c")
4300 (let ((n (parallel-job-count)))
4301 ;; For some reason we get lots of segfaults with
4302 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4303 (setenv "PROOT_NO_SECCOMP" "1")
4305 ;; Most of the tests expect "/bin" to be in $PATH so
4306 ;; they can run things that live in $ROOTFS/bin.
4308 (string-append (getenv "PATH") ":/bin"))
4310 (zero? (system* "make" "check" "-C" "tests"
4312 "-j" (number->string n))))))
4314 (lambda* (#:key outputs #:allow-other-keys)
4315 ;; The 'install' rule does nearly nothing.
4316 (let ((out (assoc-ref outputs "out")))
4318 ;; TODO: 'make install-care' (does not even
4319 ;; build currently.)
4320 (system* "make" "-C" "src" "install"
4321 (string-append "PREFIX=" out)))
4322 (let ((man1 (string-append out
4323 "/share/man/man1")))
4325 (copy-file "doc/proot/man.1"
4326 (string-append man1 "/proot.1"))
4328 (native-inputs `(("which" ,which)
4330 ;; For 'mcookie', used by some of the tests.
4331 ("util-linux" ,util-linux)))
4332 (inputs `(("talloc" ,talloc)))
4333 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4335 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4336 and @code{binfmt_misc}. This means that users don't need any privileges or
4337 setup to do things like using an arbitrary directory as the new root
4338 file system, making files accessible somewhere else in the file system
4339 hierarchy, or executing programs built for another CPU architecture
4340 transparently through QEMU user-mode. Also, developers can use PRoot as a
4341 generic process instrumentation engine thanks to its extension mechanism.
4342 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4343 available in the kernel Linux.")
4344 (license license:gpl2+)))
4346 (define-public proot-static
4349 (name "proot-static")
4351 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4352 (inputs `(("talloc" ,talloc/static)))
4354 (substitute-keyword-arguments (package-arguments proot)
4355 ((#:make-flags flags)
4356 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4358 `(modify-phases ,phases
4359 (add-after 'strip 'remove-store-references
4360 (lambda* (#:key outputs #:allow-other-keys)
4361 (let* ((out (assoc-ref outputs "out")))
4362 (with-directory-excursion out
4363 (remove-store-references "bin/proot")
4365 ((#:allowed-references _ '("out"))
4368 (define-public cpuid
4371 (version "20170122")
4374 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4375 version ".src.tar.gz"))
4378 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4379 (build-system gnu-build-system)
4381 '(#:make-flags '("CC=gcc")
4382 #:tests? #f ; no tests
4383 #:phases (modify-phases %standard-phases
4385 (add-before 'install 'fix-makefile
4386 (lambda* (#:key outputs #:allow-other-keys)
4387 (substitute* "Makefile"
4388 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4389 ;; Make the compressed manpages writable so that the
4390 ;; reset-gzip-timestamps phase does not error out.
4391 (substitute* "Makefile"
4392 (("-m 444") "-m 644"))
4394 (inputs `(("perl" ,perl)))
4395 (supported-systems '("i686-linux" "x86_64-linux"))
4396 (home-page "http://www.etallen.com/cpuid.html")
4397 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4398 (description "cpuid dumps detailed information about the CPU(s) gathered
4399 from the CPUID instruction, and also determines the exact model of CPU(s). It
4400 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4401 NexGen, Rise, and SiS CPUs.")
4402 (license license:gpl2+)))
4404 (define-public jmtpfs
4411 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4413 (file-name (string-append name "-" version ".tar.gz"))
4416 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4417 (build-system gnu-build-system)
4421 ("libmtp" ,libmtp)))
4423 `(("pkg-config" ,pkg-config)))
4424 (home-page "https://github.com/JasonFerrara/jmtpfs")
4425 (synopsis "Use a FUSE file system to access data over MTP")
4426 (description "jmtpfs uses FUSE (file system in userspace) to provide access
4427 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4428 the MTP device as a file system.")
4429 (license license:gpl3)))
4431 (define-public procenv
4438 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4440 (file-name (string-append name "-" version ".tar.gz"))
4442 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
4443 (build-system gnu-build-system)
4444 (arguments `(#:configure-flags '("--disable-silent-rules")))
4445 (native-inputs `(("pkg-config" ,pkg-config)))
4446 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4447 ("groff" ,groff) ; for tests
4448 ("libselinux" ,libselinux)))
4449 (synopsis "Utility to show process environment")
4450 (description "Procenv is a command-line tool that displays as much detail about
4451 itself and its environment as possible. It can be used as a test
4452 tool, to understand the type of environment a process runs in, and for
4453 comparing system environments.")
4454 (home-page "http://github.com/jamesodhunt/procenv/")
4455 (license license:gpl3+)))
4457 (define-public libfabric
4465 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4466 version "/libfabric-" version ".tar.bz2"))
4468 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4469 (build-system gnu-build-system)
4470 (inputs `(("rdma-core" ,rdma-core)
4471 ,@(match (%current-system)
4472 ((member (package-supported-systems psm))
4476 (home-page "https://ofiwg.github.io/libfabric/")
4477 (synopsis "Open Fabric Interfaces")
4479 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4480 communication services to applications. OFI is best described as a collection
4481 of libraries and applications used to export fabric services. The key
4482 components of OFI are: application interfaces, provider libraries, kernel
4483 services, daemons, and test applications.
4485 Libfabric is a core component of OFI. It is the library that defines and
4486 exports the user-space API of OFI, and is typically the only software that
4487 applications deal with directly. It works in conjunction with provider
4488 libraries, which are often integrated directly into libfabric.")
4489 (license (list license:bsd-2 license:gpl2)))) ;dual
4494 (version "3.3.20170428")
4495 (home-page "https://github.com/intel/psm")
4499 (uri (git-reference (url home-page)
4500 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
4501 (file-name (string-append "psm-" version ".tar.gz"))
4503 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
4504 (patches (search-patches
4505 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
4506 "psm-ldflags.patch" ; build shared lib with LDFLAGS
4507 "psm-repro.patch")))) ; reproducibility
4508 (build-system gnu-build-system)
4509 (inputs `(("libuuid" ,util-linux)))
4511 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
4512 ,(string-append "INSTALL_PREFIX=" %output)
4513 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4515 #:phases (modify-phases %standard-phases
4517 (add-after 'unpack 'patch-/usr/include
4519 (substitute* "Makefile"
4520 (("\\$\\{DESTDIR}/usr/include")
4521 (string-append %output "/include")))
4522 (substitute* "Makefile"
4523 (("/lib64") "/lib"))
4525 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
4527 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
4528 communications interface for the True Scale family of products. PSM users are
4529 enabled with mechanisms necessary to implement higher level communications
4530 interfaces in parallel environments.")
4531 ;; Only Intel-compatable processors are supported.
4532 (supported-systems '("i686-linux" "x86_64-linux"))
4533 (license (list license:bsd-2 license:gpl2)))) ;dual
4535 (define-public snapscreenshot
4537 (name "snapscreenshot")
4538 (version "1.0.14.3")
4542 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
4543 name "-" version ".tar.bz2"))
4545 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
4546 (build-system gnu-build-system)
4549 (let ((out (assoc-ref %outputs "out")))
4550 (list (string-append "BINDIR=" out "/bin")
4551 (string-append "MANDIR=" out "/share/man")))
4552 #:tests? #f ; no test suite
4554 (modify-phases %standard-phases
4555 (delete 'configure) ; ./configure is a snarky no-op
4556 (add-before 'install 'fix-ownership
4557 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
4559 (substitute* "depfun.mak"
4560 ((" -o bin -g bin ") " "))
4562 (add-before 'install 'create-output-directories
4563 (lambda* (#:key outputs #:allow-other-keys)
4564 (let ((out (assoc-ref outputs "out")))
4565 (mkdir-p (string-append out "/share/man/man1"))
4567 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
4568 (synopsis "Take screenshots of one or more Linux text consoles")
4570 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
4571 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
4572 relevant @file{/dev/vcs*} file(s).")
4573 (license license:gpl2)))
4575 (define-public fbcat
4582 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
4583 version "/" name "-" version ".tar.gz"))
4585 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
4586 (build-system gnu-build-system)
4588 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
4589 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
4590 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
4591 `(("pnmtopng" ,netpbm)))
4592 (outputs (list "out" "fbgrab"))
4596 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4597 #:tests? #f ; no tests
4599 (modify-phases %standard-phases
4600 (delete 'configure) ; no configure script
4601 (add-after 'build 'qualify-references
4602 (lambda* (#:key inputs outputs #:allow-other-keys)
4603 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
4604 (out (assoc-ref outputs "out")))
4605 (substitute* "fbgrab"
4607 (string-append out "/bin/" all))
4609 (string-append pnmtopng "/bin/" all)))
4611 (add-after 'install 'split-fbgrab-output
4612 (lambda* (#:key outputs #:allow-other-keys)
4613 (let* ((out (assoc-ref outputs "out"))
4614 (out:fbgrab (assoc-ref outputs "fbgrab")))
4615 (for-each (lambda (file)
4616 (let ((old (string-append out "/" file))
4617 (new (string-append out:fbgrab "/" file)))
4618 (mkdir-p (dirname new))
4619 (rename-file old new)))
4621 "share/man/man1/fbgrab.1"))
4623 (home-page "https://jwilk.net/software/fbcat")
4624 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
4626 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
4627 a dump therof. It supports a wide range of drivers and pixel formats.
4628 @command{fbcat} can take screenshots of virtually any application that can be
4629 made to write its output to the framebuffer, including (but not limited to)
4630 text-mode or graphical applications that don't use a display server.
4632 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
4633 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
4634 (license license:gpl2)))