1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 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, 2020 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, 2020 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, 2020 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, 2020 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, 2019 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, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
39 ;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re>
40 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
41 ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com>
42 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
43 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
44 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
45 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
47 ;;; This file is part of GNU Guix.
49 ;;; GNU Guix is free software; you can redistribute it and/or modify it
50 ;;; under the terms of the GNU General Public License as published by
51 ;;; the Free Software Foundation; either version 3 of the License, or (at
52 ;;; your option) any later version.
54 ;;; GNU Guix is distributed in the hope that it will be useful, but
55 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
56 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57 ;;; GNU General Public License for more details.
59 ;;; You should have received a copy of the GNU General Public License
60 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
62 (define-module (gnu packages linux)
63 #:use-module (gnu packages)
64 #:use-module (gnu packages acl)
65 #:use-module (gnu packages admin)
66 #:use-module (gnu packages algebra)
67 #:use-module (gnu packages audio)
68 #:use-module (gnu packages autotools)
69 #:use-module (gnu packages backup)
70 #:use-module (gnu packages base)
71 #:use-module (gnu packages bash)
72 #:use-module (gnu packages bison)
73 #:use-module (gnu packages calendar)
74 #:use-module (gnu packages check)
75 #:use-module (gnu packages crypto)
76 #:use-module (gnu packages cryptsetup)
77 #:use-module (gnu packages compression)
78 #:use-module (gnu packages dbm)
79 #:use-module (gnu packages datastructures)
80 #:use-module (gnu packages docbook)
81 #:use-module (gnu packages documentation)
82 #:use-module (gnu packages elf)
83 #:use-module (gnu packages flex)
84 #:use-module (gnu packages file)
85 #:use-module (gnu packages freedesktop)
86 #:use-module (gnu packages gcc)
87 #:use-module (gnu packages gettext)
88 #:use-module (gnu packages glib)
89 #:use-module (gnu packages golang)
90 #:use-module (gnu packages gperf)
91 #:use-module (gnu packages gstreamer)
92 #:use-module (gnu packages gtk)
93 #:use-module (gnu packages haskell-apps)
94 #:use-module (gnu packages haskell-xyz)
95 #:use-module (gnu packages libunwind)
96 #:use-module (gnu packages libusb)
97 #:use-module (gnu packages man)
98 #:use-module (gnu packages maths)
99 #:use-module (gnu packages multiprecision)
100 #:use-module (gnu packages ncurses)
101 #:use-module (gnu packages netpbm)
102 #:use-module (gnu packages networking)
103 #:use-module (gnu packages ninja)
104 #:use-module (gnu packages nss)
105 #:use-module (gnu packages perl)
106 #:use-module (gnu packages pciutils)
107 #:use-module (gnu packages pkg-config)
108 #:use-module (gnu packages popt)
109 #:use-module (gnu packages pulseaudio)
110 #:use-module (gnu packages python)
111 #:use-module (gnu packages python-xyz)
112 #:use-module (gnu packages readline)
113 #:use-module (gnu packages rrdtool)
114 #:use-module (gnu packages samba)
115 #:use-module (gnu packages sdl)
116 #:use-module (gnu packages serialization)
117 #:use-module (gnu packages slang)
118 #:use-module (gnu packages texinfo)
119 #:use-module (gnu packages tls)
120 #:use-module (gnu packages valgrind)
121 #:use-module (gnu packages video)
122 #:use-module (gnu packages web)
123 #:use-module (gnu packages xiph)
124 #:use-module (gnu packages xml)
125 #:use-module (gnu packages xdisorg)
126 #:use-module (gnu packages xorg)
127 #:use-module (gnu packages groff)
128 #:use-module (gnu packages rsync)
129 #:use-module (gnu packages selinux)
130 #:use-module (gnu packages swig)
131 #:use-module (guix build-system cmake)
132 #:use-module (guix build-system gnu)
133 #:use-module (guix build-system go)
134 #:use-module (guix build-system meson)
135 #:use-module (guix build-system python)
136 #:use-module (guix build-system trivial)
137 #:use-module (guix build-system linux-module)
138 #:use-module (guix download)
139 #:use-module (guix git-download)
140 #:use-module ((guix licenses) #:prefix license:)
141 #:use-module (guix packages)
142 #:use-module (guix gexp)
143 #:use-module (guix store)
144 #:use-module (guix monads)
145 #:use-module (guix utils)
146 #:use-module (srfi srfi-1)
147 #:use-module (srfi srfi-2)
148 #:use-module (srfi srfi-26)
149 #:use-module (ice-9 match))
151 (define-public (system->linux-architecture arch)
152 "Return the Linux architecture name for ARCH, a Guix system name such as
153 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
154 (let ((arch (car (string-split arch #\-))))
155 (cond ((string=? arch "i686") "i386")
156 ((string-prefix? "mips" arch) "mips")
157 ((string-prefix? "arm" arch) "arm")
158 ((string-prefix? "aarch64" arch) "arm64")
159 ((string-prefix? "alpha" arch) "alpha")
160 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
161 ((string-prefix? "s390" arch) "s390")
162 ((string-prefix? "riscv" arch) "riscv")
165 (define-public (system->defconfig system)
166 "Some systems (notably powerpc-linux) require a special target for kernel
167 defconfig. Return the appropriate make target if applicable, otherwise return
169 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
170 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
175 ;;; Kernel source code deblobbing.
178 (define (linux-libre-deblob-scripts version
181 (list (version-major+minor version)
184 (uri (string-append "https://linux-libre.fsfla.org"
185 "/pub/linux-libre/releases/" version "-gnu/"
186 "deblob-" (version-major+minor version)))
187 (sha256 deblob-hash))
190 (uri (string-append "https://linux-libre.fsfla.org"
191 "/pub/linux-libre/releases/" version "-gnu/"
193 (sha256 deblob-check-hash))))
195 (define deblob-scripts-5.4
196 (linux-libre-deblob-scripts
198 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
199 (base32 "08ls4gx5vanyiq9rn0869nfq4piw4lx1dl8hh9w9xgkr4ypc1j4k")))
201 (define deblob-scripts-4.19
202 (linux-libre-deblob-scripts
204 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
205 (base32 "1w2wgxblpq09i33qmqgw5v3r5rm9vkkygr6m0sgv4zgczk9s29wr")))
207 (define deblob-scripts-4.14
208 (linux-libre-deblob-scripts
210 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
211 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
213 (define deblob-scripts-4.9
214 (linux-libre-deblob-scripts
216 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
217 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
219 (define deblob-scripts-4.4
220 (linux-libre-deblob-scripts
222 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
223 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
225 (define* (computed-origin-method gexp-promise hash-algo hash
226 #:optional (name "source")
227 #:key (system (%current-system))
228 (guile (default-guile)))
229 "Return a derivation that executes the G-expression that results
230 from forcing GEXP-PROMISE."
231 (mlet %store-monad ((guile (package->derivation guile system)))
232 (gexp->derivation (or name "computed-origin")
234 #:graft? #f ;nothing to graft
236 #:guile-for-build guile)))
238 (define (make-linux-libre-source version
241 "Return a 'computed' origin that generates a Linux-libre tarball from the
242 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
243 (match deblob-scripts
244 ((deblob-version (? origin? deblob) (? origin? deblob-check))
245 (unless (string=? deblob-version (version-major+minor version))
246 ;; The deblob script cannot be expected to work properly on a
247 ;; different version (major+minor) of Linux, even if no errors
248 ;; are signaled during execution.
249 (error "deblob major+minor version mismatch"))
251 (method computed-origin-method)
252 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
256 (with-imported-modules '((guix build utils))
258 (use-modules (guix build utils)
262 (let ((dir (string-append "linux-" #$version)))
265 (set-path-environment-variable
268 #+(canonical-package bash)
269 #+(canonical-package coreutils)
270 #+(canonical-package diffutils)
271 #+(canonical-package findutils)
272 #+(canonical-package patch)
273 #+(canonical-package xz)
274 #+(canonical-package sed)
275 #+(canonical-package grep)
276 #+(canonical-package bzip2)
277 #+(canonical-package gzip)
278 #+(canonical-package tar)
279 ;; The comments in the 'deblob-check' script
280 ;; claim that it supports Python 2 and 3, but
281 ;; in fact it fails when run in Python 3 as
285 (with-directory-excursion "/tmp/bin"
287 (copy-file #+deblob "deblob")
288 (chmod "deblob" #o755)
289 (substitute* "deblob"
290 (("/bin/sh") (which "sh")))
292 (copy-file #+deblob-check "deblob-check")
293 (chmod "deblob-check" #o755)
294 (substitute* "deblob-check"
295 (("/bin/sh") (which "sh"))
296 (("/bin/sed") (which "sed"))
297 (("/usr/bin/python") (which "python"))))
299 (if (file-is-directory? #+upstream-source)
301 (format #t "Copying upstream linux source...~%")
303 (invoke "cp" "--archive" #+upstream-source dir)
304 (invoke "chmod" "--recursive" "u+w" dir))
306 (format #t "Unpacking upstream linux tarball...~%")
308 (invoke "tar" "xf" #$upstream-source)
311 (and (not (member name '("." "..")))
312 (file-is-directory? name))))
314 (unless (string=? dir unpacked-dir)
315 (rename-file unpacked-dir dir)))
317 (error "multiple directories found" dirs)))))
319 (with-directory-excursion dir
320 (setenv "PYTHON" (which "python"))
321 (format #t "Running deblob script...~%")
323 (invoke "/tmp/bin/deblob"))
325 (format #t "~%Packing new Linux-libre tarball...~%")
327 (invoke "tar" "cvfa" #$output
328 ;; Avoid non-determinism in the archive.
341 (define (linux-libre-urls version)
342 "Return a list of URLs for Linux-Libre VERSION."
344 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
345 version "-gnu/linux-libre-" version "-gnu.tar.xz")
347 ;; XXX: Work around <http://bugs.gnu.org/14851>.
349 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
350 version "-gnu.tar.xz")
352 ;; Maybe this URL will become valid eventually.
354 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
355 version "-gnu.tar.xz")))
357 (define (%upstream-linux-source version hash)
360 (uri (string-append "mirror://kernel.org"
361 "/linux/kernel/v" (version-major version) ".x/"
362 "linux-" version ".tar.xz"))
365 (define-public linux-libre-5.4-version "5.4.28")
366 (define-public linux-libre-5.4-pristine-source
367 (let ((version linux-libre-5.4-version)
368 (hash (base32 "197p7rjmbs229ncj1y8s80f7n4bm8g9w0jrv1109m3rl8q9wqqy8")))
369 (make-linux-libre-source version
370 (%upstream-linux-source version hash)
371 deblob-scripts-5.4)))
373 (define-public linux-libre-4.19-version "4.19.113")
374 (define-public linux-libre-4.19-pristine-source
375 (let ((version linux-libre-4.19-version)
376 (hash (base32 "1rf0jz7r1f4rb4k0g3glssfa1hm2ka6vlbwjlkmsx1bybxnmg85m")))
377 (make-linux-libre-source version
378 (%upstream-linux-source version hash)
379 deblob-scripts-4.19)))
381 (define-public linux-libre-4.14-version "4.14.174")
382 (define-public linux-libre-4.14-pristine-source
383 (let ((version linux-libre-4.14-version)
384 (hash (base32 "12ai2lc2ny38s93d0m5ngrv030vwv1h2hhzp0fs6fhjxasikq8jc")))
385 (make-linux-libre-source version
386 (%upstream-linux-source version hash)
387 deblob-scripts-4.14)))
389 (define-public linux-libre-4.9-version "4.9.217")
390 (define-public linux-libre-4.9-pristine-source
391 (let ((version linux-libre-4.9-version)
392 (hash (base32 "06b8av9f9pk2yp95nzv4322k0d5wsg40sxd9kfim1xzb093abckg")))
393 (make-linux-libre-source version
394 (%upstream-linux-source version hash)
395 deblob-scripts-4.9)))
397 (define-public linux-libre-4.4-version "4.4.217")
398 (define-public linux-libre-4.4-pristine-source
399 (let ((version linux-libre-4.4-version)
400 (hash (base32 "0vsjchywznmjn01flgvm9vsja5zqni319rfwgy997afcbz0c9spx")))
401 (make-linux-libre-source version
402 (%upstream-linux-source version hash)
403 deblob-scripts-4.4)))
405 (define %boot-logo-patch
406 ;; Linux-Libre boot logo featuring Freedo and a gnu.
409 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
410 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
413 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
415 (define %linux-libre-arm-export-__sync_icache_dcache-patch
419 "https://salsa.debian.org/kernel-team/linux"
420 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
421 "/debian/patches/bugfix/arm/"
422 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
423 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
425 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
427 (define (source-with-patches source patches)
430 (patches (append (origin-patches source)
433 (define-public linux-libre-5.4-source
434 (source-with-patches linux-libre-5.4-pristine-source
435 (list %boot-logo-patch
436 %linux-libre-arm-export-__sync_icache_dcache-patch
437 ;; Pinebook Pro patch from linux-next,
438 ;; can be dropped for linux-libre 5.7
440 "linux-libre-support-for-Pinebook-Pro.patch"))))
442 (define-public linux-libre-4.19-source
443 (source-with-patches linux-libre-4.19-pristine-source
444 (list %boot-logo-patch
445 %linux-libre-arm-export-__sync_icache_dcache-patch)))
447 (define-public linux-libre-4.14-source
448 (source-with-patches linux-libre-4.14-pristine-source
449 (list %boot-logo-patch)))
451 (define-public linux-libre-4.9-source
452 (source-with-patches linux-libre-4.9-pristine-source
453 (list %boot-logo-patch)))
455 (define-public linux-libre-4.4-source
456 (source-with-patches linux-libre-4.4-pristine-source
457 (list %boot-logo-patch)))
464 (define (make-linux-libre-headers version hash-string)
465 (make-linux-libre-headers* version
468 (uri (linux-libre-urls version))
469 (sha256 (base32 hash-string)))))
471 (define (make-linux-libre-headers* version source)
473 (name "linux-libre-headers")
476 (build-system gnu-build-system)
477 (native-inputs `(("perl" ,perl)
478 ,@(if (version>=? version "4.16")
482 ,@(if (version>=? version "5.3")
486 `(#:modules ((guix build gnu-build-system)
490 (modify-phases %standard-phases
494 (let ((arch ,(system->linux-architecture
495 (or (%current-target-system)
497 (defconfig ,(system->defconfig
498 (or (%current-target-system)
499 (%current-system)))))
501 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
502 (invoke "make" defconfig)
503 (invoke "make" "mrproper" "headers_check"))))
505 (lambda* (#:key outputs #:allow-other-keys)
506 (let ((out (assoc-ref outputs "out")))
508 (string-append "INSTALL_HDR_PATH=" out)
511 (mkdir (string-append out "/include/config"))
512 (call-with-output-file
514 "/include/config/kernel.release")
516 (format p "~a-default~%" ,version)))
518 ;; Remove the '.install' and '..install.cmd' files; the
519 ;; latter contains store paths, which pulls in bootstrap
520 ;; binaries in the build environment, and prevents bit
521 ;; reproducibility for the bootstrap binaries.
522 (for-each delete-file (find-files out "\\.install"))
525 #:allowed-references ()
527 (home-page "https://www.gnu.org/software/linux-libre/")
528 (synopsis "GNU Linux-Libre kernel headers")
529 (description "Headers of the Linux-Libre kernel.")
530 (license license:gpl2)))
532 (define-public linux-libre-headers-5.4
533 (make-linux-libre-headers* linux-libre-5.4-version
534 linux-libre-5.4-source))
536 (define-public linux-libre-headers-4.19
537 (make-linux-libre-headers* linux-libre-4.19-version
538 linux-libre-4.19-source))
540 (define-public linux-libre-headers-4.14
541 (make-linux-libre-headers* linux-libre-4.14-version
542 linux-libre-4.14-source))
544 (define-public linux-libre-headers-4.9
545 (make-linux-libre-headers* linux-libre-4.9-version
546 linux-libre-4.9-source))
548 (define-public linux-libre-headers-4.4
549 (make-linux-libre-headers* linux-libre-4.4-version
550 linux-libre-4.4-source))
552 ;; The following package is used in the early bootstrap, and thus must be kept
553 ;; stable and with minimal build requirements.
554 (define-public linux-libre-headers-5.4.20
555 (make-linux-libre-headers "5.4.20"
556 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
558 (define-public linux-libre-headers linux-libre-headers-5.4.20)
562 ;;; Kernel configurations.
565 (define* (kernel-config arch #:key variant)
566 "Return the absolute file name of the Linux-Libre build configuration file
567 for ARCH and optionally VARIANT, or #f if there is no such configuration."
568 (let* ((name (string-append (if variant (string-append variant "-") "")
569 (if (string=? "i386" arch) "i686" arch) ".conf"))
570 (file (string-append "linux-libre/" name)))
571 (search-auxiliary-file file)))
573 (define %default-extra-linux-options
574 `(;; Some very mild hardening.
575 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
576 ;; All kernels should have NAMESPACES options enabled
577 ("CONFIG_NAMESPACES" . #t)
578 ("CONFIG_UTS_NS" . #t)
579 ("CONFIG_IPC_NS" . #t)
580 ("CONFIG_USER_NS" . #t)
581 ("CONFIG_PID_NS" . #t)
582 ("CONFIG_NET_NS" . #t)
583 ;; Modules required for initrd:
584 ("CONFIG_NET_9P" . m)
585 ("CONFIG_NET_9P_VIRTIO" . m)
586 ("CONFIG_VIRTIO_BLK" . m)
587 ("CONFIG_VIRTIO_NET" . m)
588 ("CONFIG_VIRTIO_PCI" . m)
589 ("CONFIG_VIRTIO_BALLOON" . m)
590 ("CONFIG_VIRTIO_MMIO" . m)
591 ("CONFIG_FUSE_FS" . m)
593 ("CONFIG_9P_FS" . m)))
595 (define (config->string options)
596 (string-join (map (match-lambda
598 (string-append option "=m"))
600 (string-append option "=y"))
602 (string-append option "=n")))
608 ;;; Kernel package utilities.
611 (define* (make-linux-libre version hash-string supported-systems
613 ;; A function that takes an arch and a variant.
614 ;; See kernel-config for an example.
616 (configuration-file #f)
617 (defconfig "defconfig")
618 (extra-options %default-extra-linux-options)
619 (patches (list %boot-logo-patch)))
620 (make-linux-libre* version
623 (uri (linux-libre-urls version))
624 (sha256 (base32 hash-string))
627 #:extra-version extra-version
628 #:configuration-file configuration-file
629 #:defconfig defconfig
630 #:extra-options extra-options))
632 (define* (make-linux-libre* version source supported-systems
634 ;; A function that takes an arch and a variant.
635 ;; See kernel-config for an example.
637 (configuration-file #f)
638 (defconfig "defconfig")
639 (extra-options %default-extra-linux-options))
641 (name (if extra-version
642 (string-append "linux-libre-" extra-version)
646 (supported-systems supported-systems)
647 (build-system gnu-build-system)
652 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
656 ;; These are needed to compile the GCC plugins.
661 ,@(match (and configuration-file
663 (system->linux-architecture
664 (or (%current-target-system) (%current-system)))
665 #:variant (version-major+minor version)))
666 (#f ;no config for this platform
669 `(("kconfig" ,config))))))
671 `(#:modules ((guix build gnu-build-system)
678 (modify-phases %standard-phases
679 (add-after 'unpack 'patch-/bin/pwd
681 (substitute* (find-files "." "^Makefile(\\.include)?$")
682 (("/bin/pwd") "pwd"))
685 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
686 ;; Avoid introducing timestamps
687 (setenv "KCONFIG_NOTIMESTAMP" "1")
688 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
690 ;; Set ARCH and CROSS_COMPILE
691 (let ((arch ,(system->linux-architecture
692 (or (%current-target-system)
693 (%current-system)))))
695 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
698 (setenv "CROSS_COMPILE" (string-append target "-"))
699 (format #t "`CROSS_COMPILE' set to `~a'~%"
700 (getenv "CROSS_COMPILE"))))
702 (setenv "EXTRA_VERSION" ,extra-version)
704 (let ((build (assoc-ref %standard-phases 'build))
705 (config (assoc-ref (or native-inputs inputs) "kconfig")))
707 ;; Use a custom kernel configuration file or a default
708 ;; configuration file.
711 (copy-file config ".config")
712 (chmod ".config" #o666))
713 (invoke "make" ,defconfig))
715 ;; Appending works even when the option wasn't in the
716 ;; file. The last one prevails if duplicated.
717 (let ((port (open-file ".config" "a"))
718 (extra-configuration ,(config->string extra-options)))
719 (display extra-configuration port)
722 (invoke "make" "oldconfig"))))
724 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
725 (let* ((out (assoc-ref outputs "out"))
726 (moddir (string-append out "/lib/modules"))
727 (dtbdir (string-append out "/lib/dtbs")))
728 ;; Install kernel image, kernel configuration and link map.
729 (for-each (lambda (file) (install-file file out))
730 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
731 ;; Install device tree files
732 (unless (null? (find-files "." "\\.dtb$"))
734 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
736 ;; Install kernel modules
739 ;; Disable depmod because the Guix system's module directory
740 ;; is an union of potentially multiple packages. It is not
741 ;; possible to use depmod to usefully calculate a dependency
742 ;; graph while building only one of those packages.
744 (string-append "MODULE_DIR=" moddir)
745 (string-append "INSTALL_PATH=" out)
746 (string-append "INSTALL_MOD_PATH=" out)
747 "INSTALL_MOD_STRIP=1"
749 (let* ((versions (filter (lambda (name)
750 (not (string-prefix? "." name)))
752 (version (match versions
754 ;; There are symlinks to the build and source directory,
755 ;; both of which will point to target /tmp/guix-build*
756 ;; and thus not be useful in a profile. Delete the symlinks.
757 (false-if-file-not-found
758 (delete-file (string-append moddir "/" version "/build")))
759 (false-if-file-not-found
760 (delete-file (string-append moddir "/" version "/source"))))
763 (home-page "https://www.gnu.org/software/linux-libre/")
764 (synopsis "100% free redistribution of a cleaned Linux kernel")
766 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
767 It has been modified to remove all non-free binary blobs.")
768 (license license:gpl2)))
772 ;;; Generic kernel packages.
775 (define-public linux-libre-5.4
776 (make-linux-libre* linux-libre-5.4-version
777 linux-libre-5.4-source
778 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
779 #:configuration-file kernel-config))
781 (define-public linux-libre-version linux-libre-5.4-version)
782 (define-public linux-libre-pristine-source linux-libre-5.4-pristine-source)
783 (define-public linux-libre-source linux-libre-5.4-source)
784 (define-public linux-libre linux-libre-5.4)
786 (define-public linux-libre-4.19
787 (make-linux-libre* linux-libre-4.19-version
788 linux-libre-4.19-source
789 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
790 #:configuration-file kernel-config))
792 (define-public linux-libre-4.14
793 (make-linux-libre* linux-libre-4.14-version
794 linux-libre-4.14-source
795 '("x86_64-linux" "i686-linux" "armhf-linux")
796 #:configuration-file kernel-config))
798 (define-public linux-libre-4.9
799 (make-linux-libre* linux-libre-4.9-version
800 linux-libre-4.9-source
801 '("x86_64-linux" "i686-linux")
802 #:configuration-file kernel-config))
804 (define-public linux-libre-4.4
805 (make-linux-libre* linux-libre-4.4-version
806 linux-libre-4.4-source
807 '("x86_64-linux" "i686-linux")
808 #:configuration-file kernel-config
811 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
812 ;; This option was removed upstream in version 4.7.
813 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
814 %default-extra-linux-options)))
818 ;;; Specialized kernel variants.
821 (define-public linux-libre-arm-generic
822 (make-linux-libre* linux-libre-version
825 #:defconfig "multi_v7_defconfig"
826 #:extra-version "arm-generic"))
828 (define-public linux-libre-arm-veyron
829 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
831 (define-public linux-libre-arm-generic-4.19
832 (make-linux-libre* linux-libre-4.19-version
833 linux-libre-4.19-source
835 #:defconfig "multi_v7_defconfig"
836 #:extra-version "arm-generic"))
838 (define-public linux-libre-arm-generic-4.14
839 (make-linux-libre* linux-libre-4.14-version
840 linux-libre-4.14-source
842 #:defconfig "multi_v7_defconfig"
843 #:extra-version "arm-generic"))
845 (define-public linux-libre-arm-omap2plus
846 (make-linux-libre* linux-libre-version
849 #:defconfig "omap2plus_defconfig"
850 #:extra-version "arm-omap2plus"))
852 (define-public linux-libre-arm-omap2plus-4.19
853 (make-linux-libre* linux-libre-4.19-version
854 linux-libre-4.19-source
856 #:defconfig "omap2plus_defconfig"
857 #:extra-version "arm-omap2plus"))
859 (define-public linux-libre-arm-omap2plus-4.14
860 (make-linux-libre* linux-libre-4.14-version
861 linux-libre-4.14-source
863 #:defconfig "omap2plus_defconfig"
864 #:extra-version "arm-omap2plus"))
866 (define-public linux-libre-arm64-generic
867 (make-linux-libre* linux-libre-version
870 #:defconfig "defconfig"
871 #:extra-version "arm64-generic"))
873 (define-public linux-libre-riscv64-generic
874 (make-linux-libre* linux-libre-version
877 #:extra-version "riscv64-generic"))
881 ;;; Linux kernel modules.
884 (define-public acpi-call-linux-module
886 (name "acpi-call-linux-module")
892 (url "https://github.com/teleshoes/acpi_call.git")
894 (file-name (git-file-name name version))
896 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
897 (build-system linux-module-build-system)
899 `(#:tests? #f ; no tests
901 (modify-phases %standard-phases
902 (add-after 'unpack 'fix-for-linux-4.12
904 (substitute* "acpi_call.c"
908 (add-after 'install 'install-documentation
909 (lambda* (#:key outputs #:allow-other-keys)
910 (let* ((out (assoc-ref outputs "out"))
911 (doc (string-append out "/share/doc/" ,name "-" ,version)))
912 (for-each (lambda (file)
913 (let ((target (string-append doc "/" file)))
914 (mkdir-p (dirname target))
915 (copy-recursively file target)))
916 (list "README.md" "examples"))
918 (home-page "https://github.com/teleshoes/acpi_call")
919 (synopsis "Linux kernel module to perform ACPI method calls")
921 "This simple Linux kernel module allows calls from user space to any
922 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
923 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
924 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
925 and @code{ACPI_BUFFER}.
927 It grants direct and undocumented access to your hardware that may cause damage
928 and should be used with caution, especially on untested models.")
929 (license license:gpl3+))) ; see README.md (no licence headers)
931 (define-public rtl8812au-aircrack-ng-linux-module
932 (let ((commit "945d6ed6505c32f0993b1dba576388e92e78101b")
935 (name "rtl8812au-aircrack-ng-linux-module")
936 (version (git-version "5.6.4.2" revision commit))
941 (url "https://github.com/aircrack-ng/rtl8812au.git")
943 (file-name (git-file-name name version))
945 (base32 "1pjws7qb5l4z9k80vgz4zdxmqhbwxjjrmkpf0hijf821byyddvi7"))
946 (modules '((guix build utils)))
949 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
950 ;; and other unnecessary unlicenced things.
951 (for-each delete-file-recursively (list "android"
955 (build-system linux-module-build-system)
958 (modify-phases %standard-phases
960 (lambda* (#:key inputs make-flags #:allow-other-keys)
962 (string-append "KSRC="
963 (assoc-ref inputs "linux-module-builder")
964 "/lib/modules/build")
965 (or make-flags '())))))
966 #:tests? #f)) ; no test suite
967 (supported-systems '("x86_64-linux" "i686-linux"))
968 (home-page "https://github.com/aircrack-ng/rtl8812au")
969 (synopsis "Linux driver for Realtek USB wireless network adapters")
971 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
972 network adapters, modified by the aircrack-ng project to support monitor mode
973 and frame injection. It provides a @code{88XXau} kernel module that supports
974 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
975 (license license:gpl2+))))
977 (define-public vhba-module
984 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
988 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
989 (build-system linux-module-build-system)
993 (home-page "https://cdemu.sourceforge.io/")
994 (synopsis "Kernel module that emulates SCSI devices")
995 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
996 between the CDemu userspace daemon and linux kernel.")
997 (license license:gpl2+)))
999 (define-public ddcci-driver-linux
1001 (name "ddcci-driver-linux")
1008 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1009 (commit (string-append "v" version))))
1010 (file-name (git-file-name name version))
1013 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1014 (build-system linux-module-build-system)
1016 `(#:tests? #f ; no tests
1018 (modify-phases %standard-phases
1023 (with-directory-excursion module
1024 (apply (assoc-ref %standard-phases 'build) args)))
1025 '("ddcci" "ddcci-backlight"))
1031 (with-directory-excursion module
1032 (apply (assoc-ref %standard-phases 'install) args)))
1033 '("ddcci" "ddcci-backlight"))
1035 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1036 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1037 (description "This package provides two Linux kernel drivers, ddcci and
1038 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1039 interface. The ddcci module creates a character device for each DDC/CI
1040 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1041 module allows the control of the backlight level or luminance property when
1042 supported under @file{/sys/class/backlight/}.")
1043 (license license:gpl2+)))
1047 ;;; Pluggable authentication modules (PAM).
1050 (define-public linux-pam
1058 "https://github.com/linux-pam/linux-pam/releases/download/v"
1059 version "/Linux-PAM-" version ".tar.xz"))
1062 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1063 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1065 (build-system gnu-build-system)
1069 ;; TODO: optional dependencies
1070 ;; ("libxcrypt" ,libxcrypt)
1071 ;; ("cracklib" ,cracklib)
1074 `(;; Most users, such as `shadow', expect the headers to be under
1076 #:configure-flags (list (string-append "--includedir="
1077 (assoc-ref %outputs "out")
1078 "/include/security")
1080 ;; XXX: <rpc/rpc.h> is missing from glibc when
1081 ;; cross-compiling, so we have to disable NIS
1082 ;; support altogether.
1083 ,@(if (%current-target-system)
1087 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1090 (home-page "http://www.linux-pam.org/")
1091 (synopsis "Pluggable authentication modules for Linux")
1093 "A *Free* project to implement OSF's RFC 86.0.
1094 Pluggable authentication modules are small shared object files that can
1095 be used through the PAM API to perform tasks, like authenticating a user
1096 at login. Local and dynamic reconfiguration are its key features.")
1097 (license license:bsd-3)))
1099 (define-public linux-pam-1.2
1107 "http://www.linux-pam.org/library/"
1108 "Linux-PAM-" version ".tar.bz2"))
1111 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1112 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1119 (define-public psmisc
1126 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1129 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1130 (build-system gnu-build-system)
1132 `(,@(if (%current-target-system)
1135 "ac_cv_func_malloc_0_nonnull=yes"
1136 "ac_cv_func_realloc_0_nonnull=yes"))
1138 (inputs `(("ncurses" ,ncurses)))
1139 (home-page "https://gitlab.com/psmisc/psmisc")
1140 (synopsis "Small utilities that use the proc file system")
1142 "This PSmisc package is a set of some small useful utilities that
1143 use the proc file system. We're not about changing the world, but
1144 providing the system administrator with some help in common tasks.")
1145 (license license:gpl2+)))
1147 (define-public util-linux
1153 (uri (string-append "mirror://kernel.org/linux/utils/"
1154 "util-linux/v" (version-major+minor version) "/"
1155 "util-linux-" version ".tar.xz"))
1158 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1159 (patches (search-patches "util-linux-tests.patch"))
1160 (modules '((guix build utils)))
1162 ;; We take 'nologin' from Shadow, the 'logger' program from
1163 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1165 (substitute* "configure"
1166 (("build_nologin=yes") "build_nologin=no")
1167 (("build_logger=yes") "build_logger=no")
1168 (("build_kill=yes") "build_kill=no"))
1170 (build-system gnu-build-system)
1171 (outputs '("out" ;6.4 MiB executables and documentation
1172 "lib" ;8.8 MiB shared libraries, headers and locales
1173 "static")) ;2.9 MiB static .a libraries
1175 `(#:configure-flags (list "--disable-use-tty-group"
1176 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1177 ;; Don't try to chown root:root mount and umount
1178 "--disable-makeinstall-chown"
1179 "--localstatedir=/var"
1180 (string-append "--localedir="
1181 (assoc-ref %outputs "lib")
1183 ;; Install completions where our
1184 ;; bash-completion package expects them.
1185 (string-append "--with-bashcompletiondir="
1186 (assoc-ref %outputs "out")
1187 "/etc/bash_completion.d"))
1188 #:phases (modify-phases %standard-phases
1189 (add-before 'configure 'patch-build-scripts
1190 (lambda* (#:key outputs #:allow-other-keys)
1191 (substitute* "configure"
1192 ;; The build system assumes that we want to install
1193 ;; libraries below $exec_prefix when $libdir does not
1194 ;; match any of the "usual" locations. Fix that.
1195 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1196 "usrlib_execdir=$libdir"))
1198 (add-before 'build 'set-umount-file-name
1199 (lambda* (#:key outputs #:allow-other-keys)
1200 ;; Tell 'eject' the right file name of 'umount'.
1201 (let ((out (assoc-ref outputs "out")))
1202 (substitute* "sys-utils/eject.c"
1203 (("\"/bin/umount\"")
1204 (string-append "\"" out "/bin/umount\"")))
1206 (add-before 'check 'pre-check
1207 (lambda* (#:key inputs outputs #:allow-other-keys)
1208 (let ((out (assoc-ref outputs "out"))
1209 (net (assoc-ref inputs "net-base")))
1210 ;; Change the test to refer to the right file.
1211 (substitute* "tests/ts/misc/mcookie"
1213 (string-append net "/etc/services")))
1215 ;; The C.UTF-8 locale does not exist in our libc.
1216 (substitute* "tests/ts/column/invalid-multibyte"
1217 (("C\\.UTF-8") "en_US.utf8"))
1219 (add-after 'install 'move-static-libraries
1220 (lambda* (#:key outputs #:allow-other-keys)
1221 (let ((lib (assoc-ref outputs "lib"))
1222 (static (assoc-ref outputs "static")))
1224 ;; Move static libraries to the "static" output.
1225 (mkdir-p (string-append static "/lib"))
1226 (with-directory-excursion lib
1227 (for-each (lambda (file)
1229 (string-append static "/"
1231 (find-files "lib" "\\.a$"))
1233 ;; Remove references to the static library from the '.la'
1234 ;; files so that Libtool does the right thing when both
1235 ;; the shared and static library is available.
1236 (substitute* (find-files "lib" "\\.la$")
1237 (("old_library=.*") "old_library=''\n")))
1240 (add-after 'install 'adjust-pkg-config-files
1241 (lambda* (#:key outputs #:allow-other-keys)
1242 (let ((lib (assoc-ref outputs "lib")))
1243 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1244 ;; the pkg-config files to avoid a cyclic reference on "out".
1245 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1247 (("^(exec_)?prefix=.*") "")))
1249 (inputs `(("zlib" ,zlib)
1250 ("ncurses" ,ncurses)
1252 ;; XXX: This is so that the 'pre-check' phase can find it.
1253 ,@(if (%current-target-system)
1254 `(("net-base" ,net-base))
1258 ("net-base" ,net-base))) ;for tests
1259 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1260 (synopsis "Collection of utilities for the Linux kernel")
1261 (description "Util-linux is a diverse collection of Linux kernel
1262 utilities. It provides dmesg and includes tools for working with file systems,
1263 block devices, UUIDs, TTYs, and many other tools.")
1265 ;; Note that util-linux doesn't use the same license for all the
1266 ;; code. GPLv2+ is the default license for a code without an
1267 ;; explicitly defined license.
1268 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1269 license:bsd-4 license:public-domain))))
1271 ;; util-linux optionally supports udev, which allows lsblk to read file system
1272 ;; metadata without special privileges. Add it as a separate package to avoid
1273 ;; a circular dependency, and to keep the size small.
1274 (define-public util-linux+udev
1277 (name "util-linux-with-udev")
1280 ,@(package-inputs util-linux)))))
1282 (define-public ddate
1288 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1290 (file-name (string-append name "-" version ".tar.gz"))
1292 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1293 (build-system cmake-build-system)
1294 (arguments '(#:tests? #f))
1295 (home-page "https://github.com/bo0ts/ddate")
1296 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1298 "ddate displays the Discordian date and holidays of a given date.
1299 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1300 by Robert Shea and Robert Anton Wilson.")
1301 (license license:public-domain)))
1303 (define-public fbset
1310 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1313 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1314 (build-system gnu-build-system)
1316 '(#:modules ((guix build gnu-build-system)
1320 (modify-phases %standard-phases
1321 (delete 'configure) ; no configure script
1322 (add-before 'install 'pre-install
1323 (lambda* (#:key outputs #:allow-other-keys)
1324 (let ((out (assoc-ref outputs "out")))
1325 (substitute* "Makefile"
1326 (("mknod ") "true ")
1327 ;; The Makefile doesn't honour PREFIX or similar.
1330 (with-directory-excursion out
1331 (for-each mkdir-p (list "sbin"
1335 (add-after 'install 'install-fb.modes
1336 (lambda* (#:key outputs #:allow-other-keys)
1337 (let* ((out (assoc-ref outputs "out"))
1338 (etc (string-append out "/etc")))
1339 (for-each (cut install-file <> etc)
1340 (find-files "etc" "^fb\\.modes"))
1341 (symlink "fb.modes.ATI"
1342 (string-append etc "/fb.modes"))
1344 ;; Parallel building races to create modes.tab.c.
1345 #:parallel-build? #f
1346 #:tests? #f)) ; no test suite
1350 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1351 (synopsis "Show and modify Linux frame buffer settings")
1353 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1354 different kinds of graphic displays. The @command{fbset} utility can query and
1355 change various device settings such as depth, virtual resolution, and timing
1357 (license license:gpl2)))
1359 (define-public procps
1365 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1366 "procps-ng-" version ".tar.xz"))
1369 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1370 (build-system gnu-build-system)
1372 `(#:modules ((guix build utils)
1373 (guix build gnu-build-system)
1376 ,@(if (%current-target-system)
1379 "ac_cv_func_malloc_0_nonnull=yes"
1380 "ac_cv_func_realloc_0_nonnull=yes"))
1383 (modify-phases %standard-phases
1385 'install 'post-install
1386 ;; Remove commands and man pages redudant with
1388 (lambda* (#:key outputs #:allow-other-keys)
1389 (let* ((out (assoc-ref outputs "out"))
1390 (dup (append-map (cut find-files out <>)
1391 '("^kill" "^uptime"))))
1392 (for-each delete-file dup)
1394 (inputs `(("ncurses" ,ncurses)))
1395 (home-page "https://gitlab.com/procps-ng/procps/")
1396 (synopsis "Utilities that give information about processes")
1398 "Procps is the package that has a bunch of small useful utilities
1399 that give information about processes using the Linux /proc file system.
1400 The package includes the programs ps, top, vmstat, w, kill, free,
1401 slabtop, and skill.")
1402 (license license:gpl2)))
1404 (define-public usbutils
1411 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1412 "usbutils-" version ".tar.xz"))
1414 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1415 (build-system gnu-build-system)
1416 (outputs (list "out" "python"))
1419 (modify-phases %standard-phases
1420 (add-before 'bootstrap 'patch-bootstrap-scripts
1422 (substitute* "usbhid-dump/bootstrap"
1423 (("/bin/bash") (which "bash")))
1425 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1426 (substitute* "autogen.sh"
1427 (("^\\./configure.*") ""))
1429 (add-after 'install 'separate-python-output
1430 ;; Separating one Python script shaves more than 106 MiB from :out.
1431 (lambda* (#:key outputs #:allow-other-keys)
1432 (let ((out (assoc-ref outputs "out"))
1433 (out:python (assoc-ref outputs "python")))
1434 (for-each (lambda (file)
1435 (let ((old (string-append out "/" file))
1436 (new (string-append out:python "/" file)))
1437 (mkdir-p (dirname new))
1438 (rename-file old new)))
1439 (list "bin/lsusb.py"))
1444 ("python" ,python)))
1446 `(("autoconf" ,autoconf)
1447 ("automake" ,automake)
1448 ("libtool" ,libtool)
1449 ("pkg-config" ,pkg-config)))
1450 (home-page "http://www.linux-usb.org/")
1452 "Tools for working with USB devices, such as lsusb")
1454 "Tools for working with USB devices, such as lsusb.")
1455 (license license:gpl2+)))
1457 (define-public e2fsprogs
1464 "mirror://kernel.org/linux/kernel/people/tytso/"
1465 name "/v" version "/"
1466 name "-" version ".tar.xz"))
1469 "1pmf8inp736l587rqq7qsd8bv0mmg5cwrivxg5p5awqgv70crypr"))))
1470 (build-system gnu-build-system)
1471 (inputs `(("util-linux" ,util-linux "lib")))
1472 (native-inputs `(("pkg-config" ,pkg-config)
1473 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1477 ("procps" ,procps)))
1479 '(;; util-linux is the preferred source for some of the libraries and
1480 ;; commands, so disable them (see, e.g.,
1481 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1482 #:configure-flags (list "--disable-libblkid"
1483 "--disable-libuuid" "--disable-uuidd"
1486 ;; Use symlinks instead of hard links for
1487 ;; 'fsck.extN' etc. This makes the resulting nar
1488 ;; smaller and is preserved across copies.
1489 "--enable-symlink-install"
1491 (string-append "LDFLAGS=-Wl,-rpath="
1492 (assoc-ref %outputs "out")
1495 ;; Install libext2fs et al.
1496 "--enable-elf-shlibs")
1499 (modify-phases %standard-phases
1500 (add-before 'configure 'patch-shells
1502 (substitute* "configure"
1503 (("/bin/sh (.*)parse-types.sh" _ dir)
1504 (string-append (which "sh") " " dir
1506 (substitute* "MCONFIG.in"
1507 (("INSTALL_SYMLINK = /bin/sh")
1508 "INSTALL_SYMLINK = sh"))
1509 (substitute* (find-files "." "^Makefile.in$")
1511 (string-append "#!" (which "sh"))))
1513 (add-after 'install 'install-libs
1514 (lambda* (#:key outputs #:allow-other-keys)
1515 (let* ((out (assoc-ref outputs "out"))
1516 (lib (string-append out "/lib")))
1517 (invoke "make" "install-libs")
1519 ;; Make the .a writable so that 'strip' works.
1520 ;; Failing to do that, due to debug symbols, we
1521 ;; retain a reference to the final
1522 ;; linux-libre-headers, which refer to the
1523 ;; bootstrap binaries.
1524 (let ((archives (find-files lib "\\.a$")))
1525 (for-each (lambda (file)
1529 (home-page "http://e2fsprogs.sourceforge.net/")
1530 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1532 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1533 (license (list license:gpl2 ;programs
1534 license:lgpl2.0 ;libext2fs
1535 license:x11)))) ;libuuid
1537 (define e2fsprogs/static
1539 (package (inherit e2fsprogs)
1541 ;; Do not build shared libraries.
1542 (substitute-keyword-arguments (package-arguments e2fsprogs)
1543 ((#:configure-flags _)
1544 '(list "--disable-blkid"))
1548 (define-public e2fsck/static
1550 (name "e2fsck-static")
1551 (version (package-version e2fsprogs))
1552 (build-system trivial-build-system)
1555 `(("e2fsprogs" ,e2fsprogs/static)))
1557 `(#:modules ((guix build utils))
1560 (use-modules (guix build utils)
1564 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1566 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1568 (with-directory-excursion bin
1569 (copy-file e2fsck "e2fsck")
1570 (remove-store-references "e2fsck")
1571 (chmod "e2fsck" #o555))
1573 (home-page (package-home-page e2fsprogs))
1574 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1575 (description "This package provides statically-linked e2fsck command taken
1576 from the e2fsprogs package. It is meant to be used in initrds.")
1577 (license (package-license e2fsprogs))))
1579 (define-public extundelete
1581 (name "extundelete")
1586 (uri (string-append "mirror://sourceforge/extundelete/"
1587 "extundelete/" version "/extundelete-"
1588 version ".tar.bz2"))
1591 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1592 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1593 (build-system gnu-build-system)
1594 (inputs `(("e2fsprogs" ,e2fsprogs)))
1595 (home-page "http://extundelete.sourceforge.net/")
1596 (synopsis "Recover deleted files from ext2/3/4 partitions")
1598 "Extundelete is a set of tools that can recover deleted files from an
1599 ext3 or ext4 partition.")
1600 (license license:gpl2)))
1602 (define-public zerofree
1606 (home-page "https://frippery.org/uml/")
1609 (uri (string-append home-page name "-" version
1613 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1614 (build-system gnu-build-system)
1617 (modify-phases %standard-phases
1618 (delete 'configure) ; no configure script
1620 ;; The Makefile lacks an ‘install’ target.
1621 (lambda* (#:key outputs #:allow-other-keys)
1622 (let* ((out (assoc-ref outputs "out"))
1623 (bin (string-append out "/bin")))
1624 (chmod "zerofree" #o555)
1625 (install-file "zerofree" bin)
1627 #:tests? #f)) ; no tests
1628 (inputs `(("libext2fs" ,e2fsprogs)))
1629 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1631 "Zerofree finds the unallocated blocks with non-zero value content in an
1632 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1633 This is a simple way to make disk images more compressible.
1634 Zerofree requires the file system to be unmounted or mounted read-only.")
1635 (license license:gpl2)))
1637 (define-public strace
1641 (home-page "https://strace.io")
1644 (uri (string-append home-page "/files/" version
1645 "/strace-" version ".tar.xz"))
1648 "1zrhpzjlgfwfl8dd53llswmmharm5rbi0zch7lln5sjris69an4z"))))
1649 (build-system gnu-build-system)
1652 (modify-phases %standard-phases
1653 (add-after 'unpack 'patch-/bin/sh
1655 (substitute* "strace.c"
1656 (("/bin/sh") (which "sh")))
1658 ;; Don't fail if the architecture doesn't support different personalities.
1659 #:configure-flags '("--enable-mpers=check")
1660 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1661 #:parallel-tests? #f)) ; undeterministic failures
1662 (native-inputs `(("perl" ,perl)))
1663 (synopsis "System call tracer for Linux")
1665 "strace is a system call tracer, i.e. a debugging tool which prints out a
1666 trace of all the system calls made by a another process/program.")
1667 (license license:lgpl2.1+)))
1669 (define-public ltrace
1675 (uri (string-append "http://www.ltrace.org/ltrace_" version
1679 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1680 (build-system gnu-build-system)
1681 (inputs `(("libelf" ,libelf)))
1683 ;; Compilation uses -Werror by default, but it fails.
1684 '(#:configure-flags '("--disable-werror")))
1685 (home-page "https://www.ltrace.org/")
1686 (synopsis "Library call tracer for Linux")
1688 "ltrace intercepts and records dynamic library calls which are called by
1689 an executed process and the signals received by that process. It can also
1690 intercept and print the system calls executed by the program.")
1691 (license license:gpl2+)))
1693 (define-public alsa-lib
1700 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1701 version ".tar.bz2"))
1704 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
1705 (build-system gnu-build-system)
1707 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
1708 (assoc-ref %outputs "out")
1710 (home-page "https://www.alsa-project.org/")
1711 (synopsis "The Advanced Linux Sound Architecture libraries")
1713 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1714 MIDI functionality to the Linux-based operating system.")
1715 (license license:lgpl2.1+)))
1717 (define-public alsa-utils
1723 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1724 name "-" version ".tar.bz2"))
1727 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
1728 (build-system gnu-build-system)
1730 ;; XXX: Disable man page creation until we have DocBook.
1731 '(#:configure-flags (list "--disable-xmlto"
1733 ;; The udev rule is responsible for restoring
1735 (string-append "--with-udev-rules-dir="
1736 (assoc-ref %outputs "out")
1737 "/lib/udev/rules.d"))
1739 (modify-phases %standard-phases
1740 (add-before 'check 'disable-broken-test
1742 ;; XXX: The 1.1.8 release tarball is missing a header that's
1743 ;; required for this test to work. Fixed in 1.1.9.
1744 (substitute* "axfer/test/Makefile"
1745 ((".*container-test.*") ""))
1748 'install 'pre-install
1750 ;; Don't try to mkdir /var/lib/alsa.
1751 (substitute* "Makefile"
1752 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1756 `(("gettext" ,gettext-minimal)))
1758 `(("libsamplerate" ,libsamplerate)
1759 ("ncurses" ,ncurses)
1760 ("alsa-lib" ,alsa-lib)
1762 (home-page "http://www.alsa-project.org/")
1763 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1765 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1766 MIDI functionality to the Linux-based operating system.")
1768 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1770 (license license:gpl2)))
1772 (define-public alsa-plugins
1774 (name "alsa-plugins")
1778 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1779 name "-" version ".tar.bz2"))
1782 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
1783 (build-system gnu-build-system)
1784 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1785 ;; be split, there are references to both in files.
1786 ;; TODO: Remove OSS related plugins, they add support to run native
1787 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1789 (outputs '("out" "pulseaudio" "jack"))
1791 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1792 ;; for /etc/alsa. On Guix System plugins are loaded from
1793 ;; the ALSA service, and other distributions likely
1794 ;; won't use these files.
1795 "--with-alsalconfdir=/tmp/noop")
1797 (modify-phases %standard-phases
1798 (add-after 'install 'split
1799 (lambda* (#:key inputs outputs #:allow-other-keys)
1800 ;; Distribute the binaries to the various outputs.
1801 (let* ((out (assoc-ref outputs "out"))
1802 (jack (assoc-ref outputs "jack"))
1803 (jacklib (string-append jack "/lib/alsa-lib"))
1804 (pua (assoc-ref outputs "pulseaudio"))
1805 (pualib (string-append pua "/lib/alsa-lib")))
1808 (for-each (lambda (file)
1809 (rename-file file (string-append jacklib "/" (basename file))))
1810 (find-files out ".*jack\\.(la|so)"))
1813 (for-each (lambda (file)
1814 (rename-file file (string-append pualib "/" (basename file))))
1815 (find-files out ".*pulse\\.(la|so)"))
1818 `(("alsa-lib" ,alsa-lib)
1820 ("speex" ,speex) ; libspeexdsp resampling plugin
1821 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1822 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1823 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1825 `(("pkg-config" ,pkg-config)))
1826 (home-page "http://www.alsa-project.org/")
1827 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1829 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1830 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1831 by providing additional plugins which include: upmixing, downmixing, jackd and
1832 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1833 external rate conversion.")
1834 (license (list license:gpl2+
1835 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1836 license:lgpl2.1+))))
1838 (define-public iptables
1845 "mirror://netfilter.org/iptables/iptables-"
1846 version ".tar.bz2"))
1849 "0z0mgs1ghvn3slc868mgbf2g26njgrzcy5ggyb5w4i55j1a3lflr"))))
1850 (build-system gnu-build-system)
1852 `(("pkg-config" ,pkg-config)
1856 `(("libmnl" ,libmnl)
1857 ("libnftnl" ,libnftnl)))
1859 '(#:tests? #f ; no test suite
1860 #:configure-flags ; add $libdir to the RUNPATH of executables
1861 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1862 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1863 (synopsis "Programs to configure Linux IP packet filtering rules")
1865 "@command{iptables} is the user-space command line program used to
1866 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1867 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1869 This package also includes @command{ip6tables}, which is used to configure the
1872 Both commands are targeted at system administrators.")
1873 (license license:gpl2+)))
1875 (define-public lsscsi
1882 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
1885 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
1886 (build-system gnu-build-system)
1887 (synopsis "Lists information about SCSI or NVMe devices in Linux")
1888 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
1890 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
1891 also list NVMe namespaces or controllers and show the relationship between a
1892 device's primary node name, its SCSI generic (sg) node name and its kernel
1894 (license license:gpl2)))
1896 (define-public ebtables
1903 "mirror://netfilter.org/ebtables/ebtables-"
1907 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
1908 (build-system gnu-build-system)
1911 ("iptables" ,iptables)))
1912 (synopsis "Ethernet bridge frame table administration")
1913 (home-page "https://ebtables.netfilter.org/")
1915 "ebtables is an application program used to set up and maintain the
1916 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1917 analogous to the iptables application, but less complicated, due to the fact
1918 that the Ethernet protocol is much simpler than the IP protocol.")
1919 (license license:gpl2+)))
1921 (define-public iproute
1928 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1932 "0ywg70f98wgfai35jl47xzpjp45a6n7crja4vc8ql85cbi1l7ids"))))
1933 (build-system gnu-build-system)
1935 `( ;; There is a test suite, but it wants network namespaces and sudo.
1937 #:make-flags (let ((out (assoc-ref %outputs "out")))
1939 (string-append "BASH_COMPDIR=" out
1940 "/etc/bash_completion.d")
1941 (string-append "LIBDIR=" out "/lib")
1942 (string-append "HDRDIR=" out "/include")
1943 (string-append "SBINDIR=" out "/sbin")
1944 (string-append "CONFDIR=" out "/etc")
1945 (string-append "DOCDIR=" out "/share/doc/"
1947 (string-append "MANDIR=" out "/share/man")))
1948 #:phases (modify-phases %standard-phases
1949 (add-before 'install 'pre-install
1951 ;; Don't attempt to create /var/lib/arpd.
1952 (substitute* "Makefile"
1953 (("^.*ARPDDIR.*$") ""))
1957 ("iptables" ,iptables)
1958 ("libmnl" ,libmnl)))
1962 ("pkg-config" ,pkg-config)))
1964 ;; ("libmnl" ,libmnl)
1965 ;; ("util-linux" ,util-linux)
1967 "https://wiki.linuxfoundation.org/networking/iproute2")
1969 "Utilities for controlling TCP/IP networking and traffic in Linux")
1971 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1972 and traffic with the Linux kernel. The most important of these are
1973 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1976 Most network configuration manuals still refer to ifconfig and route as the
1977 primary network configuration tools, but ifconfig is known to behave
1978 inadequately in modern network environments, and both should be deprecated.")
1979 (license license:gpl2+)))
1981 (define-public net-tools
1982 ;; XXX: This package is basically unmaintained, but it provides a few
1983 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1985 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1989 (version (string-append "1.60-" revision "." (string-take commit 7)))
1992 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1993 "n/ne/net-tools/code.git/net-tools-code-"
1995 (file-name (string-append name "-" version ".zip"))
1998 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1999 (home-page "http://net-tools.sourceforge.net/")
2000 (build-system gnu-build-system)
2002 '(#:modules ((guix build gnu-build-system)
2007 (modify-phases %standard-phases
2009 (lambda* (#:key outputs #:allow-other-keys)
2010 (let ((out (assoc-ref outputs "out")))
2011 (mkdir-p (string-append out "/bin"))
2012 (mkdir-p (string-append out "/sbin"))
2014 ;; Pretend we have everything...
2015 (system "yes | make config")
2017 ;; ... except for the things we don't have.
2018 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2019 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2020 ;; that have been removed.
2021 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2022 ;; think about adding them later.
2023 (substitute* '("config.make" "config.h")
2024 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2027 (add-after 'install 'remove-redundant-commands
2028 (lambda* (#:key outputs #:allow-other-keys)
2029 ;; Remove commands and man pages redundant with Inetutils.
2030 (let* ((out (assoc-ref outputs "out"))
2031 (dup (append-map (cut find-files out <>)
2033 "^(yp|nis|dns)?domainname"))))
2034 (for-each delete-file dup)
2036 ;; Binaries that depend on libnet-tools.a don't declare that
2037 ;; dependency, making it parallel-unsafe.
2038 #:parallel-build? #f
2040 #:tests? #f ; no test suite
2041 #:make-flags (let ((out (assoc-ref %outputs "out")))
2043 (string-append "BASEDIR=" out)
2044 (string-append "INSTALLNLSDIR=" out "/share/locale")
2045 (string-append "mandir=/share/man")))))
2046 (native-inputs `(("gettext" ,gettext-minimal)
2048 (supported-systems (delete "i586-gnu" %supported-systems))
2049 (synopsis "Tools for controlling the network subsystem in Linux")
2051 "This package includes the important tools for controlling the network
2052 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2053 route. Additionally, this package contains utilities relating to particular
2054 network hardware types (plipconfig, slattach) and advanced aspects of IP
2055 configuration (iptunnel, ipmaddr).")
2056 (license license:gpl2+))))
2058 (define-public libcap
2065 "mirror://kernel.org/linux/libs/security/linux-privs/"
2066 "libcap2/libcap-" version ".tar.xz"))
2069 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2070 (build-system gnu-build-system)
2071 (arguments '(#:phases
2072 (modify-phases %standard-phases
2074 ;; Add $libdir to the RUNPATH of executables.
2076 (substitute* "Make.Rules"
2078 (string-append "LDFLAGS := -Wl,-rpath="
2081 #:test-target "test"
2082 #:make-flags (list "lib=lib"
2083 (string-append "prefix="
2084 (assoc-ref %outputs "out"))
2085 "RAISE_SETFCAP=no")))
2086 (native-inputs `(("perl" ,perl)))
2087 (supported-systems (delete "i586-gnu" %supported-systems))
2088 (home-page "https://sites.google.com/site/fullycapable/")
2089 (synopsis "Library for working with POSIX capabilities")
2091 "Libcap2 provides a programming interface to POSIX capabilities on
2092 Linux-based operating systems.")
2094 ;; License is BSD-3 or GPLv2, at the user's choice.
2095 (license license:gpl2)))
2097 (define-public bridge-utils
2099 (name "bridge-utils")
2104 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2105 "bridge-utils-" version ".tar.xz"))
2107 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2108 (build-system gnu-build-system)
2110 ;; The tarball lacks all the generated files.
2111 (native-inputs `(("autoconf" ,autoconf)
2112 ("automake" ,automake)))
2115 (modify-phases %standard-phases
2116 (add-before 'bootstrap 'patch-stuff
2118 ;; Fix "field ‘ip6’ has incomplete type" errors.
2119 (substitute* "libbridge/libbridge.h"
2120 (("#include <linux/if_bridge.h>")
2121 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2123 ;; Ensure that the entire build fails if one of the
2124 ;; sub-Makefiles fails.
2125 (substitute* "Makefile.in"
2126 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2127 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2130 #:tests? #f)) ; no 'check' target
2132 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2133 (synopsis "Manipulate Ethernet bridges")
2135 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2136 to connect two Ethernet segments together in a protocol independent way.
2137 Packets are forwarded based on Ethernet address, rather than IP address (like
2138 a router). Since forwarding is done at Layer 2, all protocols can go
2139 transparently through a bridge.")
2140 (license license:gpl2+)))
2142 (define-public libnl
2149 "https://github.com/thom311/libnl/releases/download/"
2150 "libnl" (string-join (string-split version #\.) "_")
2151 "/libnl-" version ".tar.gz"))
2154 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2155 (build-system gnu-build-system)
2159 ("pkg-config" ,pkg-config)
2165 "https://github.com/thom311/libnl/releases/download/libnl"
2166 (string-join (string-split version #\.) "_")
2167 "/libnl-doc-" version ".tar.gz"))
2169 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2170 (outputs `("out" "doc"))
2173 (modify-phases %standard-phases
2174 (add-after 'install 'install-doc
2175 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2176 (let ((dest (string-append (assoc-ref outputs "doc")
2177 "/share/doc/libnl")))
2179 (invoke "tar" "xf" (assoc-ref
2180 (or native-inputs inputs)
2182 "--strip-components=1" "-C" dest)))))))
2183 (home-page "https://www.infradead.org/~tgr/libnl/")
2184 (synopsis "NetLink protocol library suite")
2186 "The libnl suite is a collection of libraries providing APIs to netlink
2187 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2188 between the kernel and user space processes. It was designed to be a more
2189 flexible successor to ioctl to provide mainly networking related kernel
2190 configuration and monitoring interfaces.")
2192 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2193 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2194 (license license:gpl2)))
2196 ;; libnl python extensions used to be outputs of libnl. However, as
2197 ;; cross-compiling python extensions is currently broken, create separate
2198 ;; packages for libnl python extensions.
2199 (define (libnl-python-package python)
2200 (let ((name (string-append "libnl-" python)))
2205 ((string=? python "python2")
2206 `(("python-2" ,python-2)))
2207 ((string=? python "python3")
2208 `(("python-3" ,python-3))))))
2209 (propagated-inputs `(("libnl" ,libnl)))
2212 `(#:modules ((guix build gnu-build-system)
2216 (modify-phases %standard-phases
2218 (lambda* (#:key inputs outputs #:allow-other-keys)
2219 (define (python-inst python)
2220 (invoke python "setup.py" "build")
2221 (invoke python "setup.py" "install"
2222 (string-append "--prefix="
2223 (assoc-ref %outputs "out")))
2224 (invoke python "setup.py" "clean"))
2225 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2226 (assoc-ref inputs "libnl")))
2227 (with-directory-excursion "./python" (python-inst ,python))
2230 (define-public libnl-python2 (libnl-python-package "python2"))
2231 (define-public libnl-python3 (libnl-python-package "python3"))
2240 "mirror://kernel.org/software/network/iw/iw-"
2244 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2245 (build-system gnu-build-system)
2246 (native-inputs `(("pkg-config" ,pkg-config)))
2247 (inputs `(("libnl" ,libnl)))
2250 (let* ((target ,(%current-target-system))
2251 (gcc (if target (string-append target "-gcc") "gcc"))
2252 (pkg-config (if target
2253 (string-append target "-pkg-config")
2256 (string-append "CC=" gcc)
2257 (string-append "PKG_CONFIG="
2258 (assoc-ref %build-inputs "pkg-config")
2260 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2261 #:phases (modify-phases %standard-phases (delete 'configure))))
2262 (home-page "https://wireless.wiki.kernel.org/")
2263 (synopsis "Tool for configuring wireless devices")
2265 "iw is a new nl80211 based CLI configuration utility for wireless
2266 devices. It replaces @code{iwconfig}, which is deprecated.")
2267 (license license:isc)))
2269 (define-public powertop
2276 (uri (string-append "https://01.org/sites/default/files/downloads/"
2277 "powertop-v" version "-1-g7ef7f79.tar_0.gz"))
2279 (base32 "0kynypj5cydfbma0ssblq1k4m1arixc1s2vf0ybv8y2gg09wjs5f"))))
2280 (build-system gnu-build-system)
2283 (modify-phases %standard-phases
2284 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2285 ;; allow calibrating the network interface in Guix System.
2286 (add-after 'unpack 'patch-absolute-file-names
2287 (lambda* (#:key inputs #:allow-other-keys)
2288 (let ((kmod (assoc-ref inputs "kmod")))
2289 (substitute* (find-files "src" "\\.cpp$")
2290 ;; Give the right 'modprobe' file name so that essential
2291 ;; modules such as msr.ko can be loaded.
2292 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2293 ;; These programs are only needed to calibrate, so using
2294 ;; relative file names avoids adding extra inputs. When they
2295 ;; are missing powertop gracefully handles it.
2296 (("/usr/bin/hcitool") "hcitool")
2297 (("/usr/bin/xset") "xset")
2298 (("/usr/sbin/hciconfig") "hciconfig"))
2303 ("ncurses" ,ncurses)
2304 ("pciutils" ,pciutils)
2307 `(("pkg-config" ,pkg-config)))
2308 (home-page "https://01.org/powertop/")
2309 (synopsis "Analyze power consumption on Intel-based laptops")
2311 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2312 power management. In addition to being a diagnostic tool, PowerTOP also has
2313 an interactive mode where the user can experiment various power management
2314 settings for cases where the operating system has not enabled these
2316 (license license:gpl2)))
2318 (define-public aumix
2325 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2326 version ".tar.bz2"))
2329 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2330 (build-system gnu-build-system)
2331 (inputs `(("ncurses" ,ncurses)))
2332 (home-page "http://www.jpj.net/~trevor/aumix.html")
2333 (synopsis "Audio mixer for X and the console")
2335 "Aumix adjusts an audio mixer from X, the console, a terminal,
2336 the command line or a script.")
2337 (license license:gpl2+)))
2339 (define-public iotop
2346 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2349 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2350 (build-system python-build-system)
2353 (modify-phases %standard-phases
2354 (add-after 'unpack 'fix-build-with-python3
2356 (substitute* "setup.py"
2357 (("itervalues") "values"))
2359 ;; There are currently no checks in the package.
2361 (native-inputs `(("python" ,python)))
2362 (home-page "http://guichaz.free.fr/iotop/")
2364 "Displays the IO activity of running processes")
2366 "Iotop is a Python program with a top like user interface to show the
2367 processes currently causing I/O.")
2368 (license license:gpl2+)))
2376 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2377 "download/fuse-" version
2378 "/fuse-" version ".tar.gz"))
2381 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2382 (patches (search-patches "fuse-overlapping-headers.patch"))))
2383 (build-system gnu-build-system)
2384 (inputs `(("util-linux" ,util-linux)))
2386 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2387 (assoc-ref %outputs "out")
2389 (string-append "INIT_D_PATH="
2390 (assoc-ref %outputs "out")
2393 ;; The rule makes /dev/fuse 666.
2394 (string-append "UDEV_RULES_PATH="
2395 (assoc-ref %outputs "out")
2396 "/lib/udev/rules.d"))
2398 (modify-phases %standard-phases
2399 (add-before 'build 'set-file-names
2400 (lambda* (#:key inputs #:allow-other-keys)
2401 ;; libfuse calls out to mount(8) and umount(8). Make sure
2402 ;; it refers to the right ones.
2403 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2404 (("/bin/(u?)mount" _ maybe-u)
2405 (string-append (assoc-ref inputs "util-linux")
2406 "/bin/" maybe-u "mount")))
2407 (substitute* '("util/mount.fuse.c")
2411 ;; This hack leads libfuse to search for 'fusermount' in
2412 ;; $PATH, where it may find a setuid-root binary, instead of
2413 ;; trying solely $out/sbin/fusermount and failing because
2415 (substitute* "lib/Makefile"
2416 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2417 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2419 (supported-systems (delete "i586-gnu" %supported-systems))
2420 (home-page "https://github.com/libfuse/libfuse")
2421 (synopsis "Support file systems implemented in user space")
2423 "As a consequence of its monolithic design, file system code for Linux
2424 normally goes into the kernel itself---which is not only a robustness issue,
2425 but also an impediment to system extensibility. FUSE, for \"file systems in
2426 user space\", is a kernel module and user-space library that tries to address
2427 part of this problem by allowing users to run file system implementations as
2428 user-space processes.")
2429 (license (list license:lgpl2.1 ;library
2430 license:gpl2+)))) ;command-line utilities
2432 (define-public unionfs-fuse
2434 (name "unionfs-fuse")
2439 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2441 (file-name (string-append name "-" version ".tar.gz"))
2444 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2445 (build-system cmake-build-system)
2447 `(("python" ,python)))
2448 (inputs `(("fuse" ,fuse)))
2450 ;; The tests were never actually run ("collected 0 items"), but in recent
2451 ;; versions of pytest that causes an error.
2453 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2454 (synopsis "User-space union file system")
2456 "UnionFS-FUSE is a flexible union file system implementation in user
2457 space, using the FUSE library. Mounting a union file system allows you to
2458 \"aggregate\" the contents of several directories into a single mount point.
2459 UnionFS-FUSE additionally supports copy-on-write.")
2460 (license license:bsd-3)))
2463 (package (inherit fuse)
2464 (name "fuse-static")
2465 (source (origin (inherit (package-source fuse))
2466 (modules '((guix build utils)))
2469 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2470 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2471 ;; that it doesn't do that, allowing us to remove the
2472 ;; dependency on util-linux (something that is useful in
2474 (substitute* '("lib/mount_util.c"
2475 "util/mount_util.c")
2476 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2482 (define-public unionfs-fuse/static
2483 (package (inherit unionfs-fuse)
2484 (synopsis "User-space union file system (statically linked)")
2485 (name (string-append (package-name unionfs-fuse) "-static"))
2486 (source (origin (inherit (package-source unionfs-fuse))
2487 (modules '((guix build utils)))
2490 ;; Add -ldl to the libraries, because libfuse.a needs that.
2491 (substitute* "src/CMakeLists.txt"
2492 (("target_link_libraries(.*)\\)" _ libs)
2493 (string-append "target_link_libraries"
2498 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2500 (modify-phases %standard-phases
2501 (add-after 'install 'post-install
2502 (lambda* (#:key outputs #:allow-other-keys)
2503 (let* ((out (assoc-ref outputs "out"))
2504 (exe (string-append out "/bin/unionfs")))
2505 ;; By default, 'unionfs' keeps references to
2506 ;; $glibc/share/locale and similar stuff. Remove them.
2507 (remove-store-references exe)
2509 ;; 'unionfsctl' has references to glibc as well. Since
2510 ;; we don't need it, remove it.
2511 (delete-file (string-append out "/bin/unionfsctl"))
2513 (inputs `(("fuse" ,fuse-static)))))
2515 (define-public sshfs
2521 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2522 "download/sshfs-" version "/sshfs-" version
2526 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2527 (build-system gnu-build-system)
2532 `(("pkg-config" ,pkg-config)))
2533 (home-page "https://github.com/libfuse/sshfs")
2534 (synopsis "Mount remote file systems over SSH")
2536 "This is a file system client based on the SSH File Transfer Protocol.
2537 Since most SSH servers already support this protocol it is very easy to set
2538 up: on the server side there's nothing to do; on the client side mounting the
2539 file system is as easy as logging into the server with an SSH client.")
2540 (license license:gpl2+)))
2542 (define-public sshfs-fuse
2543 (package (inherit sshfs)
2545 (properties `((superseded . ,sshfs)))))
2547 (define-public archivemount
2549 (name "archivemount")
2554 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2555 "archivemount-" version ".tar.gz"))
2557 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2558 (build-system gnu-build-system)
2559 (inputs `(("fuse" ,fuse)
2560 ("libarchive" ,libarchive)))
2561 (native-inputs `(("pkg-config" ,pkg-config)))
2562 (home-page "https://www.cybernoia.de/software/archivemount.html")
2563 (synopsis "Tool for mounting archive files with FUSE")
2564 (description "archivemount is a FUSE-based file system for Unix variants,
2565 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2566 mount point where it can be read from or written to as with any other file
2567 system. This makes accessing the contents of the archive, which may be
2568 compressed, transparent to other programs, without decompressing them.")
2569 (license license:lgpl2.0+)))
2571 (define-public numactl
2578 "https://github.com/numactl/numactl/releases/download/v"
2579 version "/numactl-" version ".tar.gz"))
2582 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2583 (build-system gnu-build-system)
2585 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2586 ;; to run, which we can't assume to have.
2589 ;; NUMA is apparently not supported on armhf, see
2590 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2591 (supported-systems (delete "armhf-linux" %supported-systems))
2592 (home-page "https://github.com/numactl/numactl")
2593 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2595 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2596 memory is not all in one place. The @command{numactl} program allows you to
2597 run your application program on specific CPUs and memory nodes. It does this
2598 by supplying a NUMA memory policy to the operating system before running your
2601 The package contains other commands, such as @command{numastat},
2602 @command{memhog}, and @command{numademo} which provides a quick overview of
2603 NUMA performance on your system.")
2604 (license (list license:gpl2 ;programs
2605 license:lgpl2.1)))) ;library
2607 (define-public kbd-neo
2614 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2615 version "/linux/console/neo.map"))
2616 (file-name (string-append name "-" version ".map"))
2619 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2620 (build-system trivial-build-system)
2622 `(#:modules ((guix build utils))
2624 (use-modules (guix build utils))
2625 (let ((out (string-append %output "/share/keymaps"))
2626 (source (assoc-ref %build-inputs "source")))
2628 (copy-file source (string-append out "/neo.map"))
2630 (home-page "https://neo-layout.org")
2631 (synopsis "Neo2 console layout")
2633 "Kbd-neo provides the Neo2 keyboard layout for use with
2634 @command{loadkeys(1)} from @code{kbd(4)}.")
2635 ;; The file is located in an svn directory, the entire content of
2636 ;; the directory is licensed as GPL3.
2637 (license license:gpl3+)))
2645 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2649 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2650 (modules '((guix build utils)))
2653 (substitute* "tests/Makefile.in"
2654 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2657 (substitute* '("src/unicode_start" "src/unicode_stop")
2658 ;; Assume the Coreutils are in $PATH.
2662 (build-system gnu-build-system)
2665 (modify-phases %standard-phases
2666 (add-before 'build 'pre-build
2667 (lambda* (#:key inputs #:allow-other-keys)
2668 (let ((gzip (assoc-ref %build-inputs "gzip"))
2669 (bzip2 (assoc-ref %build-inputs "bzip2")))
2670 (substitute* "src/libkeymap/findfile.c"
2672 (string-append gzip "/bin/gzip"))
2674 (string-append bzip2 "/bin/bzip2")))
2676 (add-after 'install 'post-install
2677 (lambda* (#:key outputs #:allow-other-keys)
2678 ;; Make sure these programs find their comrades.
2679 (let* ((out (assoc-ref outputs "out"))
2680 (bin (string-append out "/bin")))
2681 (for-each (lambda (prog)
2682 (wrap-program (string-append bin "/" prog)
2683 `("PATH" ":" prefix (,bin))))
2684 '("unicode_start" "unicode_stop"))
2686 (inputs `(("check" ,check)
2689 ("pam" ,linux-pam)))
2690 (native-search-paths
2691 (list (search-path-specification
2692 (variable "LOADKEYS_KEYMAP_PATH")
2693 ;; Append ‘/**’ to recursively search all directories. One can then
2694 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2695 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2696 (files (list "share/keymaps/**")))))
2697 (native-inputs `(("pkg-config" ,pkg-config)))
2698 (home-page "http://kbd-project.org/")
2699 (synopsis "Linux keyboard utilities and keyboard maps")
2701 "This package contains keytable files and keyboard utilities compatible
2702 for systems using the Linux kernel. This includes commands such as
2703 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2704 (license license:gpl2+)))
2706 (define-public loadkeys-static
2709 (name "loadkeys-static")
2711 (substitute-keyword-arguments (package-arguments kbd)
2712 ((#:configure-flags flags ''())
2713 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2714 "--disable-vlock" ;so we don't need libpam
2715 "--disable-libkeymap")
2717 ((#:make-flags flags ''())
2718 `(cons "LDFLAGS=-all-static" ,flags))
2719 ((#:phases phases '%standard-phases)
2720 `(modify-phases ,phases
2722 (lambda* (#:key outputs #:allow-other-keys)
2723 (let ((out (assoc-ref outputs "out")))
2724 ;; The binary keeps references to gzip, among other things,
2725 ;; which we don't need in the initrd, so strip references.
2726 (remove-store-references "src/loadkeys")
2728 (install-file "src/loadkeys"
2729 (string-append out "/bin"))
2731 (delete 'post-install)))
2732 ((#:strip-flags _ '())
2734 ((#:allowed-references _ '())
2737 (synopsis "Statically-linked @command{loadkeys} program")
2739 ;; This package is meant to be used internally in the initrd so don't
2741 (properties '((hidden? . #t)))))
2743 (define-public inotify-tools
2745 (name "inotify-tools")
2750 (url "https://github.com/rvoicilas/inotify-tools.git")
2752 (file-name (git-file-name name version))
2755 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2756 (build-system gnu-build-system)
2758 `(("autoconf" ,autoconf)
2759 ("automake" ,automake)
2760 ("libtool" ,libtool)))
2761 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2762 (synopsis "Monitor file accesses")
2764 "The inotify-tools packages provides a C library and command-line tools
2765 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2766 (license license:gpl2+)))
2775 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2776 "kmod-" version ".tar.xz"))
2779 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2780 (patches (search-patches "kmod-module-directory.patch"))))
2781 (build-system gnu-build-system)
2783 `(("pkg-config" ,pkg-config)))
2788 `(#:tests? #f ; FIXME: Investigate test failures
2789 #:configure-flags '("--with-xz" "--with-zlib")
2791 (modify-phases %standard-phases
2792 (add-after 'install 'install-modprobe&co
2793 (lambda* (#:key outputs #:allow-other-keys)
2794 (let* ((out (assoc-ref outputs "out"))
2795 (bin (string-append out "/bin")))
2796 (for-each (lambda (tool)
2798 (string-append bin "/" tool)))
2799 '("insmod" "rmmod" "lsmod" "modprobe"
2800 "modinfo" "depmod"))
2802 (supported-systems (delete "i586-gnu" %supported-systems))
2803 (home-page "https://www.kernel.org/")
2804 (synopsis "Kernel module tools")
2805 (description "Kmod is a set of tools to handle common tasks with Linux
2806 kernel modules like insert, remove, list, check properties, resolve
2807 dependencies and aliases.
2809 These tools are designed on top of libkmod, a library that is shipped with
2810 kmod. The aim is to be compatible with tools, configurations and indices
2811 from the module-init-tools project.")
2812 (license license:gpl2+))) ; library under lgpl2.1+
2814 (define-public earlyoom
2821 (url "https://github.com/rfjakob/earlyoom.git")
2822 (commit (string-append "v" version))))
2823 (file-name (git-file-name name version))
2826 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
2827 (build-system gnu-build-system)
2829 `(#:phases (modify-phases %standard-phases
2831 (add-before 'check 'set-home
2833 (setenv "HOME" (getcwd))
2835 (add-after 'build 'install-contribs
2836 ;; Install what seems useful from the contrib directory.
2837 (lambda* (#:key outputs #:allow-other-keys)
2838 (let* ((out (assoc-ref outputs "out"))
2839 (contrib (string-append
2840 out "/share/earlyoom/contrib")))
2841 (install-file "contrib/notify_all_users.py" contrib)
2843 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
2845 (string-append "VERSION=v" ,version)
2846 (string-append "PREFIX=" prefix)
2847 (string-append "SYSCONFDIR=" prefix "/etc")))
2848 #:test-target "test"))
2849 (native-inputs `(("go" ,go) ;for the test suite
2850 ("pandoc" ,ghc-pandoc))) ;to generate the manpage
2851 (home-page "https://github.com/rfjakob/earlyoom")
2852 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
2853 (description "Early OOM is a minimalist out of memory (OOM) daemon that
2854 runs in user space and provides a more responsive and configurable alternative
2855 to the in-kernel OOM killer.")
2856 (license license:expat)))
2858 (define-public eudev
2859 ;; The post-systemd fork, maintained by Gentoo.
2865 (uri (git-reference (url "https://github.com/gentoo/eudev")
2866 (commit (string-append "v" version))))
2867 (file-name (git-file-name name version))
2870 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
2871 (patches (search-patches "eudev-rules-directory.patch"))))
2872 (build-system gnu-build-system)
2875 (modify-phases %standard-phases
2876 (add-after 'unpack 'make-source-writable
2878 ;; XXX: Git checkouts are read-only, but this package needs to
2879 ;; modify some of its files.
2880 (for-each make-file-writable (find-files "."))
2882 (add-before 'bootstrap 'patch-file-names
2883 (lambda* (#:key inputs native-inputs #:allow-other-keys)
2884 (substitute* "man/make.sh"
2885 (("/usr/bin/xsltproc")
2886 (string-append (assoc-ref
2887 (or native-inputs inputs) "xsltproc")
2890 (add-before 'configure 'patch-bindir-in-btrfs-rules
2891 (lambda* (#:key outputs #:allow-other-keys)
2892 ;; The "@bindir@" substitution incorrectly expands to a literal
2893 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
2895 (let ((out (assoc-ref outputs "out")))
2896 (substitute* "rules/64-btrfs.rules.in"
2898 (string-append out "/bin")))
2900 (add-after 'install 'move-static-library
2901 (lambda* (#:key outputs #:allow-other-keys)
2902 (let* ((out (assoc-ref outputs "out"))
2903 (static (assoc-ref outputs "static"))
2904 (source (string-append out "/lib/libudev.a"))
2905 (target (string-append static "/lib/libudev.a")))
2906 (mkdir-p (dirname target))
2907 (link source target)
2908 (delete-file source)
2909 ;; Remove reference to the static library from the .la file
2910 ;; such that Libtool looks for it in the usual places.
2911 (substitute* (string-append out "/lib/libudev.la")
2913 "old_library=''\n"))
2915 (add-after 'install 'build-hwdb
2916 (lambda* (#:key outputs #:allow-other-keys)
2917 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2918 ;; similar tools to display product names.
2920 ;; XXX: This can't be done when cross-compiling. Find another way
2921 ;; to generate hwdb.bin for cross-built systems.
2922 (let ((out (assoc-ref outputs "out")))
2923 ,@(if (%current-target-system)
2925 '((invoke (string-append out "/bin/udevadm")
2926 "hwdb" "--update")))))))
2927 #:configure-flags (list "--enable-manpages")))
2929 `(("autoconf" ,autoconf)
2930 ("automake" ,automake)
2932 ("libtool" ,libtool)
2933 ("pkg-config" ,pkg-config)
2936 ("python" ,python-wrapper)
2937 ;; For documentation.
2938 ("docbook-xml" ,docbook-xml-4.2)
2939 ("docbook-xsl" ,docbook-xsl)
2940 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2941 ("xsltproc" ,libxslt)))
2943 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2944 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2945 ;; which contains the rules to do that.
2946 `(("util-linux" ,util-linux "lib") ;for blkid
2948 (outputs '("out" "static"))
2949 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2950 (synopsis "Userspace device management")
2951 (description "Udev is a daemon which dynamically creates and removes
2952 device nodes from /dev/, handles hotplug events and loads drivers at boot
2954 (license license:gpl2+)))
2956 (define-public eudev-with-hwdb
2957 (deprecated-package "eudev-with-hwdb" eudev))
2965 (uri (list (string-append "ftp://sourceware.org/pub/lvm2/LVM2."
2967 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2971 "1j0yis658564rk1ddabkl8vbavp0fdd10gd6qhgyzc3akzf620kf"))
2972 (modules '((guix build utils)))
2975 (use-modules (guix build utils))
2977 ;; Honor sysconfdir.
2978 (substitute* "make.tmpl.in"
2980 "confdir = @sysconfdir@\n")
2981 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2982 "DEFAULT_SYS_DIR = @sysconfdir@"))
2984 (patches (search-patches "lvm2-static-link.patch"))))
2985 (build-system gnu-build-system)
2987 `(("pkg-config" ,pkg-config)
2988 ("procps" ,procps))) ;tests use 'pgrep'
2990 `(("libaio" ,libaio)
2994 (modify-phases %standard-phases
2995 (add-after 'configure 'set-makefile-shell
2997 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2999 (setenv "SHELL" (which "sh"))
3001 ;; Replace /bin/sh with the right file name.
3002 (patch-makefile-SHELL "make.tmpl")
3005 #:configure-flags (list (string-append "--sysconfdir="
3006 (assoc-ref %outputs "out")
3008 "--enable-udev_sync"
3009 "--enable-udev_rules"
3010 "--enable-pkgconfig"
3012 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3014 ;; Make sure programs such as 'dmsetup' can
3015 ;; find libdevmapper.so.
3016 (string-append "LDFLAGS=-Wl,-rpath="
3017 (assoc-ref %outputs "out")
3019 (assoc-ref %outputs "out")
3020 "/lib/device-mapper")
3021 ;; This is needed when cross-compiling.
3022 ,@(if (%current-target-system)
3023 '("ac_cv_func_malloc_0_nonnull=yes"
3024 "ac_cv_func_realloc_0_nonnull=yes")
3027 ;; The tests use 'mknod', which requires root access.
3029 (supported-systems (delete "i586-gnu" %supported-systems))
3030 (home-page "https://sourceware.org/lvm2/")
3031 (synopsis "Logical volume management for Linux")
3033 "LVM2 is the logical volume management tool set for Linux-based systems.
3034 This package includes the user-space libraries and tools, including the device
3035 mapper. Kernel components are part of Linux-libre.")
3037 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3038 ;; Command-line tools are GPLv2.
3039 (license (list license:gpl2 license:lgpl2.1))))
3041 (define-public lvm2-static
3044 (name "lvm2-static")
3046 ;; Propagate udev because libdevmapper.a depends on libudev.
3047 (propagated-inputs `(("udev:static" ,eudev "static")))
3050 (substitute-keyword-arguments (package-arguments lvm2)
3051 ((#:configure-flags flags '())
3052 ;; LVM2 doesn't use Libtool, hence the custom option.
3053 `(append '("--enable-static_link")
3054 ;; Building dmeventd statically is complicated due to a
3055 ;; requirement on libdevmapper.a, which is being phased out
3056 ;; in favor of libdevice-mapper.a, which in turn is is not
3057 ;; easily made available at dmeventd build time. Just ignore
3058 ;; it until the situation improves.
3059 (delete "--enable-dmeventd" ,flags)))
3061 `(modify-phases ,phases
3062 (add-before 'configure 'adjust-Makefile
3064 ;; These fixes are related to the upstream libdm->device_mapper
3065 ;; migration and will hopefully be fixed upstream in due time.
3066 (substitute* "tools/Makefile.in"
3067 ;; This variable is empty in a static configuration and causes
3068 ;; an erroneous GCC command line.
3069 (("-L\\$\\(interfacebuilddir\\)") "")
3070 ;; Remove obsolete reference to libdevmapper.a.
3071 (("-ldevmapper") ""))
3073 (synopsis "Logical volume management for Linux (statically linked)")))
3075 (define-public wireless-tools
3077 (name "wireless-tools")
3081 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3085 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3088 ;; Remove the older header files that are not free software.
3089 (for-each (lambda (n)
3090 (delete-file (format #f "wireless.~a.h" n)))
3091 '(10 11 12 13 14 15 16 17 18 19 20))
3093 (build-system gnu-build-system)
3096 (list (string-append "PREFIX=" %output)
3097 (string-append "INSTALL_MAN=" %output "/share/man")
3098 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3101 (modify-phases %standard-phases
3103 (lambda* (#:key target #:allow-other-keys)
3104 (when ,(%current-target-system)
3105 ;; Cross-compilation: use the cross tools.
3106 (substitute* (find-files "." "Makefile")
3108 (string-append "CC = " target "-gcc\n"))
3110 (string-append "AR = " target "-ar\n"))
3112 (string-append "RANLIB = " target "-ranlib\n"))))
3115 (synopsis "Tools for manipulating Linux Wireless Extensions")
3116 (description "Wireless Tools are used to manipulate the now-deprecated
3117 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3118 Extension was an interface allowing you to set Wireless LAN specific
3119 parameters and get the specific stats. It is deprecated in favor the nl80211
3121 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3122 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3123 ;; other files are distributed under gpl2.
3124 (license (list license:gpl2 license:lgpl2.1+))))
3132 (uri (string-append "mirror://kernel.org/software/network/crda/"
3133 "crda-" version ".tar.xz"))
3136 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3137 (patches (search-patches "crda-optional-gcrypt.patch"))))
3138 (build-system gnu-build-system)
3140 `(#:phases (modify-phases %standard-phases
3142 (add-after 'unpack 'gzip-determinism
3144 (substitute* "Makefile"
3145 (("gzip") "gzip --no-name"))
3147 ,@(if (%current-target-system)
3149 'unpack 'fix-pkg-config
3150 (lambda* (#:key target #:allow-other-keys)
3154 (string-append target "-pkg-config")))
3158 'build 'no-werror-no-ldconfig
3160 (substitute* "Makefile"
3162 (("ldconfig") "true"))
3165 'build 'set-regulator-db-file-name
3166 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3167 ;; Tell CRDA where to find our database.
3168 (let ((regdb (assoc-ref (or native-inputs inputs)
3170 (substitute* "crda.c"
3171 (("\"/lib/crda/regulatory.bin\"")
3172 (string-append "\"" regdb
3173 "/lib/crda/regulatory.bin\"")))
3175 #:test-target "verify"
3176 #:make-flags (let ((out (assoc-ref %outputs "out"))
3177 (regdb (assoc-ref %build-inputs "wireless-regdb"))
3178 (target ,(%current-target-system)))
3182 (string-append target "-gcc") "gcc"))
3185 ;; Disable signature-checking on 'regulatory.bin'.
3186 ;; The reason is that this simplifies maintenance
3187 ;; on our side (no need to manage a distro key
3188 ;; pair), and we can guarantee integrity of
3189 ;; 'regulatory.bin' by other means anyway, such as
3190 ;; 'guix gc --verify'. See
3191 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3195 (string-append "PREFIX=" out)
3196 (string-append "SBINDIR=" out "/sbin/")
3197 (string-append "UDEV_RULE_DIR="
3198 out "/lib/udev/rules.d")
3199 (string-append "LDFLAGS=-Wl,-rpath="
3201 (string-append "REG_BIN=" regdb
3202 "/lib/crda/regulatory.bin")
3204 (native-inputs `(("pkg-config" ,pkg-config)
3205 ("wireless-regdb" ,wireless-regdb)))
3206 (inputs `(("libnl" ,libnl)))
3208 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3209 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3211 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3212 communication between the kernel Linux and user space for regulatory
3214 (license license:copyleft-next)))
3216 (define-public wireless-regdb
3218 (name "wireless-regdb")
3219 (version "2019.06.03")
3223 "mirror://kernel.org/software/network/wireless-regdb/"
3224 "wireless-regdb-" version ".tar.xz"))
3227 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
3229 ;; We're building 'regulatory.bin' by ourselves.
3231 (delete-file "regulatory.bin")
3233 (build-system gnu-build-system)
3236 (modify-phases %standard-phases
3237 (add-after 'unpack 'gzip-determinism
3239 (substitute* "Makefile"
3240 (("gzip") "gzip --no-name"))
3242 (add-after 'unpack 'omit-signature
3244 (substitute* "Makefile"
3245 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3246 ;; don't provide (see below). Disable it.
3247 ((" regulatory\\.db\\.p7s") "")
3248 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3249 ;; but ‘make install’ depends only on the latter while installing
3250 ;; both (and failing). Depend on it explicitly.
3251 (("^install: " all) (string-append all "regulatory.db ")))
3253 (delete 'configure)) ; no configure script
3255 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3256 ;; is computed and can be equal to 'maintainer-clean'; when that
3257 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3258 ;; just built. Thus, build things sequentially.
3259 #:parallel-build? #f
3261 #:tests? #f ; no tests
3263 (let ((out (assoc-ref %outputs "out")))
3264 (list (string-append "PREFIX=" out)
3265 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3267 ;; Leave this empty so that db2bin.py doesn't try to sign
3268 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3269 ;; pair for the whole distribution.
3270 (string-append "REGDB_PRIVKEY=")
3271 ;; Don't generate a public key for the same reason. These are
3272 ;; used as Makefile targets and can't be the empty string.
3273 (string-append "REGDB_PUBCERT=/dev/null")
3274 (string-append "REGDB_PUBKEY=/dev/null")))))
3276 `(("python" ,python-wrapper)))
3278 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3279 (synopsis "Wireless regulatory database")
3281 "This package contains the wireless regulatory database Central
3282 Regulatory Database Agent (CRDA) daemon. The database contains information on
3283 country-specific regulations for the wireless spectrum.")
3284 (license license:isc)))
3286 (define-public lm-sensors
3294 (url "https://github.com/groeck/lm-sensors.git")
3295 (commit (string-append "V" (string-join
3296 (string-split version #\.) "-")))))
3297 (file-name (git-file-name name version))
3299 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3300 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3301 (build-system gnu-build-system)
3302 (inputs `(("rrdtool" ,rrdtool)
3305 ("gnuplot" ,gnuplot)))
3306 (native-inputs `(("pkg-config" ,pkg-config)
3310 (outputs '("lib" ; avoid perl in closure
3313 `(#:tests? #f ; no 'check' target
3314 #:make-flags (list (string-append "PREFIX=" %output)
3315 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3316 (string-append "INCLUDEDIR="
3317 (assoc-ref %outputs "lib") "/include")
3318 (string-append "MANDIR=" %output "/share/man")
3319 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3321 (modify-phases %standard-phases
3323 (add-before 'build 'patch-exec-paths
3324 (lambda* (#:key inputs outputs #:allow-other-keys)
3325 (substitute* "prog/detect/sensors-detect"
3327 (string-append "`" (assoc-ref inputs "coreutils")
3329 (("(`|\")modprobe" all open-quote)
3330 (string-append open-quote
3331 (assoc-ref inputs "kmod")
3333 (substitute* '("prog/pwm/pwmconfig"
3334 "prog/pwm/fancontrol")
3336 (string-append (assoc-ref inputs "gnuplot")
3339 (string-append (assoc-ref inputs "coreutils")
3342 (string-append (assoc-ref inputs "grep")
3345 (string-append (assoc-ref inputs "sed")
3348 (string-append (assoc-ref inputs "coreutils")
3351 (string-append (assoc-ref inputs "coreutils")
3354 (string-append (assoc-ref inputs "coreutils")
3355 "/bin/readlink -f")))
3357 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3358 (synopsis "Utilities to read temperature/voltage/fan sensors")
3360 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3361 you to access information from temperature, voltage, and fan speed sensors.
3362 It works with most newer systems.")
3363 (license license:gpl2+)))
3365 (define-public iucode-tool
3367 (name "iucode-tool")
3371 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3372 "/raw/latest/iucode-tool_" version ".tar.xz"))
3375 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3376 (build-system gnu-build-system)
3377 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3378 (synopsis "Manipulate Intel microcode bundles")
3380 "@command{iucode_tool} is a utility to work with microcode packages for
3381 Intel processors. It can convert between formats, extract specific versions,
3382 create a firmware image suitable for the Linux kernel, and more.")
3383 ;; cpuid.h is available for i686, x86_64, and ia64.
3384 (supported-systems '("i686-linux" "x86_64-linux"))
3385 (license license:gpl2+)))
3387 (define-public i2c-tools
3394 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3395 version ".tar.bz2"))
3398 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3399 (build-system gnu-build-system)
3401 `(#:tests? #f ; no 'check' target
3402 #:make-flags (list (string-append "prefix=" %output)
3404 ;; no configure script
3405 #:phases (modify-phases %standard-phases (delete 'configure))))
3408 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3409 (synopsis "I2C tools for Linux")
3411 "The i2c-tools package contains a heterogeneous set of I2C tools for
3412 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3413 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3415 (license license:gpl2+)))
3417 (define-public xsensors
3424 "http://www.linuxhardware.org/xsensors/xsensors-"
3428 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3429 (build-system gnu-build-system)
3430 (inputs `(("lm-sensors" ,lm-sensors "lib")
3432 (native-inputs `(("pkg-config" ,pkg-config)))
3435 (modify-phases %standard-phases
3436 (add-before 'configure 'enable-deprecated
3438 (substitute* "src/Makefile.in"
3439 (("-DGDK_DISABLE_DEPRECATED") "")
3440 (("-DGTK_DISABLE_DEPRECATED") ""))
3442 (add-before 'configure 'remove-Werror
3444 (substitute* '("configure" "src/Makefile.in")
3447 (home-page "http://www.linuxhardware.org/xsensors/")
3448 (synopsis "Hardware health information viewer")
3450 "Xsensors reads data from the libsensors library regarding hardware
3451 health such as temperature, voltage and fan speed and displays the information
3452 in a digital read-out.")
3453 (license license:gpl2+)))
3458 (version (package-version linux-libre))
3459 (source (package-source linux-libre))
3460 (build-system gnu-build-system)
3463 (modify-phases %standard-phases
3465 (lambda* (#:key inputs #:allow-other-keys)
3466 (setenv "SHELL_PATH" (which "bash"))
3467 (chdir "tools/perf")
3469 #:make-flags (list (string-append "prefix="
3470 (assoc-ref %outputs "out"))
3471 ;; Make sure the kernel headers are treated as system
3472 ;; headers to suppress warnings from those.
3473 (string-append "C_INCLUDE_PATH="
3474 (assoc-ref %build-inputs "kernel-headers")
3478 ;; By default, 'config/Makefile' uses lib64 on
3479 ;; x86_64. Work around that.
3481 #:tests? #f)) ;no tests
3483 `(("pkg-config" ,pkg-config)
3487 ;; There are build scripts written in these languages.
3489 ("python" ,python-2)))
3491 `(("slang" ,slang) ;for the interactive TUI
3493 ("python" ,python-2) ;'perf' links against libpython
3494 ("elfutils" ,elfutils)
3495 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3496 ("libunwind" ,libunwind) ;better stack walking
3497 ("numactl" ,numactl) ;for 'perf bench numa mem'
3500 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3501 ("docbook-xsl" ,docbook-xsl)
3503 ("asciidoc" ,asciidoc)))
3504 (home-page "https://perf.wiki.kernel.org/")
3505 (synopsis "Linux profiling with performance counters")
3507 "perf is a tool suite for profiling using hardware performance counters,
3508 with support in the Linux kernel. perf can instrument CPU performance
3509 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3510 of lightweight profiling. This package contains the user-land tools and in
3511 particular the @code{perf} command.")
3512 (license (package-license linux-libre))))
3514 (define-public pflask
3520 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3522 (file-name (string-append name "-" version ".tar.gz"))
3525 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3526 (build-system cmake-build-system)
3528 '(#:tests? #f)) ; no tests
3529 (home-page "https://ghedo.github.io/pflask/")
3530 (synopsis "Simple tool for creating Linux namespace containers")
3531 (description "pflask is a simple tool for creating Linux namespace
3532 containers. It can be used for running a command or even booting an OS inside
3533 an isolated container, created with the help of Linux namespaces. It is
3534 similar in functionality to chroot, although pflask provides better isolation
3535 thanks to the use of namespaces.")
3536 (license license:bsd-2)))
3538 (define-public singularity
3540 (name "singularity")
3544 (uri (string-append "https://github.com/singularityware/singularity/"
3545 "releases/download/" version
3546 "/singularity-" version ".tar.gz"))
3549 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3550 (modules '((guix build utils)))
3553 ;; Do not create directories in /var.
3554 (substitute* "Makefile.in"
3555 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3557 ;; The original source overrides PATH so that it points to
3558 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3559 ;; on Guix System. Leave PATH unchanged so we refer to the
3560 ;; installed Coreutils, grep, etc.
3561 (substitute* "bin/singularity.in"
3563 (string-append "#" all "\n")))
3565 (substitute* (find-files "libexec/cli" "\\.exec$")
3566 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3568 (string-append "/run/setuid-programs/singularity-"
3569 program "-helper")))
3571 ;; These squashfs mount options are apparently no longer
3572 ;; supported since Linux-libre 5.4.5.
3573 (substitute* "src/lib/image/squashfs/mount.c"
3574 (("\"errors=remount-ro\"")
3577 (build-system gnu-build-system)
3579 `(#:configure-flags '("--localstatedir=/var")
3581 (modify-phases %standard-phases
3582 (add-after 'unpack 'patch-reference-to-squashfs-tools
3584 (substitute* "libexec/cli/build.exec"
3585 (("if ! singularity_which mksquashfs") "if 0")
3586 (("if ! mksquashfs")
3587 (string-append "if ! " (which "mksquashfs"))))
3589 (add-after 'install 'set-PATH
3590 (lambda* (#:key inputs outputs #:allow-other-keys)
3591 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
3592 (let ((out (assoc-ref outputs "out"))
3593 (coreutils (assoc-ref inputs "coreutils")))
3594 (wrap-program (string-append out "/bin/singularity")
3595 `("PATH" ":" = (,(string-append coreutils "/bin"))))
3596 (substitute* (string-append out "/bin/run-singularity")
3597 (("/usr/bin/env singularity")
3598 (string-append (which "env") " "
3599 out "/bin/singularity")))
3602 `(("libarchive" ,libarchive)
3603 ("python" ,python-wrapper)
3605 ("squashfs-tools" ,squashfs-tools)))
3606 (home-page "https://singularity.lbl.gov/")
3607 (synopsis "Container platform")
3608 (description "Singularity is a container platform supporting a number of
3609 container image formats. It can build SquashFS container images or import
3610 existing Docker images. Singularity requires kernel support for container
3611 isolation or root privileges.")
3612 (license license:bsd-3)))
3614 (define-public hdparm
3620 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3621 "hdparm-" version ".tar.gz"))
3624 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3625 (build-system gnu-build-system)
3627 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3628 (list (string-append "binprefix=" out)
3629 (string-append "manprefix=" out)
3632 (modify-phases %standard-phases
3633 (delete 'configure)) ; no configure script
3634 #:tests? #f)) ; no test suite
3635 (home-page "https://sourceforge.net/projects/hdparm/")
3636 (synopsis "View and tune ATA disk drive parameters")
3638 "@command{hdparm} is a command-line utility to control ATA controllers and
3639 disk drives. It can increase performance and/or reliability by careful tuning
3640 of hardware settings like power and acoustic management, DMA modes, and caching.
3641 It can also display detailed device information, or be used as a simple
3642 performance benchmarking tool.
3644 @command{hdparm} provides a command line interface to various Linux kernel
3645 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3646 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3647 Translation (@dfn{SAT}) are also supported.")
3648 (license (license:non-copyleft "file://LICENSE.TXT"))))
3650 (define-public nvme-cli
3654 (home-page "https://github.com/linux-nvme/nvme-cli")
3659 (commit (string-append "v" version))))
3661 (base32 "12wp2wxmsw2v8m9bhvwvdbhdgx1md8iilhbl19sfzz2araiwi2x8"))
3662 (file-name (git-file-name name version))))
3663 (build-system gnu-build-system)
3665 `(#:make-flags (list "CC=gcc")
3666 #:phases (modify-phases %standard-phases
3667 (delete 'configure) ; No ./configure script
3670 (invoke "make" "install-spec" "PREFIX="
3671 (string-append "DESTDIR=" %output)))))
3672 #:tests? #f)) ; The tests require sysfs, which is not accessible from
3673 ; the build environment
3674 (synopsis "NVM-Express user space tooling for Linux")
3675 (description "Nvme-cli is a utility to provide standards compliant tooling
3676 for NVM-Express drives. It was made specifically for Linux as it relies on the
3677 IOCTLs defined by the mainline kernel driver.")
3678 (license license:gpl2+)))
3680 (define-public rfkill
3686 (uri (string-append "mirror://kernel.org/software/network/"
3687 name "/" name "-" version ".tar.xz"))
3690 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3691 (build-system gnu-build-system)
3693 `(#:make-flags (list "CC=gcc"
3694 (string-append "PREFIX=" %output))
3695 #:phases (modify-phases %standard-phases
3696 (delete 'configure))
3698 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3699 (synopsis "Tool for enabling and disabling wireless devices")
3701 "rfkill is a simple tool for accessing the rfkill device interface,
3702 which is used to enable and disable wireless networking devices, typically
3703 WLAN, Bluetooth and mobile broadband.")
3704 (license (license:non-copyleft "file://COPYING"
3705 "See COPYING in the distribution."))
3706 ;; rfkill is part of util-linux as of 2.31.
3707 (properties `((superseded . ,util-linux)))))
3715 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3716 version "/" name "-" version ".tar.gz"))
3719 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3720 (build-system gnu-build-system)
3721 (home-page "http://acpiclient.sourceforge.net")
3722 (synopsis "Display information on ACPI devices")
3723 (description "@code{acpi} attempts to replicate the functionality of the
3724 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3725 information. It does not support ACPI suspending, only displays information
3726 about ACPI devices.")
3727 (license license:gpl2+)))
3729 (define-public acpid
3735 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3739 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
3740 (build-system gnu-build-system)
3741 (home-page "https://sourceforge.net/projects/acpid2/")
3742 (synopsis "Daemon for delivering ACPI events to user-space programs")
3744 "acpid is designed to notify user-space programs of Advanced
3745 Configuration and Power Interface (ACPI) events. acpid should be started
3746 during the system boot, and will run as a background process. When an ACPI
3747 event is received from the kernel, acpid will examine the list of rules
3748 specified in /etc/acpi/events and execute the rules that match the event.")
3749 (license license:gpl2+)))
3751 (define-public sysfsutils
3760 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3763 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3764 (build-system gnu-build-system)
3765 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3766 (synopsis "System utilities based on Linux sysfs")
3768 "These are a set of utilities built upon sysfs, a virtual file system in
3769 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3770 also contains the libsysfs library.")
3771 ;; The library is under lgpl2.1+ (all files say "or any later version").
3772 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3773 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3775 (define-public sysfsutils-1
3777 (inherit sysfsutils)
3784 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3785 "/sysfsutils-" version ".tar.gz"))
3787 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3788 (modules '((guix build utils)))
3791 (substitute* "Makefile.in"
3792 (("includedir = /usr/include/sysfs")
3793 "includedir = @includedir@"))
3794 (substitute* "configure"
3795 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3796 (string-append "includedir='" orig "/sysfs'")))
3798 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3800 (define-public cpufrequtils
3802 (name "cpufrequtils")
3807 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3808 "cpufrequtils-" version ".tar.gz"))
3810 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3811 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3812 (build-system gnu-build-system)
3814 `(("sysfsutils" ,sysfsutils-1)))
3816 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3817 (assoc-ref %outputs "out") "/lib"))))
3818 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3819 (synopsis "Utilities to get and set CPU frequency on Linux")
3821 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3822 information, and set the CPU frequency if supported, using the cpufreq
3823 capabilities of the Linux kernel.")
3824 (license license:gpl2)))
3826 (define-public libraw1394
3833 "mirror://kernel.org/linux/libs/ieee1394/"
3834 name "-" version ".tar.xz"))
3837 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3838 (build-system gnu-build-system)
3839 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3840 (synopsis "Interface library for the Linux IEEE1394 drivers")
3842 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3843 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3844 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3845 send to and receive from other nodes without requiring a kernel driver for the
3846 protocol in question.")
3847 (license license:lgpl2.1+)))
3849 (define-public libavc1394
3855 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3856 name "-" version ".tar.gz"))
3859 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3860 (build-system gnu-build-system)
3862 `(("pkg-config" ,pkg-config)))
3864 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3865 (home-page "https://sourceforge.net/projects/libavc1394/")
3866 (synopsis "AV/C protocol library for IEEE 1394")
3868 "Libavc1394 is a programming interface to the AV/C specification from
3869 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3870 (license license:lgpl2.1+)))
3872 (define-public libiec61883
3874 (name "libiec61883")
3879 "mirror://kernel.org/linux/libs/ieee1394/"
3880 name "-" version ".tar.xz"))
3883 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3884 (build-system gnu-build-system)
3886 `(("pkg-config" ,pkg-config)))
3888 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3889 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3890 (synopsis "Isochronous streaming media library for IEEE 1394")
3892 "The libiec61883 library provides a higher level API for streaming DV,
3893 MPEG-2 and audio over Linux IEEE 1394.")
3894 (license license:lgpl2.1+)))
3896 (define-public mdadm
3903 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3907 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3908 (build-system gnu-build-system)
3912 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3916 ;; TODO: tell it where to find 'sendmail'
3917 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3918 (string-append "BINDIR=" out "/sbin")
3919 (string-append "MANDIR=" out "/share/man")
3920 (string-append "UDEVDIR=" out "/lib/udev")))
3922 (modify-phases %standard-phases
3923 (add-before 'build 'patch-program-paths
3924 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3925 (let ((coreutils (assoc-ref (or native-inputs inputs)
3927 (substitute* "udev-md-raid-arrays.rules"
3928 (("/usr/bin/(readlink|basename)" all program)
3929 (string-append coreutils "/bin/" program))))
3931 (add-before 'build 'remove-W-error
3933 ;; We cannot build with -Werror on i686 due to a
3934 ;; 'sign-compare' warning in util.c.
3935 (substitute* "Makefile"
3938 (delete 'configure))
3939 ;;tests must be done as root
3941 (supported-systems (delete "i586-gnu" %supported-systems))
3942 (home-page "http://neil.brown.name/blog/mdadm")
3943 (synopsis "Tool for managing Linux Software RAID arrays")
3945 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3946 assemble, report on, and monitor arrays. It can also move spares between raid
3947 arrays when needed.")
3948 (license license:gpl2+)))
3950 (define-public mdadm-static
3953 (name "mdadm-static")
3955 (substitute-keyword-arguments (package-arguments mdadm)
3956 ((#:make-flags flags)
3957 `(cons "LDFLAGS = -static" ,flags))
3959 `(modify-phases ,phases
3960 (add-after 'install 'remove-cruft
3961 (lambda* (#:key outputs #:allow-other-keys)
3962 (let* ((out (assoc-ref outputs "out"))
3963 (precious? (lambda (file)
3964 (member file '("." ".." "sbin"))))
3965 (directories (scandir out (negate precious?))))
3966 (with-directory-excursion out
3967 (for-each delete-file-recursively directories)
3968 (remove-store-references "sbin/mdadm")
3969 (delete-file "sbin/mdmon")
3971 ((#:modules modules %gnu-build-system-modules)
3972 `((ice-9 ftw) ,@modules))
3973 ((#:strip-flags _ '())
3974 ''("--strip-all")) ;strip a few extra KiB
3975 ((#:allowed-references _ '("out"))
3976 '("out")))) ;refer only self
3977 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3979 (define-public multipath-tools
3981 (name "multipath-tools")
3985 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3986 ".git;a=snapshot;h=" version ";sf=tgz"))
3987 (file-name (string-append name "-" version ".tar.gz"))
3990 "1c6ay97wlfv1fl0y8hcfpxhkps14hlnw9gzmj7884micsp7pa9yv"))
3991 (modules '((guix build utils)))
3994 ;; Drop bundled valgrind headers.
3995 (delete-file-recursively "third-party")
3996 (substitute* '("multipathd/main.c"
3997 "libmultipath/debug.c")
3998 (("#include \"../third-party/")
4001 (build-system gnu-build-system)
4003 '(#:tests? #f ; no tests
4004 #:make-flags (list "CC=gcc"
4005 (string-append "DESTDIR="
4006 (assoc-ref %outputs "out"))
4008 ;; Add the libaio headers to GCCs system header
4009 ;; search path to suppress -Werror=cast-qual on
4010 ;; the included headers.
4011 (string-append "C_INCLUDE_PATH="
4012 (assoc-ref %build-inputs "libaio")
4014 (string-append "LDFLAGS=-Wl,-rpath="
4015 (assoc-ref %outputs "out")
4018 (modify-phases %standard-phases
4019 (add-after 'unpack 'patch-source
4020 (lambda* (#:key inputs #:allow-other-keys)
4021 (let ((lvm2 (assoc-ref inputs "lvm2"))
4022 (udev (assoc-ref inputs "udev")))
4023 (substitute* "Makefile.inc"
4024 (("\\$\\(prefix\\)/usr") "$(prefix)")
4025 ;; Do not save timestamp to avoid gzip "timestamp
4026 ;; out-of-range" warnings.
4027 (("gzip -9") "gzip -9n"))
4028 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4029 (("/usr/include/libdevmapper.h")
4030 (string-append lvm2 "/include/libdevmapper.h"))
4031 (("/usr/include/libudev.h")
4032 (string-append udev "/include/libudev.h")))
4034 (delete 'configure)))) ; no configure script
4037 ("pkg-config" ,pkg-config)
4038 ("valgrind" ,valgrind)))
4040 `(("json-c" ,json-c)
4042 ("liburcu" ,liburcu)
4044 ("readline" ,readline)
4046 (home-page "http://christophe.varoqui.free.fr/")
4047 (synopsis "Access block devices through multiple paths")
4049 "This package provides the following binaries to drive the
4050 Linux Device Mapper multipathing driver:
4052 @item @command{multipath} - Device mapper target autoconfig.
4053 @item @command{multipathd} - Multipath daemon.
4054 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4055 @code{dm} multipath devices.
4056 @item @command{kpartx} - Create device maps from partition tables.
4058 (license (list license:gpl2+ ; main distribution
4059 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4061 (define-public libaio
4068 (string-append "https://releases.pagure.org/libaio/"
4069 name "-" version ".tar.gz")))
4072 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4073 (build-system gnu-build-system)
4076 (let ((target ,(%current-target-system)))
4077 (list (string-append "prefix=" %output)
4080 (string-append (assoc-ref %build-inputs "cross-gcc")
4081 "/bin/" target "-gcc")
4083 #:test-target "partcheck" ; need root for a full 'check'
4085 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4086 (home-page "https://pagure.io/libaio")
4087 (synopsis "Linux-native asynchronous I/O access library")
4089 "This library enables userspace to use Linux kernel asynchronous I/O
4090 system calls, important for the performance of databases and other advanced
4092 (license license:lgpl2.1+)))
4094 (define-public blktrace
4095 ;; Take a newer commit to get the fix for CVE-2018-10689.
4096 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4100 (version (git-version "1.2.0" revision commit))
4102 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4109 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4110 (file-name (git-file-name name version))))
4111 (build-system gnu-build-system)
4114 (list "CC=gcc" (string-append "prefix=" %output))
4115 #:tests? #f ; no tests
4117 (modify-phases %standard-phases
4118 (delete 'configure) ; no configure script
4119 (add-after 'unpack 'fix-gnuplot-path
4120 (lambda* (#:key inputs #:allow-other-keys)
4121 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4122 (substitute* "btt/bno_plot.py"
4124 (string-append gnuplot "/bin/gnuplot %s")))
4127 `(("libaio" ,libaio)
4128 ("gnuplot" ,gnuplot)
4129 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4130 (synopsis "Block layer IO tracing mechanism")
4131 (description "Blktrace is a block layer IO tracing mechanism which provides
4132 detailed information about request queue operations to user space. It extracts
4133 event traces from the kernel (via the relaying through the debug file system).")
4134 (license license:gpl2))))
4142 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4146 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4147 (build-system gnu-build-system)
4149 `(("libsndfile" ,libsndfile)))
4151 `(("pkg-config" ,pkg-config)))
4152 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4153 (synopsis "Bluetooth subband audio codec")
4155 "The SBC is a digital audio encoder and decoder used to transfer data to
4156 Bluetooth audio output devices like headphones or loudspeakers.")
4157 (license license:gpl2+)))
4159 (define-public bluez
4166 "mirror://kernel.org/linux/bluetooth/bluez-"
4168 (patches (search-patches "bluez-CVE-2020-0556.patch"))
4171 "1g1qg6dz6hl3csrmz75ixr12lwv836hq3ckb259svvrg62l2vaiq"))))
4172 (build-system gnu-build-system)
4175 (let ((out (assoc-ref %outputs "out")))
4176 (list "--sysconfdir=/etc"
4177 "--localstatedir=/var"
4180 ;; Install dbus/udev files to the correct location.
4181 (string-append "--with-dbusconfdir=" out "/etc")
4182 (string-append "--with-udevdir=" out "/lib/udev")))
4184 (modify-phases %standard-phases
4185 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4186 ;; issue (discussion on upstream mailing list:
4187 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4188 (add-before 'check 'skip-wonky-test
4190 (substitute* "unit/test-gatt.c"
4191 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4193 (add-after 'install 'post-install
4194 (lambda* (#:key inputs outputs #:allow-other-keys)
4195 (let* ((out (assoc-ref outputs "out"))
4196 (servicedir (string-append out "/share/dbus-1/services"))
4197 (service "obexd/src/org.bluez.obex.service")
4198 (rule (string-append
4199 out "/lib/udev/rules.d/97-hid2hci.rules")))
4200 ;; Install the obex dbus service file.
4201 (substitute* service
4203 (string-append out "/libexec/bluetooth/obexd")))
4204 (install-file service servicedir)
4205 ;; Fix paths in the udev rule.
4207 (("hid2hci --method")
4208 (string-append out "/lib/udev/hid2hci --method"))
4210 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4213 `(("pkg-config" ,pkg-config)
4214 ("gettext" ,gettext-minimal)))
4219 ("libical" ,libical)
4220 ("readline" ,readline)))
4221 (home-page "http://www.bluez.org/")
4222 (synopsis "Linux Bluetooth protocol stack")
4224 "BlueZ provides support for the core Bluetooth layers and protocols. It
4225 is flexible, efficient and uses a modular implementation.")
4226 (license license:gpl2+)))
4228 (define-public fuse-exfat
4235 "https://github.com/relan/exfat/releases/download/v"
4236 version "/" name "-" version ".tar.gz"))
4239 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4240 (build-system gnu-build-system)
4242 `(("pkg-config" ,pkg-config)))
4245 (home-page "https://github.com/relan/exfat")
4246 (synopsis "Mount exFAT file systems")
4248 "This package provides a FUSE-based file system that provides read and
4249 write access to exFAT devices.")
4250 (license license:gpl2+)))
4252 (define-public fuseiso
4255 (version "20070708")
4258 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4259 version "/fuseiso-" version ".tar.bz2"))
4262 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4263 (build-system gnu-build-system)
4265 `(("pkg-config" ,pkg-config)))
4270 (home-page "https://sourceforge.net/projects/fuseiso/")
4271 (synopsis "Mount ISO file system images")
4273 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4274 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4275 Ridge, Joliet, and zisofs.")
4276 (license license:gpl2)))
4285 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
4286 version ".tar.bz2"))
4287 (patches (search-patches "gpm-glibc-2.26.patch"))
4290 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4291 (build-system gnu-build-system)
4293 '(#:phases (modify-phases %standard-phases
4296 ;; The tarball was not generated with 'make dist' so we
4297 ;; need to bootstrap things ourselves.
4298 (substitute* "autogen.sh"
4299 (("/bin/sh") (which "sh")))
4300 (invoke "./autogen.sh")
4301 (patch-makefile-SHELL "Makefile.include.in")
4304 ;; Make sure programs find libgpm.so.
4305 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4306 (assoc-ref %outputs "out")
4309 `(("texinfo" ,texinfo)
4312 ("autoconf" ,autoconf)
4313 ("automake" ,automake)
4314 ("libtool" ,libtool)))
4315 (home-page "http://www.nico.schottelius.org/software/gpm/")
4316 (synopsis "Mouse support for the Linux console")
4318 "The GPM (general-purpose mouse) daemon is a mouse server for
4319 applications running on the Linux console. It allows users to select items
4320 and copy/paste text in the console and in xterm.")
4321 (license license:gpl2+)))
4323 (define-public btrfs-progs
4325 (name "btrfs-progs")
4329 (uri (string-append "mirror://kernel.org/linux/kernel/"
4330 "people/kdave/btrfs-progs/"
4331 "btrfs-progs-v" version ".tar.xz"))
4334 "0scxg9p6z0wss92gmv5a8yxdmr8x449kb5v3bfnvs26n92r7zq7k"))))
4335 (build-system gnu-build-system)
4337 "static")) ; static versions of the binaries in "out"
4339 '(#:phases (modify-phases %standard-phases
4340 (add-after 'unpack 'patch-makefile
4341 (lambda* (#:key outputs #:allow-other-keys)
4342 (substitute* "Makefile"
4343 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4344 (string-append (assoc-ref outputs "out")
4345 "/lib/udev/rules.d")))
4347 (add-after 'build 'build-static
4348 (lambda _ (invoke "make" "static")))
4349 (add-after 'install 'install-bash-completion
4350 (lambda* (#:key outputs #:allow-other-keys)
4351 (let* ((out (assoc-ref outputs "out"))
4352 (bashcomp (string-append out "/etc/bash_completion.d")))
4354 (copy-file "btrfs-completion"
4355 (string-append bashcomp "/btrfs"))
4357 (add-after 'install 'install-static
4358 (let ((staticbin (string-append (assoc-ref %outputs "static")
4362 (string-append "bindir=" staticbin)
4363 "install-static")))))
4364 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4365 #:test-target "test"
4366 #:parallel-tests? #f)) ; tests fail when run in parallel
4367 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4369 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4370 ("util-linux:static" ,util-linux "static") ;ditto
4372 ("zlib:static" ,zlib "static")
4373 ("zstd" ,zstd "lib")
4374 ("zstd:static" ,zstd "static")))
4375 (native-inputs `(("pkg-config" ,pkg-config)
4376 ("asciidoc" ,asciidoc)
4379 ;; For building documentation.
4380 ("libxml2" ,libxml2)
4381 ("docbook-xsl" ,docbook-xsl)
4387 ;; The tests need 'grep' with perl regexp support.
4389 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4390 (synopsis "Create and manage btrfs copy-on-write file systems")
4391 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4392 aimed at implementing advanced features while focusing on fault tolerance,
4393 repair and easy administration.")
4394 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4395 ;; GPL2: Everything else.
4396 (license (list license:gpl2 license:gpl2+))))
4398 (define-public btrfs-progs/static
4400 (name "btrfs-progs-static")
4401 (version (package-version btrfs-progs))
4403 (build-system trivial-build-system)
4405 `(("btrfs-progs:static" ,btrfs-progs "static")))
4407 `(#:modules ((guix build utils))
4410 (use-modules (guix build utils)
4414 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4415 (out (assoc-ref %outputs "out"))
4416 (source (string-append btrfs "/bin/btrfs.static"))
4417 (target (string-append out "/bin/btrfs")))
4418 (mkdir-p (dirname target))
4419 (copy-file source target)
4420 (remove-store-references target)
4421 (chmod target #o555)
4423 (home-page (package-home-page btrfs-progs))
4424 (synopsis "Statically-linked btrfs command from btrfs-progs")
4425 (description "This package provides the statically-linked @command{btrfs}
4426 from the btrfs-progs package. It is meant to be used in initrds.")
4427 (license (package-license btrfs-progs))))
4429 (define-public compsize
4433 (home-page "https://github.com/kilobyte/compsize")
4438 (commit (string-append "v" version))))
4440 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4441 (file-name (git-file-name name version))))
4442 (build-system gnu-build-system)
4444 `(("btrfs-progs" ,btrfs-progs)))
4446 `(#:tests? #f ; No tests.
4447 #:make-flags (list "CC=gcc")
4449 (modify-phases %standard-phases
4452 (lambda* (#:key outputs #:allow-other-keys)
4453 (let ((out (assoc-ref outputs "out")))
4454 (install-file "compsize" (string-append out "/bin"))
4455 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4456 (synopsis "Find compression type/ratio on Btrfs files")
4457 (description "@command{compsize} takes a list of files (given as
4458 arguments) on a Btrfs file system and measures used compression types and
4459 effective compression ratio, producing a report.
4461 A directory has no extents but has a (recursive) list of files. A non-regular
4462 file is silently ignored.
4464 As it makes no sense to talk about compression ratio of a partial extent,
4465 every referenced extent is counted whole, exactly once -- no matter if you use
4466 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4467 uncompressed size will not match the number given by @command{tar} or
4468 @command{du}. On the other hand, the space used should be accurate (although
4469 obviously it can be shared with files outside our set).")
4470 (license license:gpl2+)))
4472 (define-public f2fs-tools-1.7
4479 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4480 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4483 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4485 (build-system gnu-build-system)
4488 (modify-phases %standard-phases
4489 (add-after 'install 'install-headers
4490 (lambda* (#:key outputs #:allow-other-keys)
4491 (let* ((out (assoc-ref outputs "out"))
4492 (out-include (string-append out "/include")))
4493 (install-file "include/f2fs_fs.h" out-include)
4494 (install-file "mkfs/f2fs_format_utils.h" out-include)
4497 `(("autoconf" ,autoconf)
4498 ("automake" ,automake)
4499 ("libtool" ,libtool)
4500 ("pkg-config" ,pkg-config)))
4502 `(("libuuid" ,util-linux "lib")
4503 ("libselinux" ,libselinux)))
4504 (home-page "https://f2fs.wiki.kernel.org/")
4505 (synopsis "Userland tools for f2fs")
4507 "F2FS, the Flash-Friendly File System, is a modern file system
4508 designed to be fast and durable on flash devices such as solid-state
4509 disks and SD cards. This package provides the userland utilities.")
4510 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4511 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4512 (license (list license:gpl2 license:lgpl2.1))))
4514 (define-public f2fs-tools
4516 (inherit f2fs-tools-1.7)
4522 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4523 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4526 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
4528 `(("libuuid" ,util-linux "lib")))))
4530 (define-public freefall
4533 (version (package-version linux-libre))
4534 (source (package-source linux-libre))
4535 (build-system gnu-build-system)
4537 '(#:phases (modify-phases %standard-phases
4538 (add-after 'unpack 'enter-subdirectory
4540 (chdir "tools/laptop/freefall")
4543 (add-before 'build 'increase-timeout
4545 ;; The default of 2 seconds is too low: it assumes an
4546 ;; open lid and AC power without actually checking.
4547 (substitute* "freefall.c"
4548 (("alarm\\(2\\)") "alarm(5)"))
4550 #:make-flags (list (string-append "PREFIX="
4551 (assoc-ref %outputs "out"))
4553 #:tests? #f)) ;no tests
4554 (home-page (package-home-page linux-libre))
4555 (synopsis "Free-fall protection for spinning laptop hard drives")
4557 "Prevents shock damage to the internal spinning hard drive(s) of some
4558 HP and Dell laptops. When sudden movement is detected, all input/output
4559 operations on the drive are suspended and its heads are parked on the ramp,
4560 where they are less likely to cause damage to the spinning disc. Requires a
4561 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4562 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4563 (license license:gpl2)))
4565 (define-public thinkfan
4573 (url "https://github.com/vmatare/thinkfan.git")
4575 (file-name (git-file-name name version))
4577 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4578 (build-system cmake-build-system)
4580 `(#:modules ((guix build cmake-build-system)
4583 #:tests? #f ; no test target
4585 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4586 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4588 `("-DUSE_ATASMART:BOOL=ON")
4590 (modify-phases %standard-phases
4591 (add-after 'unpack 'create-init-scripts
4592 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4593 ;; systemd to patch and install their service files. Fake their
4594 ;; presence rather than duplicating the build system below. Leave
4595 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4596 ;; The sysvinit needs manual patching, but since upstream doesn't
4597 ;; even provide the option to install it: don't.
4598 (lambda* (#:key outputs #:allow-other-keys)
4599 (let* ((out (assoc-ref outputs "out"))
4600 (share (string-append out "/share/" ,name)))
4601 (substitute* "CMakeLists.txt"
4602 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4603 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4604 ;; That was easy! Now we just need to fix the destinations.
4606 (string-append out directory)))
4609 `(("pkg-config" ,pkg-config)))
4611 `(("libatasmart" ,libatasmart)
4612 ("yaml-cpp" ,yaml-cpp)))
4613 (home-page "http://thinkfan.sourceforge.net/")
4614 (synopsis "Simple fan control program")
4616 "Thinkfan is a simple fan control program. It reads temperatures,
4617 checks them against configured limits and switches to appropriate (also
4618 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4619 other @code{hwmon} driver that enables temperature reading and fan control
4621 (license license:gpl3+)))
4623 (define-public tpacpi-bat
4631 (url "https://github.com/teleshoes/tpacpi-bat.git")
4632 (commit (string-append "v" version))))
4633 (file-name (git-file-name name version))
4635 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4636 (build-system gnu-build-system)
4638 `(#:tests? #f ; no test target
4640 (modify-phases %standard-phases
4641 (add-after 'unpack 'refer-to-inputs
4643 (substitute* "tpacpi-bat"
4645 (format "~a " (which "cat")))
4646 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4647 ;; loaded. That's the administrator's prerogative; disable it.
4648 (("system \"(modprobe .*)\"" _ match)
4649 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4651 (delete 'configure) ; nothing to configure
4652 (delete 'build) ; nothing to build
4654 (lambda* (#:key outputs #:allow-other-keys)
4655 (let* ((out (assoc-ref outputs "out"))
4656 (bin (string-append out "/bin"))
4657 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4658 (install-file "tpacpi-bat" bin)
4660 ;; There's no man page. Install other forms of documentation.
4661 (for-each (lambda (file)
4662 (let ((target (string-append doc "/" file)))
4663 (mkdir-p (dirname target))
4664 (copy-recursively file target)))
4665 (list "battery_asl" "examples" "README.md"))
4669 (home-page "https://github.com/teleshoes/tpacpi-bat")
4670 (synopsis "ThinkPad battery charge controller")
4672 "Tpacpi-bat is a command-line interface to control battery charging on
4673 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4674 ThinkPad models released after 2011}, starting with the xx20 series. It can
4675 query and set the thresholds at which one or both batteries will start and stop
4676 charging, inhibit charging batteries for a set period of time, or force them to
4677 discharge when they otherwise would not.
4679 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4680 kernel module provided by the @code{acpi-call-linux-module} package, which must
4681 be installed and loaded separately. Only the original vendor firmware is
4683 (license license:gpl3+)))
4685 (define-public ntfs-3g
4688 (version "2017.3.23")
4691 (uri (string-append "https://tuxera.com/opensource/"
4692 "ntfs-3g_ntfsprogs-" version ".tgz"))
4693 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4696 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4697 (modules '((guix build utils)))
4699 ;; Install under $prefix.
4700 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4704 (build-system gnu-build-system)
4705 (inputs `(("util-linux" ,util-linux)
4706 ("fuse" ,fuse))) ;libuuid
4707 (native-inputs `(("pkg-config" ,pkg-config)))
4709 '(#:configure-flags (list "--exec-prefix=${prefix}"
4710 "--with-fuse=external" ;use our own FUSE
4711 "--enable-mount-helper"
4712 "--enable-posix-acls"
4713 "--enable-xattr-mappings")
4715 (modify-phases %standard-phases
4716 ;; If users install ntfs-3g, they probably want to make it the
4717 ;; default driver as well, so we opt for sensible defaults and link
4718 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4719 ;; mount NTFS file systems.)
4720 (add-after 'install 'install-link
4721 (lambda* (#:key outputs #:allow-other-keys)
4722 (let* ((out (assoc-ref outputs "out"))
4723 (sbin (string-append out "/sbin")))
4724 (symlink "mount.ntfs-3g"
4725 (string-append sbin "/mount.ntfs")))
4727 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4728 (synopsis "Read-write access to NTFS file systems")
4730 "NTFS-3G provides read-write access to NTFS file systems, which are
4731 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4732 The package provides additional NTFS tools.")
4733 (license license:gpl2+)))
4735 (define-public rdma-core
4741 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4742 "/releases/download/v" version "/rdma-core-"
4746 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
4747 (build-system cmake-build-system)
4749 `(#:tests? #f ; no tests
4750 ;; Upstream uses the "ninja" build system and encourage distros
4751 ;; to do the same for consistency. They also recommend using the
4752 ;; "Release" build type.
4753 #:build-type "Release"
4754 #:configure-flags (list "-GNinja"
4756 (string-append "-DRST2MAN_EXECUTABLE="
4757 (assoc-ref %build-inputs
4761 ;; On some configurations, the
4762 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4763 ;; used by default, would return ENODEV. To
4764 ;; avoid that, use 'write' instead of ioctls,
4765 ;; as suggested in 'CMakeList.txt'.
4766 "-DIOCTL_MODE=write")
4768 (modify-phases %standard-phases
4772 "-j" (number->string (parallel-job-count)))))
4775 (invoke "ninja" "install"))))))
4778 ("pkg-config" ,pkg-config)
4779 ("python" ,python-wrapper)
4780 ("python-docutils" ,python-docutils))) ;for 'rst2man'
4784 (home-page "https://github.com/linux-rdma/rdma-core")
4785 (synopsis "Utilities and libraries for working with RDMA devices")
4787 "This package provides userspace components for the InfiniBand
4788 subsystem of the Linux kernel. Specifically it contains userspace
4789 libraries for the following device nodes:
4792 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4793 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4794 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4797 The following service daemons are also provided:
4799 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4800 @item @code{iwpmd} (for iWARP kernel providers)
4801 @item @code{ibacm} (for InfiniBand communication management assistant)
4803 ;; All library code is dual licensed under GPL2 and a custom MIT
4804 ;; variant. The package also includes some components covered by
4805 ;; other licenses. Consult COPYING.md for full details.
4808 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4809 license:bsd-2 ; Files referring to COPYING.BSD_FB
4810 license:cc0 ; most files in ccan/
4811 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4813 (define-public perftest
4820 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4821 version "/perftest-" version ".g0927198.tar.gz"))
4823 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4824 (build-system gnu-build-system)
4827 (modify-phases %standard-phases
4828 (add-after 'unpack 'patch-header-paths
4830 (substitute* '("src/raw_ethernet_fs_rate.c"
4831 "src/raw_ethernet_resources.c"
4832 "src/raw_ethernet_resources.h"
4833 "src/raw_ethernet_send_burst_lat.c"
4834 "src/raw_ethernet_send_bw.c"
4835 "src/raw_ethernet_send_lat.c")
4836 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4838 (inputs `(("rdma-core" ,rdma-core)))
4839 (home-page "https://github.com/linux-rdma/perftest/")
4840 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4841 (description "This is a collection of tests written over uverbs intended for
4842 use as a performance micro-benchmark. The tests may be used for hardware or
4843 software tuning as well as for functional testing.
4845 The collection contains a set of bandwidth and latency benchmark such as:
4847 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4848 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4849 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4850 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4851 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4853 (license license:gpl2)))
4855 (define-public rng-tools
4858 (home-page "https://github.com/nhorman/rng-tools")
4862 (uri (git-reference (url home-page)
4863 (commit (string-append "v" version))))
4864 (file-name (git-file-name name version))
4867 "065jf26s8zkicb95zc9ilksjdq9gqrh5vcx3mhi6mypbnamn6w98"))))
4868 (build-system gnu-build-system)
4870 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4871 #:configure-flags '("--without-nistbeacon"
4872 "--without-pkcs11")))
4874 `(("autoconf" ,autoconf)
4875 ("automake" ,automake)
4876 ("pkg-config" ,pkg-config)))
4878 `(("libsysfs" ,sysfsutils)))
4879 (synopsis "Random number generator daemon")
4881 "Monitor a hardware random number generator, and supply entropy
4882 from that to the system kernel's @file{/dev/random} machinery.")
4883 ;; The source package is offered under the GPL2+, but the files
4884 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4885 (license (list license:gpl2 license:gpl2+))))
4887 (define-public cpupower
4890 (version (package-version linux-libre))
4891 (source (package-source linux-libre))
4892 (build-system gnu-build-system)
4894 '(#:phases (modify-phases %standard-phases
4895 (add-after 'unpack 'enter-subdirectory
4897 (chdir "tools/power/cpupower")
4900 (add-before 'build 'fix-makefiles
4902 (substitute* "Makefile"
4904 (("/bin/(install|pwd)" _ command) command))
4905 (substitute* "bench/Makefile"
4906 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4908 #:make-flags (let ((out (assoc-ref %outputs "out")))
4909 (list (string-append "DESTDIR=" out)
4910 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4912 "docdir=/share/doc/cpupower"
4913 "confdir=$(docdir)/examples"
4914 ;; The Makefile recommends the following changes
4916 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4917 #:tests? #f)) ;no tests
4918 (native-inputs `(("gettext" ,gettext-minimal)))
4919 (inputs `(("pciutils" ,pciutils)))
4920 (home-page (package-home-page linux-libre))
4921 (synopsis "CPU frequency and voltage scaling tools for Linux")
4923 "cpupower is a set of user-space tools that use the cpufreq feature of the
4924 Linux kernel to retrieve and control processor features related to power saving,
4925 such as frequency and voltage scaling.")
4926 (license license:gpl2)))
4928 (define-public x86-energy-perf-policy
4930 (name "x86-energy-perf-policy")
4931 (version (package-version linux-libre))
4932 (source (package-source linux-libre))
4933 (build-system gnu-build-system)
4937 (modify-phases %standard-phases
4938 (add-after 'unpack 'enter-subdirectory
4940 (chdir "tools/power/x86/x86_energy_perf_policy")
4943 (add-before 'build 'fix-makefile
4945 (substitute* "Makefile" (("/usr") ""))
4948 (let ((out (assoc-ref %outputs "out")))
4949 (list (string-append "DESTDIR=" out)
4950 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4951 (supported-systems '("i686-linux" "x86_64-linux"))
4952 (home-page (package-home-page linux-libre))
4953 (synopsis "Display and update Intel-CPU energy-performance policy")
4955 "@command{x86_energy_perf_policy} displays and updates energy-performance
4956 policy settings specific to Intel Architecture Processors. Settings are
4957 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4958 cpufreq sub-system is enabled or not.")
4959 (license license:gpl2)))
4961 (define-public haveged
4969 (url "https://github.com/jirka-h/haveged.git")
4970 (commit (string-append "v" version))))
4971 (file-name (git-file-name name version))
4973 (base32 "1znr58fb3faq4nmrvc3c5whkc1f3chivm4vhicdwr9pdsyqqsd51"))))
4974 (build-system gnu-build-system)
4975 (home-page "https://www.issihosts.com/haveged")
4976 (synopsis "Entropy source for the Linux random number generator")
4978 "haveged generates an unpredictable stream of random numbers for use by
4979 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4980 standard mechanisms for filling the entropy pool may not be sufficient for
4981 systems with high needs or limited user interaction, such as headless servers.
4983 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4984 indirect effects of hardware events on hidden processor state using the
4985 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4986 It tunes itself to its environment and provides the same built-in test suite
4987 for the output stream as used on certified hardware security devices.
4989 The quality of the randomness produced by this algorithm has not been proven.
4990 It is recommended to run it together with another entropy source like rngd, and
4991 not as a replacement for it.")
4992 (license (list (license:non-copyleft "file://nist/mconf.h")
4993 (license:non-copyleft "file://nist/packtest.c")
4994 license:public-domain ; nist/dfft.c
4995 license:gpl3+)))) ; everything else
4997 (define-public ecryptfs-utils
4999 (name "ecryptfs-utils")
5004 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5005 version "/+download/ecryptfs-utils_"
5006 version ".orig.tar.gz"))
5009 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5010 (build-system gnu-build-system)
5012 `(#:configure-flags (list "--disable-pywrap")
5014 (modify-phases %standard-phases
5015 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5016 (lambda* (#:key inputs outputs #:allow-other-keys)
5017 (let ((out (assoc-ref outputs "out"))
5018 (utils-linux (assoc-ref inputs "utils-linux"))
5019 (cryptsetup (assoc-ref inputs "cryptsetup"))
5020 (linux-pam (assoc-ref inputs "linux-pam"))
5021 (lvm2 (assoc-ref inputs "lvm2")))
5022 (substitute* '("src/utils/ecryptfs-mount-private"
5023 "src/utils/ecryptfs-umount-private"
5024 "src/utils/ecryptfs-setup-private"
5025 "src/utils/ecryptfs-setup-swap"
5026 "src/utils/mount.ecryptfs.c"
5027 "src/utils/umount.ecryptfs.c"
5028 "src/pam_ecryptfs/pam_ecryptfs.c"
5029 "src/desktop/ecryptfs-mount-private.desktop.in"
5030 "src/desktop/ecryptfs-setup-private.desktop.in")
5032 (string-append utils-linux "/bin/mount"))
5034 (string-append utils-linux "/bin/umount"))
5035 (("/sbin/mount.ecryptfs_private")
5036 (string-append out "/sbin/mount.ecryptfs_private"))
5037 (("/sbin/umount.ecryptfs_private")
5038 (string-append out "/sbin/umount.ecryptfs_private"))
5039 (("/usr/bin/ecryptfs-mount-private")
5040 (string-append out "/bin/ecryptfs-mount-private"))
5041 (("/usr/bin/ecryptfs-rewrite-file")
5042 (string-append out "/bin/ecryptfs-rewrite-file"))
5043 (("/usr/bin/ecryptfs-setup-private")
5044 (string-append out "/bin/ecryptfs-setup-private"))
5045 (("/sbin/cryptsetup")
5046 (string-append cryptsetup "/sbin/cryptsetup"))
5047 (("/sbin/unix_chkpwd")
5048 (string-append linux-pam "/sbin/unix_chkpwd"))
5050 (string-append lvm2 "/sbin/dmsetup")))))))))
5052 `(("intltool" ,intltool)
5053 ("perl" ,perl) ; for pod2man
5054 ("pkg-config" ,pkg-config)))
5056 `(("keyutils" ,keyutils)
5057 ("linux-pam" ,linux-pam)
5058 ("utils-linux" ,util-linux)
5059 ("cryptsetup" ,cryptsetup)
5062 (home-page "https://ecryptfs.org/")
5063 (synopsis "eCryptfs cryptographic file system utilities")
5065 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5066 Each file's cryptographic meta-data is stored inside the file itself, along
5067 with the encrypted contents. This allows individual encrypted files to be
5068 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5069 native Linux file system, and has been part of the Linux kernel since version
5070 2.6.19. This package contains the userland utilities to manage it.")
5071 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5072 ;; grant additional permission to link with OpenSSL.
5073 (license license:gpl2+)))
5075 (define-public libnfsidmap
5077 (name "libnfsidmap")
5082 (uri (string-append "https://fedorapeople.org/~steved/"
5083 name "/" version "/" name "-" version ".tar.bz2"))
5085 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5086 (build-system gnu-build-system)
5088 `(#:configure-flags (list
5089 (string-append "--with-pluginpath="
5090 (assoc-ref %outputs "out")
5091 "/lib/libnfsidmap"))))
5093 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5095 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5096 (synopsis "NFSv4 support library for name/ID mapping")
5097 (description "Libnfsidmap is a library holding mulitiple methods of
5098 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5099 extensible array of mapping functions, currently consisting of two choices:
5100 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5101 (license (license:non-copyleft "file://COPYING"
5102 "See COPYING in the distribution."))))
5104 (define-public module-init-tools
5106 (name "module-init-tools")
5111 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5112 "module-init-tools-" version ".tar.bz2"))
5115 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5116 (patches (search-patches "module-init-tools-moduledir.patch"))))
5117 (build-system gnu-build-system)
5119 ;; FIXME: The upstream tarball lacks man pages, and building them would
5120 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5121 ;; but they vanished. In the meantime, fake it.
5123 (modify-phases %standard-phases
5124 (add-before 'configure 'fake-docbook
5126 (substitute* "Makefile.in"
5127 (("^DOCBOOKTOMAN.*$")
5128 "DOCBOOKTOMAN = true\n"))
5130 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5131 (synopsis "Tools for loading and managing Linux kernel modules")
5133 "Tools for loading and managing Linux kernel modules, such as
5134 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5135 (license license:gpl2+)))
5137 (define-public mcelog
5143 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5144 "mcelog.git/snapshot/v" version ".tar.gz"))
5147 "1c4faayg1gcm3002b2fdrfnv76z92mvfzccvx8w9crjp0d17sp24"))
5148 (file-name (string-append name "-" version ".tar.gz"))
5149 (modules '((guix build utils)))
5152 ;; The snapshots lack a .git directory,
5153 ;; breaking ‘git describe’.
5154 (substitute* "Makefile"
5155 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5157 (build-system gnu-build-system)
5159 `(#:phases (modify-phases %standard-phases
5160 (delete 'configure)) ; no configure script
5161 #:make-flags (let ((out (assoc-ref %outputs "out")))
5163 (string-append "prefix=" out)
5164 (string-append "DOCDIR=" out "/share/doc/mcelog")
5165 "etcprefix=$(DOCDIR)/examples"))
5166 ;; The tests will only run as root on certain supported CPU models.
5168 (supported-systems (list "i686-linux" "x86_64-linux"))
5169 (home-page "https://mcelog.org/")
5170 (synopsis "Machine check monitor for x86 Linux systems")
5172 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
5173 and other hardware errors on x86 systems. It can also perform user-defined
5174 tasks, such as bringing bad pages off-line, when configurable error thresholds
5176 (license license:gpl2)))
5178 (define-public mtd-utils
5185 "ftp://ftp.infradead.org/pub/mtd-utils/"
5186 "mtd-utils-" version ".tar.bz2"))
5189 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
5191 '(#:configure-flags '("--enable-unit-tests")))
5193 `(("cmocka" ,cmocka)
5194 ("pkg-config" ,pkg-config)))
5196 `(("acl" ,acl) ; extended attributes (xattr)
5197 ("libuuid" ,util-linux "lib")
5199 ("openssl" ,openssl) ; optional crypto support
5201 ("zstd" ,zstd "lib")))
5202 (build-system gnu-build-system)
5203 (synopsis "MTD Flash Storage Utilities")
5204 (description "This package provides utilities for testing, partitioning, etc
5206 (home-page "http://www.linux-mtd.infradead.org/")
5208 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5209 license:mpl1.1 ; All ftl* files
5210 license:expat)))) ; libiniparser
5212 (define-public libseccomp
5218 (uri (string-append "https://github.com/seccomp/libseccomp/"
5219 "releases/download/v" version
5220 "/libseccomp-" version ".tar.gz"))
5223 "07crwxqzvl5k2b90a47ii9wgvi09s9hsy5b5jddw9ylp351d25fg"))))
5224 (build-system gnu-build-system)
5226 `(("which" ,which)))
5227 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5228 (description "The libseccomp library provides an easy to use, platform
5229 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5230 libseccomp API is designed to abstract away the underlying BPF based syscall
5231 filter language and present a more conventional function-call based filtering
5232 interface that should be familiar to, and easily adopted by, application
5234 (home-page "https://github.com/seccomp/libseccomp")
5235 (license license:lgpl2.1)))
5237 (define-public radeontop
5245 (url "https://github.com/clbr/radeontop.git")
5246 (commit (string-append "v" version))))
5247 (file-name (git-file-name name version))
5249 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5250 (build-system gnu-build-system)
5252 `(#:phases (modify-phases %standard-phases
5253 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5254 ;; dependency, and doesn't even work on release(!) tarballs.
5255 (add-after 'unpack 'report-correct-version
5257 (substitute* "getver.sh"
5259 (string-append "ver=" ,version)))
5261 (delete 'configure)) ; no configure script
5262 #:make-flags (list "CC=gcc"
5263 (string-append "PREFIX=" %output))
5264 #:tests? #f)) ; no tests
5266 `(("gettext" ,gettext-minimal)
5267 ("pkg-config" ,pkg-config)))
5269 `(("libdrm" ,libdrm)
5270 ("libpciaccess" ,libpciaccess)
5272 ("ncurses" ,ncurses)))
5273 (home-page "https://github.com/clbr/radeontop/")
5274 (synopsis "Usage monitor for AMD Radeon graphics")
5275 (description "RadeonTop monitors resource consumption on supported AMD
5276 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5277 a terminal or saved to a file for further processing. It measures both the
5278 activity of the GPU as a whole, which is also accurate during OpenCL
5279 computations, as well as separate component statistics that are only meaningful
5280 under OpenGL graphics workloads.")
5281 (license license:gpl3)))
5283 (define-public efivar
5289 (uri (string-append "https://github.com/rhboot/" name
5290 "/releases/download/" version "/" name
5291 "-" version ".tar.bz2"))
5294 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5295 (build-system gnu-build-system)
5297 `(;; Tests require a UEFI system and is not detected in the chroot.
5299 #:make-flags (list (string-append "prefix=" %output)
5300 (string-append "libdir=" %output "/lib")
5302 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5304 (modify-phases %standard-phases
5305 (delete 'configure))))
5307 `(("pkg-config" ,pkg-config)))
5310 (home-page "https://github.com/rhboot/efivar")
5311 (synopsis "Tool and library to manipulate EFI variables")
5312 (description "This package provides a library and a command line
5313 interface to the variable facility of UEFI boot firmware.")
5314 (license license:lgpl2.1+)))
5316 (define-public efibootmgr
5322 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5323 "/releases/download/" version "/efibootmgr"
5324 "-" version ".tar.bz2"))
5327 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5328 (build-system gnu-build-system)
5330 `(#:tests? #f ;no tests
5331 #:make-flags (list (string-append "prefix=" %output)
5332 (string-append "libdir=" %output "/lib")
5333 ;; EFIDIR denotes a subdirectory relative to the
5334 ;; EFI System Partition where the loader will be
5335 ;; installed (known as OS_VENDOR in the code).
5336 ;; GRUB overrides this, as such it's only used if
5337 ;; nothing else is specified on the command line.
5339 #:phases (modify-phases %standard-phases (delete 'configure))))
5341 `(("pkg-config" ,pkg-config)))
5343 `(("efivar" ,efivar)
5345 (home-page "https://github.com/rhinstaller/efibootmgr")
5346 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5348 "@code{efibootmgr} is a user-space application to modify the Intel
5349 Extensible Firmware Interface (EFI) Boot Manager. This application can
5350 create and destroy boot entries, change the boot order, change the next
5351 running boot option, and more.")
5352 (license license:gpl2+)))
5354 (define-public sysstat
5360 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5361 "sysstat-" version ".tar.xz"))
5364 "1hf1sy7akribmgavadqccxpy49yv0zfb3m81d2bj6jf8pyzwcrbq"))))
5365 (build-system gnu-build-system)
5367 `(#:tests? #f ; No test suite.
5368 ;; Without this flag, it tries to install the man pages with group 'root'
5369 ;; and fails because /etc/passwd lacks an entry for the root user.
5371 (list "--disable-file-attr"
5372 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5374 (modify-phases %standard-phases
5375 ;; The build process tries to create '/var/lib/sa', so we skip that
5377 (add-after 'build 'skip-touching-var
5379 (substitute* "Makefile"
5380 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5383 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5384 (synopsis "Performance monitoring tools for Linux")
5385 (description "The sysstat utilities are a collection of performance
5386 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5387 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5388 @code{sadf} and @code{sa}.")
5389 (license license:gpl2+)))
5391 (define-public light
5399 (url "https://github.com/haikarainen/light.git")
5400 (commit (string-append "v" version))))
5402 (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
5403 (file-name (git-file-name name version))))
5404 (build-system gnu-build-system)
5407 (modify-phases %standard-phases
5408 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5409 (lambda* (#:key inputs #:allow-other-keys)
5410 (substitute* "90-backlight.rules"
5411 (("/bin/chgrp") (which "chgrp"))
5412 (("/bin/chmod") (which "chmod")))
5414 (add-after 'install 'install-udev-rules
5415 (lambda* (#:key outputs #:allow-other-keys)
5416 (let ((out (assoc-ref outputs "out")))
5418 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5421 `(("autoconf" ,autoconf)
5422 ("automake" ,automake)))
5423 (home-page "https://haikarainen.github.io/light/")
5424 (synopsis "GNU/Linux application to control backlights")
5426 "Light is a program to send commands to screen backlight controllers
5427 under GNU/Linux. Features include:
5430 @item It does not rely on X.
5431 @item Light can automatically figure out the best controller to use, making
5432 full use of underlying hardware.
5433 @item It is possible to set a minimum brightness value, as some controllers
5434 set the screen to be pitch black at a vaĺue of 0 (or higher).
5437 Light is the successor of lightscript.")
5438 (license license:gpl3+)))
5440 (define-public brightnessctl
5441 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5443 (name "brightnessctl")
5444 (version (git-version "0.4" "0" commit))
5448 (url "https://github.com/Hummer12007/brightnessctl/")
5450 (file-name (git-file-name name version))
5453 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5454 (build-system gnu-build-system)
5456 '(#:tests? #f ; no tests
5457 #:make-flags (list "CC=gcc"
5458 (string-append "PREFIX=" %output)
5459 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5461 (modify-phases %standard-phases
5463 (add-after 'unpack 'adjust-udev-rules
5465 (substitute* "90-brightnessctl.rules"
5466 (("/bin/") "/run/current-system/profile/bin/"))
5468 (home-page "https://github.com/Hummer12007/brightnessctl")
5469 (synopsis "Backlight and LED brightness control")
5471 "This program allows you read and control device brightness. Devices
5472 include backlight and LEDs. It can also preserve current brightness before
5473 applying the operation, such as on lid close.
5475 The appropriate permissions must be set on the backlight or LED control
5476 interface in sysfs, which can be accomplished with the included udev rules.")
5477 (license license:expat))))
5487 (url "https://github.com/linrunner/TLP.git")
5489 (file-name (git-file-name name version))
5491 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
5493 `(("shellcheck" ,shellcheck)))
5497 ("ethtool" ,ethtool)
5501 ("inetutils" ,inetutils)
5504 ("pciutils" ,pciutils)
5508 ("usbutils" ,usbutils)
5509 ("util-linux" ,util-linux)
5510 ("wireless-tools" ,wireless-tools)
5511 ,@(if (let ((system (or (%current-target-system)
5512 (%current-system))))
5513 (or (string-prefix? "i686-" system)
5514 (string-prefix? "x86_64-" system)))
5515 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5517 (build-system gnu-build-system)
5519 ;; XXX: The full test suite is run with "checkall" but it requires
5520 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
5521 `(#:test-target "shellcheck"
5522 #:modules ((guix build gnu-build-system)
5526 (modify-phases %standard-phases
5527 (delete 'configure) ; no configure script
5528 (add-before 'build 'setenv
5529 (lambda* (#:key outputs #:allow-other-keys)
5530 (let ((out (assoc-ref outputs "out")))
5531 (setenv "TLP_WITH_SYSTEMD" "0")
5532 (setenv "TLP_NO_INIT" "1")
5533 (setenv "TLP_NO_PMUTILS" "1")
5534 (setenv "TLP_SBIN" (string-append out "/bin"))
5535 (setenv "TLP_BIN" (string-append out "/bin"))
5536 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5537 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
5538 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
5539 (setenv "TLP_CONFDEF"
5540 (string-append out "/share/tlp/defaults.conf"))
5541 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
5543 (string-append out "/lib/elogind/system-sleep"))
5545 (string-append out "/share/bash-completion/completions"))
5546 (setenv "TLP_MAN" (string-append out "/share/man"))
5547 (setenv "TLP_META" (string-append out "/share/metainfo"))
5549 (add-before 'install 'fix-installation
5551 ;; Stop the Makefile from trying to create system directories.
5552 (substitute* "Makefile"
5553 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
5554 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
5557 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
5558 (add-after 'install 'wrap
5559 (lambda* (#:key inputs outputs #:allow-other-keys)
5560 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5561 (bin-files (find-files bin ".*")))
5562 (define (bin-directory input-name)
5563 (let ((p (assoc-ref inputs input-name)))
5564 (and p (string-append p "/bin"))))
5565 (define (sbin-directory input-name)
5566 (string-append (assoc-ref inputs input-name) "/sbin"))
5567 (for-each (lambda (program)
5568 (wrap-program program
5571 (filter-map bin-directory
5583 "x86-energy-perf-policy"))
5584 (filter-map sbin-directory
5590 "wireless-tools"))))))
5593 (home-page "https://linrunner.de/en/tlp/tlp.html")
5594 (synopsis "Power management tool for Linux")
5595 (description "TLP is a power management tool for Linux. It comes with
5596 a default configuration already optimized for battery life. Nevertheless,
5597 TLP is customizable to fulfil system requirements. TLP settings are applied
5598 every time the power supply source is changed.")
5599 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5601 (license (list license:gpl2+ license:gpl3+))))
5609 (uri (string-append "https://www.ezix.org/software/"
5610 "files/lshw-" version
5614 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5615 (build-system gnu-build-system)
5617 `(#:phases (modify-phases %standard-phases (delete 'configure))
5618 #:tests? #f ; no tests
5620 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5621 (synopsis "List hardware information")
5623 "@command{lshw} (Hardware Lister) is a small tool to provide
5624 detailed information on the hardware configuration of the machine.
5625 It can report exact memory configuration, firmware version, mainboard
5626 configuration, CPU version and speed, cache configuration, bus speed,
5627 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5628 machines (PowerMac G4 is known to work).")
5629 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5630 (license license:gpl2+)))
5632 (define-public libmnl
5639 (uri (string-append "mirror://netfilter.org/libmnl/"
5640 "libmnl-" version ".tar.bz2"))
5643 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5644 (build-system gnu-build-system)
5645 (home-page "https://www.netfilter.org/projects/libmnl/")
5646 (synopsis "Netlink utility library")
5647 (description "Libmnl is a minimalistic user-space library oriented to
5648 Netlink developers. There are a lot of common tasks in parsing, validating,
5649 constructing of both the Netlink header and TLVs that are repetitive and easy to
5650 get wrong. This library aims to provide simple helpers that allows you to
5651 re-use code and to avoid re-inventing the wheel.")
5652 (license license:lgpl2.1+)))
5654 (define-public libnftnl
5661 (uri (string-append "mirror://netfilter.org/libnftnl/"
5662 "libnftnl-" version ".tar.bz2"))
5664 (base32 "1wqlxf76bkqf3qhka9sw32qhb2ni20q1k6rn3iril2kw482lvpk6"))
5666 (search-patches "libnftnl-dont-check-NFTNL_FLOWTABLE_SIZE.patch"))))
5667 (build-system gnu-build-system)
5669 `(("pkg-config" ,pkg-config)))
5671 `(("libmnl" ,libmnl)))
5672 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5673 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5674 (description "Libnftnl is a userspace library providing a low-level netlink
5675 programming interface to the in-kernel nf_tables subsystem. The library
5676 libnftnl has been previously known as libnftables. This library is currently
5678 (license license:gpl2+)))
5680 (define-public nftables
5687 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
5689 (string-append "https://www.nftables.org/projects/nftables"
5690 "/files/nftables-" version ".tar.bz2")))
5692 (base32 "0y6vbqp6x8w165q65h4n9sba1406gaz0d4744gqszbm7w9f92swm"))))
5693 (build-system gnu-build-system)
5694 (arguments `(#:configure-flags
5695 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5696 (inputs `(("bison" ,bison)
5700 ("libnftnl" ,libnftnl)
5701 ("readline" ,readline)))
5702 (native-inputs `(("pkg-config" ,pkg-config)))
5703 (home-page "https://www.nftables.org")
5704 (synopsis "Userspace utility for Linux packet filtering")
5705 (description "nftables is the project that aims to replace the existing
5706 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5707 filtering framework, a new userspace utility and also a compatibility layer for
5708 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5709 infrastructure such as the existing hooks, the connection tracking system, the
5710 userspace queueing component and the logging subsystem.")
5711 (license license:gpl2)))
5713 (define-public proot
5721 (url "https://github.com/proot-me/PRoot.git")
5722 (commit (string-append "v" version))))
5723 (file-name (git-file-name name version))
5725 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5726 (patches (search-patches "proot-test-fhs.patch"))))
5727 (build-system gnu-build-system)
5729 '(#:make-flags '("-C" "src")
5731 #:phases (modify-phases %standard-phases
5733 (add-before 'build 'set-shell-file-name
5734 (lambda* (#:key inputs #:allow-other-keys)
5735 (substitute* (find-files "src" "\\.[ch]$")
5738 (assoc-ref inputs "bash")
5741 (add-before 'check 'fix-fhs-assumptions-in-tests
5743 (substitute* "tests/test-c6b77b77.mk"
5744 (("/bin/bash") (which "bash"))
5745 (("/usr/bin/test") (which "test")))
5746 (substitute* '("tests/test-16573e73.c")
5747 (("/bin/([a-z-]+)" _ program)
5750 (substitute* (find-files "tests" "\\.sh$")
5751 ;; Some of the tests try to "bind-mount" /bin/true.
5753 (string-append "-b " (which "true") ":"))
5754 ;; Likewise for /bin.
5755 (("-b /bin:") "-b /gnu:")
5756 ;; Others try to run /bin/sh.
5757 (("/bin/sh") (which "sh"))
5758 ;; Others assume /etc/fstab exists.
5759 (("/etc/fstab") "/etc/passwd"))
5761 (substitute* "tests/GNUmakefile"
5762 (("-b /bin:") "-b /gnu:"))
5764 ;; XXX: This test fails in an obscure corner case, just
5766 (delete-file "tests/test-kkkkkkkk.c")
5771 (let ((n (parallel-job-count)))
5772 ;; For some reason we get lots of segfaults with
5773 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5774 (setenv "PROOT_NO_SECCOMP" "1")
5776 ;; Most of the tests expect "/bin" to be in $PATH so
5777 ;; they can run things that live in $ROOTFS/bin.
5779 (string-append (getenv "PATH") ":/bin"))
5781 (invoke "make" "check" "-C" "tests"
5783 "-j" (number->string n)))))
5785 (lambda* (#:key outputs #:allow-other-keys)
5786 ;; The 'install' rule does nearly nothing.
5787 (let* ((out (assoc-ref outputs "out"))
5788 (man1 (string-append out "/share/man/man1")))
5789 ;; TODO: 'make install-care' (does not even
5790 ;; build currently.)
5791 (invoke "make" "-C" "src" "install"
5792 (string-append "PREFIX=" out))
5795 (copy-file "doc/proot/man.1"
5796 (string-append man1 "/proot.1"))
5798 (native-inputs `(("which" ,which)
5800 ;; For 'mcookie', used by some of the tests.
5801 ("util-linux" ,util-linux)))
5802 (inputs `(("talloc" ,talloc)))
5803 (home-page "https://github.com/proot-me/PRoot")
5804 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5806 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5807 and @code{binfmt_misc}. This means that users don't need any privileges or
5808 setup to do things like using an arbitrary directory as the new root
5809 file system, making files accessible somewhere else in the file system
5810 hierarchy, or executing programs built for another CPU architecture
5811 transparently through QEMU user-mode. Also, developers can use PRoot as a
5812 generic process instrumentation engine thanks to its extension mechanism.
5813 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5814 available in the kernel Linux.")
5815 (license license:gpl2+)))
5817 (define-public proot-static
5820 (name "proot-static")
5822 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5823 (inputs `(("talloc" ,talloc/static)))
5825 (substitute-keyword-arguments (package-arguments proot)
5826 ((#:make-flags flags)
5827 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5829 `(modify-phases ,phases
5830 (add-after 'strip 'remove-store-references
5831 (lambda* (#:key outputs #:allow-other-keys)
5832 (let* ((out (assoc-ref outputs "out")))
5833 (with-directory-excursion out
5834 (remove-store-references "bin/proot")
5836 ((#:allowed-references _ '("out"))
5839 (define-public cpuid
5842 (version "20200211")
5845 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5846 version ".src.tar.gz"))
5849 "06sjbqqp80l7nhsp6khglkzdp9qy4vhbvjxbfilznhsmrqiwlw55"))))
5850 (build-system gnu-build-system)
5852 '(#:make-flags '("CC=gcc")
5853 #:tests? #f ; no tests
5854 #:phases (modify-phases %standard-phases
5855 (delete 'configure) ; no configure script
5856 (add-before 'install 'fix-makefile
5857 (lambda* (#:key outputs #:allow-other-keys)
5858 (substitute* "Makefile"
5859 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5860 ;; Make the compressed manpages writable so that the
5861 ;; reset-gzip-timestamps phase does not error out.
5862 (substitute* "Makefile"
5863 (("-m 444") "-m 644"))
5865 (inputs `(("perl" ,perl)))
5866 (supported-systems '("i686-linux" "x86_64-linux"))
5867 (home-page "http://www.etallen.com/cpuid.html")
5868 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5869 (description "cpuid dumps detailed information about the CPU(s) gathered
5870 from the CPUID instruction, and also determines the exact model of CPU(s). It
5871 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5872 NexGen, Rise, and SiS CPUs.")
5873 (license license:gpl2+)))
5875 (define-public jmtpfs
5882 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5884 (file-name (string-append name "-" version ".tar.gz"))
5887 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5888 (build-system gnu-build-system)
5892 ("libmtp" ,libmtp)))
5894 `(("pkg-config" ,pkg-config)))
5895 (home-page "https://github.com/JasonFerrara/jmtpfs")
5896 (synopsis "Use a FUSE file system to access data over MTP")
5897 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5898 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5899 the MTP device as a file system.")
5900 (license license:gpl3)))
5902 (define-public procenv
5909 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5911 (file-name (string-append name "-" version ".tar.gz"))
5913 (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
5914 (build-system gnu-build-system)
5915 (arguments `(#:configure-flags '("--disable-silent-rules")))
5916 (native-inputs `(("pkg-config" ,pkg-config)))
5917 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5918 ("groff" ,groff) ; for tests
5919 ("libselinux" ,libselinux)))
5920 (synopsis "Utility to show process environment")
5921 (description "Procenv is a command-line tool that displays as much detail about
5922 itself and its environment as possible. It can be used as a test
5923 tool, to understand the type of environment a process runs in, and for
5924 comparing system environments.")
5925 (home-page "http://github.com/jamesodhunt/procenv/")
5926 (license license:gpl3+)))
5928 (define-public libfabric
5936 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5937 version "/libfabric-" version ".tar.bz2"))
5939 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5940 (build-system gnu-build-system)
5941 (inputs `(("rdma-core" ,rdma-core)
5942 ,@(match (%current-system)
5943 ((member (package-supported-systems psm))
5947 (home-page "https://ofiwg.github.io/libfabric/")
5948 (synopsis "Open Fabric Interfaces")
5950 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5951 communication services to applications. OFI is best described as a collection
5952 of libraries and applications used to export fabric services. The key
5953 components of OFI are: application interfaces, provider libraries, kernel
5954 services, daemons, and test applications.
5956 Libfabric is a core component of OFI. It is the library that defines and
5957 exports the user-space API of OFI, and is typically the only software that
5958 applications deal with directly. It works in conjunction with provider
5959 libraries, which are often integrated directly into libfabric.")
5960 (license (list license:bsd-2 license:gpl2)))) ;dual
5965 (version "3.3.20170428")
5966 (home-page "https://github.com/intel/psm")
5970 (uri (git-reference (url home-page)
5971 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5972 (file-name (string-append "psm-" version ".tar.gz"))
5974 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5975 (patches (search-patches
5976 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5977 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5978 "psm-repro.patch" ; reproducibility
5979 "psm-disable-memory-stats.patch"))))
5980 (build-system gnu-build-system)
5981 (outputs '("out" "debug"))
5982 (inputs `(("libuuid" ,util-linux "lib")))
5984 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5985 ,(string-append "INSTALL_PREFIX=" %output)
5986 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5988 #:phases (modify-phases %standard-phases
5990 (add-after 'unpack 'patch-/usr/include
5992 (substitute* "Makefile"
5993 (("\\$\\{DESTDIR}/usr/include")
5994 (string-append %output "/include")))
5995 (substitute* "Makefile"
5996 (("/lib64") "/lib"))
5998 (add-after 'unpack 'patch-sysmacros
6000 (substitute* "ipath/ipath_proto.c"
6001 (("#include <sys/poll.h>" m)
6002 (string-append m "\n"
6003 "#include <sys/sysmacros.h>")))
6005 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6007 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6008 communications interface for the True Scale family of products. PSM users are
6009 enabled with mechanisms necessary to implement higher level communications
6010 interfaces in parallel environments.")
6011 ;; Only Intel-compatable processors are supported.
6012 (supported-systems '("i686-linux" "x86_64-linux"))
6013 (license (list license:bsd-2 license:gpl2)))) ;dual
6015 (define-public snapscreenshot
6017 (name "snapscreenshot")
6018 (version "1.0.14.3")
6022 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6023 name "-" version ".tar.bz2"))
6025 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6026 (build-system gnu-build-system)
6029 (let ((out (assoc-ref %outputs "out")))
6030 (list (string-append "BINDIR=" out "/bin")
6031 (string-append "MANDIR=" out "/share/man")))
6032 #:tests? #f ; no test suite
6034 (modify-phases %standard-phases
6035 (delete 'configure) ; ./configure is a snarky no-op
6036 (add-before 'install 'fix-ownership
6037 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6039 (substitute* "depfun.mak"
6040 ((" -o bin -g bin ") " "))
6042 (add-before 'install 'create-output-directories
6043 (lambda* (#:key outputs #:allow-other-keys)
6044 (let ((out (assoc-ref outputs "out")))
6045 (mkdir-p (string-append out "/share/man/man1"))
6047 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6048 (synopsis "Take screenshots of one or more Linux text consoles")
6050 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6051 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6052 relevant @file{/dev/vcs*} file(s).")
6053 (license license:gpl2)))
6055 (define-public fbcat
6062 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6063 version "/" name "-" version ".tar.gz"))
6065 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6066 (build-system gnu-build-system)
6068 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6069 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6070 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6071 `(("pnmtopng" ,netpbm)))
6072 (outputs (list "out" "fbgrab"))
6076 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6077 #:tests? #f ; no tests
6079 (modify-phases %standard-phases
6080 (delete 'configure) ; no configure script
6081 (add-after 'build 'qualify-references
6082 (lambda* (#:key inputs outputs #:allow-other-keys)
6083 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6084 (out (assoc-ref outputs "out")))
6085 (substitute* "fbgrab"
6087 (string-append out "/bin/" all))
6089 (string-append pnmtopng "/bin/" all)))
6091 (add-after 'install 'split-fbgrab-output
6092 (lambda* (#:key outputs #:allow-other-keys)
6093 (let* ((out (assoc-ref outputs "out"))
6094 (out:fbgrab (assoc-ref outputs "fbgrab")))
6095 (for-each (lambda (file)
6096 (let ((old (string-append out "/" file))
6097 (new (string-append out:fbgrab "/" file)))
6098 (mkdir-p (dirname new))
6099 (rename-file old new)))
6101 "share/man/man1/fbgrab.1"))
6103 (home-page "https://jwilk.net/software/fbcat")
6104 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6106 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6107 a dump therof. It supports a wide range of drivers and pixel formats.
6108 @command{fbcat} can take screenshots of virtually any application that can be
6109 made to write its output to the framebuffer, including (but not limited to)
6110 text-mode or graphical applications that don't use a display server.
6112 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6113 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6114 (license license:gpl2)))
6116 (define-public libcgroup
6124 "mirror://sourceforge/libcg/" name "/"
6125 version "/" name "-" version ".tar.bz2"))
6127 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6128 (build-system gnu-build-system)
6135 `(("linux-pam" ,linux-pam)))
6136 (home-page "https://sourceforge.net/projects/libcg/")
6137 (synopsis "Control groups management tools")
6138 (description "Control groups is Linux kernel method for process resource
6139 restriction, permission handling and more. This package provides userspace
6140 interface to this kernel feature.")
6141 (license license:lgpl2.1)))
6143 (define-public mbpfan
6151 (url "https://github.com/dgraziotin/mbpfan.git")
6152 (commit (string-append "v" version))))
6153 (file-name (git-file-name name version))
6155 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6156 (build-system gnu-build-system)
6158 '(#:tests? #f ; tests ask to be run as root
6159 #:make-flags (let ((out (assoc-ref %outputs "out")))
6160 (list (string-append "DESTDIR=" out)
6163 (modify-phases %standard-phases
6164 (add-after 'unpack 'patch-paths
6166 (substitute* "Makefile"
6169 (delete 'configure)))) ; there's no configure phase
6170 (home-page "https://github.com/dgraziotin/mbpfan")
6171 (synopsis "Control fan speed on Macbooks")
6173 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6174 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6175 module. It can be executed as a daemon or in the foreground with root
6177 (license license:gpl3+)))
6186 (url "https://github.com/intel/opa-psm2.git")
6187 (commit (string-append "PSM2_" version))))
6188 (file-name (git-file-name name version))
6191 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6192 (build-system gnu-build-system)
6195 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6197 #:phases (modify-phases %standard-phases
6199 (add-after 'unpack 'patch-Makefiles
6201 (substitute* "Makefile"
6204 (substitute* "compat/Makefile"
6210 (setenv "DESTDIR" %output)
6211 (invoke "make" "install")
6214 `(("rdma-core" ,rdma-core)
6215 ("numactl" ,numactl)))
6216 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6218 "This package is low-level user-level Intel's communications interface.
6219 The PSM2 API is a high-performance vendor-specific protocol that provides a
6220 low-level communications interface for the Intel Omni-Path family of
6221 high-speed networking devices.")
6222 (home-page "https://github.com/intel/opa-psm2")
6223 ;; Only the x86_64 architecure is supported.
6224 (supported-systems '("x86_64-linux"))
6225 (license (list license:bsd-3 license:gpl2)))) ; dual
6227 (define-public libpfm4
6233 (uri (string-append "mirror://sourceforge/perfmon2/"
6234 name "/libpfm-" version ".tar.gz"))
6237 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6238 (build-system gnu-build-system)
6240 '(#:modules ((guix build utils)
6241 (guix build gnu-build-system))
6242 #:phases (modify-phases %standard-phases
6246 (lambda* (#:key inputs outputs #:allow-other-keys)
6247 (let* ((out (assoc-ref outputs "out")))
6252 (lambda* (#:key outputs #:allow-other-keys)
6253 (let* ((out (assoc-ref outputs "out")))
6255 (string-append "PREFIX=" out)
6258 (synopsis "Performance event monitoring library")
6260 "This package provides a library called libpfm4, which is used to develop
6261 monitoring tools exploiting the performance monitoring events such as those
6262 provided by the Performance Monitoring Unit (PMU) of modern processors.
6264 Libpfm4 helps convert from an event name, expressed as a string, to the event
6265 encoding that is either the raw event as documented by the hardware vendor or
6266 the OS-specific encoding. In the latter case, the library is able to prepare
6267 the OS-specific data structures needed by the kernel to setup the event.
6269 libpfm4 provides support for the @code{perf_events} interface, which was
6270 introduced in Linux 2.6.31.")
6271 (home-page "http://perfmon2.sourceforge.net/")
6272 (license license:expat)))
6274 (define-public libnfnetlink
6276 (name "libnfnetlink")
6281 "https://www.netfilter.org/projects/libnfnetlink/files/"
6282 "libnfnetlink-" version ".tar.bz2"))
6285 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6286 (build-system gnu-build-system)
6287 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6288 (synopsis "Low-level netfilter netlink communication library")
6290 "@code{libnfnetlink} is the low-level library for netfilter related
6291 kernel/userspace communication. It provides a generic messaging
6292 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6293 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6294 management tools in userspace.")
6295 (license license:gpl2)))
6297 (define-public go-netlink
6304 (url "https://github.com/vishvananda/netlink.git")
6305 (commit (string-append "v" version))))
6306 (file-name (git-file-name name version))
6309 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6310 (build-system go-build-system)
6312 `(#:import-path "github.com/vishvananda/netlink"))
6314 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6315 ("go-netns" ,go-netns)))
6316 (home-page "https://github.com/vishvananda/netlink")
6317 (synopsis "Simple netlink library for Go")
6318 (description "The netlink package provides a simple netlink library for
6319 Go. Netlink is the interface a user-space program in Linux uses to
6320 communicate with the kernel. It can be used to add and remove interfaces, set
6321 IP addresses and routes, and configure IPsec.")
6322 (license license:asl2.0)))
6324 (define-public xfsprogs
6331 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6332 "xfsprogs-" version ".tar.gz"))
6335 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
6336 (build-system gnu-build-system)
6337 (outputs (list "out" "python"))
6339 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6341 (modify-phases %standard-phases
6342 (add-after 'install 'separate-python-output
6343 (lambda* (#:key outputs #:allow-other-keys)
6344 (let ((out (assoc-ref outputs "out"))
6345 (python (assoc-ref outputs "python")))
6348 (mkdir-p (string-append python (dirname script)))
6349 (rename-file (string-append out script)
6350 (string-append python script)))
6351 (list "/sbin/xfs_scrub_all"))
6353 (add-after 'install 'install-headers
6355 (invoke "make" "install-dev"))))))
6357 `(("gettext" ,gettext-minimal)))
6359 `(("libuuid" ,util-linux "lib")
6360 ("python" ,python-wrapper)))
6361 (home-page "https://xfs.wiki.kernel.org/")
6362 (synopsis "XFS file system tools")
6363 (description "This package provides commands to create and check XFS
6365 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6366 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6367 (license (list license:gpl2 license:lgpl2.1))))
6369 (define-public genext2fs
6376 (url "https://github.com/jeremie-koenig/genext2fs.git")
6377 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6378 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6379 (file-name (git-file-name name version))
6381 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6382 (build-system gnu-build-system)
6385 (modify-phases %standard-phases
6386 (add-after 'unpack 'apply-debian-patches
6387 ;; Debian changes (the revision after ‘-’ in VERSION) are
6388 ;; maintained as separate patches. Apply those relevant to us.
6392 (invoke "patch" "-p1" "-i"
6393 (string-append "debian/patches/" file-name)))
6394 (list "blocksize+creator.diff" ; add -B/-o options
6395 "byteswap_fix.diff"))
6398 `(("autoconf" ,autoconf)
6399 ("automake" ,automake)))
6400 (home-page "https://github.com/jeremie-koenig/genext2fs")
6401 (synopsis "Generate ext2 file system as a normal user")
6402 (description "This package provides a program to generate an ext2
6403 file system as a normal (non-root) user. It does not require you to mount
6404 the image file to copy files on it, nor does it require that you become
6405 the superuser to make device nodes.")
6406 (license license:gpl2)))
6408 (define-public fakeroot
6414 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
6415 "fakeroot/fakeroot_" version ".orig.tar.gz"))
6416 (file-name (string-append name "-" version ".tar.gz"))
6419 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
6420 (build-system gnu-build-system)
6423 (modify-phases %standard-phases
6424 (add-after 'configure 'patch-Makefile
6426 ;; Note: The root of the problem is already in "Makefile.am".
6427 (substitute* "Makefile"
6428 (("/bin/sh") (which "sh")))
6430 (add-after 'unpack 'patch-getopt
6431 (lambda* (#:key inputs #:allow-other-keys)
6432 (substitute* "scripts/fakeroot.in"
6434 (string-append (assoc-ref inputs "util-linux")
6437 (add-before 'configure 'setenv
6439 (setenv "LIBS" "-lacl")
6441 (add-before 'check 'prepare-check
6443 (setenv "SHELL" (which "bash"))
6444 (setenv "VERBOSE" "1")
6445 (substitute* "test/t.touchinstall"
6446 ;; We don't have the name of the root user, so use ID=0.
6447 (("grep root") "grep \"\\<0\\>\""))
6448 (substitute* "test/tartest"
6449 ;; We don't have the name of the root group, so use ID=0.
6450 (("ROOTGROUP=root") "ROOTGROUP=0")
6451 ;; We don't have the name of the daemon user, so use IDs.
6452 (("daemon:sys") "1:3")
6454 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6455 (substitute* "test/compare-tar"
6456 (("tar -tvf") "tar --numeric-owner -tvf"))
6460 ("sharutils" ,sharutils) ; for the tests
6461 ("xz" ,xz))) ; for the tests
6463 `(("libcap" ,libcap)
6464 ("util-linux" ,util-linux)))
6465 (synopsis "Provides a fake root environment")
6466 (description "@command{fakeroot} runs a command in an environment where
6467 it appears to have root privileges for file manipulation. This is useful
6468 for allowing users to create archives (tar, ar, .deb etc.) with files in
6469 them with root permissions/ownership. Without fakeroot one would have to
6470 have root privileges to create the constituent files of the archives with
6471 the correct permissions and ownership, and then pack them up, or one would
6472 have to construct the archives directly, without using the archiver.")
6473 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6474 (license license:gpl3+)))
6476 (define-public inputattach
6478 (name "inputattach")
6483 (url "https://github.com/linuxwacom/input-wacom.git")
6484 (commit (string-append "input-wacom-" version))))
6485 (file-name (git-file-name name version))
6487 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6488 (build-system gnu-build-system)
6491 (modify-phases %standard-phases
6495 (lambda* (#:key inputs #:allow-other-keys)
6496 (with-directory-excursion "inputattach"
6497 (invoke (string-append (assoc-ref inputs "gcc")
6499 "-O2" "-o" "inputattach" "inputattach.c"))
6503 (lambda* (#:key outputs #:allow-other-keys)
6504 (let ((target-dir (string-append
6505 (assoc-ref outputs "out")
6507 (mkdir-p target-dir)
6508 (copy-file "inputattach/inputattach"
6509 (string-append target-dir
6512 (home-page "https://linuxwacom.github.io/")
6513 (synopsis "Dispatch input peripherals events to a device file")
6514 (description "inputattach dispatches input events from several device
6515 types and interfaces and translates so that the X server can use them.")
6516 (license license:gpl2+)))
6518 (define-public pipewire
6525 (url "https://github.com/PipeWire/pipewire")
6527 (file-name (git-file-name name version))
6530 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
6531 (build-system meson-build-system)
6533 '(#:configure-flags '("-Dsystemd=false")))
6535 `(("pkg-config" ,pkg-config)))
6537 `(("alsa-lib" ,alsa-lib)
6541 ("gstreamer" ,gstreamer)
6542 ("gst-plugins-base" ,gst-plugins-base)
6546 (home-page "https://pipewire.org/")
6547 (synopsis "Server and user space API to deal with multimedia pipelines")
6549 "PipeWire is a project that aims to greatly improve handling of audio and
6550 video under Linux. It aims to support the usecases currently handled by both
6551 PulseAudio and Jack and at the same time provide same level of powerful handling
6552 of Video input and output. It also introduces a security model that makes
6553 interacting with audio and video devices from containerized applications easy,
6554 with supporting Flatpak applications being the primary goal. Alongside Wayland
6555 and Flatpak we expect PipeWire to provide a core building block for the future
6556 of Linux application development.")
6557 (license license:lgpl2.0+)))
6566 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6568 (file-name (git-file-name name version))
6571 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6572 (build-system gnu-build-system)
6575 (modify-phases %standard-phases
6576 (add-after 'unpack 'fix-dbus-tests
6578 (substitute* '("unit/test-dbus-message-fds.c"
6579 "unit/test-dbus-properties.c"
6581 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6585 ("libtool" ,libtool)))
6587 `(("autoconf" ,autoconf)
6588 ("pkgconfig" ,pkg-config)
6589 ("automake" ,automake)))
6590 (home-page "https://01.org/ell")
6591 (synopsis "Embedded Linux Library")
6592 (description "The Embedded Linux* Library (ELL) provides core, low-level
6593 functionality for system daemons. It typically has no dependencies other than
6594 the Linux kernel, C standard library, and libdl (for dynamic linking). While
6595 ELL is designed to be efficient and compact enough for use on embedded Linux
6596 platforms, it is not limited to resource-constrained systems.")
6597 (license license:lgpl2.1+)))
6599 (define-public lttng-ust
6605 (uri (string-append "https://lttng.org/files/lttng-ust/"
6606 "lttng-ust-" version ".tar.bz2"))
6609 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
6610 (build-system gnu-build-system)
6612 `(("liburcu" ,liburcu)
6613 ("numactl" ,numactl)))
6615 `(("python" ,python-3)))
6616 (home-page "https://lttng.org/")
6617 (synopsis "LTTng userspace tracer libraries")
6618 (description "The user space tracing library, liblttng-ust, is the LTTng
6619 user space tracer. It receives commands from a session daemon, for example to
6620 enable and disable specific instrumentation points, and writes event records
6621 to ring buffers shared with a consumer daemon.")
6622 (license license:lgpl2.1+)))
6624 (define-public kexec-tools
6626 (name "kexec-tools")
6630 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
6631 "/kexec/kexec-tools-" version ".tar.xz"))
6634 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
6635 (build-system gnu-build-system)
6637 ;; There are no automated tests.
6639 (home-page "https://projects.horms.net/projects/kexec/")
6640 (synopsis "Tools for booting directly into different kernels")
6641 (description "This package provides the @code{kexec} program and ancillary
6642 utilities. Using @code{kexec}, it is possible to boot directly into a new
6643 kernel from the context of an already-running kernel, bypassing the normal
6644 system boot process.")
6645 (license license:gpl2)))