1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 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, 2019 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, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019 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, 2019 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
22 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
31 ;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
38 ;;; This file is part of GNU Guix.
40 ;;; GNU Guix is free software; you can redistribute it and/or modify it
41 ;;; under the terms of the GNU General Public License as published by
42 ;;; the Free Software Foundation; either version 3 of the License, or (at
43 ;;; your option) any later version.
45 ;;; GNU Guix is distributed in the hope that it will be useful, but
46 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
47 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48 ;;; GNU General Public License for more details.
50 ;;; You should have received a copy of the GNU General Public License
51 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
53 (define-module (gnu packages linux)
54 #:use-module (gnu packages)
55 #:use-module (gnu packages acl)
56 #:use-module (gnu packages admin)
57 #:use-module (gnu packages algebra)
58 #:use-module (gnu packages attr)
59 #:use-module (gnu packages audio)
60 #:use-module (gnu packages autotools)
61 #:use-module (gnu packages backup)
62 #:use-module (gnu packages base)
63 #:use-module (gnu packages bash)
64 #:use-module (gnu packages bison)
65 #:use-module (gnu packages calendar)
66 #:use-module (gnu packages check)
67 #:use-module (gnu packages crypto)
68 #:use-module (gnu packages cryptsetup)
69 #:use-module (gnu packages compression)
70 #:use-module (gnu packages dbm)
71 #:use-module (gnu packages datastructures)
72 #:use-module (gnu packages docbook)
73 #:use-module (gnu packages documentation)
74 #:use-module (gnu packages elf)
75 #:use-module (gnu packages flex)
76 #:use-module (gnu packages file)
77 #:use-module (gnu packages freedesktop)
78 #:use-module (gnu packages gcc)
79 #:use-module (gnu packages gettext)
80 #:use-module (gnu packages glib)
81 #:use-module (gnu packages golang)
82 #:use-module (gnu packages gperf)
83 #:use-module (gnu packages gtk)
84 #:use-module (gnu packages libunwind)
85 #:use-module (gnu packages libusb)
86 #:use-module (gnu packages man)
87 #:use-module (gnu packages maths)
88 #:use-module (gnu packages multiprecision)
89 #:use-module (gnu packages ncurses)
90 #:use-module (gnu packages netpbm)
91 #:use-module (gnu packages nettle)
92 #:use-module (gnu packages networking)
93 #:use-module (gnu packages ninja)
94 #:use-module (gnu packages nss)
95 #:use-module (gnu packages perl)
96 #:use-module (gnu packages pciutils)
97 #:use-module (gnu packages pkg-config)
98 #:use-module (gnu packages popt)
99 #:use-module (gnu packages pulseaudio)
100 #:use-module (gnu packages python)
101 #:use-module (gnu packages readline)
102 #:use-module (gnu packages rrdtool)
103 #:use-module (gnu packages samba)
104 #:use-module (gnu packages serialization)
105 #:use-module (gnu packages slang)
106 #:use-module (gnu packages storage)
107 #:use-module (gnu packages texinfo)
108 #:use-module (gnu packages tls)
109 #:use-module (gnu packages valgrind)
110 #:use-module (gnu packages video)
111 #:use-module (gnu packages web)
112 #:use-module (gnu packages xiph)
113 #:use-module (gnu packages xml)
114 #:use-module (gnu packages xdisorg)
115 #:use-module (gnu packages xorg)
116 #:use-module (gnu packages groff)
117 #:use-module (gnu packages selinux)
118 #:use-module (gnu packages swig)
119 #:use-module (guix build-system cmake)
120 #:use-module (guix build-system gnu)
121 #:use-module (guix build-system go)
122 #:use-module (guix build-system python)
123 #:use-module (guix build-system trivial)
124 #:use-module (guix build-system linux-module)
125 #:use-module (guix download)
126 #:use-module (guix git-download)
127 #:use-module ((guix licenses) #:prefix license:)
128 #:use-module (guix packages)
129 #:use-module (guix utils)
130 #:use-module (srfi srfi-1)
131 #:use-module (srfi srfi-2)
132 #:use-module (srfi srfi-26)
133 #:use-module (ice-9 match))
135 (define-public (system->linux-architecture arch)
136 "Return the Linux architecture name for ARCH, a Guix system name such as
137 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
138 (let ((arch (car (string-split arch #\-))))
139 (cond ((string=? arch "i686") "i386")
140 ((string-prefix? "mips" arch) "mips")
141 ((string-prefix? "arm" arch) "arm")
142 ((string-prefix? "aarch64" arch) "arm64")
143 ((string-prefix? "alpha" arch) "alpha")
144 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
145 ((string-prefix? "s390" arch) "s390")
148 (define-public (system->defconfig system)
149 "Some systems (notably powerpc-linux) require a special target for kernel
150 defconfig. Return the appropriate make target if applicable, otherwise return
152 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
153 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
156 (define (linux-libre-urls version)
157 "Return a list of URLs for Linux-Libre VERSION."
159 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
160 version "-gnu/linux-libre-" version "-gnu.tar.xz")
162 ;; XXX: Work around <http://bugs.gnu.org/14851>.
164 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
165 version "-gnu.tar.xz")
167 ;; Maybe this URL will become valid eventually.
169 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
170 version "-gnu.tar.xz")))
172 (define-public linux-libre-headers
174 (name "linux-libre-headers")
178 (uri (linux-libre-urls version))
181 "050zvdxjy6sc64q75pr1gxsmh49chwav2pwxz8xlif39bvahnrpg"))))
182 (build-system gnu-build-system)
183 (native-inputs `(("perl" ,perl)))
185 `(#:modules ((guix build gnu-build-system)
189 (modify-phases %standard-phases
193 (let ((arch ,(system->linux-architecture
194 (or (%current-target-system)
196 (defconfig ,(system->defconfig
197 (or (%current-target-system)
198 (%current-system)))))
200 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
201 (invoke "make" defconfig)
202 (invoke "make" "mrproper" "headers_check"))))
204 (lambda* (#:key outputs #:allow-other-keys)
205 (let ((out (assoc-ref outputs "out")))
207 (string-append "INSTALL_HDR_PATH=" out)
210 (mkdir (string-append out "/include/config"))
211 (call-with-output-file
213 "/include/config/kernel.release")
215 (format p "~a-default~%" ,version)))
217 ;; Remove the '.install' and '..install.cmd' files; the
218 ;; latter contains store paths, which pulls in bootstrap
219 ;; binaries in the build environment, and prevents bit
220 ;; reproducibility for the bootstrap binaries.
221 (for-each delete-file (find-files out "\\.install"))
224 #:allowed-references ()
226 (home-page "https://www.gnu.org/software/linux-libre/")
227 (synopsis "GNU Linux-Libre kernel headers")
228 (description "Headers of the Linux-Libre kernel.")
229 (license license:gpl2)))
231 (define %boot-logo-patch
232 ;; Linux-Libre boot logo featuring Freedo and a gnu.
235 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
236 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
239 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
241 (define %linux-libre-arm-export-__sync_icache_dcache-patch
245 "https://salsa.debian.org/kernel-team/linux"
246 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
247 "/debian/patches/bugfix/arm/"
248 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
249 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
251 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
253 (define* (kernel-config arch #:key variant)
254 "Return the absolute file name of the Linux-Libre build configuration file
255 for ARCH and optionally VARIANT, or #f if there is no such configuration."
256 (let* ((name (string-append (if variant (string-append variant "-") "")
257 (if (string=? "i386" arch) "i686" arch) ".conf"))
258 (file (string-append "linux-libre/" name)))
259 (search-auxiliary-file file)))
261 ;; FIXME: merge into kernel-config
262 (define* (kernel-config-veyron arch #:key variant)
263 "Return the absolute file name of the Linux-Libre build configuration file
264 for ARCH and optionally VARIANT, or #f if there is no such configuration."
265 (let* ((name (string-append (if variant (string-append variant "-") "")
266 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
267 (file (string-append "linux-libre/" name)))
268 (search-auxiliary-file file)))
270 (define %default-extra-linux-options
271 `(;; Modules required for initrd:
272 ("CONFIG_NET_9P" . m)
273 ("CONFIG_NET_9P_VIRTIO" . m)
274 ("CONFIG_VIRTIO_BLK" . m)
275 ("CONFIG_VIRTIO_NET" . m)
276 ("CONFIG_VIRTIO_PCI" . m)
277 ("CONFIG_VIRTIO_BALLOON" . m)
278 ("CONFIG_VIRTIO_MMIO" . m)
279 ("CONFIG_FUSE_FS" . m)
281 ("CONFIG_9P_FS" . m)))
283 (define (config->string options)
284 (string-join (map (match-lambda
286 (string-append option "=m"))
288 (string-append option "=y"))
290 (string-append option "=n")))
294 (define* (make-linux-libre version hash supported-systems
296 ;; A function that takes an arch and a variant.
297 ;; See kernel-config for an example.
299 (configuration-file #f)
300 (defconfig "defconfig")
301 (extra-options %default-extra-linux-options)
302 (patches (list %boot-logo-patch)))
304 (name (if extra-version
305 (string-append "linux-libre-" extra-version)
310 (uri (linux-libre-urls version))
311 (sha256 (base32 hash))
313 (supported-systems supported-systems)
314 (build-system gnu-build-system)
320 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
324 ;; Build with GCC-7 for full retpoline support.
325 ;; FIXME: Remove this when our default compiler has retpoline support.
328 ;; These are needed to compile the GCC plugins.
333 ,@(match (and configuration-file
335 (system->linux-architecture
336 (or (%current-target-system) (%current-system)))
337 #:variant (version-major+minor version)))
338 (#f ;no config for this platform
341 `(("kconfig" ,config))))))
343 `(#:modules ((guix build gnu-build-system)
348 (modify-phases %standard-phases
349 (add-after 'unpack 'patch-/bin/pwd
351 (substitute* (find-files "." "^Makefile(\\.include)?$")
352 (("/bin/pwd") "pwd"))
354 (add-before 'configure 'work-around-gcc-7-include-path-issue
356 (unsetenv "C_INCLUDE_PATH")
357 (unsetenv "CPLUS_INCLUDE_PATH")
360 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
361 ;; Avoid introducing timestamps
362 (setenv "KCONFIG_NOTIMESTAMP" "1")
363 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
365 ;; Set ARCH and CROSS_COMPILE
366 (let ((arch ,(system->linux-architecture
367 (or (%current-target-system)
368 (%current-system)))))
370 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
373 (setenv "CROSS_COMPILE" (string-append target "-"))
374 (format #t "`CROSS_COMPILE' set to `~a'~%"
375 (getenv "CROSS_COMPILE"))))
377 (setenv "EXTRA_VERSION" ,extra-version)
379 (let ((build (assoc-ref %standard-phases 'build))
380 (config (assoc-ref (or native-inputs inputs) "kconfig")))
382 ;; Use a custom kernel configuration file or a default
383 ;; configuration file.
386 (copy-file config ".config")
387 (chmod ".config" #o666))
388 (invoke "make" ,defconfig))
390 ;; Appending works even when the option wasn't in the
391 ;; file. The last one prevails if duplicated.
392 (let ((port (open-file ".config" "a"))
393 (extra-configuration ,(config->string extra-options)))
394 (display extra-configuration port)
397 (invoke "make" "oldconfig"))))
399 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
400 (let* ((out (assoc-ref outputs "out"))
401 (moddir (string-append out "/lib/modules"))
402 (dtbdir (string-append out "/lib/dtbs"))
403 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
404 ;; Install kernel image, kernel configuration and link map.
405 (for-each (lambda (file) (install-file file out))
406 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
407 ;; Install device tree files
408 (unless (null? (find-files "." "\\.dtb$"))
410 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
412 ;; Install kernel modules
415 (string-append "DEPMOD=" kmod "/bin/depmod")
416 (string-append "MODULE_DIR=" moddir)
417 (string-append "INSTALL_PATH=" out)
418 (string-append "INSTALL_MOD_PATH=" out)
419 "INSTALL_MOD_STRIP=1"
420 "modules_install")))))
422 (home-page "https://www.gnu.org/software/linux-libre/")
423 (synopsis "100% free redistribution of a cleaned Linux kernel")
425 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
426 It has been modified to remove all non-free binary blobs.")
427 (license license:gpl2)))
429 (define %linux-libre-version "5.1.5")
430 (define %linux-libre-hash "1zz0hlv509mf2vvrkvj8w19g3fhws6jk5j4ml47kzyr0lbs56iwa")
432 (define %linux-libre-5.1-patches
433 (list %boot-logo-patch
434 %linux-libre-arm-export-__sync_icache_dcache-patch))
436 (define-public linux-libre
437 (make-linux-libre %linux-libre-version
439 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
440 #:patches %linux-libre-5.1-patches
441 #:configuration-file kernel-config))
443 (define %linux-libre-4.19-version "4.19.46")
444 (define %linux-libre-4.19-hash "17yy3h064kr7zck07wdrw3fmmmnfk15m17xvkpkc4yv5vxxi76vh")
446 (define %linux-libre-4.19-patches
447 (list %boot-logo-patch
448 %linux-libre-arm-export-__sync_icache_dcache-patch))
450 (define-public linux-libre-4.19
451 (make-linux-libre %linux-libre-4.19-version
452 %linux-libre-4.19-hash
453 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
454 #:patches %linux-libre-4.19-patches
455 #:configuration-file kernel-config))
457 (define %linux-libre-4.14-version "4.14.122")
458 (define %linux-libre-4.14-hash "0923m61b3gwm69w6m9zhb8az57lrwn7igdysf8wb7ld9z4hzpag8")
460 (define-public linux-libre-4.14
461 (make-linux-libre %linux-libre-4.14-version
462 %linux-libre-4.14-hash
463 '("x86_64-linux" "i686-linux" "armhf-linux")
464 #:configuration-file kernel-config))
466 (define-public linux-libre-4.9
467 (make-linux-libre "4.9.179"
468 "0nc9a7b7g5a18fdc8dswm3la7srn5sgz8adavp8r9h3ya9zh3wim"
469 '("x86_64-linux" "i686-linux")
470 #:configuration-file kernel-config))
472 (define-public linux-libre-4.4
473 (make-linux-libre "4.4.180"
474 "157kfs4slii86q9yrspvqdynpiv6rff80hrrn569v6h4nkc4b7ag"
475 '("x86_64-linux" "i686-linux")
476 #:configuration-file kernel-config
479 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
480 ;; This option was removed upstream in version 4.7.
481 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
482 %default-extra-linux-options)))
484 (define-public linux-libre-arm-veyron
485 (make-linux-libre %linux-libre-version
488 #:patches %linux-libre-5.1-patches
489 #:configuration-file kernel-config-veyron
490 #:extra-version "arm-veyron"))
492 (define-public linux-libre-arm-generic
493 (make-linux-libre %linux-libre-version
496 #:patches %linux-libre-5.1-patches
497 #:defconfig "multi_v7_defconfig"
498 #:extra-version "arm-generic"))
500 (define-public linux-libre-arm-generic-4.19
501 (make-linux-libre %linux-libre-4.19-version
502 %linux-libre-4.19-hash
504 #:patches %linux-libre-4.19-patches
505 #:defconfig "multi_v7_defconfig"
506 #:extra-version "arm-generic"))
508 (define-public linux-libre-arm-generic-4.14
509 (make-linux-libre %linux-libre-4.14-version
510 %linux-libre-4.14-hash
512 #:defconfig "multi_v7_defconfig"
513 #:extra-version "arm-generic"))
515 (define-public linux-libre-arm-omap2plus
516 (make-linux-libre %linux-libre-version
519 #:patches %linux-libre-5.1-patches
520 #:defconfig "omap2plus_defconfig"
521 #:extra-version "arm-omap2plus"))
523 (define-public linux-libre-arm-omap2plus-4.19
524 (make-linux-libre %linux-libre-4.19-version
525 %linux-libre-4.19-hash
527 #:patches %linux-libre-4.19-patches
528 #:defconfig "omap2plus_defconfig"
529 #:extra-version "arm-omap2plus"))
531 (define-public linux-libre-arm-omap2plus-4.14
532 (make-linux-libre %linux-libre-4.14-version
533 %linux-libre-4.14-hash
535 #:defconfig "omap2plus_defconfig"
536 #:extra-version "arm-omap2plus"))
540 ;;; Linux kernel modules.
543 (define-public acpi-call-linux-module
545 (name "acpi-call-linux-module")
551 (url "https://github.com/teleshoes/acpi_call.git")
553 (file-name (git-file-name name version))
555 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
556 (build-system linux-module-build-system)
558 `(#:tests? #f ; no tests
560 (modify-phases %standard-phases
561 (add-after 'unpack 'fix-for-linux-4.12
563 (substitute* "acpi_call.c"
567 (add-after 'install 'install-documentation
568 (lambda* (#:key outputs #:allow-other-keys)
569 (let* ((out (assoc-ref outputs "out"))
570 (doc (string-append out "/share/doc/" ,name "-" ,version)))
571 (for-each (lambda (file)
572 (let ((target (string-append doc "/" file)))
573 (mkdir-p (dirname target))
574 (copy-recursively file target)))
575 (list "README.md" "examples"))
577 (home-page "https://github.com/teleshoes/acpi_call")
578 (synopsis "Linux kernel module to perform ACPI method calls")
580 "This simple Linux kernel module allows calls from user space to any
581 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
582 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
583 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
584 and @code{ACPI_BUFFER}.
586 It grants direct and undocumented access to your hardware that may cause damage
587 and should be used with caution, especially on untested models.")
588 (license license:gpl3+))) ; see README.md (no licence headers)
590 (define-public vhba-module
597 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
601 "1513hq130raxp9z5grj54cwfjfxj05apipxg425j0zicii59a60c"))))
602 (build-system linux-module-build-system)
606 (home-page "https://cdemu.sourceforge.io/")
607 (synopsis "Kernel module that emulates SCSI devices")
608 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
609 between the CDemu userspace daemon and linux kernel.")
610 (license license:gpl2+)))
614 ;;; Pluggable authentication modules (PAM).
617 (define-public linux-pam
625 "https://github.com/linux-pam/linux-pam/releases/download/v"
626 version "/Linux-PAM-" version ".tar.xz"))
629 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
630 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
632 (build-system gnu-build-system)
636 ;; TODO: optional dependencies
637 ;; ("libxcrypt" ,libxcrypt)
638 ;; ("cracklib" ,cracklib)
641 `(;; Most users, such as `shadow', expect the headers to be under
643 #:configure-flags (list (string-append "--includedir="
644 (assoc-ref %outputs "out")
647 ;; XXX: <rpc/rpc.h> is missing from glibc when
648 ;; cross-compiling, so we have to disable NIS
649 ;; support altogether.
650 ,@(if (%current-target-system)
654 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
657 (home-page "http://www.linux-pam.org/")
658 (synopsis "Pluggable authentication modules for Linux")
660 "A *Free* project to implement OSF's RFC 86.0.
661 Pluggable authentication modules are small shared object files that can
662 be used through the PAM API to perform tasks, like authenticating a user
663 at login. Local and dynamic reconfiguration are its key features.")
664 (license license:bsd-3)))
666 (define-public linux-pam-1.2
674 "http://www.linux-pam.org/library/"
675 "Linux-PAM-" version ".tar.bz2"))
678 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
679 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
686 (define-public psmisc
693 (uri (string-append "mirror://sourceforge/psmisc/psmisc devel/psmisc-"
697 "0s1kjhrik0wzqbm7hv4gkhywhjrwhp9ajw0ad05fwharikk6ah49"))))
698 (build-system gnu-build-system)
699 (inputs `(("ncurses" ,ncurses)))
700 (home-page "https://gitlab.com/psmisc/psmisc")
702 "Small utilities that use the proc file system")
704 "This PSmisc package is a set of some small useful utilities that
705 use the proc file system. We're not about changing the world, but
706 providing the system administrator with some help in common tasks.")
707 (license license:gpl2+)))
709 (define-public util-linux
715 (uri (string-append "mirror://kernel.org/linux/utils/"
716 name "/v" (version-major+minor version) "/"
717 name "-" version ".tar.xz"))
720 "1ck7d8srw5szpjq7v0gpmjahnjs6wgqzm311ki4gazww6xx71rl6"))
721 (patches (search-patches "util-linux-tests.patch"))
722 (modules '((guix build utils)))
724 ;; We take 'nologin' from Shadow, the 'logger' program from
725 ;; GNU Inetutils and 'kill' from GNU Coreutils.
727 (substitute* "configure"
728 (("build_nologin=yes") "build_nologin=no")
729 (("build_logger=yes") "build_logger=no")
730 (("build_kill=yes") "build_kill=no"))
732 (build-system gnu-build-system)
734 "static")) ; >2 MiB of static .a libraries
736 `(#:configure-flags (list "--disable-use-tty-group"
737 "--enable-fs-paths-default=/run/current-system/profile/sbin"
738 ;; Don't try to chown root:root mount and umount
739 "--disable-makeinstall-chown"
740 ;; Install completions where our
741 ;; bash-completion package expects them.
742 (string-append "--with-bashcompletiondir="
743 (assoc-ref %outputs "out")
744 "/etc/bash_completion.d"))
745 #:phases (modify-phases %standard-phases
747 'build 'set-umount-file-name
748 (lambda* (#:key outputs #:allow-other-keys)
749 ;; Tell 'eject' the right file name of 'umount'.
750 (let ((out (assoc-ref outputs "out")))
751 (substitute* "sys-utils/eject.c"
753 (string-append "\"" out "/bin/umount\"")))
757 (lambda* (#:key inputs outputs #:allow-other-keys)
758 (let ((out (assoc-ref outputs "out"))
759 (net (assoc-ref inputs "net-base")))
760 ;; Change the test to refer to the right file.
761 (substitute* "tests/ts/misc/mcookie"
763 (string-append net "/etc/services")))
766 'install 'move-static-libraries
767 (lambda* (#:key outputs #:allow-other-keys)
768 (let ((out (assoc-ref outputs "out"))
769 (static (assoc-ref outputs "static")))
770 (mkdir-p (string-append static "/lib"))
771 (with-directory-excursion out
772 (for-each (lambda (file)
774 (string-append static "/"
776 (find-files "lib" "\\.a$"))
778 ;; Remove references to the static library from the '.la'
779 ;; files so that Libtool does the right thing when both
780 ;; the shared and static library is available.
781 (substitute* (find-files "lib" "\\.la$")
782 (("old_library=.*") "old_library=''\n")))
785 (inputs `(("zlib" ,zlib)
788 ;; XXX: This is so that the 'pre-check' phase can find it.
789 ,@(if (%current-target-system)
790 `(("net-base" ,net-base))
794 ("net-base" ,net-base))) ;for tests
795 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
796 (synopsis "Collection of utilities for the Linux kernel")
797 (description "Util-linux is a diverse collection of Linux kernel
798 utilities. It provides dmesg and includes tools for working with file systems,
799 block devices, UUIDs, TTYs, and many other tools.")
801 ;; Note that util-linux doesn't use the same license for all the
802 ;; code. GPLv2+ is the default license for a code without an
803 ;; explicitly defined license.
804 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
805 license:bsd-4 license:public-domain))))
813 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
815 (file-name (string-append name "-" version ".tar.gz"))
817 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
818 (build-system cmake-build-system)
819 (arguments '(#:tests? #f))
820 (home-page "https://github.com/bo0ts/ddate")
821 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
823 "ddate displays the Discordian date and holidays of a given date.
824 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
825 by Robert Shea and Robert Anton Wilson.")
826 (license license:public-domain)))
828 (define-public procps
834 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
835 "procps-ng-" version ".tar.xz"))
838 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
839 (build-system gnu-build-system)
841 '(#:modules ((guix build utils)
842 (guix build gnu-build-system)
846 (modify-phases %standard-phases
848 'install 'post-install
849 ;; Remove commands and man pages redudant with
851 (lambda* (#:key outputs #:allow-other-keys)
852 (let* ((out (assoc-ref outputs "out"))
853 (dup (append-map (cut find-files out <>)
854 '("^kill" "^uptime"))))
855 (for-each delete-file dup)
857 (inputs `(("ncurses" ,ncurses)))
858 (home-page "https://gitlab.com/procps-ng/procps/")
859 (synopsis "Utilities that give information about processes")
861 "Procps is the package that has a bunch of small useful utilities
862 that give information about processes using the Linux /proc file system.
863 The package includes the programs ps, top, vmstat, w, kill, free,
864 slabtop, and skill.")
865 (license license:gpl2)))
867 (define-public usbutils
874 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
875 "usbutils-" version ".tar.xz"))
877 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
878 (build-system gnu-build-system)
879 (outputs (list "out" "python"))
882 (modify-phases %standard-phases
883 (add-before 'bootstrap 'patch-bootstrap-scripts
885 (substitute* "usbhid-dump/bootstrap"
886 (("/bin/bash") (which "bash")))
888 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
889 (substitute* "autogen.sh"
890 (("^\\./configure.*") ""))
892 (add-after 'install 'separate-python-output
893 ;; Separating one Python script shaves more than 106 MiB from :out.
894 (lambda* (#:key outputs #:allow-other-keys)
895 (let ((out (assoc-ref outputs "out"))
896 (out:python (assoc-ref outputs "python")))
897 (for-each (lambda (file)
898 (let ((old (string-append out "/" file))
899 (new (string-append out:python "/" file)))
900 (mkdir-p (dirname new))
901 (rename-file old new)))
902 (list "bin/lsusb.py"))
909 `(("autoconf" ,autoconf)
910 ("automake" ,automake)
912 ("pkg-config" ,pkg-config)))
913 (home-page "http://www.linux-usb.org/")
915 "Tools for working with USB devices, such as lsusb")
917 "Tools for working with USB devices, such as lsusb.")
918 (license license:gpl2+)))
920 (define-public e2fsprogs
927 "mirror://kernel.org/linux/kernel/people/tytso/"
928 name "/v" version "/"
929 name "-" version ".tar.xz"))
932 "1ff56h6h1h17sj2zvlddv5c88nmbx46p1fcbh6b0s5k9kl3b6pms"))))
933 (build-system gnu-build-system)
934 (inputs `(("util-linux" ,util-linux)))
935 (native-inputs `(("pkg-config" ,pkg-config)
936 ("texinfo" ,texinfo) ;for the libext2fs Info manual
942 '(;; util-linux is the preferred source for some of the libraries and
943 ;; commands, so disable them (see, e.g.,
944 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
945 #:configure-flags (list "--disable-libblkid"
946 "--disable-libuuid" "--disable-uuidd"
949 ;; Use symlinks instead of hard links for
950 ;; 'fsck.extN' etc. This makes the resulting nar
951 ;; smaller and is preserved across copies.
952 "--enable-symlink-install"
954 (string-append "LDFLAGS=-Wl,-rpath="
955 (assoc-ref %outputs "out")
958 ;; Install libext2fs et al.
959 "--enable-elf-shlibs")
962 (modify-phases %standard-phases
963 (add-before 'configure 'patch-shells
965 (substitute* "configure"
966 (("/bin/sh (.*)parse-types.sh" _ dir)
967 (string-append (which "sh") " " dir
969 (substitute* "MCONFIG.in"
970 (("INSTALL_SYMLINK = /bin/sh")
971 "INSTALL_SYMLINK = sh"))
972 (substitute* (find-files "." "^Makefile.in$")
974 (string-append "#!" (which "sh"))))
976 (add-after 'install 'install-libs
977 (lambda* (#:key outputs #:allow-other-keys)
978 (let* ((out (assoc-ref outputs "out"))
979 (lib (string-append out "/lib")))
980 (invoke "make" "install-libs")
982 ;; Make the .a writable so that 'strip' works.
983 ;; Failing to do that, due to debug symbols, we
984 ;; retain a reference to the final
985 ;; linux-libre-headers, which refer to the
986 ;; bootstrap binaries.
987 (let ((archives (find-files lib "\\.a$")))
988 (for-each (lambda (file)
992 (home-page "http://e2fsprogs.sourceforge.net/")
993 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
995 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
996 (license (list license:gpl2 ;programs
997 license:lgpl2.0 ;libext2fs
998 license:x11)))) ;libuuid
1000 (define e2fsprogs/static
1002 (package (inherit e2fsprogs)
1004 ;; Do not build shared libraries.
1005 (substitute-keyword-arguments (package-arguments e2fsprogs)
1006 ((#:configure-flags _)
1007 '(list "--disable-blkid"))
1011 (define-public e2fsck/static
1013 (name "e2fsck-static")
1014 (version (package-version e2fsprogs))
1015 (build-system trivial-build-system)
1018 `(("e2fsprogs" ,e2fsprogs/static)))
1020 `(#:modules ((guix build utils))
1023 (use-modules (guix build utils)
1027 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1029 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1031 (with-directory-excursion bin
1032 (copy-file e2fsck "e2fsck")
1033 (remove-store-references "e2fsck")
1034 (chmod "e2fsck" #o555))
1036 (home-page (package-home-page e2fsprogs))
1037 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1038 (description "This package provides statically-linked e2fsck command taken
1039 from the e2fsprogs package. It is meant to be used in initrds.")
1040 (license (package-license e2fsprogs))))
1042 (define-public extundelete
1044 (name "extundelete")
1049 (uri (string-append "mirror://sourceforge/extundelete/"
1050 "extundelete/" version "/extundelete-"
1051 version ".tar.bz2"))
1054 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1055 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1056 (build-system gnu-build-system)
1057 (inputs `(("e2fsprogs" ,e2fsprogs)))
1058 (home-page "http://extundelete.sourceforge.net/")
1059 (synopsis "Recover deleted files from ext2/3/4 partitions")
1061 "Extundelete is a set of tools that can recover deleted files from an
1062 ext3 or ext4 partition.")
1063 (license license:gpl2)))
1065 (define-public zerofree
1069 (home-page "https://frippery.org/uml/")
1072 (uri (string-append home-page name "-" version
1076 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1077 (build-system gnu-build-system)
1080 (modify-phases %standard-phases
1081 (delete 'configure) ; no configure script
1083 ;; The Makefile lacks an ‘install’ target.
1084 (lambda* (#:key outputs #:allow-other-keys)
1085 (let* ((out (assoc-ref outputs "out"))
1086 (bin (string-append out "/bin")))
1087 (chmod "zerofree" #o555)
1088 (install-file "zerofree" bin)
1090 #:tests? #f)) ; no tests
1091 (inputs `(("libext2fs" ,e2fsprogs)))
1092 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1094 "Zerofree finds the unallocated blocks with non-zero value content in an
1095 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1096 This is a simple way to make disk images more compressible.
1097 Zerofree requires the file system to be unmounted or mounted read-only.")
1098 (license license:gpl2)))
1100 (define-public strace
1104 (home-page "https://strace.io")
1107 (uri (string-append home-page "/files/" version
1108 "/strace-" version ".tar.xz"))
1111 "12wsga1v3rab24gr0mpfip7j7gwr90m8f9h6fviqxa3xgnwl38zm"))))
1112 (build-system gnu-build-system)
1115 (modify-phases %standard-phases
1116 (add-after 'unpack 'patch-/bin/sh
1118 (substitute* "strace.c"
1119 (("/bin/sh") (which "sh")))
1121 ;; Don't fail if the architecture doesn't support different personalities.
1122 #:configure-flags '("--enable-mpers=check")
1123 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1124 #:parallel-tests? #f)) ; undeterministic failures
1125 (native-inputs `(("perl" ,perl)))
1126 (synopsis "System call tracer for Linux")
1128 "strace is a system call tracer, i.e. a debugging tool which prints out a
1129 trace of all the system calls made by a another process/program.")
1130 (license license:lgpl2.1+)))
1132 (define-public ltrace
1138 (uri (string-append "http://www.ltrace.org/ltrace_" version
1142 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1143 (build-system gnu-build-system)
1144 (inputs `(("libelf" ,libelf)))
1146 ;; Compilation uses -Werror by default, but it fails.
1147 '(#:configure-flags '("--disable-werror")))
1148 (home-page "https://www.ltrace.org/")
1149 (synopsis "Library call tracer for Linux")
1151 "ltrace intercepts and records dynamic library calls which are called by
1152 an executed process and the signals received by that process. It can also
1153 intercept and print the system calls executed by the program.")
1154 (license license:gpl2+)))
1156 (define-public alsa-lib
1163 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1164 version ".tar.bz2"))
1167 "1pxf0zkmps03l3zzd0fr828xhkg6a8hxljmbxzc2cyj2ls9kmp1w"))))
1168 (build-system gnu-build-system)
1169 (home-page "https://www.alsa-project.org/")
1170 (synopsis "The Advanced Linux Sound Architecture libraries")
1172 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1173 MIDI functionality to the Linux-based operating system.")
1174 (license license:lgpl2.1+)))
1176 (define-public alsa-utils
1182 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1183 name "-" version ".tar.bz2"))
1186 "1kx45yhrxai3k595yyqs4wj0p2n5b0c9mf0k36ljjf1bj8lgb6zx"))))
1187 (build-system gnu-build-system)
1189 ;; XXX: Disable man page creation until we have DocBook.
1190 '(#:configure-flags (list "--disable-xmlto"
1192 ;; The udev rule is responsible for restoring
1194 (string-append "--with-udev-rules-dir="
1195 (assoc-ref %outputs "out")
1196 "/lib/udev/rules.d"))
1198 (modify-phases %standard-phases
1199 (add-before 'check 'disable-broken-test
1201 ;; XXX: The 1.1.8 release tarball is missing a header that's
1202 ;; required for this test to work. Fixed in 1.1.9.
1203 (substitute* "axfer/test/Makefile"
1204 ((".*container-test.*") ""))
1207 'install 'pre-install
1209 ;; Don't try to mkdir /var/lib/alsa.
1210 (substitute* "Makefile"
1211 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1215 `(("libsamplerate" ,libsamplerate)
1216 ("ncurses" ,ncurses)
1217 ("alsa-lib" ,alsa-lib)
1219 ("gettext" ,gettext-minimal)))
1220 (home-page "http://www.alsa-project.org/")
1221 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1223 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1224 MIDI functionality to the Linux-based operating system.")
1226 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1228 (license license:gpl2)))
1230 (define-public alsa-plugins
1232 (name "alsa-plugins")
1236 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1237 name "-" version ".tar.bz2"))
1240 "152r82i6f97gfilfgiax5prxkd4xlcipciv8ha8yrk452qbxyxvz"))))
1241 (build-system gnu-build-system)
1242 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1243 ;; be split, there are references to both in files.
1244 ;; TODO: Remove OSS related plugins, they add support to run native
1245 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1247 (outputs '("out" "pulseaudio" "jack"))
1249 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1250 ;; for /etc/alsa. On Guix System plugins are loaded from
1251 ;; the ALSA service, and other distributions likely
1252 ;; won't use these files.
1253 "--with-alsalconfdir=/tmp/noop")
1255 (modify-phases %standard-phases
1256 (add-after 'install 'split
1257 (lambda* (#:key inputs outputs #:allow-other-keys)
1258 ;; Distribute the binaries to the various outputs.
1259 (let* ((out (assoc-ref outputs "out"))
1260 (jack (assoc-ref outputs "jack"))
1261 (jacklib (string-append jack "/lib/alsa-lib"))
1262 (pua (assoc-ref outputs "pulseaudio"))
1263 (pualib (string-append pua "/lib/alsa-lib")))
1266 (for-each (lambda (file)
1267 (rename-file file (string-append jacklib "/" (basename file))))
1268 (find-files out ".*jack\\.(la|so)"))
1271 (for-each (lambda (file)
1272 (rename-file file (string-append pualib "/" (basename file))))
1273 (find-files out ".*pulse\\.(la|so)"))
1276 `(("alsa-lib" ,alsa-lib)
1278 ("speex" ,speex) ; libspeexdsp resampling plugin
1279 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1280 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1281 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1283 `(("pkg-config" ,pkg-config)))
1284 (home-page "http://www.alsa-project.org/")
1285 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1287 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1288 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1289 by providing additional plugins which include: upmixing, downmixing, jackd and
1290 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1291 external rate conversion.")
1292 (license (list license:gpl2+
1293 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1294 license:lgpl2.1+))))
1296 (define-public iptables
1303 "mirror://netfilter.org/iptables/iptables-"
1304 version ".tar.bz2"))
1307 "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
1308 (build-system gnu-build-system)
1310 `(("pkg-config" ,pkg-config)
1314 `(("libmnl" ,libmnl)
1315 ("libnftnl" ,libnftnl)))
1317 '(#:tests? #f ; no test suite
1318 #:configure-flags ; add $libdir to the RUNPATH of executables
1319 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1320 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1321 (synopsis "Programs to configure Linux IP packet filtering rules")
1323 "@command{iptables} is the user-space command line program used to
1324 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1325 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1327 This package also includes @command{ip6tables}, which is used to configure the
1330 Both commands are targeted at system administrators.")
1331 (license license:gpl2+)))
1333 (define-public ebtables
1336 (version "2.0.10-4")
1340 "mirror://netfilter.org/ebtables/ebtables-v"
1344 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1345 (build-system gnu-build-system)
1347 '(#:tests? #f ; no test suite
1349 (let* ((out (assoc-ref %outputs "out"))
1350 (bin (string-append out "/sbin"))
1351 (lib (string-append out "/lib"))
1352 (man (string-append out "/share/man"))
1353 (iptables (assoc-ref %build-inputs "iptables"))
1354 (ethertypes (string-append iptables "/etc/ethertypes")))
1355 (list (string-append "LIBDIR=" lib)
1356 (string-append "MANDIR=" man)
1357 (string-append "BINDIR=" bin)
1358 (string-append "ETHERTYPESFILE=" ethertypes)
1359 ;; With the default CFLAGS, it falis with:
1360 ;; communication.c:259:58: error: variable ‘ret’ set but not
1361 ;; used [-Werror=unused-but-set-variable]
1364 (modify-phases %standard-phases
1366 ;; no configure script
1368 (substitute* "Makefile"
1369 ;; Remove user and group options from install commands,
1370 ;; otherwise it fails with: invalid user 'root'.
1371 (("-o root -g root") "")
1372 ;; Remove 'ethertypes' from the install target.
1374 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1378 ("iptables" ,iptables)))
1379 (synopsis "Ethernet bridge frame table administration")
1380 (home-page "http://ebtables.netfilter.org/")
1382 "ebtables is an application program used to set up and maintain the
1383 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1384 analogous to the iptables application, but less complicated, due to the fact
1385 that the Ethernet protocol is much simpler than the IP protocol.")
1386 (license license:gpl2+)))
1388 (define-public iproute
1395 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1399 "1kvvrz5mlpjxqcm7vl6i8w6l1cb2amp6p5xyq006pgzafc49hnnw"))))
1400 (build-system gnu-build-system)
1402 `( ;; There is a test suite, but it wants network namespaces and sudo.
1404 #:make-flags (let ((out (assoc-ref %outputs "out")))
1406 (string-append "BASH_COMPDIR=" out
1407 "/etc/bash_completion.d")
1408 (string-append "LIBDIR=" out "/lib")
1409 (string-append "HDRDIR=" out "/include")
1410 (string-append "SBINDIR=" out "/sbin")
1411 (string-append "CONFDIR=" out "/etc")
1412 (string-append "DOCDIR=" out "/share/doc/"
1414 (string-append "MANDIR=" out "/share/man")))
1415 #:phases (modify-phases %standard-phases
1416 (add-before 'install 'pre-install
1418 ;; Don't attempt to create /var/lib/arpd.
1419 (substitute* "Makefile"
1420 (("^.*ARPDDIR.*$") ""))
1424 ("iptables" ,iptables)))
1428 ("pkg-config" ,pkg-config)))
1430 ;; ("libmnl" ,libmnl)
1431 ;; ("util-linux" ,util-linux)
1433 "https://wiki.linuxfoundation.org/networking/iproute2")
1435 "Utilities for controlling TCP/IP networking and traffic in Linux")
1437 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1438 and traffic with the Linux kernel. The most important of these are
1439 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1442 Most network configuration manuals still refer to ifconfig and route as the
1443 primary network configuration tools, but ifconfig is known to behave
1444 inadequately in modern network environments, and both should be deprecated.")
1445 (license license:gpl2+)))
1447 (define-public net-tools
1448 ;; XXX: This package is basically unmaintained, but it provides a few
1449 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1451 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1455 (version (string-append "1.60-" revision "." (string-take commit 7)))
1458 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1459 "n/ne/net-tools/code.git/net-tools-code-"
1461 (file-name (string-append name "-" version ".zip"))
1464 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1465 (home-page "http://net-tools.sourceforge.net/")
1466 (build-system gnu-build-system)
1468 '(#:modules ((guix build gnu-build-system)
1473 (modify-phases %standard-phases
1475 (lambda* (#:key outputs #:allow-other-keys)
1476 (let ((out (assoc-ref outputs "out")))
1477 (mkdir-p (string-append out "/bin"))
1478 (mkdir-p (string-append out "/sbin"))
1480 ;; Pretend we have everything...
1481 (system "yes | make config")
1483 ;; ... except for the things we don't have.
1484 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1485 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1486 ;; that have been removed.
1487 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1488 ;; think about adding them later.
1489 (substitute* '("config.make" "config.h")
1490 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1493 (add-after 'install 'remove-redundant-commands
1494 (lambda* (#:key outputs #:allow-other-keys)
1495 ;; Remove commands and man pages redundant with Inetutils.
1496 (let* ((out (assoc-ref outputs "out"))
1497 (dup (append-map (cut find-files out <>)
1499 "^(yp|nis|dns)?domainname"))))
1500 (for-each delete-file dup)
1502 ;; Binaries that depend on libnet-tools.a don't declare that
1503 ;; dependency, making it parallel-unsafe.
1504 #:parallel-build? #f
1506 #:tests? #f ; no test suite
1507 #:make-flags (let ((out (assoc-ref %outputs "out")))
1509 (string-append "BASEDIR=" out)
1510 (string-append "INSTALLNLSDIR=" out "/share/locale")
1511 (string-append "mandir=/share/man")))))
1512 (native-inputs `(("gettext" ,gettext-minimal)
1514 (synopsis "Tools for controlling the network subsystem in Linux")
1516 "This package includes the important tools for controlling the network
1517 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1518 route. Additionally, this package contains utilities relating to particular
1519 network hardware types (plipconfig, slattach) and advanced aspects of IP
1520 configuration (iptunnel, ipmaddr).")
1521 (license license:gpl2+))))
1523 (define-public libcap
1530 "mirror://kernel.org/linux/libs/security/linux-privs/"
1531 "libcap2/libcap-" version ".tar.xz"))
1534 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1535 (build-system gnu-build-system)
1536 (arguments '(#:phases
1537 (modify-phases %standard-phases
1539 ;; Add $libdir to the RUNPATH of executables.
1541 (substitute* "Make.Rules"
1543 (string-append "LDFLAGS := -Wl,-rpath="
1546 #:tests? #f ; no 'check' target
1547 #:make-flags (list "lib=lib"
1548 (string-append "prefix="
1549 (assoc-ref %outputs "out"))
1550 "RAISE_SETFCAP=no")))
1551 (native-inputs `(("perl" ,perl)))
1552 (inputs `(("attr" ,attr)))
1553 (home-page "https://sites.google.com/site/fullycapable/")
1554 (synopsis "Library for working with POSIX capabilities")
1556 "Libcap2 provides a programming interface to POSIX capabilities on
1557 Linux-based operating systems.")
1559 ;; License is BSD-3 or GPLv2, at the user's choice.
1560 (license license:gpl2)))
1562 (define-public bridge-utils
1564 (name "bridge-utils")
1569 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
1570 "bridge-utils-" version ".tar.xz"))
1572 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
1573 (build-system gnu-build-system)
1575 ;; The tarball lacks all the generated files.
1576 (native-inputs `(("autoconf" ,autoconf)
1577 ("automake" ,automake)))
1580 (modify-phases %standard-phases
1581 (add-before 'bootstrap 'patch-stuff
1583 ;; Fix "field ‘ip6’ has incomplete type" errors.
1584 (substitute* "libbridge/libbridge.h"
1585 (("#include <linux/if_bridge.h>")
1586 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1588 ;; Ensure that the entire build fails if one of the
1589 ;; sub-Makefiles fails.
1590 (substitute* "Makefile.in"
1591 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1592 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1595 #:tests? #f)) ; no 'check' target
1598 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1599 (synopsis "Manipulate Ethernet bridges")
1601 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1602 to connect two Ethernet segments together in a protocol independent way.
1603 Packets are forwarded based on Ethernet address, rather than IP address (like
1604 a router). Since forwarding is done at Layer 2, all protocols can go
1605 transparently through a bridge.")
1606 (license license:gpl2+)))
1608 (define-public libnl
1615 "https://github.com/thom311/libnl/releases/download/"
1616 "libnl" (string-join (string-split version #\.) "_")
1617 "/libnl-" version ".tar.gz"))
1620 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
1621 (build-system gnu-build-system)
1625 ("pkg-config" ,pkg-config)
1631 "https://github.com/thom311/libnl/releases/download/libnl"
1632 (string-join (string-split version #\.) "_")
1633 "/libnl-doc-" version ".tar.gz"))
1635 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
1637 `(("python-2" ,python-2)
1638 ("python-3" ,python-3)))
1639 (outputs '("out" "doc" "python2" "python3"))
1641 `(#:modules ((guix build gnu-build-system)
1645 (modify-phases %standard-phases
1646 (add-after 'install 'install-python
1647 (lambda* (#:key outputs #:allow-other-keys)
1648 (define (python-inst python)
1649 (invoke python "setup.py" "build")
1650 (invoke python "setup.py" "install"
1651 (string-append "--prefix="
1652 (assoc-ref %outputs python)))
1653 (invoke python "setup.py" "clean"))
1654 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
1655 (assoc-ref %outputs "out")))
1656 (with-directory-excursion "./python"
1657 (for-each python-inst '("python2" "python3")))
1659 (add-after 'install 'install-doc
1660 (lambda* (#:key inputs outputs #:allow-other-keys)
1661 (let ((dest (string-append (assoc-ref outputs "doc")
1662 "/share/doc/libnl")))
1664 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
1665 "--strip-components=1" "-C" dest)))))))
1666 (home-page "https://www.infradead.org/~tgr/libnl/")
1667 (synopsis "NetLink protocol library suite")
1669 "The libnl suite is a collection of libraries providing APIs to netlink
1670 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1671 between the kernel and user space processes. It was designed to be a more
1672 flexible successor to ioctl to provide mainly networking related kernel
1673 configuration and monitoring interfaces.")
1675 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1676 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1677 (license license:gpl2)))
1686 "mirror://kernel.org/software/network/iw/iw-"
1690 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
1691 (build-system gnu-build-system)
1692 (native-inputs `(("pkg-config" ,pkg-config)))
1693 (inputs `(("libnl" ,libnl)))
1695 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1697 #:phases (modify-phases %standard-phases (delete 'configure))))
1698 (home-page "https://wireless.wiki.kernel.org/")
1699 (synopsis "Tool for configuring wireless devices")
1701 "iw is a new nl80211 based CLI configuration utility for wireless
1702 devices. It replaces @code{iwconfig}, which is deprecated.")
1703 (license license:isc)))
1705 (define-public powertop
1712 (uri (string-append "https://01.org/sites/default/files/downloads/"
1713 "powertop-v" version ".tar.gz"))
1715 (base32 "0xaazqccyd42v2q532dxx40nqhb9sfsa6cyx8641rl57mfg4bdyk"))))
1716 (build-system gnu-build-system)
1719 (modify-phases %standard-phases
1720 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1721 ;; allow calibrating the network interface in Guix System.
1722 (add-after 'unpack 'patch-absolute-file-names
1723 (lambda* (#:key inputs #:allow-other-keys)
1724 (let ((kmod (assoc-ref inputs "kmod")))
1725 (substitute* (find-files "src" "\\.cpp$")
1726 ;; Give the right 'modprobe' file name so that essential
1727 ;; modules such as msr.ko can be loaded.
1728 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1729 ;; These programs are only needed to calibrate, so using
1730 ;; relative file names avoids adding extra inputs. When they
1731 ;; are missing powertop gracefully handles it.
1732 (("/usr/bin/hcitool") "hcitool")
1733 (("/usr/bin/xset") "xset")
1734 (("/usr/sbin/hciconfig") "hciconfig"))
1739 ("ncurses" ,ncurses)
1740 ("pciutils" ,pciutils)
1743 `(("pkg-config" ,pkg-config)))
1744 (home-page "https://01.org/powertop/")
1745 (synopsis "Analyze power consumption on Intel-based laptops")
1747 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1748 power management. In addition to being a diagnostic tool, PowerTOP also has
1749 an interactive mode where the user can experiment various power management
1750 settings for cases where the operating system has not enabled these
1752 (license license:gpl2)))
1754 (define-public aumix
1761 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1762 version ".tar.bz2"))
1765 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1766 (build-system gnu-build-system)
1767 (inputs `(("ncurses" ,ncurses)))
1768 (home-page "http://www.jpj.net/~trevor/aumix.html")
1769 (synopsis "Audio mixer for X and the console")
1771 "Aumix adjusts an audio mixer from X, the console, a terminal,
1772 the command line or a script.")
1773 (license license:gpl2+)))
1775 (define-public iotop
1782 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1785 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1786 (build-system python-build-system)
1788 ;; The setup.py script expects python-2.
1789 `(#:python ,python-2
1790 ;; There are currently no checks in the package.
1792 (native-inputs `(("python" ,python-2)))
1793 (home-page "http://guichaz.free.fr/iotop/")
1795 "Displays the IO activity of running processes")
1797 "Iotop is a Python program with a top like user interface to show the
1798 processes currently causing I/O.")
1799 (license license:gpl2+)))
1807 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1808 "download/fuse-" version
1809 "/fuse-" version ".tar.gz"))
1812 "1qxg1r1mgysfq6qakmvid2njph3lr00w0swvydsfl9ymilfzi12y"))
1813 (patches (search-patches "fuse-overlapping-headers.patch"))))
1814 (build-system gnu-build-system)
1815 (inputs `(("util-linux" ,util-linux)))
1817 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1818 (assoc-ref %outputs "out")
1820 (string-append "INIT_D_PATH="
1821 (assoc-ref %outputs "out")
1824 ;; The rule makes /dev/fuse 666.
1825 (string-append "UDEV_RULES_PATH="
1826 (assoc-ref %outputs "out")
1827 "/lib/udev/rules.d"))
1829 (modify-phases %standard-phases
1830 (add-before 'build 'set-file-names
1831 (lambda* (#:key inputs #:allow-other-keys)
1832 ;; libfuse calls out to mount(8) and umount(8). Make sure
1833 ;; it refers to the right ones.
1834 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1835 (("/bin/(u?)mount" _ maybe-u)
1836 (string-append (assoc-ref inputs "util-linux")
1837 "/bin/" maybe-u "mount")))
1838 (substitute* '("util/mount.fuse.c")
1842 ;; This hack leads libfuse to search for 'fusermount' in
1843 ;; $PATH, where it may find a setuid-root binary, instead of
1844 ;; trying solely $out/sbin/fusermount and failing because
1846 (substitute* "lib/Makefile"
1847 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1848 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
1850 (home-page "https://github.com/libfuse/libfuse")
1851 (synopsis "Support file systems implemented in user space")
1853 "As a consequence of its monolithic design, file system code for Linux
1854 normally goes into the kernel itself---which is not only a robustness issue,
1855 but also an impediment to system extensibility. FUSE, for \"file systems in
1856 user space\", is a kernel module and user-space library that tries to address
1857 part of this problem by allowing users to run file system implementations as
1858 user-space processes.")
1859 (license (list license:lgpl2.1 ;library
1860 license:gpl2+)))) ;command-line utilities
1862 (define-public unionfs-fuse
1864 (name "unionfs-fuse")
1869 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1871 (file-name (string-append name "-" version ".tar.gz"))
1874 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1875 (build-system cmake-build-system)
1877 `(("python" ,python)))
1878 (inputs `(("fuse" ,fuse)))
1880 ;; The tests were never actually run ("collected 0 items"), but in recent
1881 ;; versions of pytest that causes an error.
1883 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1884 (synopsis "User-space union file system")
1886 "UnionFS-FUSE is a flexible union file system implementation in user
1887 space, using the FUSE library. Mounting a union file system allows you to
1888 \"aggregate\" the contents of several directories into a single mount point.
1889 UnionFS-FUSE additionally supports copy-on-write.")
1890 (license license:bsd-3)))
1893 (package (inherit fuse)
1894 (name "fuse-static")
1895 (source (origin (inherit (package-source fuse))
1896 (modules '((guix build utils)))
1899 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1900 ;; updated. Change calls to 'mtab_needs_update' to 0 so
1901 ;; that it doesn't do that, allowing us to remove the
1902 ;; dependency on util-linux (something that is useful in
1904 (substitute* '("lib/mount_util.c"
1905 "util/mount_util.c")
1906 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1912 (define-public unionfs-fuse/static
1913 (package (inherit unionfs-fuse)
1914 (synopsis "User-space union file system (statically linked)")
1915 (name (string-append (package-name unionfs-fuse) "-static"))
1916 (source (origin (inherit (package-source unionfs-fuse))
1917 (modules '((guix build utils)))
1920 ;; Add -ldl to the libraries, because libfuse.a needs that.
1921 (substitute* "src/CMakeLists.txt"
1922 (("target_link_libraries(.*)\\)" _ libs)
1923 (string-append "target_link_libraries"
1928 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1930 (modify-phases %standard-phases
1931 (add-after 'install 'post-install
1932 (lambda* (#:key outputs #:allow-other-keys)
1933 (let* ((out (assoc-ref outputs "out"))
1934 (exe (string-append out "/bin/unionfs")))
1935 ;; By default, 'unionfs' keeps references to
1936 ;; $glibc/share/locale and similar stuff. Remove them.
1937 (remove-store-references exe)
1939 ;; 'unionfsctl' has references to glibc as well. Since
1940 ;; we don't need it, remove it.
1941 (delete-file (string-append out "/bin/unionfsctl"))
1943 (inputs `(("fuse" ,fuse-static)))))
1945 (define-public sshfs
1951 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1952 "download/sshfs-" version "/sshfs-" version
1956 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
1957 (build-system gnu-build-system)
1962 `(("pkg-config" ,pkg-config)))
1963 (home-page "https://github.com/libfuse/sshfs")
1964 (synopsis "Mount remote file systems over SSH")
1966 "This is a file system client based on the SSH File Transfer Protocol.
1967 Since most SSH servers already support this protocol it is very easy to set
1968 up: on the server side there's nothing to do; on the client side mounting the
1969 file system is as easy as logging into the server with an SSH client.")
1970 (license license:gpl2+)))
1972 (define-public sshfs-fuse
1973 (package (inherit sshfs)
1975 (properties `((superseded . ,sshfs)))))
1977 (define-public archivemount
1979 (name "archivemount")
1984 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
1985 "archivemount-" version ".tar.gz"))
1987 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
1988 (build-system gnu-build-system)
1989 (inputs `(("fuse" ,fuse)
1990 ("libarchive" ,libarchive)))
1991 (native-inputs `(("pkg-config" ,pkg-config)))
1992 (home-page "https://www.cybernoia.de/software/archivemount.html")
1993 (synopsis "Tool for mounting archive files with FUSE")
1994 (description "archivemount is a FUSE-based file system for Unix variants,
1995 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1996 mount point where it can be read from or written to as with any other file
1997 system. This makes accessing the contents of the archive, which may be
1998 compressed, transparent to other programs, without decompressing them.")
1999 (license license:lgpl2.0+)))
2001 (define-public numactl
2008 "https://github.com/numactl/numactl/releases/download/v"
2009 version "/" name "-" version ".tar.gz"))
2012 "0ad7mpi3vacbfnx3aqxnvgsj64yp3mav9yxnaz8ancjv7wvdmfsm"))))
2013 (build-system gnu-build-system)
2015 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2016 ;; to run, which we can't assume to have.
2019 ;; NUMA is apparently not supported on armhf, see
2020 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2021 (supported-systems (delete "armhf-linux" %supported-systems))
2022 (home-page "https://github.com/numactl/numactl")
2023 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2025 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2026 memory is not all in one place. The numactl program allows you to run your
2027 application program on specific CPU's and memory nodes. It does this by
2028 supplying a NUMA memory policy to the operating system before running your
2031 The package contains other commands, such as numademo, numastat and memhog.
2032 The numademo command provides a quick overview of NUMA performance on your
2034 (license (list license:gpl2 ;programs
2035 license:lgpl2.1)))) ;library
2037 (define-public kbd-neo
2044 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2045 version "/linux/console/neo.map"))
2046 (file-name (string-append name "-" version ".map"))
2049 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2050 (build-system trivial-build-system)
2052 `(#:modules ((guix build utils))
2054 (use-modules (guix build utils))
2055 (let ((out (string-append %output "/share/keymaps"))
2056 (source (assoc-ref %build-inputs "source")))
2058 (copy-file source (string-append out "/neo.map"))
2060 (home-page "https://neo-layout.org")
2061 (synopsis "Neo2 console layout")
2063 "Kbd-neo provides the Neo2 keyboard layout for use with
2064 @command{loadkeys(1)} from @code{kbd(4)}.")
2065 ;; The file is located in an svn directory, the entire content of
2066 ;; the directory is licensed as GPL3.
2067 (license license:gpl3+)))
2075 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2079 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2080 (modules '((guix build utils)))
2083 (substitute* "tests/Makefile.in"
2084 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2087 (substitute* '("src/unicode_start" "src/unicode_stop")
2088 ;; Assume the Coreutils are in $PATH.
2092 (build-system gnu-build-system)
2095 (modify-phases %standard-phases
2096 (add-before 'build 'pre-build
2097 (lambda* (#:key inputs #:allow-other-keys)
2098 (let ((gzip (assoc-ref %build-inputs "gzip"))
2099 (bzip2 (assoc-ref %build-inputs "bzip2")))
2100 (substitute* "src/libkeymap/findfile.c"
2102 (string-append gzip "/bin/gzip"))
2104 (string-append bzip2 "/bin/bzip2")))
2106 (add-after 'install 'post-install
2107 (lambda* (#:key outputs #:allow-other-keys)
2108 ;; Make sure these programs find their comrades.
2109 (let* ((out (assoc-ref outputs "out"))
2110 (bin (string-append out "/bin")))
2111 (for-each (lambda (prog)
2112 (wrap-program (string-append bin "/" prog)
2113 `("PATH" ":" prefix (,bin))))
2114 '("unicode_start" "unicode_stop"))
2116 (inputs `(("check" ,check)
2119 ("pam" ,linux-pam)))
2120 (native-search-paths
2121 (list (search-path-specification
2122 (variable "LOADKEYS_KEYMAP_PATH")
2123 ;; Append ‘/**’ to recursively search all directories. One can then
2124 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2125 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2126 (files (list "share/keymaps/**")))))
2127 (native-inputs `(("pkg-config" ,pkg-config)))
2128 (home-page "http://kbd-project.org/")
2129 (synopsis "Linux keyboard utilities and keyboard maps")
2131 "This package contains keytable files and keyboard utilities compatible
2132 for systems using the Linux kernel. This includes commands such as
2133 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2134 (license license:gpl2+)))
2136 (define-public loadkeys-static
2139 (name "loadkeys-static")
2141 (substitute-keyword-arguments (package-arguments kbd)
2142 ((#:configure-flags flags ''())
2143 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2144 "--disable-vlock" ;so we don't need libpam
2145 "--disable-libkeymap")
2147 ((#:make-flags flags ''())
2148 `(cons "LDFLAGS=-all-static" ,flags))
2149 ((#:phases phases '%standard-phases)
2150 `(modify-phases ,phases
2152 (lambda* (#:key outputs #:allow-other-keys)
2153 (let ((out (assoc-ref outputs "out")))
2154 ;; The binary keeps references to gzip, among other things,
2155 ;; which we don't need in the initrd, so strip references.
2156 (remove-store-references "src/loadkeys")
2158 (install-file "src/loadkeys"
2159 (string-append out "/bin"))
2161 (delete 'post-install)))
2162 ((#:strip-flags _ '())
2164 ((#:allowed-references _ '())
2167 (synopsis "Statically-linked @command{loadkeys} program")
2169 ;; This package is meant to be used internally in the initrd so don't
2171 (properties '((hidden? . #t)))))
2173 (define-public inotify-tools
2175 (name "inotify-tools")
2180 (url "https://github.com/rvoicilas/inotify-tools.git")
2182 (file-name (git-file-name name version))
2185 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2186 (build-system gnu-build-system)
2188 `(("autoconf" ,autoconf)
2189 ("automake" ,automake)
2190 ("libtool" ,libtool)))
2191 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2192 (synopsis "Monitor file accesses")
2194 "The inotify-tools packages provides a C library and command-line tools
2195 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2196 (license license:gpl2+)))
2205 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2206 "kmod-" version ".tar.xz"))
2209 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2210 (patches (search-patches "kmod-module-directory.patch"))))
2211 (build-system gnu-build-system)
2213 `(("pkg-config" ,pkg-config)))
2218 `(#:tests? #f ; FIXME: Investigate test failures
2219 #:configure-flags '("--with-xz" "--with-zlib")
2221 (modify-phases %standard-phases
2222 (add-after 'install 'install-modprobe&co
2223 (lambda* (#:key outputs #:allow-other-keys)
2224 (let* ((out (assoc-ref outputs "out"))
2225 (bin (string-append out "/bin")))
2226 (for-each (lambda (tool)
2228 (string-append bin "/" tool)))
2229 '("insmod" "rmmod" "lsmod" "modprobe"
2230 "modinfo" "depmod"))
2232 (home-page "https://www.kernel.org/")
2233 (synopsis "Kernel module tools")
2234 (description "Kmod is a set of tools to handle common tasks with Linux
2235 kernel modules like insert, remove, list, check properties, resolve
2236 dependencies and aliases.
2238 These tools are designed on top of libkmod, a library that is shipped with
2239 kmod. The aim is to be compatible with tools, configurations and indices
2240 from the module-init-tools project.")
2241 (license license:gpl2+))) ; library under lgpl2.1+
2243 (define-public eudev
2244 ;; The post-systemd fork, maintained by Gentoo.
2250 (uri (git-reference (url "https://github.com/gentoo/eudev")
2251 (commit (string-append "v" version))))
2252 (file-name (git-file-name name version))
2255 "1la7x7v7yqb84wnc7w0kj53sa0an0m9xp6wn01ypi8drh02wjjy2"))
2256 (patches (search-patches "eudev-rules-directory.patch"))))
2257 (build-system gnu-build-system)
2260 (modify-phases %standard-phases
2261 (add-after 'unpack 'make-source-writable
2263 ;; XXX: Git checkouts are read-only, but this package needs to
2264 ;; modify some of its files.
2265 (for-each make-file-writable (find-files "."))
2267 (add-before 'bootstrap 'patch-file-names
2268 (lambda* (#:key inputs #:allow-other-keys)
2269 (substitute* "man/make.sh"
2270 (("/usr/bin/xsltproc")
2271 (string-append (assoc-ref inputs "xsltproc")
2274 (add-after 'install 'build-hwdb
2275 (lambda* (#:key outputs #:allow-other-keys)
2276 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2277 ;; similar tools to display product names.
2278 (let ((out (assoc-ref outputs "out")))
2279 (invoke (string-append out "/bin/udevadm")
2280 "hwdb" "--update")))))
2281 #:configure-flags (list "--enable-manpages")))
2283 `(("autoconf" ,autoconf)
2284 ("automake" ,automake)
2286 ("libtool" ,libtool)
2287 ("pkg-config" ,pkg-config)
2290 ("python" ,python-wrapper)
2291 ;; For documentation.
2292 ("docbook-xml" ,docbook-xml-4.2)
2293 ("docbook-xsl" ,docbook-xsl)
2294 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2295 ("xsltproc" ,libxslt)))
2297 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2298 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2299 ;; which contains the rules to do that.
2300 `(("util-linux" ,util-linux) ;for blkid
2302 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2303 (synopsis "Userspace device management")
2304 (description "Udev is a daemon which dynamically creates and removes
2305 device nodes from /dev/, handles hotplug events and loads drivers at boot
2307 (license license:gpl2+)))
2309 (define-public eudev-with-hwdb
2310 (deprecated-package "eudev-with-hwdb" eudev))
2315 (version "2.02.177")
2318 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2322 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2323 (modules '((guix build utils)))
2326 (use-modules (guix build utils))
2328 ;; Honor sysconfdir.
2329 (substitute* "make.tmpl.in"
2331 "confdir = @sysconfdir@\n")
2332 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2333 "DEFAULT_SYS_DIR = @sysconfdir@"))
2335 (patches (search-patches "lvm2-static-link.patch"))))
2336 (build-system gnu-build-system)
2338 `(("pkg-config" ,pkg-config)
2339 ("procps" ,procps))) ;tests use 'pgrep'
2344 (modify-phases %standard-phases
2345 (add-after 'configure 'set-makefile-shell
2347 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2349 (setenv "SHELL" (which "sh"))
2351 ;; Replace /bin/sh with the right file name.
2352 (patch-makefile-SHELL "make.tmpl")
2355 #:configure-flags (list (string-append "--sysconfdir="
2356 (assoc-ref %outputs "out")
2358 "--enable-udev_sync"
2359 "--enable-udev_rules"
2360 "--enable-pkgconfig"
2362 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2364 ;; Make sure programs such as 'dmsetup' can
2365 ;; find libdevmapper.so.
2366 (string-append "LDFLAGS=-Wl,-rpath="
2367 (assoc-ref %outputs "out")
2369 (assoc-ref %outputs "out")
2370 "/lib/device-mapper")
2371 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2372 ;; into account so that we don't need to also
2374 (string-append "CLDFLAGS=-Wl,-rpath="
2375 (assoc-ref %outputs "out")
2377 (assoc-ref %outputs "out")
2378 "/lib/device-mapper"))
2380 ;; The tests use 'mknod', which requires root access.
2382 (home-page "https://sourceware.org/lvm2/")
2383 (synopsis "Logical volume management for Linux")
2385 "LVM2 is the logical volume management tool set for Linux-based systems.
2386 This package includes the user-space libraries and tools, including the device
2387 mapper. Kernel components are part of Linux-libre.")
2389 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2390 ;; Command-line tools are GPLv2.
2391 (license (list license:gpl2 license:lgpl2.1))))
2393 (define-public lvm2-static
2396 (name "lvm2-static")
2398 ;; Propagate udev because libdevmapper.a depends on libudev.
2399 (inputs (alist-delete "udev" (package-inputs lvm2)))
2400 (propagated-inputs `(("udev" ,eudev)))
2403 (substitute-keyword-arguments (package-arguments lvm2)
2404 ((#:configure-flags flags '())
2405 ;; LVM2 doesn't use Libtool, hence the custom option.
2406 `(cons "--enable-static_link" ,flags))))
2407 (synopsis "Logical volume management for Linux (statically linked)")))
2409 (define-public wireless-tools
2411 (name "wireless-tools")
2415 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2419 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2422 ;; Remove the older header files that are not free software.
2423 (for-each (lambda (n)
2424 (delete-file (format #f "wireless.~a.h" n)))
2425 '(10 11 12 13 14 15 16 17 18 19 20))
2427 (build-system gnu-build-system)
2430 (list (string-append "PREFIX=" %output)
2431 (string-append "INSTALL_MAN=" %output "/share/man")
2432 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2434 #:phases (modify-phases %standard-phases
2435 (delete 'configure))
2437 (synopsis "Tools for manipulating Linux Wireless Extensions")
2438 (description "Wireless Tools are used to manipulate the now-deprecated
2439 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
2440 Extension was an interface allowing you to set Wireless LAN specific
2441 parameters and get the specific stats. It is deprecated in favor the nl80211
2443 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2444 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2445 ;; other files are distributed under gpl2.
2446 (license (list license:gpl2 license:lgpl2.1+))))
2454 (uri (string-append "mirror://kernel.org/software/network/crda/"
2455 "crda-" version ".tar.xz"))
2458 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2459 (patches (search-patches "crda-optional-gcrypt.patch"))))
2460 (build-system gnu-build-system)
2462 '(#:phases (modify-phases %standard-phases
2464 (add-after 'unpack 'gzip-determinism
2466 (substitute* "Makefile"
2467 (("gzip") "gzip --no-name"))
2470 'build 'no-werror-no-ldconfig
2472 (substitute* "Makefile"
2474 (("ldconfig") "true"))
2477 'build 'set-regulator-db-file-name
2478 (lambda* (#:key inputs #:allow-other-keys)
2479 ;; Tell CRDA where to find our database.
2480 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2481 (substitute* "crda.c"
2482 (("\"/lib/crda/regulatory.bin\"")
2483 (string-append "\"" regdb
2484 "/lib/crda/regulatory.bin\"")))
2486 #:test-target "verify"
2487 #:make-flags (let ((out (assoc-ref %outputs "out"))
2488 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2489 (list "CC=gcc" "V=1"
2491 ;; Disable signature-checking on 'regulatory.bin'.
2492 ;; The reason is that this simplifies maintenance
2493 ;; on our side (no need to manage a distro key
2494 ;; pair), and we can guarantee integrity of
2495 ;; 'regulatory.bin' by other means anyway, such as
2496 ;; 'guix gc --verify'. See
2497 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2501 (string-append "PREFIX=" out)
2502 (string-append "SBINDIR=" out "/sbin/")
2503 (string-append "UDEV_RULE_DIR="
2504 out "/lib/udev/rules.d")
2505 (string-append "LDFLAGS=-Wl,-rpath="
2507 (string-append "REG_BIN=" regdb
2508 "/lib/crda/regulatory.bin")))))
2509 (native-inputs `(("pkg-config" ,pkg-config)
2510 ("python" ,python-2)
2511 ("wireless-regdb" ,wireless-regdb)))
2512 (inputs `(("libnl" ,libnl)))
2514 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2515 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2517 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2518 communication between the kernel Linux and user space for regulatory
2520 (license license:copyleft-next)))
2522 (define-public wireless-regdb
2524 (name "wireless-regdb")
2525 (version "2017.03.07")
2529 "mirror://kernel.org/software/network/wireless-regdb/"
2530 "wireless-regdb-" version ".tar.xz"))
2533 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2535 ;; We're building 'regulatory.bin' by ourselves.
2537 (delete-file "regulatory.bin")
2539 (build-system gnu-build-system)
2541 '(#:phases (modify-phases %standard-phases
2542 (add-after 'unpack 'gzip-determinism
2544 (substitute* "Makefile"
2545 (("gzip") "gzip --no-name"))
2547 (delete 'configure))
2549 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2550 ;; is computed and can be equal to 'maintainer-clean'; when that
2551 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2552 ;; just built. Thus, build things sequentially.
2553 #:parallel-build? #f
2555 #:tests? #f ;no tests
2556 #:make-flags (let ((out (assoc-ref %outputs "out")))
2557 (list (string-append "PREFIX=" out)
2558 (string-append "LSB_ID=Guix")
2559 (string-append "DISTRO_PUBKEY=/dev/null")
2560 (string-append "DISTRO_PRIVKEY=/dev/null")
2561 (string-append "REGDB_PUBKEY=/dev/null")
2563 ;; Leave that empty so that db2bin.py doesn't try
2564 ;; to sign 'regulatory.bin'. This allows us to
2565 ;; avoid managing a key pair for the whole distro.
2566 (string-append "REGDB_PRIVKEY=")))))
2567 (native-inputs `(("python" ,python-2)))
2569 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2570 (synopsis "Wireless regulatory database")
2572 "This package contains the wireless regulatory database Central
2573 Regulatory Database Agent (CRDA) daemon. The database contains information on
2574 country-specific regulations for the wireless spectrum.")
2575 (license license:isc)))
2577 (define-public lm-sensors
2585 (url "https://github.com/groeck/lm-sensors.git")
2586 (commit (string-append "V" (string-join
2587 (string-split version #\.) "-")))))
2588 (file-name (git-file-name name version))
2590 (base32 "1mdrnb9r01z1xfdm6dpkywvf9yy9a4yzb59paih9sijwmigv19fj"))
2591 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2592 (build-system gnu-build-system)
2593 (inputs `(("rrdtool" ,rrdtool)
2596 ("gnuplot" ,gnuplot)))
2597 (native-inputs `(("pkg-config" ,pkg-config)
2601 (outputs '("lib" ;avoid perl in closure
2604 `(#:tests? #f ; no 'check' target
2605 #:make-flags (list (string-append "PREFIX=" %output)
2606 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2607 (string-append "INCLUDEDIR="
2608 (assoc-ref %outputs "lib") "/include")
2609 (string-append "MANDIR=" %output "/share/man")
2610 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2612 (modify-phases %standard-phases
2614 (add-before 'build 'patch-exec-paths
2615 (lambda* (#:key inputs outputs #:allow-other-keys)
2616 (substitute* "prog/detect/sensors-detect"
2618 (string-append "`" (assoc-ref inputs "coreutils")
2620 (("(`|\")modprobe" all open-quote)
2621 (string-append open-quote
2622 (assoc-ref inputs "kmod")
2624 (substitute* '("prog/pwm/pwmconfig"
2625 "prog/pwm/fancontrol")
2627 (string-append (assoc-ref inputs "gnuplot")
2630 (string-append (assoc-ref inputs "coreutils")
2633 (string-append (assoc-ref inputs "grep")
2636 (string-append (assoc-ref inputs "sed")
2639 (string-append (assoc-ref inputs "coreutils")
2642 (string-append (assoc-ref inputs "coreutils")
2645 (string-append (assoc-ref inputs "coreutils")
2646 "/bin/readlink -f")))
2648 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
2649 (synopsis "Utilities to read temperature/voltage/fan sensors")
2651 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2652 you to access information from temperature, voltage, and fan speed sensors.
2653 It works with most newer systems.")
2654 (license license:gpl2+)))
2656 (define-public iucode-tool
2658 (name "iucode-tool")
2662 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2663 "/raw/latest/iucode-tool_" version ".tar.xz"))
2666 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
2667 (build-system gnu-build-system)
2668 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2669 (synopsis "Manipulate Intel microcode bundles")
2671 "@command{iucode_tool} is a utility to work with microcode packages for
2672 Intel processors. It can convert between formats, extract specific versions,
2673 create a firmware image suitable for the Linux kernel, and more.")
2674 ;; cpuid.h is available for i686, x86_64, and ia64.
2675 (supported-systems '("i686-linux" "x86_64-linux"))
2676 (license license:gpl2+)))
2678 (define-public i2c-tools
2685 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2686 version ".tar.bz2"))
2689 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2690 (build-system gnu-build-system)
2692 `(#:tests? #f ; no 'check' target
2693 #:make-flags (list (string-append "prefix=" %output)
2695 ;; no configure script
2696 #:phases (modify-phases %standard-phases (delete 'configure))))
2699 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2700 (synopsis "I2C tools for Linux")
2702 "The i2c-tools package contains a heterogeneous set of I2C tools for
2703 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2704 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2706 (license license:gpl2+)))
2708 (define-public xsensors
2715 "http://www.linuxhardware.org/xsensors/xsensors-"
2719 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2720 (build-system gnu-build-system)
2721 (inputs `(("lm-sensors" ,lm-sensors "lib")
2723 (native-inputs `(("pkg-config" ,pkg-config)))
2726 (modify-phases %standard-phases
2727 (add-before 'configure 'enable-deprecated
2729 (substitute* "src/Makefile.in"
2730 (("-DGDK_DISABLE_DEPRECATED") "")
2731 (("-DGTK_DISABLE_DEPRECATED") ""))
2733 (add-before 'configure 'remove-Werror
2735 (substitute* '("configure" "src/Makefile.in")
2738 (home-page "http://www.linuxhardware.org/xsensors/")
2739 (synopsis "Hardware health information viewer")
2741 "Xsensors reads data from the libsensors library regarding hardware
2742 health such as temperature, voltage and fan speed and displays the information
2743 in a digital read-out.")
2744 (license license:gpl2+)))
2749 (version (package-version linux-libre))
2750 (source (package-source linux-libre))
2751 (build-system gnu-build-system)
2754 (modify-phases %standard-phases
2756 (lambda* (#:key inputs #:allow-other-keys)
2757 (setenv "SHELL_PATH" (which "bash"))
2758 (chdir "tools/perf")
2760 #:make-flags (list (string-append "prefix="
2761 (assoc-ref %outputs "out"))
2764 ;; By default, 'config/Makefile' uses lib64 on
2765 ;; x86_64. Work around that.
2767 #:tests? #f)) ;no tests
2769 `(("pkg-config" ,pkg-config)
2773 ;; There are build scripts written in these languages.
2775 ("python" ,python-2)))
2777 `(("slang" ,slang) ;for the interactive TUI
2779 ("python" ,python-2) ;'perf' links against libpython
2780 ("elfutils" ,elfutils)
2781 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2782 ("libunwind" ,libunwind) ;better stack walking
2783 ("numactl" ,numactl) ;for 'perf bench numa mem'
2786 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2787 ("docbook-xsl" ,docbook-xsl)
2789 ("asciidoc" ,asciidoc)))
2790 (home-page "https://perf.wiki.kernel.org/")
2791 (synopsis "Linux profiling with performance counters")
2793 "perf is a tool suite for profiling using hardware performance counters,
2794 with support in the Linux kernel. perf can instrument CPU performance
2795 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2796 of lightweight profiling. This package contains the user-land tools and in
2797 particular the @code{perf} command.")
2798 (license (package-license linux-libre))))
2800 (define-public pflask
2806 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2808 (file-name (string-append name "-" version ".tar.gz"))
2811 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2812 (build-system cmake-build-system)
2814 '(#:tests? #f)) ; no tests
2815 (home-page "https://ghedo.github.io/pflask/")
2816 (synopsis "Simple tool for creating Linux namespace containers")
2817 (description "pflask is a simple tool for creating Linux namespace
2818 containers. It can be used for running a command or even booting an OS inside
2819 an isolated container, created with the help of Linux namespaces. It is
2820 similar in functionality to chroot, although pflask provides better isolation
2821 thanks to the use of namespaces.")
2822 (license license:bsd-2)))
2824 (define-public singularity
2826 (name "singularity")
2830 (uri (string-append "https://github.com/singularityware/singularity/"
2831 "releases/download/" version
2832 "/singularity-" version ".tar.gz"))
2835 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
2836 (modules '((guix build utils)))
2839 ;; Do not create directories in /var.
2840 (substitute* "Makefile.in"
2841 (("\\$\\(MAKE\\) .*install-data-hook") ""))
2843 ;; The original source overrides PATH so that it points to
2844 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
2845 ;; on Guix System. Leave PATH unchanged so we refer to the
2846 ;; installed Coreutils, grep, etc.
2847 (substitute* "bin/singularity.in"
2849 (string-append "#" all "\n")))
2851 (build-system gnu-build-system)
2854 (list "--disable-suid"
2855 "--localstatedir=/var")
2857 (modify-phases %standard-phases
2858 (add-after 'unpack 'patch-reference-to-squashfs-tools
2860 (substitute* "libexec/cli/build.exec"
2861 (("if ! singularity_which mksquashfs") "if 0")
2862 (("if ! mksquashfs")
2863 (string-append "if ! " (which "mksquashfs"))))
2866 `(("libarchive" ,libarchive)
2867 ("python" ,python-wrapper)
2870 ("squashfs-tools" ,squashfs-tools)))
2871 (home-page "https://singularity.lbl.gov/")
2872 (synopsis "Container platform")
2873 (description "Singularity is a container platform supporting a number of
2874 container image formats. It can build SquashFS container images or import
2875 existing Docker images. Singularity requires kernel support for container
2876 isolation or root privileges.")
2877 (license license:bsd-3)))
2879 (define-public hdparm
2885 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
2886 "hdparm-" version ".tar.gz"))
2889 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
2890 (build-system gnu-build-system)
2892 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2893 (list (string-append "binprefix=" out)
2894 (string-append "manprefix=" out)
2897 (modify-phases %standard-phases
2898 (delete 'configure)) ; no configure script
2899 #:tests? #f)) ; no test suite
2900 (home-page "https://sourceforge.net/projects/hdparm/")
2901 (synopsis "View and tune ATA disk drive parameters")
2903 "@command{hdparm} is a command-line utility to control ATA controllers and
2904 disk drives. It can increase performance and/or reliability by careful tuning
2905 of hardware settings like power and acoustic management, DMA modes, and caching.
2906 It can also display detailed device information, or be used as a simple
2907 performance benchmarking tool.
2909 @command{hdparm} provides a command line interface to various Linux kernel
2910 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2911 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2912 Translation (@dfn{SAT}) are also supported.")
2913 (license (license:non-copyleft "file://LICENSE.TXT"))))
2915 (define-public rfkill
2921 (uri (string-append "mirror://kernel.org/software/network/"
2922 name "/" name "-" version ".tar.xz"))
2925 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2926 (build-system gnu-build-system)
2928 `(#:make-flags (list "CC=gcc"
2929 (string-append "PREFIX=" %output))
2930 #:phases (modify-phases %standard-phases
2931 (delete 'configure))
2933 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2934 (synopsis "Tool for enabling and disabling wireless devices")
2936 "rfkill is a simple tool for accessing the rfkill device interface,
2937 which is used to enable and disable wireless networking devices, typically
2938 WLAN, Bluetooth and mobile broadband.")
2939 (license (license:non-copyleft "file://COPYING"
2940 "See COPYING in the distribution."))
2941 ;; rfkill is part of util-linux as of 2.31.
2942 (properties `((superseded . ,util-linux)))))
2950 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2951 version "/" name "-" version ".tar.gz"))
2954 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2955 (build-system gnu-build-system)
2956 (home-page "http://acpiclient.sourceforge.net")
2957 (synopsis "Display information on ACPI devices")
2958 (description "@code{acpi} attempts to replicate the functionality of the
2959 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2960 information. It does not support ACPI suspending, only displays information
2961 about ACPI devices.")
2962 (license license:gpl2+)))
2964 (define-public acpid
2970 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2974 "1hrc0xm6q12knbgzhq0i8g2rfrkwcvh1asd7k9rs3nc5xmlwd7gw"))))
2975 (build-system gnu-build-system)
2976 (home-page "https://sourceforge.net/projects/acpid2/")
2977 (synopsis "Daemon for delivering ACPI events to user-space programs")
2979 "acpid is designed to notify user-space programs of Advanced
2980 Configuration and Power Interface (ACPI) events. acpid should be started
2981 during the system boot, and will run as a background process. When an ACPI
2982 event is received from the kernel, acpid will examine the list of rules
2983 specified in /etc/acpi/events and execute the rules that match the event.")
2984 (license license:gpl2+)))
2986 (define-public sysfsutils
2995 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2998 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2999 (build-system gnu-build-system)
3000 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3001 (synopsis "System utilities based on Linux sysfs")
3003 "These are a set of utilities built upon sysfs, a virtual file system in
3004 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3005 also contains the libsysfs library.")
3006 ;; The library is under lgpl2.1+ (all files say "or any later version").
3007 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3008 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3010 (define-public sysfsutils-1
3012 (inherit sysfsutils)
3019 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3020 "/sysfsutils-" version ".tar.gz"))
3022 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3023 (modules '((guix build utils)))
3026 (substitute* "Makefile.in"
3027 (("includedir = /usr/include/sysfs")
3028 "includedir = @includedir@"))
3029 (substitute* "configure"
3030 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3031 (string-append "includedir='" orig "/sysfs'")))
3033 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3035 (define-public cpufrequtils
3037 (name "cpufrequtils")
3042 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3043 "cpufrequtils-" version ".tar.gz"))
3045 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3046 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3047 (build-system gnu-build-system)
3049 `(("sysfsutils" ,sysfsutils-1)))
3051 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3052 (assoc-ref %outputs "out") "/lib"))))
3053 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3054 (synopsis "Utilities to get and set CPU frequency on Linux")
3056 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3057 information, and set the CPU frequency if supported, using the cpufreq
3058 capabilities of the Linux kernel.")
3059 (license license:gpl2)))
3061 (define-public libraw1394
3068 "mirror://kernel.org/linux/libs/ieee1394/"
3069 name "-" version ".tar.xz"))
3072 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3073 (build-system gnu-build-system)
3074 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3075 (synopsis "Interface library for the Linux IEEE1394 drivers")
3077 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3078 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3079 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3080 send to and receive from other nodes without requiring a kernel driver for the
3081 protocol in question.")
3082 (license license:lgpl2.1+)))
3084 (define-public libavc1394
3090 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3091 name "-" version ".tar.gz"))
3094 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3095 (build-system gnu-build-system)
3097 `(("pkg-config" ,pkg-config)))
3099 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3100 (home-page "https://sourceforge.net/projects/libavc1394/")
3101 (synopsis "AV/C protocol library for IEEE 1394")
3103 "Libavc1394 is a programming interface to the AV/C specification from
3104 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3105 (license license:lgpl2.1+)))
3107 (define-public libiec61883
3109 (name "libiec61883")
3114 "mirror://kernel.org/linux/libs/ieee1394/"
3115 name "-" version ".tar.xz"))
3118 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3119 (build-system gnu-build-system)
3121 `(("pkg-config" ,pkg-config)))
3123 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3124 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3125 (synopsis "Isochronous streaming media library for IEEE 1394")
3127 "The libiec61883 library provides a higher level API for streaming DV,
3128 MPEG-2 and audio over Linux IEEE 1394.")
3129 (license license:lgpl2.1+)))
3131 (define-public mdadm
3138 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3142 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3143 (build-system gnu-build-system)
3147 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3151 ;; TODO: tell it where to find 'sendmail'
3152 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3153 (string-append "BINDIR=" out "/sbin")
3154 (string-append "MANDIR=" out "/share/man")
3155 (string-append "UDEVDIR=" out "/lib/udev")))
3157 (modify-phases %standard-phases
3158 (add-before 'build 'patch-program-paths
3159 (lambda* (#:key inputs #:allow-other-keys)
3160 (let ((coreutils (assoc-ref inputs "coreutils")))
3161 (substitute* "udev-md-raid-arrays.rules"
3162 (("/usr/bin/(readlink|basename)" all program)
3163 (string-append coreutils "/bin/" program))))
3165 (add-before 'build 'remove-W-error
3167 ;; We cannot build with -Werror on i686 due to a
3168 ;; 'sign-compare' warning in util.c.
3169 (substitute* "Makefile"
3172 (delete 'configure))
3173 ;;tests must be done as root
3175 (home-page "http://neil.brown.name/blog/mdadm")
3176 (synopsis "Tool for managing Linux Software RAID arrays")
3178 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3179 assemble, report on, and monitor arrays. It can also move spares between raid
3180 arrays when needed.")
3181 (license license:gpl2+)))
3183 (define-public mdadm-static
3186 (name "mdadm-static")
3188 (substitute-keyword-arguments (package-arguments mdadm)
3189 ((#:make-flags flags)
3190 `(cons "LDFLAGS = -static" ,flags))
3192 `(modify-phases ,phases
3193 (add-after 'install 'remove-cruft
3194 (lambda* (#:key outputs #:allow-other-keys)
3195 (let* ((out (assoc-ref outputs "out"))
3196 (precious? (lambda (file)
3197 (member file '("." ".." "sbin"))))
3198 (directories (scandir out (negate precious?))))
3199 (with-directory-excursion out
3200 (for-each delete-file-recursively directories)
3201 (remove-store-references "sbin/mdadm")
3202 (delete-file "sbin/mdmon")
3204 ((#:modules modules %gnu-build-system-modules)
3205 `((ice-9 ftw) ,@modules))
3206 ((#:strip-flags _ '())
3207 ''("--strip-all")) ;strip a few extra KiB
3208 ((#:allowed-references _ '("out"))
3209 '("out")))) ;refer only self
3210 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3212 (define-public multipath-tools
3214 (name "multipath-tools")
3218 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3219 ".git;a=snapshot;h=" version ";sf=tgz"))
3220 (file-name (string-append name "-" version ".tar.gz"))
3223 "1jhi6bhl4ih75rfmyyjxd35ghgch5ls1gw40cjxwy9d6bd41z6q1"))
3224 (modules '((guix build utils)))
3227 ;; Drop bundled valgrind headers.
3228 (delete-file-recursively "third-party")
3229 (substitute* '("multipathd/main.c"
3230 "libmultipath/debug.c")
3231 (("#include \"../third-party/")
3234 (build-system gnu-build-system)
3236 '(#:tests? #f ; no tests
3237 #:make-flags (list "CC=gcc"
3238 (string-append "DESTDIR="
3239 (assoc-ref %outputs "out"))
3241 (string-append "LDFLAGS=-Wl,-rpath="
3242 (assoc-ref %outputs "out")
3245 (modify-phases %standard-phases
3246 (add-after 'unpack 'patch-source
3247 (lambda* (#:key inputs #:allow-other-keys)
3248 (let ((lvm2 (assoc-ref inputs "lvm2"))
3249 (udev (assoc-ref inputs "udev")))
3250 (substitute* "Makefile.inc"
3251 (("\\$\\(prefix\\)/usr") "$(prefix)")
3252 ;; Do not save timestamp to avoid gzip "timestamp
3253 ;; out-of-range" warnings.
3254 (("gzip -9") "gzip -9n"))
3255 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3256 (("/usr/include/libdevmapper.h")
3257 (string-append lvm2 "/include/libdevmapper.h"))
3258 (("/usr/include/libudev.h")
3259 (string-append udev "/include/libudev.h")))
3261 (delete 'configure)))) ; no configure script
3264 ("pkg-config" ,pkg-config)
3265 ("valgrind" ,valgrind)))
3267 `(("ceph:lib" ,ceph "lib")
3270 ("liburcu" ,liburcu)
3272 ("readline" ,readline)
3274 (home-page "http://christophe.varoqui.free.fr/")
3275 (synopsis "Access block devices through multiple paths")
3277 "This package provides the following binaries to drive the
3278 Linux Device Mapper multipathing driver:
3280 @item @command{multipath} - Device mapper target autoconfig.
3281 @item @command{multipathd} - Multipath daemon.
3282 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3283 @code{dm} multipath devices.
3284 @item @command{kpartx} - Create device maps from partition tables.
3286 (license (list license:gpl2+ ; main distribution
3287 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3289 (define-public libaio
3296 (string-append "https://releases.pagure.org/libaio/"
3297 name "-" version ".tar.gz")))
3300 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3301 (build-system gnu-build-system)
3304 (list "CC=gcc" (string-append "prefix=" %output))
3305 #:test-target "partcheck" ; need root for a full 'check'
3307 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3308 (home-page "https://pagure.io/libaio")
3309 (synopsis "Linux-native asynchronous I/O access library")
3311 "This library enables userspace to use Linux kernel asynchronous I/O
3312 system calls, important for the performance of databases and other advanced
3314 (license license:lgpl2.1+)))
3322 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3326 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
3327 (build-system gnu-build-system)
3329 `(("libsndfile" ,libsndfile)))
3331 `(("pkg-config" ,pkg-config)))
3332 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3333 (synopsis "Bluetooth subband audio codec")
3335 "The SBC is a digital audio encoder and decoder used to transfer data to
3336 Bluetooth audio output devices like headphones or loudspeakers.")
3337 (license license:gpl2+)))
3339 (define-public bluez
3346 "mirror://kernel.org/linux/bluetooth/bluez-"
3350 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
3351 (build-system gnu-build-system)
3354 (let ((out (assoc-ref %outputs "out")))
3355 (list "--sysconfdir=/etc"
3356 "--localstatedir=/var"
3359 ;; Install dbus/udev files to the correct location.
3360 (string-append "--with-dbusconfdir=" out "/etc")
3361 (string-append "--with-udevdir=" out "/lib/udev")))
3363 (modify-phases %standard-phases
3364 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3365 ;; issue (discussion on upstream mailing list:
3366 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3367 (add-before 'check 'skip-wonky-test
3369 (substitute* "unit/test-gatt.c"
3370 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3372 (add-after 'install 'post-install
3373 (lambda* (#:key inputs outputs #:allow-other-keys)
3374 (let* ((out (assoc-ref outputs "out"))
3375 (servicedir (string-append out "/share/dbus-1/services"))
3376 (service "obexd/src/org.bluez.obex.service")
3377 (rule (string-append
3378 out "/lib/udev/rules.d/97-hid2hci.rules")))
3379 ;; Install the obex dbus service file.
3380 (substitute* service
3382 (string-append out "/libexec/bluetooth/obexd")))
3383 (install-file service servicedir)
3384 ;; Fix paths in the udev rule.
3386 (("hid2hci --method")
3387 (string-append out "/lib/udev/hid2hci --method"))
3389 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3392 `(("pkg-config" ,pkg-config)
3393 ("gettext" ,gettext-minimal)))
3398 ("libical" ,libical)
3399 ("readline" ,readline)))
3400 (home-page "http://www.bluez.org/")
3401 (synopsis "Linux Bluetooth protocol stack")
3403 "BlueZ provides support for the core Bluetooth layers and protocols. It
3404 is flexible, efficient and uses a modular implementation.")
3405 (license license:gpl2+)))
3407 (define-public fuse-exfat
3414 "https://github.com/relan/exfat/releases/download/v"
3415 version "/" name "-" version ".tar.gz"))
3418 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3419 (build-system gnu-build-system)
3421 `(("pkg-config" ,pkg-config)))
3424 (home-page "https://github.com/relan/exfat")
3425 (synopsis "Mount exFAT file systems")
3427 "This package provides a FUSE-based file system that provides read and
3428 write access to exFAT devices.")
3429 (license license:gpl2+)))
3431 (define-public fuseiso
3434 (version "20070708")
3437 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3438 version "/fuseiso-" version ".tar.bz2"))
3441 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3442 (build-system gnu-build-system)
3444 `(("pkg-config" ,pkg-config)))
3449 (home-page "https://sourceforge.net/projects/fuseiso/")
3450 (synopsis "Mount ISO file system images")
3452 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
3453 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3454 Ridge, Joliet, and zisofs.")
3455 (license license:gpl2)))
3464 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3465 version ".tar.bz2"))
3466 (patches (search-patches "gpm-glibc-2.26.patch"))
3469 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3470 (build-system gnu-build-system)
3472 '(#:phases (modify-phases %standard-phases
3475 ;; The tarball was not generated with 'make dist' so we
3476 ;; need to bootstrap things ourselves.
3477 (substitute* "autogen.sh"
3478 (("/bin/sh") (which "sh")))
3479 (invoke "./autogen.sh")
3480 (patch-makefile-SHELL "Makefile.include.in")
3483 ;; Make sure programs find libgpm.so.
3484 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3485 (assoc-ref %outputs "out")
3488 `(("texinfo" ,texinfo)
3491 ("autoconf" ,autoconf)
3492 ("automake" ,automake)
3493 ("libtool" ,libtool)))
3494 (home-page "http://www.nico.schottelius.org/software/gpm/")
3495 (synopsis "Mouse support for the Linux console")
3497 "The GPM (general-purpose mouse) daemon is a mouse server for
3498 applications running on the Linux console. It allows users to select items
3499 and copy/paste text in the console and in xterm.")
3500 (license license:gpl2+)))
3502 (define-public btrfs-progs
3504 (name "btrfs-progs")
3508 (uri (string-append "mirror://kernel.org/linux/kernel/"
3509 "people/kdave/btrfs-progs/"
3510 "btrfs-progs-v" version ".tar.xz"))
3513 "0dgh56pamav8wb9nmabjwdlpcazvqc9pgzwablxn77mqh0qrhkaq"))))
3514 (build-system gnu-build-system)
3516 "static")) ; static versions of the binaries in "out"
3518 '(#:phases (modify-phases %standard-phases
3519 (add-after 'build 'build-static
3520 (lambda _ (invoke "make" "static")))
3521 (add-after 'install 'install-bash-completion
3522 (lambda* (#:key outputs #:allow-other-keys)
3523 (let* ((out (assoc-ref outputs "out"))
3524 (bashcomp (string-append out "/etc/bash_completion.d")))
3526 (copy-file "btrfs-completion"
3527 (string-append bashcomp "/btrfs"))
3529 (add-after 'install 'install-static
3530 (let ((staticbin (string-append (assoc-ref %outputs "static")
3534 (string-append "bindir=" staticbin)
3535 "install-static")))))
3536 #:tests? #f ; XXX: require the 'btrfs' kernel module.
3537 #:test-target "test"
3538 #:parallel-tests? #f)) ; tests fail when run in parallel
3539 (inputs `(("e2fsprogs" ,e2fsprogs)
3540 ("libblkid" ,util-linux)
3541 ("libblkid:static" ,util-linux "static")
3542 ("libuuid" ,util-linux)
3543 ("libuuid:static" ,util-linux "static")
3546 ("zlib:static" ,zlib "static")
3548 (native-inputs `(("pkg-config" ,pkg-config)
3549 ("asciidoc" ,asciidoc)
3552 ;; For building documentation.
3553 ("libxml2" ,libxml2)
3554 ("docbook-xsl" ,docbook-xsl)
3558 ;; The tests need 'grep' with perl regexp support.
3560 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
3561 (synopsis "Create and manage btrfs copy-on-write file systems")
3562 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3563 aimed at implementing advanced features while focusing on fault tolerance,
3564 repair and easy administration.")
3565 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3566 ;; GPL2: Everything else.
3567 (license (list license:gpl2 license:gpl2+))))
3569 (define-public btrfs-progs/static
3571 (name "btrfs-progs-static")
3572 (version (package-version btrfs-progs))
3574 (build-system trivial-build-system)
3576 `(("btrfs-progs:static" ,btrfs-progs "static")))
3578 `(#:modules ((guix build utils))
3581 (use-modules (guix build utils)
3585 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3586 (out (assoc-ref %outputs "out"))
3587 (source (string-append btrfs "/bin/btrfs.static"))
3588 (target (string-append out "/bin/btrfs")))
3589 (mkdir-p (dirname target))
3590 (copy-file source target)
3591 (remove-store-references target)
3592 (chmod target #o555)
3594 (home-page (package-home-page btrfs-progs))
3595 (synopsis "Statically-linked btrfs command from btrfs-progs")
3596 (description "This package provides the statically-linked @command{btrfs}
3597 from the btrfs-progs package. It is meant to be used in initrds.")
3598 (license (package-license btrfs-progs))))
3600 (define-public f2fs-tools-1.7
3607 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3608 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
3611 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
3613 (build-system gnu-build-system)
3616 (modify-phases %standard-phases
3617 (add-after 'install 'install-headers
3618 (lambda* (#:key outputs #:allow-other-keys)
3619 (let* ((out (assoc-ref outputs "out"))
3620 (out-include (string-append out "/include")))
3621 (install-file "include/f2fs_fs.h" out-include)
3622 (install-file "mkfs/f2fs_format_utils.h" out-include)
3625 `(("autoconf" ,autoconf)
3626 ("automake" ,automake)
3627 ("libtool" ,libtool)
3628 ("pkg-config" ,pkg-config)))
3630 `(("libuuid" ,util-linux)
3631 ("libselinux" ,libselinux)))
3632 (home-page "https://f2fs.wiki.kernel.org/")
3633 (synopsis "Userland tools for f2fs")
3635 "F2FS, the Flash-Friendly File System, is a modern file system
3636 designed to be fast and durable on flash devices such as solid-state
3637 disks and SD cards. This package provides the userland utilities.")
3638 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3639 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3640 (license (list license:gpl2 license:lgpl2.1))))
3642 (define-public f2fs-tools
3644 (inherit f2fs-tools-1.7)
3650 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3651 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
3654 "15pn2fm9knn7p1vzfzy6msnrdl14p6y1gn4m2ka6ba5bzx6lw4p2"))))
3656 `(("libuuid" ,util-linux)))))
3658 (define-public freefall
3661 (version (package-version linux-libre))
3662 (source (package-source linux-libre))
3663 (build-system gnu-build-system)
3665 '(#:phases (modify-phases %standard-phases
3666 (add-after 'unpack 'enter-subdirectory
3668 (chdir "tools/laptop/freefall")
3671 (add-before 'build 'increase-timeout
3673 ;; The default of 2 seconds is too low: it assumes an
3674 ;; open lid and AC power without actually checking.
3675 (substitute* "freefall.c"
3676 (("alarm\\(2\\)") "alarm(5)"))
3678 #:make-flags (list (string-append "PREFIX="
3679 (assoc-ref %outputs "out"))
3681 #:tests? #f)) ;no tests
3682 (home-page (package-home-page linux-libre))
3683 (synopsis "Free-fall protection for spinning laptop hard drives")
3685 "Prevents shock damage to the internal spinning hard drive(s) of some
3686 HP and Dell laptops. When sudden movement is detected, all input/output
3687 operations on the drive are suspended and its heads are parked on the ramp,
3688 where they are less likely to cause damage to the spinning disc. Requires a
3689 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3690 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3691 (license license:gpl2)))
3693 (define-public thinkfan
3701 (url "https://github.com/vmatare/thinkfan.git")
3703 (file-name (git-file-name name version))
3705 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
3706 (build-system cmake-build-system)
3708 `(#:modules ((guix build cmake-build-system)
3711 #:tests? #f ; no test target
3713 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3714 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
3716 `("-DUSE_ATASMART:BOOL=ON")
3718 (modify-phases %standard-phases
3719 (add-after 'unpack 'create-init-scripts
3720 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
3721 ;; systemd to patch and install their service files. Fake their
3722 ;; presence rather than duplicating the build system below. Leave
3723 ;; things like ‘/bin/kill’ because they're not worth a dependency.
3724 ;; The sysvinit needs manual patching, but since upstream doesn't
3725 ;; even provide the option to install it: don't.
3726 (lambda* (#:key outputs #:allow-other-keys)
3727 (let* ((out (assoc-ref outputs "out"))
3728 (share (string-append out "/share/" ,name)))
3729 (substitute* "CMakeLists.txt"
3730 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
3731 (format "option(~a_FOUND \"Faked\" ON)\n" package))
3732 ;; That was easy! Now we just need to fix the destinations.
3734 (string-append out directory)))
3737 `(("pkg-config" ,pkg-config)))
3739 `(("libatasmart" ,libatasmart)
3740 ("yaml-cpp" ,yaml-cpp)))
3741 (home-page "http://thinkfan.sourceforge.net/")
3742 (synopsis "Simple fan control program")
3744 "Thinkfan is a simple fan control program. It reads temperatures,
3745 checks them against configured limits and switches to appropriate (also
3746 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3747 other @code{hwmon} driver that enables temperature reading and fan control
3749 (license license:gpl3+)))
3751 (define-public tpacpi-bat
3759 (url "https://github.com/teleshoes/tpacpi-bat.git")
3760 (commit (string-append "v" version))))
3761 (file-name (git-file-name name version))
3763 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
3764 (build-system gnu-build-system)
3766 `(#:tests? #f ; no test target
3768 (modify-phases %standard-phases
3769 (add-after 'unpack 'refer-to-inputs
3771 (substitute* "tpacpi-bat"
3773 (format "~a " (which "cat")))
3774 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
3775 ;; loaded. That's the administrator's prerogative; disable it.
3776 (("system \"(modprobe .*)\"" _ match)
3777 (format "die \"Please run ‘~a’ first.\\n\"" match)))
3779 (delete 'configure) ; nothing to configure
3780 (delete 'build) ; nothing to build
3782 (lambda* (#:key outputs #:allow-other-keys)
3783 (let* ((out (assoc-ref outputs "out"))
3784 (bin (string-append out "/bin"))
3785 (doc (string-append out "/share/doc/" ,name "-" ,version)))
3786 (install-file "tpacpi-bat" bin)
3788 ;; There's no man page. Install other forms of documentation.
3789 (for-each (lambda (file)
3790 (let ((target (string-append doc "/" file)))
3791 (mkdir-p (dirname target))
3792 (copy-recursively file target)))
3793 (list "battery_asl" "examples" "README.md"))
3797 (home-page "https://github.com/teleshoes/tpacpi-bat")
3798 (synopsis "ThinkPad battery charge controller")
3800 "Tpacpi-bat is a command-line interface to control battery charging on
3801 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
3802 ThinkPad models released after 2011}, starting with the xx20 series. It can
3803 query and set the thresholds at which one or both batteries will start and stop
3804 charging, inhibit charging batteries for a set period of time, or force them to
3805 discharge when they otherwise would not.
3807 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
3808 kernel module provided by the @code{acpi-call-linux-module} package, which must
3809 be installed and loaded separately. Only the original vendor firmware is
3811 (license license:gpl3+)))
3813 (define-public ntfs-3g
3816 (version "2017.3.23")
3819 (uri (string-append "https://tuxera.com/opensource/"
3820 "ntfs-3g_ntfsprogs-" version ".tgz"))
3821 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
3824 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
3825 (modules '((guix build utils)))
3827 ;; Install under $prefix.
3828 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3832 (build-system gnu-build-system)
3833 (inputs `(("util-linux" ,util-linux)
3834 ("fuse" ,fuse))) ;libuuid
3835 (native-inputs `(("pkg-config" ,pkg-config)))
3837 '(#:configure-flags (list "--exec-prefix=${prefix}"
3838 "--with-fuse=external" ;use our own FUSE
3839 "--enable-mount-helper"
3840 "--enable-posix-acls"
3841 "--enable-xattr-mappings")
3843 (modify-phases %standard-phases
3844 ;; If users install ntfs-3g, they probably want to make it the
3845 ;; default driver as well, so we opt for sensible defaults and link
3846 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
3847 ;; mount NTFS file systems.)
3848 (add-after 'install 'install-link
3849 (lambda* (#:key outputs #:allow-other-keys)
3850 (let* ((out (assoc-ref outputs "out"))
3851 (sbin (string-append out "/sbin")))
3852 (symlink "mount.ntfs-3g"
3853 (string-append sbin "/mount.ntfs")))
3855 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
3856 (synopsis "Read-write access to NTFS file systems")
3858 "NTFS-3G provides read-write access to NTFS file systems, which are
3859 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3860 The package provides additional NTFS tools.")
3861 (license license:gpl2+)))
3863 (define-public rdma-core
3869 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3870 "/releases/download/v" version "/rdma-core-"
3874 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3875 (build-system cmake-build-system)
3877 '(#:tests? #f ; no tests
3878 ;; Upstream uses the "ninja" build system and encourage distros
3879 ;; to do the same for consistency. They also recommend using the
3880 ;; "Release" build type.
3881 #:build-type "Release"
3882 #:configure-flags (list "-GNinja")
3884 (modify-phases %standard-phases
3888 "-j" (number->string (parallel-job-count)))))
3891 (invoke "ninja" "install"))))))
3894 ("pkg-config" ,pkg-config)
3895 ("python" ,python-wrapper)))
3899 (home-page "https://github.com/linux-rdma/rdma-core")
3900 (synopsis "Utilities and libraries for working with RDMA devices")
3902 "This package provides userspace components for the InfiniBand
3903 subsystem of the Linux kernel. Specifically it contains userspace
3904 libraries for the following device nodes:
3907 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3908 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3909 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3912 The following service daemons are also provided:
3914 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3915 @item @code{iwpmd} (for iWARP kernel providers)
3916 @item @code{ibacm} (for InfiniBand communication management assistant)
3918 ;; All library code is dual licensed under GPL2 and a custom MIT
3919 ;; variant. The package also includes some components covered by
3920 ;; other licenses. Consult COPYING.md for full details.
3923 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3924 license:bsd-2 ; Files referring to COPYING.BSD_FB
3925 license:cc0 ; most files in ccan/
3926 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3928 (define-public perftest
3935 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
3936 version "/perftest-" version ".g0927198.tar.gz"))
3938 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
3939 (build-system gnu-build-system)
3942 (modify-phases %standard-phases
3943 (add-after 'unpack 'patch-header-paths
3945 (substitute* '("src/raw_ethernet_fs_rate.c"
3946 "src/raw_ethernet_resources.c"
3947 "src/raw_ethernet_resources.h"
3948 "src/raw_ethernet_send_burst_lat.c"
3949 "src/raw_ethernet_send_bw.c"
3950 "src/raw_ethernet_send_lat.c")
3951 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
3953 (inputs `(("rdma-core" ,rdma-core)))
3954 (home-page "https://github.com/linux-rdma/perftest/")
3955 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
3956 (description "This is a collection of tests written over uverbs intended for
3957 use as a performance micro-benchmark. The tests may be used for hardware or
3958 software tuning as well as for functional testing.
3960 The collection contains a set of bandwidth and latency benchmark such as:
3962 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
3963 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
3964 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
3965 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
3966 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
3968 (license license:gpl2)))
3970 (define-public rng-tools
3973 (home-page "https://github.com/nhorman/rng-tools")
3977 (uri (git-reference (url home-page)
3978 (commit (string-append "v" version))))
3979 (file-name (git-file-name name version))
3982 "19f75m6mzg8h7b4snzg7d6ypvkz6nq32lrpi9ja95gqz4wsd18a5"))))
3983 (build-system gnu-build-system)
3985 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
3986 #:configure-flags '("--without-nistbeacon"
3987 "--without-pkcs11")))
3989 `(("autoconf" ,autoconf)
3990 ("automake" ,automake)
3991 ("pkg-config" ,pkg-config)))
3993 `(("libsysfs" ,sysfsutils)))
3994 (synopsis "Random number generator daemon")
3996 "Monitor a hardware random number generator, and supply entropy
3997 from that to the system kernel's @file{/dev/random} machinery.")
3998 ;; The source package is offered under the GPL2+, but the files
3999 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4000 (license (list license:gpl2 license:gpl2+))))
4002 (define-public cpupower
4005 (version (package-version linux-libre))
4006 (source (package-source linux-libre))
4007 (build-system gnu-build-system)
4009 '(#:phases (modify-phases %standard-phases
4010 (add-after 'unpack 'enter-subdirectory
4012 (chdir "tools/power/cpupower")
4015 (add-before 'build 'fix-makefiles
4017 (substitute* "Makefile"
4019 (("/bin/(install|pwd)" _ command) command))
4020 (substitute* "bench/Makefile"
4021 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4023 #:make-flags (let ((out (assoc-ref %outputs "out")))
4024 (list (string-append "DESTDIR=" out)
4025 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4026 "docdir=/share/doc/cpupower"
4027 "confdir=$(docdir)/examples"
4028 ;; The Makefile recommends the following changes
4030 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4031 #:tests? #f)) ;no tests
4032 (native-inputs `(("gettext" ,gettext-minimal)))
4033 (inputs `(("pciutils" ,pciutils)))
4034 (home-page (package-home-page linux-libre))
4035 (synopsis "CPU frequency and voltage scaling tools for Linux")
4037 "cpupower is a set of user-space tools that use the cpufreq feature of the
4038 Linux kernel to retrieve and control processor features related to power saving,
4039 such as frequency and voltage scaling.")
4040 (license license:gpl2)))
4042 (define-public haveged
4050 (url "https://github.com/jirka-h/haveged.git")
4052 (file-name (git-file-name name version))
4054 (base32 "1hrwzjd4byq4fdrg8svww3d8x449k80jxxrjy9v6jvzhfv19rvxr"))))
4055 (build-system gnu-build-system)
4056 (home-page "http://www.issihosts.com/haveged")
4057 (synopsis "Entropy source for the Linux random number generator")
4059 "haveged generates an unpredictable stream of random numbers for use by
4060 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4061 standard mechanisms for filling the entropy pool may not be sufficient for
4062 systems with high needs or limited user interaction, such as headless servers.
4064 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4065 indirect effects of hardware events on hidden processor state using the HArdware
4066 Volatile Entropy Gathering and Expansion (@dfn{HAVEGE}) algorithm. It tunes
4067 itself to its environment and provides the same built-in test suite for the
4068 output stream as used on certified hardware security devices.
4070 The quality of the randomness produced by this algorithm has not been proven.
4071 It is recommended to run it together with another entropy source like rngd, and
4072 not as a replacement for it.")
4073 (license (list (license:non-copyleft "file://nist/mconf.h")
4074 (license:non-copyleft "file://nist/packtest.c")
4075 license:public-domain ; nist/dfft.c
4076 license:gpl3+)))) ; everything else
4078 (define-public ecryptfs-utils
4080 (name "ecryptfs-utils")
4085 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4086 version "/+download/ecryptfs-utils_"
4087 version ".orig.tar.gz"))
4090 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4091 (build-system gnu-build-system)
4093 `(#:configure-flags (list "--disable-pywrap")
4095 (modify-phases %standard-phases
4096 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4097 (lambda* (#:key inputs outputs #:allow-other-keys)
4098 (let ((out (assoc-ref outputs "out"))
4099 (utils-linux (assoc-ref inputs "utils-linux"))
4100 (cryptsetup (assoc-ref inputs "cryptsetup"))
4101 (linux-pam (assoc-ref inputs "linux-pam"))
4102 (lvm2 (assoc-ref inputs "lvm2")))
4103 (substitute* '("src/utils/ecryptfs-mount-private"
4104 "src/utils/ecryptfs-umount-private"
4105 "src/utils/ecryptfs-setup-private"
4106 "src/utils/ecryptfs-setup-swap"
4107 "src/utils/mount.ecryptfs.c"
4108 "src/utils/umount.ecryptfs.c"
4109 "src/pam_ecryptfs/pam_ecryptfs.c"
4110 "src/desktop/ecryptfs-mount-private.desktop.in"
4111 "src/desktop/ecryptfs-setup-private.desktop.in")
4113 (string-append utils-linux "/bin/mount"))
4115 (string-append utils-linux "/bin/umount"))
4116 (("/sbin/mount.ecryptfs_private")
4117 (string-append out "/sbin/mount.ecryptfs_private"))
4118 (("/sbin/umount.ecryptfs_private")
4119 (string-append out "/sbin/umount.ecryptfs_private"))
4120 (("/usr/bin/ecryptfs-mount-private")
4121 (string-append out "/bin/ecryptfs-mount-private"))
4122 (("/usr/bin/ecryptfs-rewrite-file")
4123 (string-append out "/bin/ecryptfs-rewrite-file"))
4124 (("/usr/bin/ecryptfs-setup-private")
4125 (string-append out "/bin/ecryptfs-setup-private"))
4126 (("/sbin/cryptsetup")
4127 (string-append cryptsetup "/sbin/cryptsetup"))
4128 (("/sbin/unix_chkpwd")
4129 (string-append linux-pam "/sbin/unix_chkpwd"))
4131 (string-append lvm2 "/sbin/dmsetup")))))))))
4133 `(("intltool" ,intltool)
4134 ("perl" ,perl) ; for pod2man
4135 ("pkg-config" ,pkg-config)))
4137 `(("keyutils" ,keyutils)
4138 ("linux-pam" ,linux-pam)
4139 ("utils-linux" ,util-linux)
4140 ("cryptsetup" ,cryptsetup)
4143 (home-page "http://ecryptfs.org/")
4144 (synopsis "eCryptfs cryptographic file system utilities")
4146 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4147 Each file's cryptographic meta-data is stored inside the file itself, along
4148 with the encrypted contents. This allows individual encrypted files to be
4149 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4150 native Linux file system, and has been part of the Linux kernel since version
4151 2.6.19. This package contains the userland utilities to manage it.")
4152 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4153 ;; grant additional permission to link with OpenSSL.
4154 (license license:gpl2+)))
4156 (define-public libnfsidmap
4158 (name "libnfsidmap")
4163 (uri (string-append "https://fedorapeople.org/~steved/"
4164 name "/" version "/" name "-" version ".tar.bz2"))
4166 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4167 (build-system gnu-build-system)
4169 `(#:configure-flags (list
4170 (string-append "--with-pluginpath="
4171 (assoc-ref %outputs "out")
4172 "/lib/libnfsidmap"))))
4174 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4176 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4177 (synopsis "NFSv4 support library for name/ID mapping")
4178 (description "Libnfsidmap is a library holding mulitiple methods of
4179 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4180 extensible array of mapping functions, currently consisting of two choices:
4181 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4182 (license (license:non-copyleft "file://COPYING"
4183 "See COPYING in the distribution."))))
4185 (define-public module-init-tools
4187 (name "module-init-tools")
4192 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4193 "module-init-tools-" version ".tar.bz2"))
4196 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4197 (patches (search-patches "module-init-tools-moduledir.patch"))))
4198 (build-system gnu-build-system)
4200 ;; FIXME: The upstream tarball lacks man pages, and building them would
4201 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4202 ;; but they vanished. In the meantime, fake it.
4204 (modify-phases %standard-phases
4205 (add-before 'configure 'fake-docbook
4207 (substitute* "Makefile.in"
4208 (("^DOCBOOKTOMAN.*$")
4209 "DOCBOOKTOMAN = true\n"))
4211 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
4212 (synopsis "Tools for loading and managing Linux kernel modules")
4214 "Tools for loading and managing Linux kernel modules, such as
4215 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
4216 (license license:gpl2+)))
4218 (define-public mcelog
4224 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4225 "mcelog.git/snapshot/v" version ".tar.gz"))
4228 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
4229 (file-name (string-append name "-" version ".tar.gz"))
4230 (modules '((guix build utils)))
4233 ;; The snapshots lack a .git directory,
4234 ;; breaking ‘git describe’.
4235 (substitute* "Makefile"
4236 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4238 (build-system gnu-build-system)
4240 `(#:phases (modify-phases %standard-phases
4241 (delete 'configure)) ; no configure script
4242 #:make-flags (let ((out (assoc-ref %outputs "out")))
4244 (string-append "prefix=" out)
4245 (string-append "DOCDIR=" out "/share/doc/mcelog")
4246 "etcprefix=$(DOCDIR)/examples"))
4247 ;; The tests will only run as root on certain supported CPU models.
4249 (supported-systems (list "i686-linux" "x86_64-linux"))
4250 (home-page "https://mcelog.org/")
4251 (synopsis "Machine check monitor for x86 Linux systems")
4253 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4254 and other hardware errors on x86 systems. It can also perform user-defined
4255 tasks, such as bringing bad pages off-line, when configurable error thresholds
4257 (license license:gpl2)))
4259 (define-public mtd-utils
4266 "ftp://ftp.infradead.org/pub/mtd-utils/"
4267 "mtd-utils-" version ".tar.bz2"))
4270 "1f30jszknc5v6ykmil8ajxgksmcg54q3rsp84jsancp9x0dycggv"))))
4272 '(#:configure-flags '("--enable-unit-tests")))
4274 `(("cmocka" ,cmocka)
4275 ("pkg-config" ,pkg-config)))
4277 `(("acl" ,acl) ; for XATTR
4278 ("libuuid" ,util-linux)
4281 (build-system gnu-build-system)
4282 (synopsis "MTD Flash Storage Utilities")
4283 (description "This package provides utilities for testing, partitioning, etc
4285 (home-page "http://www.linux-mtd.infradead.org/")
4287 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4288 license:mpl1.1 ; All ftl* files
4289 license:expat)))) ; libiniparser
4291 (define-public libseccomp
4297 (uri (string-append "https://github.com/seccomp/libseccomp/"
4298 "releases/download/v" version
4299 "/libseccomp-" version ".tar.gz"))
4302 "1s06h2cgk0xxwmhwj72z33bllafc1xqnxzk2yyra2rmg959778qw"))))
4303 (build-system gnu-build-system)
4305 `(("which" ,which)))
4306 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4307 (description "The libseccomp library provides an easy to use, platform
4308 independent, interface to the Linux Kernel's syscall filtering mechanism. The
4309 libseccomp API is designed to abstract away the underlying BPF based syscall
4310 filter language and present a more conventional function-call based filtering
4311 interface that should be familiar to, and easily adopted by, application
4313 (home-page "https://github.com/seccomp/libseccomp")
4314 (license license:lgpl2.1)))
4316 (define-public radeontop
4320 (home-page "https://github.com/clbr/radeontop/")
4323 (uri (string-append home-page "archive/v" version ".tar.gz"))
4324 (file-name (string-append name "-" version ".tar.gz"))
4327 "1fv06j5c99imvzkac3j40lgjhr5b2i77fnyffhlvj92bli1fm1c6"))))
4328 (build-system gnu-build-system)
4330 `(#:phases (modify-phases %standard-phases
4331 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4332 ;; dependency, and doesn't even work on release(!) tarballs.
4333 (add-after 'unpack 'report-correct-version
4335 (substitute* "getver.sh"
4337 (string-append "ver=" ,version)))
4339 (delete 'configure)) ; no configure script
4340 #:make-flags (list "CC=gcc"
4341 (string-append "PREFIX=" %output))
4342 #:tests? #f)) ; no tests
4344 `(("gettext" ,gettext-minimal)
4345 ("pkg-config" ,pkg-config)))
4347 `(("libdrm" ,libdrm)
4348 ("libpciaccess" ,libpciaccess)
4350 ("ncurses" ,ncurses)))
4351 (synopsis "Usage monitor for AMD Radeon graphics")
4352 (description "RadeonTop monitors resource consumption on supported AMD
4353 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4354 a terminal or saved to a file for further processing. It measures both the
4355 activity of the GPU as a whole, which is also accurate during OpenCL
4356 computations, as well as separate component statistics that are only meaningful
4357 under OpenGL graphics workloads.")
4358 (license license:gpl3)))
4360 (define-public efivar
4366 (uri (string-append "https://github.com/rhboot/" name
4367 "/releases/download/" version "/" name
4368 "-" version ".tar.bz2"))
4371 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
4372 (build-system gnu-build-system)
4374 `(;; Tests require a UEFI system and is not detected in the chroot.
4376 #:make-flags (list (string-append "prefix=" %output)
4377 (string-append "libdir=" %output "/lib")
4379 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4381 (modify-phases %standard-phases
4382 (delete 'configure))))
4384 `(("pkg-config" ,pkg-config)))
4387 (home-page "https://github.com/rhboot/efivar")
4388 (synopsis "Tool and library to manipulate EFI variables")
4389 (description "This package provides a library and a command line
4390 interface to the variable facility of UEFI boot firmware.")
4391 (license license:lgpl2.1+)))
4393 (define-public efibootmgr
4399 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4400 "/releases/download/" version "/efibootmgr"
4401 "-" version ".tar.bz2"))
4404 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
4405 (build-system gnu-build-system)
4407 `(#:tests? #f ;no tests
4408 #:make-flags (list (string-append "prefix=" %output)
4409 (string-append "libdir=" %output "/lib")
4410 ;; EFIDIR denotes a subdirectory relative to the
4411 ;; EFI System Partition where the loader will be
4412 ;; installed (known as OS_VENDOR in the code).
4413 ;; GRUB overrides this, as such it's only used if
4414 ;; nothing else is specified on the command line.
4416 #:phases (modify-phases %standard-phases (delete 'configure))))
4418 `(("pkg-config" ,pkg-config)))
4420 `(("efivar" ,efivar)
4422 (home-page "https://github.com/rhinstaller/efibootmgr")
4423 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4425 "@code{efibootmgr} is a user-space application to modify the Intel
4426 Extensible Firmware Interface (EFI) Boot Manager. This application can
4427 create and destroy boot entries, change the boot order, change the next
4428 running boot option, and more.")
4429 (license license:gpl2+)))
4431 (define-public sysstat
4437 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
4438 "sysstat-" version ".tar.xz"))
4441 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
4442 (build-system gnu-build-system)
4444 `(#:tests? #f ; No test suite.
4445 ;; Without this flag, it tries to install the man pages with group 'root'
4446 ;; and fails because /etc/passwd lacks an entry for the root user.
4448 (list "--disable-file-attr"
4449 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4451 (modify-phases %standard-phases
4452 ;; The build process tries to create '/var/lib/sa', so we skip that
4454 (add-after 'build 'skip-touching-var
4456 (substitute* "Makefile"
4457 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4460 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4461 (synopsis "Performance monitoring tools for Linux")
4462 (description "The sysstat utilities are a collection of performance
4463 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4464 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4465 @code{sadf} and @code{sa}.")
4466 (license license:gpl2+)))
4468 (define-public light
4475 "https://github.com/haikarainen/light/archive/v"
4479 "1gfvsw7gh5pis733l7j54vzp272pvjyzbg8a0pvapfmg0s7mip97"))
4480 (file-name (string-append name "-" version ".tar.gz"))))
4481 (build-system gnu-build-system)
4483 `(("autoconf" ,autoconf)
4484 ("automake" ,automake)))
4485 (home-page "https://haikarainen.github.io/light/")
4486 (synopsis "GNU/Linux application to control backlights")
4488 "Light is a program to send commands to screen backlight controllers
4489 under GNU/Linux. Features include:
4492 @item It does not rely on X.
4493 @item Light can automatically figure out the best controller to use, making
4494 full use of underlying hardware.
4495 @item It is possible to set a minimum brightness value, as some controllers
4496 set the screen to be pitch black at a vaĺue of 0 (or higher).
4499 Light is the successor of lightscript.")
4500 (license license:gpl3+)))
4502 (define-public brightnessctl
4503 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
4505 (name "brightnessctl")
4506 (version (git-version "0.4" "0" commit))
4510 (url "https://github.com/Hummer12007/brightnessctl/")
4512 (file-name (git-file-name name version))
4515 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
4516 (build-system gnu-build-system)
4518 '(#:tests? #f ; no tests
4519 #:make-flags (list "CC=gcc"
4520 (string-append "PREFIX=" %output)
4521 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
4523 (modify-phases %standard-phases
4525 (add-after 'unpack 'adjust-udev-rules
4527 (substitute* "90-brightnessctl.rules"
4528 (("/bin/") "/run/current-system/profile/bin/"))
4530 (home-page "https://github.com/Hummer12007/brightnessctl")
4531 (synopsis "Backlight and LED brightness control")
4533 "This program allows you read and control device brightness. Devices
4534 include backlight and LEDs. It can also preserve current brightness before
4535 applying the operation, such as on lid close.
4537 The appropriate permissions must be set on the backlight or LED control
4538 interface in sysfs, which can be accomplished with the included udev rules.")
4539 (license license:expat))))
4548 "https://github.com/linrunner/"
4549 (string-upcase name)
4550 "/archive/" version ".tar.gz"))
4551 (file-name (string-append name "-" version ".tar.gz"))
4554 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
4555 (inputs `(("bash" ,bash)
4557 ("ethtool" ,ethtool)
4561 ("inetutils" ,inetutils)
4564 ("pciutils" ,pciutils)
4568 ("usbutils" ,usbutils)
4569 ("util-linux" ,util-linux)
4570 ("wireless-tools" ,wireless-tools)))
4571 (build-system gnu-build-system)
4574 (modify-phases %standard-phases
4575 (delete 'configure) ; no configure script
4576 (add-before 'build 'setenv
4577 (lambda* (#:key outputs #:allow-other-keys)
4578 (let ((out (assoc-ref outputs "out")))
4579 (setenv "TLP_WITH_SYSTEMD" "0")
4580 (setenv "TLP_NO_INIT" "1")
4581 (setenv "TLP_NO_PMUTILS" "1")
4582 (setenv "TLP_SBIN" (string-append out "/bin"))
4583 (setenv "TLP_BIN" (string-append out "/bin"))
4584 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
4585 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
4586 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
4587 (setenv "TLP_CONF" "/etc/tlp")
4589 (string-append out "/lib/elogind/system-sleep"))
4591 (string-append out "/share/bash-completion/completions"))
4592 (setenv "TLP_MAN" (string-append out "/share/man"))
4593 (setenv "TLP_META" (string-append out "/share/metainfo"))
4595 (delete 'check) ; no tests
4596 (add-before 'install 'fix-installation
4598 ;; Stop the Makefile from trying to create system directories.
4599 (substitute* "Makefile"
4600 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
4601 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
4605 (invoke "make" "install-tlp" "install-man")))
4606 (add-after 'install 'wrap
4607 (lambda* (#:key inputs outputs #:allow-other-keys)
4608 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4609 (bin-files (find-files bin ".*")))
4610 (define (bin-directory input-name)
4611 (string-append (assoc-ref inputs input-name) "/bin"))
4612 (define (sbin-directory input-name)
4613 (string-append (assoc-ref inputs input-name) "/sbin"))
4614 (for-each (lambda (program)
4615 (wrap-program program
4618 (map bin-directory '("bash"
4629 (map sbin-directory '("ethtool"
4634 "wireless-tools"))))))
4637 (home-page "http://linrunner.de/en/tlp/tlp.html")
4638 (synopsis "Power management tool for Linux")
4639 (description "TLP is a power management tool for Linux. It comes with
4640 a default configuration already optimized for battery life. Nevertheless,
4641 TLP is customizable to fulfil system requirements. TLP settings are applied
4642 every time the power supply source is changed.")
4643 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4645 (license (list license:gpl2+ license:gpl3+))))
4653 (uri (string-append "https://www.ezix.org/software/"
4654 "files/lshw-" version
4658 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4659 (build-system gnu-build-system)
4661 `(#:phases (modify-phases %standard-phases (delete 'configure))
4662 #:tests? #f ; no tests
4664 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4665 (synopsis "List hardware information")
4667 "@command{lshw} (Hardware Lister) is a small tool to provide
4668 detailed information on the hardware configuration of the machine.
4669 It can report exact memory configuration, firmware version, mainboard
4670 configuration, CPU version and speed, cache configuration, bus speed,
4671 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4672 machines (PowerMac G4 is known to work).")
4673 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4674 (license license:gpl2+)))
4676 (define-public libmnl
4683 (uri (string-append "mirror://netfilter.org/libmnl/"
4684 "libmnl-" version ".tar.bz2"))
4687 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4688 (build-system gnu-build-system)
4689 (home-page "https://www.netfilter.org/projects/libmnl/")
4690 (synopsis "Netlink utility library")
4691 (description "Libmnl is a minimalistic user-space library oriented to
4692 Netlink developers. There are a lot of common tasks in parsing, validating,
4693 constructing of both the Netlink header and TLVs that are repetitive and easy to
4694 get wrong. This library aims to provide simple helpers that allows you to
4695 re-use code and to avoid re-inventing the wheel.")
4696 (license license:lgpl2.1+)))
4698 (define-public libnftnl
4705 (uri (string-append "mirror://netfilter.org/libnftnl/"
4706 "libnftnl-" version ".tar.bz2"))
4708 (base32 "0pffmsv41alsn5ac7mwnb9fh3qpwzqk13jrzn6c5i71wq6kbgix5"))))
4709 (build-system gnu-build-system)
4711 `(("pkg-config" ,pkg-config)))
4713 `(("libmnl" ,libmnl)))
4714 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4715 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4716 (description "Libnftnl is a userspace library providing a low-level netlink
4717 programming interface to the in-kernel nf_tables subsystem. The library
4718 libnftnl has been previously known as libnftables. This library is currently
4720 (license license:gpl2+)))
4722 (define-public nftables
4729 (uri (string-append "http://www.nftables.org/projects/nftables"
4730 "/files/nftables-" version ".tar.bz2"))
4733 "14bygs6vg2v448cw5r4pxqi8an29hw0m9vab8hpmgjmrzjsq30dd"))))
4734 (build-system gnu-build-system)
4735 (arguments `(#:configure-flags
4736 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
4737 (inputs `(("bison" ,bison)
4741 ("libnftnl" ,libnftnl)
4742 ("readline" ,readline)))
4743 (native-inputs `(("pkg-config" ,pkg-config)))
4744 (home-page "http://www.nftables.org")
4745 (synopsis "Userspace utility for Linux packet filtering")
4746 (description "nftables is the project that aims to replace the existing
4747 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4748 filtering framework, a new userspace utility and also a compatibility layer for
4749 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4750 infrastructure such as the existing hooks, the connection tracking system, the
4751 userspace queueing component and the logging subsystem.")
4752 (license license:gpl2)))
4754 (define-public proot
4762 (url "https://github.com/proot-me/PRoot.git")
4763 (commit (string-append "v" version))))
4764 (file-name (git-file-name name version))
4766 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
4767 (patches (search-patches "proot-test-fhs.patch"))))
4768 (build-system gnu-build-system)
4770 '(#:make-flags '("-C" "src")
4772 #:phases (modify-phases %standard-phases
4774 (add-before 'build 'set-shell-file-name
4775 (lambda* (#:key inputs #:allow-other-keys)
4776 (substitute* (find-files "src" "\\.[ch]$")
4779 (assoc-ref inputs "bash")
4782 (add-before 'check 'fix-fhs-assumptions-in-tests
4784 (substitute* "tests/test-c6b77b77.mk"
4785 (("/bin/bash") (which "bash"))
4786 (("/usr/bin/test") (which "test")))
4787 (substitute* '("tests/test-16573e73.c")
4788 (("/bin/([a-z-]+)" _ program)
4791 (substitute* (find-files "tests" "\\.sh$")
4792 ;; Some of the tests try to "bind-mount" /bin/true.
4794 (string-append "-b " (which "true") ":"))
4795 ;; Likewise for /bin.
4796 (("-b /bin:") "-b /gnu:")
4797 ;; Others try to run /bin/sh.
4798 (("/bin/sh") (which "sh"))
4799 ;; Others assume /etc/fstab exists.
4800 (("/etc/fstab") "/etc/passwd"))
4802 (substitute* "tests/GNUmakefile"
4803 (("-b /bin:") "-b /gnu:"))
4805 ;; XXX: This test fails in an obscure corner case, just
4807 (delete-file "tests/test-kkkkkkkk.c")
4812 (let ((n (parallel-job-count)))
4813 ;; For some reason we get lots of segfaults with
4814 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4815 (setenv "PROOT_NO_SECCOMP" "1")
4817 ;; Most of the tests expect "/bin" to be in $PATH so
4818 ;; they can run things that live in $ROOTFS/bin.
4820 (string-append (getenv "PATH") ":/bin"))
4822 (invoke "make" "check" "-C" "tests"
4824 "-j" (number->string n)))))
4826 (lambda* (#:key outputs #:allow-other-keys)
4827 ;; The 'install' rule does nearly nothing.
4828 (let* ((out (assoc-ref outputs "out"))
4829 (man1 (string-append out "/share/man/man1")))
4830 ;; TODO: 'make install-care' (does not even
4831 ;; build currently.)
4832 (invoke "make" "-C" "src" "install"
4833 (string-append "PREFIX=" out))
4836 (copy-file "doc/proot/man.1"
4837 (string-append man1 "/proot.1"))
4839 (native-inputs `(("which" ,which)
4841 ;; For 'mcookie', used by some of the tests.
4842 ("util-linux" ,util-linux)))
4843 (inputs `(("talloc" ,talloc)))
4844 (home-page "https://github.com/proot-me/PRoot")
4845 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4847 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4848 and @code{binfmt_misc}. This means that users don't need any privileges or
4849 setup to do things like using an arbitrary directory as the new root
4850 file system, making files accessible somewhere else in the file system
4851 hierarchy, or executing programs built for another CPU architecture
4852 transparently through QEMU user-mode. Also, developers can use PRoot as a
4853 generic process instrumentation engine thanks to its extension mechanism.
4854 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4855 available in the kernel Linux.")
4856 (license license:gpl2+)))
4858 (define-public proot-static
4861 (name "proot-static")
4863 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4864 (inputs `(("talloc" ,talloc/static)))
4866 (substitute-keyword-arguments (package-arguments proot)
4867 ((#:make-flags flags)
4868 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4870 `(modify-phases ,phases
4871 (add-after 'strip 'remove-store-references
4872 (lambda* (#:key outputs #:allow-other-keys)
4873 (let* ((out (assoc-ref outputs "out")))
4874 (with-directory-excursion out
4875 (remove-store-references "bin/proot")
4877 ((#:allowed-references _ '("out"))
4880 (define-public cpuid
4883 (version "20180519")
4886 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4887 version ".src.tar.gz"))
4890 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
4891 (build-system gnu-build-system)
4893 '(#:make-flags '("CC=gcc")
4894 #:tests? #f ; no tests
4895 #:phases (modify-phases %standard-phases
4896 (delete 'configure) ; no configure script
4897 (add-before 'install 'fix-makefile
4898 (lambda* (#:key outputs #:allow-other-keys)
4899 (substitute* "Makefile"
4900 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4901 ;; Make the compressed manpages writable so that the
4902 ;; reset-gzip-timestamps phase does not error out.
4903 (substitute* "Makefile"
4904 (("-m 444") "-m 644"))
4906 (inputs `(("perl" ,perl)))
4907 (supported-systems '("i686-linux" "x86_64-linux"))
4908 (home-page "http://www.etallen.com/cpuid.html")
4909 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4910 (description "cpuid dumps detailed information about the CPU(s) gathered
4911 from the CPUID instruction, and also determines the exact model of CPU(s). It
4912 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4913 NexGen, Rise, and SiS CPUs.")
4914 (license license:gpl2+)))
4916 (define-public jmtpfs
4923 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4925 (file-name (string-append name "-" version ".tar.gz"))
4928 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4929 (build-system gnu-build-system)
4933 ("libmtp" ,libmtp)))
4935 `(("pkg-config" ,pkg-config)))
4936 (home-page "https://github.com/JasonFerrara/jmtpfs")
4937 (synopsis "Use a FUSE file system to access data over MTP")
4938 (description "jmtpfs uses FUSE (file system in userspace) to provide access
4939 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4940 the MTP device as a file system.")
4941 (license license:gpl3)))
4943 (define-public procenv
4950 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4952 (file-name (string-append name "-" version ".tar.gz"))
4954 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
4955 (build-system gnu-build-system)
4956 (arguments `(#:configure-flags '("--disable-silent-rules")))
4957 (native-inputs `(("pkg-config" ,pkg-config)))
4958 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4959 ("groff" ,groff) ; for tests
4960 ("libselinux" ,libselinux)))
4961 (synopsis "Utility to show process environment")
4962 (description "Procenv is a command-line tool that displays as much detail about
4963 itself and its environment as possible. It can be used as a test
4964 tool, to understand the type of environment a process runs in, and for
4965 comparing system environments.")
4966 (home-page "http://github.com/jamesodhunt/procenv/")
4967 (license license:gpl3+)))
4969 (define-public libfabric
4977 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4978 version "/libfabric-" version ".tar.bz2"))
4980 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4981 (build-system gnu-build-system)
4982 (inputs `(("rdma-core" ,rdma-core)
4983 ,@(match (%current-system)
4984 ((member (package-supported-systems psm))
4988 (home-page "https://ofiwg.github.io/libfabric/")
4989 (synopsis "Open Fabric Interfaces")
4991 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4992 communication services to applications. OFI is best described as a collection
4993 of libraries and applications used to export fabric services. The key
4994 components of OFI are: application interfaces, provider libraries, kernel
4995 services, daemons, and test applications.
4997 Libfabric is a core component of OFI. It is the library that defines and
4998 exports the user-space API of OFI, and is typically the only software that
4999 applications deal with directly. It works in conjunction with provider
5000 libraries, which are often integrated directly into libfabric.")
5001 (license (list license:bsd-2 license:gpl2)))) ;dual
5006 (version "3.3.20170428")
5007 (home-page "https://github.com/intel/psm")
5011 (uri (git-reference (url home-page)
5012 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5013 (file-name (string-append "psm-" version ".tar.gz"))
5015 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5016 (patches (search-patches
5017 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5018 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5019 "psm-repro.patch")))) ; reproducibility
5020 (build-system gnu-build-system)
5021 (inputs `(("libuuid" ,util-linux)))
5023 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5024 ,(string-append "INSTALL_PREFIX=" %output)
5025 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5027 #:phases (modify-phases %standard-phases
5029 (add-after 'unpack 'patch-/usr/include
5031 (substitute* "Makefile"
5032 (("\\$\\{DESTDIR}/usr/include")
5033 (string-append %output "/include")))
5034 (substitute* "Makefile"
5035 (("/lib64") "/lib"))
5037 (add-after 'unpack 'patch-sysmacros
5039 (substitute* "ipath/ipath_proto.c"
5040 (("#include <sys/poll.h>" m)
5041 (string-append m "\n"
5042 "#include <sys/sysmacros.h>")))
5044 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5046 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5047 communications interface for the True Scale family of products. PSM users are
5048 enabled with mechanisms necessary to implement higher level communications
5049 interfaces in parallel environments.")
5050 ;; Only Intel-compatable processors are supported.
5051 (supported-systems '("i686-linux" "x86_64-linux"))
5052 (license (list license:bsd-2 license:gpl2)))) ;dual
5054 (define-public snapscreenshot
5056 (name "snapscreenshot")
5057 (version "1.0.14.3")
5061 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5062 name "-" version ".tar.bz2"))
5064 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5065 (build-system gnu-build-system)
5068 (let ((out (assoc-ref %outputs "out")))
5069 (list (string-append "BINDIR=" out "/bin")
5070 (string-append "MANDIR=" out "/share/man")))
5071 #:tests? #f ; no test suite
5073 (modify-phases %standard-phases
5074 (delete 'configure) ; ./configure is a snarky no-op
5075 (add-before 'install 'fix-ownership
5076 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5078 (substitute* "depfun.mak"
5079 ((" -o bin -g bin ") " "))
5081 (add-before 'install 'create-output-directories
5082 (lambda* (#:key outputs #:allow-other-keys)
5083 (let ((out (assoc-ref outputs "out")))
5084 (mkdir-p (string-append out "/share/man/man1"))
5086 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
5087 (synopsis "Take screenshots of one or more Linux text consoles")
5089 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5090 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5091 relevant @file{/dev/vcs*} file(s).")
5092 (license license:gpl2)))
5094 (define-public fbcat
5101 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5102 version "/" name "-" version ".tar.gz"))
5104 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
5105 (build-system gnu-build-system)
5107 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5108 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5109 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5110 `(("pnmtopng" ,netpbm)))
5111 (outputs (list "out" "fbgrab"))
5115 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5116 #:tests? #f ; no tests
5118 (modify-phases %standard-phases
5119 (delete 'configure) ; no configure script
5120 (add-after 'build 'qualify-references
5121 (lambda* (#:key inputs outputs #:allow-other-keys)
5122 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5123 (out (assoc-ref outputs "out")))
5124 (substitute* "fbgrab"
5126 (string-append out "/bin/" all))
5128 (string-append pnmtopng "/bin/" all)))
5130 (add-after 'install 'split-fbgrab-output
5131 (lambda* (#:key outputs #:allow-other-keys)
5132 (let* ((out (assoc-ref outputs "out"))
5133 (out:fbgrab (assoc-ref outputs "fbgrab")))
5134 (for-each (lambda (file)
5135 (let ((old (string-append out "/" file))
5136 (new (string-append out:fbgrab "/" file)))
5137 (mkdir-p (dirname new))
5138 (rename-file old new)))
5140 "share/man/man1/fbgrab.1"))
5142 (home-page "https://jwilk.net/software/fbcat")
5143 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5145 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5146 a dump therof. It supports a wide range of drivers and pixel formats.
5147 @command{fbcat} can take screenshots of virtually any application that can be
5148 made to write its output to the framebuffer, including (but not limited to)
5149 text-mode or graphical applications that don't use a display server.
5151 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5152 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5153 (license license:gpl2)))
5155 (define-public libcgroup
5163 "mirror://sourceforge/libcg/" name "/"
5164 version "/" name "-" version ".tar.bz2"))
5166 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5167 (build-system gnu-build-system)
5174 `(("linux-pam" ,linux-pam)))
5175 (home-page "https://sourceforge.net/projects/libcg/")
5176 (synopsis "Control groups management tools")
5177 (description "Control groups is Linux kernel method for process resource
5178 restriction, permission handling and more. This package provides userspace
5179 interface to this kernel feature.")
5180 (license license:lgpl2.1)))
5182 (define-public mbpfan
5190 (url "https://github.com/dgraziotin/mbpfan.git")
5191 (commit (string-append "v" version))))
5192 (file-name (git-file-name name version))
5194 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5195 (build-system gnu-build-system)
5197 '(#:tests? #f ; tests ask to be run as root
5198 #:make-flags (let ((out (assoc-ref %outputs "out")))
5199 (list (string-append "DESTDIR=" out)
5202 (modify-phases %standard-phases
5203 (add-after 'unpack 'patch-paths
5205 (substitute* "Makefile"
5208 (delete 'configure)))) ; there's no configure phase
5209 (home-page "https://github.com/dgraziotin/mbpfan")
5210 (synopsis "Control fan speed on Macbooks")
5212 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5213 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5214 module. It can be executed as a daemon or in the foreground with root
5216 (license license:gpl3+)))
5225 (url "https://github.com/intel/opa-psm2.git")
5226 (commit (string-append "PSM2_" version))))
5227 (file-name (git-file-name name version))
5230 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
5231 (build-system gnu-build-system)
5234 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5236 #:phases (modify-phases %standard-phases
5238 (add-after 'unpack 'patch-Makefiles
5240 (substitute* "Makefile"
5243 (substitute* "compat/Makefile"
5249 (setenv "DESTDIR" %output)
5250 (invoke "make" "install")
5253 `(("rdma-core" ,rdma-core)
5254 ("numactl" ,numactl)))
5255 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5257 "This package is low-level user-level Intel's communications interface.
5258 The PSM2 API is a high-performance vendor-specific protocol that provides a
5259 low-level communications interface for the Intel Omni-Path family of
5260 high-speed networking devices.")
5261 (home-page "https://github.com/intel/opa-psm2")
5262 ;; Only the x86_64 architecure is supported.
5263 (supported-systems '("x86_64-linux"))
5264 (license (list license:bsd-3 license:gpl2)))) ; dual
5266 (define-public libpfm4
5272 (uri (string-append "mirror://sourceforge/perfmon2/"
5273 name "/libpfm-" version ".tar.gz"))
5276 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5277 (build-system gnu-build-system)
5279 '(#:modules ((guix build utils)
5280 (guix build gnu-build-system))
5281 #:phases (modify-phases %standard-phases
5285 (lambda* (#:key inputs outputs #:allow-other-keys)
5286 (let* ((out (assoc-ref outputs "out")))
5291 (lambda* (#:key outputs #:allow-other-keys)
5292 (let* ((out (assoc-ref outputs "out")))
5294 (string-append "PREFIX=" out)
5297 (synopsis "Performance event monitoring library")
5299 "This package provides a library called libpfm4, which is used to develop
5300 monitoring tools exploiting the performance monitoring events such as those
5301 provided by the Performance Monitoring Unit (PMU) of modern processors.
5303 Libpfm4 helps convert from an event name, expressed as a string, to the event
5304 encoding that is either the raw event as documented by the hardware vendor or
5305 the OS-specific encoding. In the latter case, the library is able to prepare
5306 the OS-specific data structures needed by the kernel to setup the event.
5308 libpfm4 provides support for the @code{perf_events} interface, which was
5309 introduced in Linux 2.6.31.")
5310 (home-page "http://perfmon2.sourceforge.net/")
5311 (license license:expat)))
5313 (define-public libnfnetlink
5315 (name "libnfnetlink")
5320 "https://www.netfilter.org/projects/libnfnetlink/files/"
5321 "libnfnetlink-" version ".tar.bz2"))
5324 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5325 (build-system gnu-build-system)
5326 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5327 (synopsis "Low-level netfilter netlink communication library")
5329 "@code{libnfnetlink} is the low-level library for netfilter related
5330 kernel/userspace communication. It provides a generic messaging
5331 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5332 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5333 management tools in userspace.")
5334 (license license:gpl2)))
5336 (define-public go-netlink
5343 (url "https://github.com/vishvananda/netlink.git")
5344 (commit (string-append "v" version))))
5345 (file-name (git-file-name name version))
5348 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5349 (build-system go-build-system)
5351 `(#:import-path "github.com/vishvananda/netlink"))
5353 `(("go-golang-org-x-sys-unix" ,go-golang-org-x-sys-unix)
5354 ("go-netns" ,go-netns)))
5355 (home-page "https://github.com/vishvananda/netlink")
5356 (synopsis "Simple netlink library for Go")
5357 (description "The netlink package provides a simple netlink library for
5358 Go. Netlink is the interface a user-space program in Linux uses to
5359 communicate with the kernel. It can be used to add and remove interfaces, set
5360 IP addresses and routes, and configure IPsec.")
5361 (license license:asl2.0)))
5363 (define-public xfsprogs
5370 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5371 "xfsprogs-" version ".tar.gz"))
5374 "0ss0r6jlxxinf9fhpc0fgf7b89n9mzirpa85xxjmi1ix9l6cls6x"))))
5375 (build-system gnu-build-system)
5377 `(#:tests? #f ;kernel/user integration tests are in package "xfstests"
5378 #:phases (modify-phases %standard-phases
5379 (add-after 'install 'install-headers
5381 (invoke "make" "install-dev"))))))
5383 `(("gettext" ,gettext-minimal)
5384 ("util-linux" ,util-linux)))
5385 (home-page "https://xfs.wiki.kernel.org/")
5386 (synopsis "XFS file system tools")
5387 (description "This package provides commands to create and check XFS
5389 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5390 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5391 (license (list license:gpl2 license:lgpl2.1))))
5393 (define-public genext2fs
5400 (url "https://github.com/jeremie-koenig/genext2fs.git")
5401 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5402 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
5403 (file-name (git-file-name name version))
5405 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
5406 (build-system gnu-build-system)
5409 (modify-phases %standard-phases
5410 (add-after 'unpack 'apply-debian-patches
5411 ;; Debian changes (the revision after ‘-’ in VERSION) are
5412 ;; maintained as separate patches. Apply those relevant to us.
5416 (invoke "patch" "-p1" "-i"
5417 (string-append "debian/patches/" file-name)))
5418 (list "blocksize+creator.diff" ; add -B/-o options
5419 "byteswap_fix.diff"))
5422 `(("autoconf" ,autoconf)
5423 ("automake" ,automake)))
5424 (home-page "https://github.com/jeremie-koenig/genext2fs")
5425 (synopsis "Generate ext2 file system as a normal user")
5426 (description "This package provides a program to generate an ext2
5427 file system as a normal (non-root) user. It does not require you to mount
5428 the image file to copy files on it, nor does it require that you become
5429 the superuser to make device nodes.")
5430 (license license:gpl2)))
5432 (define-public fakeroot
5438 (uri (string-append "http://ftp.debian.org/debian/pool/main/f/"
5439 "fakeroot/fakeroot_" version ".orig.tar.xz"))
5440 (file-name (string-append name "-" version ".tar.gz"))
5443 "1xpl0s2yjyjwlf832b6kbkaa5921liybaar13k7n45ckd9lxd700"))))
5444 (build-system gnu-build-system)
5447 (modify-phases %standard-phases
5448 (add-after 'configure 'patch-Makefile
5450 ;; Note: The root of the problem is already in "Makefile.am".
5451 (substitute* "Makefile"
5452 (("/bin/sh") (which "sh")))
5454 (add-after 'unpack 'patch-getopt
5455 (lambda* (#:key inputs #:allow-other-keys)
5456 (substitute* "scripts/fakeroot.in"
5458 (string-append (assoc-ref inputs "util-linux")
5461 (add-before 'configure 'setenv
5463 (setenv "LIBS" "-lacl")
5465 (add-before 'check 'prepare-check
5467 (setenv "SHELL" (which "bash"))
5468 (setenv "VERBOSE" "1")
5469 (substitute* "test/t.touchinstall"
5470 ;; We don't have the name of the root user, so use ID=0.
5471 (("grep root") "grep \"\\<0\\>\""))
5472 (substitute* "test/tartest"
5473 ;; We don't have the name of the root group, so use ID=0.
5474 (("ROOTGROUP=root") "ROOTGROUP=0")
5475 ;; We don't have the name of the daemon user, so use IDs.
5476 (("daemon:sys") "1:3")
5478 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
5479 (substitute* "test/compare-tar"
5480 (("tar -tvf") "tar --numeric-owner -tvf"))
5484 ("sharutils" ,sharutils) ; for the tests
5485 ("xz" ,xz))) ; for the tests
5487 `(("libcap" ,libcap)
5488 ("util-linux" ,util-linux)))
5489 (synopsis "Provides a fake root environment")
5490 (description "@command{fakeroot} runs a command in an environment where
5491 it appears to have root privileges for file manipulation. This is useful
5492 for allowing users to create archives (tar, ar, .deb etc.) with files in
5493 them with root permissions/ownership. Without fakeroot one would have to
5494 have root privileges to create the constituent files of the archives with
5495 the correct permissions and ownership, and then pack them up, or one would
5496 have to construct the archives directly, without using the archiver.")
5497 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
5498 (license license:gpl3+)))
5500 (define-public inputattach
5502 (name "inputattach")
5507 (url "https://github.com/linuxwacom/input-wacom.git")
5508 (commit (string-append "input-wacom-" version))))
5509 (file-name (git-file-name name version))
5511 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
5512 (build-system gnu-build-system)
5515 (modify-phases %standard-phases
5519 (lambda* (#:key inputs #:allow-other-keys)
5520 (with-directory-excursion "inputattach"
5521 (invoke (string-append (assoc-ref inputs "gcc")
5523 "-O2" "-o" "inputattach" "inputattach.c"))
5527 (lambda* (#:key outputs #:allow-other-keys)
5528 (let ((target-dir (string-append
5529 (assoc-ref outputs "out")
5531 (mkdir-p target-dir)
5532 (copy-file "inputattach/inputattach"
5533 (string-append target-dir
5536 (home-page "https://linuxwacom.github.io/")
5537 (synopsis "Dispatch input peripherals events to a device file")
5538 (description "inputattach dispatches input events from several device
5539 types and interfaces and translates so that the X server can use them.")
5540 (license license:gpl2+)))