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, 2020 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, 2020 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 Nikita <nikita@n0.is>
22 ;;; Copyright © 2017, 2018, 2020 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, 2020 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>
46 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
47 ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com>
48 ;;; Copyright © 2020 John Soo <jsoo1@asu.edu>
49 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
50 ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com>
52 ;;; This file is part of GNU Guix.
54 ;;; GNU Guix is free software; you can redistribute it and/or modify it
55 ;;; under the terms of the GNU General Public License as published by
56 ;;; the Free Software Foundation; either version 3 of the License, or (at
57 ;;; your option) any later version.
59 ;;; GNU Guix is distributed in the hope that it will be useful, but
60 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
61 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62 ;;; GNU General Public License for more details.
64 ;;; You should have received a copy of the GNU General Public License
65 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
67 (define-module (gnu packages linux)
68 #:use-module (gnu packages)
69 #:use-module (gnu packages acl)
70 #:use-module (gnu packages admin)
71 #:use-module (gnu packages algebra)
72 #:use-module (gnu packages audio)
73 #:use-module (gnu packages autotools)
74 #:use-module (gnu packages backup)
75 #:use-module (gnu packages base)
76 #:use-module (gnu packages bash)
77 #:use-module (gnu packages bison)
78 #:use-module (gnu packages boost)
79 #:use-module (gnu packages calendar)
80 #:use-module (gnu packages check)
81 #:use-module (gnu packages cpio)
82 #:use-module (gnu packages crypto)
83 #:use-module (gnu packages cryptsetup)
84 #:use-module (gnu packages compression)
85 #:use-module (gnu packages dbm)
86 #:use-module (gnu packages datastructures)
87 #:use-module (gnu packages docbook)
88 #:use-module (gnu packages documentation)
89 #:use-module (gnu packages elf)
90 #:use-module (gnu packages flex)
91 #:use-module (gnu packages file)
92 #:use-module (gnu packages freedesktop)
93 #:use-module (gnu packages gcc)
94 #:use-module (gnu packages gettext)
95 #:use-module (gnu packages glib)
96 #:use-module (gnu packages golang)
97 #:use-module (gnu packages gperf)
98 #:use-module (gnu packages gstreamer)
99 #:use-module (gnu packages gtk)
100 #:use-module (gnu packages haskell-apps)
101 #:use-module (gnu packages haskell-xyz)
102 #:use-module (gnu packages libunwind)
103 #:use-module (gnu packages libusb)
104 #:use-module (gnu packages llvm)
105 #:use-module (gnu packages lua)
106 #:use-module (gnu packages man)
107 #:use-module (gnu packages maths)
108 #:use-module (gnu packages multiprecision)
109 #:use-module (gnu packages ncurses)
110 #:use-module (gnu packages netpbm)
111 #:use-module (gnu packages networking)
112 #:use-module (gnu packages ninja)
113 #:use-module (gnu packages nss)
114 #:use-module (gnu packages perl)
115 #:use-module (gnu packages pciutils)
116 #:use-module (gnu packages pkg-config)
117 #:use-module (gnu packages popt)
118 #:use-module (gnu packages pulseaudio)
119 #:use-module (gnu packages python)
120 #:use-module (gnu packages python-xyz)
121 #:use-module (gnu packages readline)
122 #:use-module (gnu packages rrdtool)
123 #:use-module (gnu packages samba)
124 #:use-module (gnu packages sdl)
125 #:use-module (gnu packages serialization)
126 #:use-module (gnu packages slang)
127 #:use-module (gnu packages texinfo)
128 #:use-module (gnu packages tls)
129 #:use-module (gnu packages valgrind)
130 #:use-module (gnu packages video)
131 #:use-module (gnu packages vulkan)
132 #:use-module (gnu packages web)
133 #:use-module (gnu packages xiph)
134 #:use-module (gnu packages xml)
135 #:use-module (gnu packages xdisorg)
136 #:use-module (gnu packages xorg)
137 #:use-module (gnu packages groff)
138 #:use-module (gnu packages rsync)
139 #:use-module (gnu packages selinux)
140 #:use-module (gnu packages swig)
141 #:use-module (guix build-system cmake)
142 #:use-module (guix build-system gnu)
143 #:use-module (guix build-system go)
144 #:use-module (guix build-system meson)
145 #:use-module (guix build-system python)
146 #:use-module (guix build-system trivial)
147 #:use-module (guix build-system linux-module)
148 #:use-module (guix download)
149 #:use-module (guix git-download)
150 #:use-module ((guix licenses) #:prefix license:)
151 #:use-module (guix packages)
152 #:use-module (guix gexp)
153 #:use-module (guix store)
154 #:use-module (guix monads)
155 #:use-module (guix utils)
156 #:use-module (srfi srfi-1)
157 #:use-module (srfi srfi-2)
158 #:use-module (srfi srfi-26)
159 #:use-module (ice-9 match))
161 (define-public (system->linux-architecture arch)
162 "Return the Linux architecture name for ARCH, a Guix system name such as
163 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
164 (let ((arch (car (string-split arch #\-))))
165 (cond ((string=? arch "i686") "i386")
166 ((string-prefix? "mips" arch) "mips")
167 ((string-prefix? "arm" arch) "arm")
168 ((string-prefix? "aarch64" arch) "arm64")
169 ((string-prefix? "alpha" arch) "alpha")
170 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
171 ((string-prefix? "s390" arch) "s390")
172 ((string-prefix? "riscv" arch) "riscv")
175 (define-public (system->defconfig system)
176 "Some systems (notably powerpc-linux) require a special target for kernel
177 defconfig. Return the appropriate make target if applicable, otherwise return
179 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
180 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
185 ;;; Kernel source code deblobbing.
188 (define (linux-libre-deblob-scripts version
191 (list (version-major+minor version)
194 (uri (string-append "https://linux-libre.fsfla.org"
195 "/pub/linux-libre/releases/" version "-gnu/"
196 "deblob-" (version-major+minor version)))
197 (file-name (string-append "linux-libre-deblob-"
198 (version-major+minor version)))
199 (sha256 deblob-hash))
202 (uri (string-append "https://linux-libre.fsfla.org"
203 "/pub/linux-libre/releases/" version "-gnu/"
205 (file-name (string-append "linux-libre-deblob-check-"
206 (version-major+minor version)))
207 (sha256 deblob-check-hash))))
209 (define deblob-scripts-5.8
210 (linux-libre-deblob-scripts
212 (base32 "07z7sglyrfh0706icqqf3shadf638pvyid9386r661ds5lbsa2mw")
213 (base32 "0j6jba5fcddqlb42f95gjl78jisfla4nswqila074gglcrbnl9q7")))
215 (define deblob-scripts-5.4
216 (linux-libre-deblob-scripts
218 (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25")
219 (base32 "1b3q88i2qfdxyvpi9f7jds0qlb8hfpw87mgia096ax6822c2cmyb")))
221 (define deblob-scripts-4.19
222 (linux-libre-deblob-scripts
224 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
225 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
227 (define deblob-scripts-4.14
228 (linux-libre-deblob-scripts
230 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
231 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
233 (define deblob-scripts-4.9
234 (linux-libre-deblob-scripts
236 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
237 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
239 (define deblob-scripts-4.4
240 (linux-libre-deblob-scripts
242 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
243 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
245 (define* (computed-origin-method gexp-promise hash-algo hash
246 #:optional (name "source")
247 #:key (system (%current-system))
248 (guile (default-guile)))
249 "Return a derivation that executes the G-expression that results
250 from forcing GEXP-PROMISE."
251 (mlet %store-monad ((guile (package->derivation guile system)))
252 (gexp->derivation (or name "computed-origin")
254 #:graft? #f ;nothing to graft
256 #:guile-for-build guile)))
258 (define (make-linux-libre-source version
261 "Return a 'computed' origin that generates a Linux-libre tarball from the
262 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
263 (match deblob-scripts
264 ((deblob-version (? origin? deblob) (? origin? deblob-check))
265 (unless (string=? deblob-version (version-major+minor version))
266 ;; The deblob script cannot be expected to work properly on a
267 ;; different version (major+minor) of Linux, even if no errors
268 ;; are signaled during execution.
269 (error "deblob major+minor version mismatch"))
271 (method computed-origin-method)
272 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
276 (with-imported-modules '((guix build utils))
278 (use-modules (guix build utils)
282 (let ((dir (string-append "linux-" #$version)))
285 (set-path-environment-variable
288 #+(canonical-package bash)
289 #+(canonical-package coreutils)
290 #+(canonical-package diffutils)
291 #+(canonical-package findutils)
292 #+(canonical-package patch)
293 #+(canonical-package xz)
294 #+(canonical-package sed)
295 #+(canonical-package grep)
296 #+(canonical-package bzip2)
297 #+(canonical-package gzip)
298 #+(canonical-package tar)
299 ;; The comments in the 'deblob-check' script
300 ;; claim that it supports Python 2 and 3, but
301 ;; in fact it fails when run in Python 3 as
305 (with-directory-excursion "/tmp/bin"
307 (copy-file #+deblob "deblob")
308 (chmod "deblob" #o755)
309 (substitute* "deblob"
310 (("/bin/sh") (which "sh")))
312 (copy-file #+deblob-check "deblob-check")
313 (chmod "deblob-check" #o755)
314 (substitute* "deblob-check"
315 (("/bin/sh") (which "sh"))
316 (("/bin/sed") (which "sed"))
317 (("/usr/bin/python") (which "python"))))
319 (if (file-is-directory? #+upstream-source)
321 (format #t "Copying upstream linux source...~%")
323 (invoke "cp" "--archive" #+upstream-source dir)
324 (invoke "chmod" "--recursive" "u+w" dir))
326 (format #t "Unpacking upstream linux tarball...~%")
328 (invoke "tar" "xf" #$upstream-source)
331 (and (not (member name '("." "..")))
332 (file-is-directory? name))))
334 (unless (string=? dir unpacked-dir)
335 (rename-file unpacked-dir dir)))
337 (error "multiple directories found" dirs)))))
339 (with-directory-excursion dir
340 (setenv "PYTHON" (which "python"))
341 (format #t "Running deblob script...~%")
343 (invoke "/tmp/bin/deblob"))
345 (format #t "~%Packing new Linux-libre tarball...~%")
347 (invoke "tar" "cvfa" #$output
348 ;; Avoid non-determinism in the archive.
361 (define (linux-libre-urls version)
362 "Return a list of URLs for Linux-Libre VERSION."
364 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
365 version "-gnu/linux-libre-" version "-gnu.tar.xz")
367 ;; XXX: Work around <http://bugs.gnu.org/14851>.
369 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
370 version "-gnu.tar.xz")
372 ;; Maybe this URL will become valid eventually.
374 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
375 version "-gnu.tar.xz")))
377 (define (%upstream-linux-source version hash)
380 (uri (string-append "mirror://kernel.org"
381 "/linux/kernel/v" (version-major version) ".x/"
382 "linux-" version ".tar.xz"))
386 (define-public linux-libre-5.8-version "5.8.5")
387 (define-public linux-libre-5.8-pristine-source
388 (let ((version linux-libre-5.8-version)
389 (hash (base32 "0zwl0nk3x6fxwsbnmpx1drh7v0116yhgamisb1pghd472mmw6klx")))
390 (make-linux-libre-source version
391 (%upstream-linux-source version hash)
392 deblob-scripts-5.8)))
394 (define-public linux-libre-5.4-version "5.4.61")
395 (define-public linux-libre-5.4-pristine-source
396 (let ((version linux-libre-5.4-version)
397 (hash (base32 "197y2yb60m1k8i7mig4pa9wsrklfxq81ba3zfahwb2b31w2kvwc6")))
398 (make-linux-libre-source version
399 (%upstream-linux-source version hash)
400 deblob-scripts-5.4)))
402 (define-public linux-libre-4.19-version "4.19.143")
403 (define-public linux-libre-4.19-pristine-source
404 (let ((version linux-libre-4.19-version)
405 (hash (base32 "1383yfwb962mhn25b3b3zqrwnpyp01g5xclsv14wra0fdz33ahra")))
406 (make-linux-libre-source version
407 (%upstream-linux-source version hash)
408 deblob-scripts-4.19)))
410 (define-public linux-libre-4.14-version "4.14.196")
411 (define-public linux-libre-4.14-pristine-source
412 (let ((version linux-libre-4.14-version)
413 (hash (base32 "16mhqymwkgqi8zalcij5c754smc8ysvfw6l2cwshr4scipsv4qay")))
414 (make-linux-libre-source version
415 (%upstream-linux-source version hash)
416 deblob-scripts-4.14)))
418 (define-public linux-libre-4.9-version "4.9.235")
419 (define-public linux-libre-4.9-pristine-source
420 (let ((version linux-libre-4.9-version)
421 (hash (base32 "1hqcb3zw4546h6x5xy2mywdznha8813lx15mxbgfbvwm4qhsc9g6")))
422 (make-linux-libre-source version
423 (%upstream-linux-source version hash)
424 deblob-scripts-4.9)))
426 (define-public linux-libre-4.4-version "4.4.235")
427 (define-public linux-libre-4.4-pristine-source
428 (let ((version linux-libre-4.4-version)
429 (hash (base32 "0w5pkv936zb0shjgnpv17gcp5n8f91djznzq54p6j1bl5q2qdyqd")))
430 (make-linux-libre-source version
431 (%upstream-linux-source version hash)
432 deblob-scripts-4.4)))
434 (define %boot-logo-patch
435 ;; Linux-Libre boot logo featuring Freedo and a gnu.
438 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
439 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
442 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
444 (define %linux-libre-arm-export-__sync_icache_dcache-patch
448 "https://salsa.debian.org/kernel-team/linux"
449 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
450 "/debian/patches/bugfix/arm/"
451 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
452 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
454 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
456 (define (source-with-patches source patches)
459 (patches (append (origin-patches source)
462 (define-public linux-libre-5.8-source
463 (source-with-patches linux-libre-5.8-pristine-source
464 (list %boot-logo-patch
465 %linux-libre-arm-export-__sync_icache_dcache-patch)))
467 (define-public linux-libre-5.4-source
468 (source-with-patches linux-libre-5.4-pristine-source
469 (list %boot-logo-patch
470 %linux-libre-arm-export-__sync_icache_dcache-patch
471 ;; Pinebook Pro patch from linux-next,
472 ;; can be dropped for linux-libre 5.7
474 "linux-libre-support-for-Pinebook-Pro.patch"))))
476 (define-public linux-libre-4.19-source
477 (source-with-patches linux-libre-4.19-pristine-source
478 (list %boot-logo-patch
479 %linux-libre-arm-export-__sync_icache_dcache-patch)))
481 (define-public linux-libre-4.14-source
482 (source-with-patches linux-libre-4.14-pristine-source
483 (list %boot-logo-patch)))
485 (define-public linux-libre-4.9-source
486 (source-with-patches linux-libre-4.9-pristine-source
487 (list %boot-logo-patch)))
489 (define-public linux-libre-4.4-source
490 (source-with-patches linux-libre-4.4-pristine-source
491 (list %boot-logo-patch)))
498 (define (make-linux-libre-headers version hash-string)
499 (make-linux-libre-headers* version
502 (uri (linux-libre-urls version))
503 (sha256 (base32 hash-string)))))
505 (define (make-linux-libre-headers* version source)
507 (name "linux-libre-headers")
510 (build-system gnu-build-system)
511 (native-inputs `(("perl" ,perl)
512 ,@(if (version>=? version "4.16")
516 ,@(if (version>=? version "5.3")
520 `(#:modules ((guix build gnu-build-system)
524 (modify-phases %standard-phases
528 (let ((arch ,(system->linux-architecture
529 (or (%current-target-system)
531 (defconfig ,(system->defconfig
532 (or (%current-target-system)
533 (%current-system)))))
535 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
536 (invoke "make" defconfig)
537 (invoke "make" "mrproper" "headers_check"))))
539 (lambda* (#:key outputs #:allow-other-keys)
540 (let ((out (assoc-ref outputs "out")))
542 (string-append "INSTALL_HDR_PATH=" out)
545 (mkdir (string-append out "/include/config"))
546 (call-with-output-file
548 "/include/config/kernel.release")
550 (format p "~a-default~%" ,version)))
552 ;; Remove the '.install' and '..install.cmd' files; the
553 ;; latter contains store paths, which pulls in bootstrap
554 ;; binaries in the build environment, and prevents bit
555 ;; reproducibility for the bootstrap binaries.
556 (for-each delete-file (find-files out "\\.install"))
559 #:allowed-references ()
561 (home-page "https://www.gnu.org/software/linux-libre/")
562 (synopsis "GNU Linux-Libre kernel headers")
563 (description "Headers of the Linux-Libre kernel.")
564 (license license:gpl2)))
566 (define-public linux-libre-headers-5.8
567 (make-linux-libre-headers* linux-libre-5.8-version
568 linux-libre-5.8-source))
570 (define-public linux-libre-headers-5.4
571 (make-linux-libre-headers* linux-libre-5.4-version
572 linux-libre-5.4-source))
574 (define-public linux-libre-headers-4.19
575 (make-linux-libre-headers* linux-libre-4.19-version
576 linux-libre-4.19-source))
578 (define-public linux-libre-headers-4.14
579 (make-linux-libre-headers* linux-libre-4.14-version
580 linux-libre-4.14-source))
582 (define-public linux-libre-headers-4.9
583 (make-linux-libre-headers* linux-libre-4.9-version
584 linux-libre-4.9-source))
586 (define-public linux-libre-headers-4.4
587 (make-linux-libre-headers* linux-libre-4.4-version
588 linux-libre-4.4-source))
590 ;; The following package is used in the early bootstrap, and thus must be kept
591 ;; stable and with minimal build requirements.
592 (define-public linux-libre-headers-5.4.20
593 (make-linux-libre-headers "5.4.20"
594 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
596 (define-public linux-libre-headers linux-libre-headers-5.4.20)
600 ;;; Kernel configurations.
603 (define* (kernel-config arch #:key variant)
604 "Return the absolute file name of the Linux-Libre build configuration file
605 for ARCH and optionally VARIANT, or #f if there is no such configuration."
606 (let* ((name (string-append (if variant (string-append variant "-") "")
607 (if (string=? "i386" arch) "i686" arch) ".conf"))
608 (file (string-append "linux-libre/" name)))
609 (search-auxiliary-file file)))
611 (define %default-extra-linux-options
612 `(;; Some very mild hardening.
613 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
614 ;; All kernels should have NAMESPACES options enabled
615 ("CONFIG_NAMESPACES" . #t)
616 ("CONFIG_UTS_NS" . #t)
617 ("CONFIG_IPC_NS" . #t)
618 ("CONFIG_USER_NS" . #t)
619 ("CONFIG_PID_NS" . #t)
620 ("CONFIG_NET_NS" . #t)
621 ;; Various options needed for elogind service:
622 ;; https://issues.guix.gnu.org/43078
623 ("CONFIG_CGROUP_FREEZER" . #t)
624 ("CONFIG_BLK_CGROUP" . #t)
625 ("CONFIG_CGROUP_WRITEBACK" . #t)
626 ("CONFIG_CGROUP_SCHED" . #t)
627 ("CONFIG_CGROUP_PIDS" . #t)
628 ("CONFIG_CGROUP_FREEZER" . #t)
629 ("CONFIG_CGROUP_DEVICE" . #t)
630 ("CONFIG_CGROUP_CPUACCT" . #t)
631 ("CONFIG_CGROUP_PERF" . #t)
632 ("CONFIG_SOCK_CGROUP_DATA" . #t)
633 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
634 ("CONFIG_CGROUP_NET_PRIO" . #t)
635 ("CONFIG_CGROUP_NET_CLASSID" . #t)
636 ("CONFIG_MEMCG" . #t)
637 ("CONFIG_MEMCG_SWAP" . #t)
638 ("CONFIG_MEMCG_KMEM" . #t)
639 ("CONFIG_CPUSETS" . #t)
640 ("CONFIG_PROC_PID_CPUSET" . #t)
641 ;; Modules required for initrd:
642 ("CONFIG_NET_9P" . m)
643 ("CONFIG_NET_9P_VIRTIO" . m)
644 ("CONFIG_VIRTIO_BLK" . m)
645 ("CONFIG_VIRTIO_NET" . m)
646 ("CONFIG_VIRTIO_PCI" . m)
647 ("CONFIG_VIRTIO_BALLOON" . m)
648 ("CONFIG_VIRTIO_MMIO" . m)
649 ("CONFIG_FUSE_FS" . m)
651 ("CONFIG_9P_FS" . m)))
653 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
654 (define %bpf-extra-linux-options
655 `(;; Needed for probes
656 ("CONFIG_UPROBE_EVENTS" . #t)
657 ("CONFIG_KPROBE_EVENTS" . #t)
658 ;; kheaders module also helpful for tracing
659 ("CONFIG_IKHEADERS" . #t)
661 ("CONFIG_BPF_SYSCALL" . #t)
662 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
663 ;; optional, for tc filters
664 ("CONFIG_NET_CLS_BPF" . m)
665 ;; optional, for tc actions
666 ("CONFIG_NET_ACT_BPF" . m)
667 ("CONFIG_BPF_JIT" . #t)
668 ;; for Linux kernel versions 4.1 through 4.6
669 ;; ("CONFIG_HAVE_BPF_JIT" . y)
670 ;; for Linux kernel versions 4.7 and later
671 ("CONFIG_HAVE_EBPF_JIT" . #t)
672 ;; optional, for kprobes
673 ("CONFIG_BPF_EVENTS" . #t)
675 ("CONFIG_IKHEADERS" . #t)))
677 (define (config->string options)
678 (string-join (map (match-lambda
680 (string-append option "=m"))
682 (string-append option "=y"))
684 (string-append option "=n")))
690 ;;; Kernel package utilities.
693 (define* (make-linux-libre version hash-string supported-systems
695 ;; A function that takes an arch and a variant.
696 ;; See kernel-config for an example.
698 (configuration-file #f)
699 (defconfig "defconfig")
700 (extra-options %default-extra-linux-options)
701 (patches (list %boot-logo-patch)))
702 (make-linux-libre* version
705 (uri (linux-libre-urls version))
706 (sha256 (base32 hash-string))
709 #:extra-version extra-version
710 #:configuration-file configuration-file
711 #:defconfig defconfig
712 #:extra-options extra-options))
714 (define* (make-linux-libre* version source supported-systems
716 ;; A function that takes an arch and a variant.
717 ;; See kernel-config for an example.
719 (configuration-file #f)
720 (defconfig "defconfig")
721 (extra-options %default-extra-linux-options))
723 (name (if extra-version
724 (string-append "linux-libre-" extra-version)
728 (supported-systems supported-systems)
729 (build-system gnu-build-system)
734 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
738 ;; These are needed to compile the GCC plugins.
743 ,@(match (and configuration-file
745 (system->linux-architecture
746 (or (%current-target-system) (%current-system)))
747 #:variant (version-major+minor version)))
748 (#f ;no config for this platform
751 `(("kconfig" ,config))))))
753 `(#:modules ((guix build gnu-build-system)
760 (modify-phases %standard-phases
761 (add-after 'unpack 'patch-/bin/pwd
763 (substitute* (find-files "." "^Makefile(\\.include)?$")
764 (("/bin/pwd") "pwd"))
767 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
768 ;; Avoid introducing timestamps
769 (setenv "KCONFIG_NOTIMESTAMP" "1")
770 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
772 ;; Set ARCH and CROSS_COMPILE
773 (let ((arch ,(system->linux-architecture
774 (or (%current-target-system)
775 (%current-system)))))
777 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
780 (setenv "CROSS_COMPILE" (string-append target "-"))
781 (format #t "`CROSS_COMPILE' set to `~a'~%"
782 (getenv "CROSS_COMPILE"))))
784 (setenv "EXTRA_VERSION" ,extra-version)
786 (let ((build (assoc-ref %standard-phases 'build))
787 (config (assoc-ref (or native-inputs inputs) "kconfig")))
789 ;; Use a custom kernel configuration file or a default
790 ;; configuration file.
793 (copy-file config ".config")
794 (chmod ".config" #o666))
795 (invoke "make" ,defconfig))
797 ;; Appending works even when the option wasn't in the
798 ;; file. The last one prevails if duplicated.
799 (let ((port (open-file ".config" "a"))
800 (extra-configuration ,(config->string extra-options)))
801 (display extra-configuration port)
804 (invoke "make" "oldconfig"))))
806 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
807 (let* ((out (assoc-ref outputs "out"))
808 (moddir (string-append out "/lib/modules"))
809 (dtbdir (string-append out "/lib/dtbs")))
810 ;; Install kernel image, kernel configuration and link map.
811 (for-each (lambda (file) (install-file file out))
812 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
813 ;; Install device tree files
814 (unless (null? (find-files "." "\\.dtb$"))
816 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
818 ;; Install kernel modules
821 ;; Disable depmod because the Guix system's module directory
822 ;; is an union of potentially multiple packages. It is not
823 ;; possible to use depmod to usefully calculate a dependency
824 ;; graph while building only one of those packages.
826 (string-append "MODULE_DIR=" moddir)
827 (string-append "INSTALL_PATH=" out)
828 (string-append "INSTALL_MOD_PATH=" out)
829 "INSTALL_MOD_STRIP=1"
831 (let* ((versions (filter (lambda (name)
832 (not (string-prefix? "." name)))
834 (version (match versions
836 ;; There are symlinks to the build and source directory,
837 ;; both of which will point to target /tmp/guix-build*
838 ;; and thus not be useful in a profile. Delete the symlinks.
839 (false-if-file-not-found
840 (delete-file (string-append moddir "/" version "/build")))
841 (false-if-file-not-found
842 (delete-file (string-append moddir "/" version "/source"))))
845 (home-page "https://www.gnu.org/software/linux-libre/")
846 (synopsis "100% free redistribution of a cleaned Linux kernel")
848 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
849 It has been modified to remove all non-free binary blobs.")
850 (license license:gpl2)))
854 ;;; Generic kernel packages.
857 (define-public linux-libre-5.8
858 (make-linux-libre* linux-libre-5.8-version
859 linux-libre-5.8-source
860 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
861 #:configuration-file kernel-config))
863 (define-public linux-libre-version linux-libre-5.8-version)
864 (define-public linux-libre-pristine-source linux-libre-5.8-pristine-source)
865 (define-public linux-libre-source linux-libre-5.8-source)
866 (define-public linux-libre linux-libre-5.8)
868 (define-public linux-libre-5.4
869 (make-linux-libre* linux-libre-5.4-version
870 linux-libre-5.4-source
871 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
872 #:configuration-file kernel-config))
874 (define-public linux-libre-4.19
875 (make-linux-libre* linux-libre-4.19-version
876 linux-libre-4.19-source
877 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
878 #:configuration-file kernel-config))
880 (define-public linux-libre-4.14
881 (make-linux-libre* linux-libre-4.14-version
882 linux-libre-4.14-source
883 '("x86_64-linux" "i686-linux" "armhf-linux")
884 #:configuration-file kernel-config))
886 (define-public linux-libre-4.9
887 (make-linux-libre* linux-libre-4.9-version
888 linux-libre-4.9-source
889 '("x86_64-linux" "i686-linux")
890 #:configuration-file kernel-config))
892 (define-public linux-libre-4.4
893 (make-linux-libre* linux-libre-4.4-version
894 linux-libre-4.4-source
895 '("x86_64-linux" "i686-linux")
896 #:configuration-file kernel-config
899 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
900 ;; This option was removed upstream in version 4.7.
901 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
902 %default-extra-linux-options)))
906 ;;; Specialized kernel variants.
909 (define-public linux-libre-arm-generic
910 (make-linux-libre* linux-libre-version
913 #:defconfig "multi_v7_defconfig"
914 #:extra-version "arm-generic"
917 `(;; needed to fix the RTC on rockchip platforms
918 ("CONFIG_RTC_DRV_RK808" . #t))
919 %default-extra-linux-options)))
921 (define-public linux-libre-arm-veyron
922 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
924 (define-public linux-libre-arm-generic-5.4
925 (make-linux-libre* linux-libre-5.4-version
926 linux-libre-5.4-source
928 #:defconfig "multi_v7_defconfig"
929 #:extra-version "arm-generic"
932 `(;; needed to fix the RTC on rockchip platforms
933 ("CONFIG_RTC_DRV_RK808" . #t))
934 %default-extra-linux-options)))
936 (define-public linux-libre-arm-generic-4.19
937 (make-linux-libre* linux-libre-4.19-version
938 linux-libre-4.19-source
940 #:defconfig "multi_v7_defconfig"
941 #:extra-version "arm-generic"))
943 (define-public linux-libre-arm-generic-4.14
944 (make-linux-libre* linux-libre-4.14-version
945 linux-libre-4.14-source
947 #:defconfig "multi_v7_defconfig"
948 #:extra-version "arm-generic"))
950 (define-public linux-libre-arm-omap2plus
951 (make-linux-libre* linux-libre-version
954 #:defconfig "omap2plus_defconfig"
955 #:extra-version "arm-omap2plus"))
957 (define-public linux-libre-arm-omap2plus-4.19
958 (make-linux-libre* linux-libre-4.19-version
959 linux-libre-4.19-source
961 #:defconfig "omap2plus_defconfig"
962 #:extra-version "arm-omap2plus"))
964 (define-public linux-libre-arm-omap2plus-4.14
965 (make-linux-libre* linux-libre-4.14-version
966 linux-libre-4.14-source
968 #:defconfig "omap2plus_defconfig"
969 #:extra-version "arm-omap2plus"))
971 (define-public linux-libre-arm64-generic
972 (make-linux-libre* linux-libre-version
975 #:defconfig "defconfig"
976 #:extra-version "arm64-generic"
979 `(;; needed to fix the RTC on rockchip platforms
980 ("CONFIG_RTC_DRV_RK808" . #t))
981 %default-extra-linux-options)))
983 (define-public linux-libre-arm64-generic-5.4
984 (make-linux-libre* linux-libre-5.4-version
985 linux-libre-5.4-source
987 #:defconfig "defconfig"
988 #:extra-version "arm64-generic"
991 `(;; needed to fix the RTC on rockchip platforms
992 ("CONFIG_RTC_DRV_RK808" . #t))
993 %default-extra-linux-options)))
995 (define-public linux-libre-riscv64-generic
996 (make-linux-libre* linux-libre-version
999 #:extra-version "riscv64-generic"))
1001 (define-public linux-libre-with-bpf
1002 (let ((base-linux-libre
1004 linux-libre-5.4-version
1005 linux-libre-5.4-source
1006 '("x86_64-linux" "i686-linux" "armhf-linux"
1007 "aarch64-linux" "riscv64-linux")
1008 #:extra-version "bpf"
1009 #:configuration-file kernel-config
1011 (append %bpf-extra-linux-options
1012 %default-extra-linux-options))))
1014 (inherit base-linux-libre)
1015 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1020 ;;; Linux kernel modules.
1023 (define-public acpi-call-linux-module
1024 (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a")
1027 (name "acpi-call-linux-module")
1028 (version (git-version "3.17" revision commit))
1033 (url "https://github.com/teleshoes/acpi_call")
1035 (file-name (git-file-name name version))
1037 (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x"))))
1038 (build-system linux-module-build-system)
1040 `(#:tests? #f ; no tests
1042 (modify-phases %standard-phases
1043 (add-after 'install 'install-documentation
1044 (lambda* (#:key outputs #:allow-other-keys)
1045 (let* ((out (assoc-ref outputs "out"))
1046 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1047 (for-each (lambda (file)
1048 (let ((target (string-append doc "/" file)))
1049 (mkdir-p (dirname target))
1050 (copy-recursively file target)))
1051 (list "README.md" "examples"))
1053 (home-page "https://github.com/teleshoes/acpi_call")
1054 (synopsis "Linux kernel module to perform ACPI method calls")
1056 "This simple Linux kernel module allows calls from user space to any
1057 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1058 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1059 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1060 and @code{ACPI_BUFFER}.
1062 It grants direct and undocumented access to your hardware that may cause damage
1063 and should be used with caution, especially on untested models.")
1064 (license license:gpl3+)))) ; see README.md (no licence headers)
1066 (define-public rtl8812au-aircrack-ng-linux-module
1067 (let ((commit "df2b8dfd8cb7d9f6cfeb55abaeab8a5372011fc9")
1070 (name "rtl8812au-aircrack-ng-linux-module")
1071 (version (git-version "5.6.4.2" revision commit))
1076 (url "https://github.com/aircrack-ng/rtl8812au")
1078 (file-name (git-file-name name version))
1080 (base32 "1qcr0j8yhg8l9l0f5y55zcsk1mgf3qd46yh9xfqgg91szxa3yvca"))
1081 (modules '((guix build utils)))
1084 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1085 ;; and other unnecessary unlicenced things.
1086 (for-each delete-file-recursively (list "android"
1090 (build-system linux-module-build-system)
1093 (list (string-append "KSRC="
1094 (assoc-ref %build-inputs "linux-module-builder")
1095 "/lib/modules/build"))
1097 (modify-phases %standard-phases
1099 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1100 (apply invoke "make" make-flags))))
1101 #:tests? #f)) ; no test suite
1102 (supported-systems '("x86_64-linux" "i686-linux"))
1103 (home-page "https://github.com/aircrack-ng/rtl8812au")
1104 (synopsis "Linux driver for Realtek USB wireless network adapters")
1106 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1107 network adapters, modified by the aircrack-ng project to support monitor mode
1108 and frame injection. It provides a @code{88XXau} kernel module that supports
1109 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1110 (license license:gpl2+))))
1112 (define-public rtl8821ce-linux-module
1113 (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
1116 (name "rtl8821ce-linux-module")
1117 (version (git-version "0.0.0" revision commit))
1122 (url "https://github.com/tomaspinho/rtl8821ce")
1124 (file-name (git-file-name name version))
1127 "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
1128 (build-system linux-module-build-system)
1132 (string-append "KSRC="
1133 (assoc-ref %build-inputs "linux-module-builder")
1134 "/lib/modules/build"))
1136 (modify-phases %standard-phases
1138 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1139 (apply invoke "make" make-flags))))
1140 #:tests? #f)) ; no test suite
1141 (home-page "https://github.com/tomaspinho/rtl8821ce")
1142 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1143 (description "This is Realtek's RTL8821CE Linux driver for wireless
1145 (license license:gpl2))))
1147 (define-public vhba-module
1149 (name "vhba-module")
1150 (version "20200106")
1154 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1155 version ".tar.bz2"))
1158 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1159 (build-system linux-module-build-system)
1163 (home-page "https://cdemu.sourceforge.io/")
1164 (synopsis "Kernel module that emulates SCSI devices")
1165 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1166 between the CDemu userspace daemon and linux kernel.")
1167 (license license:gpl2+)))
1169 (define-public bbswitch-module
1171 (name "bbswitch-module")
1176 (url "https://github.com/Bumblebee-Project/bbswitch")
1177 (commit (string-append "v" version))))
1178 (file-name (git-file-name name version))
1181 "1glch4j0x1dzlp2yrb67v2r5jg9609jb6p8m251y78m74advqw0l"))))
1182 (build-system linux-module-build-system)
1186 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1187 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1188 (description "The bbswitch module provides a way to toggle the Nvidia
1189 graphics card on Optimus laptops.")
1190 (license license:gpl2)))
1192 (define-public ddcci-driver-linux
1194 (name "ddcci-driver-linux")
1201 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1202 (commit (string-append "v" version))))
1203 (file-name (git-file-name name version))
1206 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1207 (build-system linux-module-build-system)
1209 `(#:tests? #f ; no tests
1211 (modify-phases %standard-phases
1216 (with-directory-excursion module
1217 (apply (assoc-ref %standard-phases 'build) args)))
1218 '("ddcci" "ddcci-backlight"))
1224 (with-directory-excursion module
1225 (apply (assoc-ref %standard-phases 'install) args)))
1226 '("ddcci" "ddcci-backlight"))
1228 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1229 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1230 (description "This package provides two Linux kernel drivers, ddcci and
1231 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1232 interface. The ddcci module creates a character device for each DDC/CI
1233 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1234 module allows the control of the backlight level or luminance property when
1235 supported under @file{/sys/class/backlight/}.")
1236 (license license:gpl2+)))
1238 (define-public v4l2loopback-linux-module
1240 (name "v4l2loopback-linux-module")
1245 (url "https://github.com/umlaeute/v4l2loopback")
1246 (commit (string-append "v" version))))
1247 (file-name (git-file-name name version))
1250 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1251 (build-system linux-module-build-system)
1253 `(#:tests? #f)) ; no test suite
1254 (home-page "https://github.com/umlaeute/v4l2loopback")
1255 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1257 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1258 for Linux 2} applications will treat these as ordinary video devices but read
1259 video data generated by another application, instead of a hardware device such
1262 This lets you apply nifty effects to your Jitsi video, for example, but also
1263 allows some more serious things like adding streaming capabilities to an
1264 application by hooking GStreamer into the loopback device.")
1265 (license license:gpl2+)))
1269 ;;; Pluggable authentication modules (PAM).
1272 (define-public linux-pam
1280 "https://github.com/linux-pam/linux-pam/releases/download/v"
1281 version "/Linux-PAM-" version ".tar.xz"))
1284 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
1285 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1287 (build-system gnu-build-system)
1291 ;; TODO: optional dependencies
1292 ;; ("libxcrypt" ,libxcrypt)
1293 ;; ("cracklib" ,cracklib)
1296 `(;; Most users, such as `shadow', expect the headers to be under
1298 #:configure-flags (list (string-append "--includedir="
1299 (assoc-ref %outputs "out")
1300 "/include/security")
1302 ;; XXX: <rpc/rpc.h> is missing from glibc when
1303 ;; cross-compiling, so we have to disable NIS
1304 ;; support altogether.
1305 ,@(if (%current-target-system)
1309 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1312 (home-page "http://www.linux-pam.org/")
1313 (synopsis "Pluggable authentication modules for Linux")
1315 "A *Free* project to implement OSF's RFC 86.0.
1316 Pluggable authentication modules are small shared object files that can
1317 be used through the PAM API to perform tasks, like authenticating a user
1318 at login. Local and dynamic reconfiguration are its key features.")
1319 (license license:bsd-3)))
1321 (define-public linux-pam-1.2
1329 "http://www.linux-pam.org/library/"
1330 "Linux-PAM-" version ".tar.bz2"))
1333 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1334 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1336 (define-public python-pamela
1338 (name "python-pamela")
1342 ;; Tests not distributed in pypi release.
1345 (url "https://github.com/minrk/pamela.git")
1347 (file-name (git-file-name name version))
1350 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1351 (build-system python-build-system)
1353 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1355 (modify-phases %standard-phases
1356 (add-after 'unpack 'hardcode-pam.so
1357 (lambda* (#:key inputs #:allow-other-keys)
1358 (let ((pam (assoc-ref inputs "linux-pam")))
1359 (substitute* "pamela.py"
1360 (("find_library\\(\"pam\")")
1361 (string-append "'" pam "/lib/libpam.so'")))
1364 (lambda* (#:key tests? #:allow-other-keys)
1366 (if (file-exists? "test_pamela.py")
1367 (invoke "py.test" "--assert=plain" "test_pamela.py")
1368 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1371 `(("linux-pam" ,linux-pam)))
1373 `(("python-pytest" ,python-pytest)))
1374 (home-page "https://github.com/minrk/pamela")
1375 (synopsis "PAM interface using ctypes")
1376 (description "This package provides a PAM interface using @code{ctypes}.")
1377 (license license:expat)))
1384 (define-public powerstat
1391 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1392 "powerstat/powerstat-" version ".tar.gz"))
1394 (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g"))))
1395 (build-system gnu-build-system)
1398 (list (string-append "CC=" ,(cc-for-target))
1399 (string-append "prefix=" (assoc-ref %outputs "out")))
1400 #:tests? #f ; no test suite
1402 (modify-phases %standard-phases
1403 (add-after 'unpack 'respect-$prefix
1404 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1406 (substitute* "Makefile"
1407 (("DIR=/usr/") "DIR=$(prefix)/"))
1409 (delete 'configure)))) ; no configure script
1410 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1411 (synopsis "Measure system power consumption")
1413 "Powerstat measures and reports your computer's power consumption in real
1414 time. On mobile PCs, it uses ACPI battery information to measure the power
1415 drain of the entire system.
1417 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1418 domain measurements. These are available only on some hardware such as Intel
1419 Sandybridge and newer, and cover only part of the machine's components such as
1420 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1421 and don't require a battery at all.
1423 The output is like @command{vmstat} but also shows power consumption statistics:
1424 at the end of a run, @command{powerstat} will calculate the average, standard
1425 deviation, and minimum and maximum values. It can show a nice histogram too.")
1426 (license license:gpl2)))
1428 (define-public psmisc
1435 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1438 (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1"))))
1439 (build-system gnu-build-system)
1441 `(,@(if (%current-target-system)
1444 "ac_cv_func_malloc_0_nonnull=yes"
1445 "ac_cv_func_realloc_0_nonnull=yes"))
1447 (inputs `(("ncurses" ,ncurses)))
1448 (home-page "https://gitlab.com/psmisc/psmisc")
1449 (synopsis "Small utilities that use the proc file system")
1451 "This PSmisc package is a set of some small useful utilities that
1452 use the proc file system. We're not about changing the world, but
1453 providing the system administrator with some help in common tasks.")
1454 (license license:gpl2+)))
1456 (define-public util-linux
1462 (uri (string-append "mirror://kernel.org/linux/utils/"
1463 "util-linux/v" (version-major+minor version) "/"
1464 "util-linux-" version ".tar.xz"))
1467 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1468 (patches (search-patches "util-linux-tests.patch"))
1469 (modules '((guix build utils)))
1471 ;; We take 'nologin' from Shadow, the 'logger' program from
1472 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1474 (substitute* "configure"
1475 (("build_nologin=yes") "build_nologin=no")
1476 (("build_logger=yes") "build_logger=no")
1477 (("build_kill=yes") "build_kill=no"))
1479 (build-system gnu-build-system)
1480 (outputs '("out" ;6.4 MiB executables and documentation
1481 "lib" ;8.8 MiB shared libraries, headers and locales
1482 "static")) ;2.9 MiB static .a libraries
1484 `(#:configure-flags (list "--disable-use-tty-group"
1485 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1486 ;; Don't try to chown root:root mount and umount
1487 "--disable-makeinstall-chown"
1488 "--localstatedir=/var"
1489 (string-append "--localedir="
1490 (assoc-ref %outputs "lib")
1492 ;; Install completions where our
1493 ;; bash-completion package expects them.
1494 (string-append "--with-bashcompletiondir="
1495 (assoc-ref %outputs "out")
1496 "/etc/bash_completion.d"))
1497 #:phases (modify-phases %standard-phases
1498 (add-before 'configure 'patch-build-scripts
1499 (lambda* (#:key outputs #:allow-other-keys)
1500 (substitute* "configure"
1501 ;; The build system assumes that we want to install
1502 ;; libraries below $exec_prefix when $libdir does not
1503 ;; match any of the "usual" locations. Fix that.
1504 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1505 "usrlib_execdir=$libdir"))
1507 (add-before 'build 'set-umount-file-name
1508 (lambda* (#:key outputs #:allow-other-keys)
1509 ;; Tell 'eject' the right file name of 'umount'.
1510 (let ((out (assoc-ref outputs "out")))
1511 (substitute* "sys-utils/eject.c"
1512 (("\"/bin/umount\"")
1513 (string-append "\"" out "/bin/umount\"")))
1515 (add-before 'check 'pre-check
1516 (lambda* (#:key inputs outputs #:allow-other-keys)
1517 (let ((out (assoc-ref outputs "out"))
1518 (net (assoc-ref inputs "net-base")))
1519 ;; Change the test to refer to the right file.
1520 (substitute* "tests/ts/misc/mcookie"
1522 (string-append net "/etc/services")))
1524 ;; The C.UTF-8 locale does not exist in our libc.
1525 (substitute* "tests/ts/column/invalid-multibyte"
1526 (("C\\.UTF-8") "en_US.utf8"))
1528 ;; TODO: Remove the conditional on the next rebuild cycle.
1529 ,@(if (string-prefix? "arm" (%current-system))
1530 '((add-before 'check 'disable-setarch-test
1532 ;; The setarch tests are unreliable in QEMU's
1533 ;; user-mode emulation, which is our primary
1534 ;; method of building ARMv7 packages.
1535 ;; <https://github.com/karelzak/util-linux/issues/601>
1536 (substitute* "tests/ts/misc/setarch"
1537 (("ts_init_subtest.*" all)
1540 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1543 (add-after 'install 'move-static-libraries
1544 (lambda* (#:key outputs #:allow-other-keys)
1545 (let ((lib (assoc-ref outputs "lib"))
1546 (static (assoc-ref outputs "static")))
1548 ;; Move static libraries to the "static" output.
1549 (mkdir-p (string-append static "/lib"))
1550 (with-directory-excursion lib
1551 (for-each (lambda (file)
1553 (string-append static "/"
1555 (find-files "lib" "\\.a$"))
1557 ;; Remove references to the static library from the '.la'
1558 ;; files so that Libtool does the right thing when both
1559 ;; the shared and static library is available.
1560 (substitute* (find-files "lib" "\\.la$")
1561 (("old_library=.*") "old_library=''\n")))
1564 (add-after 'install 'adjust-pkg-config-files
1565 (lambda* (#:key outputs #:allow-other-keys)
1566 (let ((lib (assoc-ref outputs "lib")))
1567 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1568 ;; the pkg-config files to avoid a cyclic reference on "out".
1569 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1571 (("^(exec_)?prefix=.*") "")))
1573 (inputs `(("zlib" ,zlib)
1574 ("ncurses" ,ncurses)
1576 ;; XXX: This is so that the 'pre-check' phase can find it.
1577 ,@(if (%current-target-system)
1578 `(("net-base" ,net-base))
1582 ("net-base" ,net-base))) ;for tests
1583 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1584 (synopsis "Collection of utilities for the Linux kernel")
1585 (description "Util-linux is a diverse collection of Linux kernel
1586 utilities. It provides dmesg and includes tools for working with file systems,
1587 block devices, UUIDs, TTYs, and many other tools.")
1589 ;; Note that util-linux doesn't use the same license for all the
1590 ;; code. GPLv2+ is the default license for a code without an
1591 ;; explicitly defined license.
1592 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1593 license:bsd-4 license:public-domain))))
1595 ;; util-linux optionally supports udev, which allows lsblk to read file system
1596 ;; metadata without special privileges. Add it as a separate package to avoid
1597 ;; a circular dependency, and to keep the size small.
1598 (define-public util-linux+udev
1601 (name "util-linux-with-udev")
1604 ,@(package-inputs util-linux)))))
1606 (define-public ddate
1613 (url "https://github.com/bo0ts/ddate")
1614 (commit (string-append "v" version))))
1615 (file-name (git-file-name name version))
1617 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1618 (build-system cmake-build-system)
1619 (arguments '(#:tests? #f))
1620 (home-page "https://github.com/bo0ts/ddate")
1621 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1623 "ddate displays the Discordian date and holidays of a given date.
1624 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1625 by Robert Shea and Robert Anton Wilson.")
1626 (license license:public-domain)))
1628 (define-public fbset
1635 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1638 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1639 (build-system gnu-build-system)
1641 '(#:modules ((guix build gnu-build-system)
1645 (modify-phases %standard-phases
1646 (delete 'configure) ; no configure script
1647 (add-before 'install 'pre-install
1648 (lambda* (#:key outputs #:allow-other-keys)
1649 (let ((out (assoc-ref outputs "out")))
1650 (substitute* "Makefile"
1651 (("mknod ") "true ")
1652 ;; The Makefile doesn't honour PREFIX or similar.
1655 (with-directory-excursion out
1656 (for-each mkdir-p (list "sbin"
1660 (add-after 'install 'install-fb.modes
1661 (lambda* (#:key outputs #:allow-other-keys)
1662 (let* ((out (assoc-ref outputs "out"))
1663 (etc (string-append out "/etc")))
1664 (for-each (cut install-file <> etc)
1665 (find-files "etc" "^fb\\.modes"))
1666 (symlink "fb.modes.ATI"
1667 (string-append etc "/fb.modes"))
1669 ;; Parallel building races to create modes.tab.c.
1670 #:parallel-build? #f
1671 #:tests? #f)) ; no test suite
1675 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1676 (synopsis "Show and modify Linux frame buffer settings")
1678 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1679 different kinds of graphic displays. The @command{fbset} utility can query and
1680 change various device settings such as depth, virtual resolution, and timing
1682 (license license:gpl2)))
1684 (define-public procps
1690 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1691 "procps-ng-" version ".tar.xz"))
1694 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1695 (build-system gnu-build-system)
1697 `(#:modules ((guix build utils)
1698 (guix build gnu-build-system)
1701 ,@(if (%current-target-system)
1704 "ac_cv_func_malloc_0_nonnull=yes"
1705 "ac_cv_func_realloc_0_nonnull=yes"))
1708 (modify-phases %standard-phases
1710 'install 'post-install
1711 ;; Remove commands and man pages redudant with
1713 (lambda* (#:key outputs #:allow-other-keys)
1714 (let* ((out (assoc-ref outputs "out"))
1715 (dup (append-map (cut find-files out <>)
1716 '("^kill" "^uptime"))))
1717 (for-each delete-file dup)
1719 (inputs `(("ncurses" ,ncurses)))
1720 (home-page "https://gitlab.com/procps-ng/procps/")
1721 (synopsis "Utilities that give information about processes")
1723 "Procps is the package that has a bunch of small useful utilities
1724 that give information about processes using the Linux /proc file system.
1725 The package includes the programs ps, top, vmstat, w, kill, free,
1726 slabtop, and skill.")
1727 (license license:gpl2)))
1729 (define-public usbutils
1736 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1737 "usbutils-" version ".tar.xz"))
1739 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1740 (build-system gnu-build-system)
1741 (outputs (list "out" "python"))
1744 (modify-phases %standard-phases
1745 (add-before 'bootstrap 'patch-bootstrap-scripts
1747 (substitute* "usbhid-dump/bootstrap"
1748 (("/bin/bash") (which "bash")))
1750 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1751 (substitute* "autogen.sh"
1752 (("^\\./configure.*") ""))
1754 (add-after 'install 'separate-python-output
1755 ;; Separating one Python script shaves more than 106 MiB from :out.
1756 (lambda* (#:key outputs #:allow-other-keys)
1757 (let ((out (assoc-ref outputs "out"))
1758 (out:python (assoc-ref outputs "python")))
1759 (for-each (lambda (file)
1760 (let ((old (string-append out "/" file))
1761 (new (string-append out:python "/" file)))
1762 (mkdir-p (dirname new))
1763 (rename-file old new)))
1764 (list "bin/lsusb.py"))
1769 ("python" ,python)))
1771 `(("autoconf" ,autoconf)
1772 ("automake" ,automake)
1773 ("libtool" ,libtool)
1774 ("pkg-config" ,pkg-config)))
1775 (home-page "http://www.linux-usb.org/")
1777 "Tools for working with USB devices, such as lsusb")
1779 "Tools for working with USB devices, such as lsusb.")
1780 (license license:gpl2+)))
1782 (define-public e2fsprogs
1789 "mirror://kernel.org/linux/kernel/people/tytso/"
1790 "e2fsprogs/v" version "/"
1791 "e2fsprogs-" version ".tar.xz"))
1794 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1795 (build-system gnu-build-system)
1796 (inputs `(("util-linux" ,util-linux "lib")))
1797 (native-inputs `(("pkg-config" ,pkg-config)
1798 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1802 ("procps" ,procps)))
1804 '(;; util-linux is the preferred source for some of the libraries and
1805 ;; commands, so disable them (see, e.g.,
1806 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1807 #:configure-flags (list "--disable-libblkid"
1808 "--disable-libuuid" "--disable-uuidd"
1811 ;; Use symlinks instead of hard links for
1812 ;; 'fsck.extN' etc. This makes the resulting nar
1813 ;; smaller and is preserved across copies.
1814 "--enable-symlink-install"
1816 (string-append "LDFLAGS=-Wl,-rpath="
1817 (assoc-ref %outputs "out")
1820 ;; Install libext2fs et al.
1821 "--enable-elf-shlibs")
1824 (modify-phases %standard-phases
1825 (add-before 'configure 'patch-shells
1827 (substitute* "configure"
1828 (("/bin/sh (.*)parse-types.sh" _ dir)
1829 (string-append (which "sh") " " dir
1831 (substitute* "MCONFIG.in"
1832 (("INSTALL_SYMLINK = /bin/sh")
1833 "INSTALL_SYMLINK = sh"))
1834 (substitute* (find-files "." "^Makefile.in$")
1836 (string-append "#!" (which "sh"))))
1838 (add-after 'install 'install-libs
1839 (lambda* (#:key outputs #:allow-other-keys)
1840 (let* ((out (assoc-ref outputs "out"))
1841 (lib (string-append out "/lib")))
1842 (invoke "make" "install-libs")
1844 ;; Make the .a writable so that 'strip' works.
1845 ;; Failing to do that, due to debug symbols, we
1846 ;; retain a reference to the final
1847 ;; linux-libre-headers, which refer to the
1848 ;; bootstrap binaries.
1849 (let ((archives (find-files lib "\\.a$")))
1850 (for-each (lambda (file)
1854 (home-page "http://e2fsprogs.sourceforge.net/")
1855 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1857 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1858 (license (list license:gpl2 ;programs
1859 license:lgpl2.0 ;libext2fs
1860 license:x11)))) ;libuuid
1862 (define e2fsprogs/static
1864 (package (inherit e2fsprogs)
1866 ;; Do not build shared libraries.
1867 (substitute-keyword-arguments (package-arguments e2fsprogs)
1868 ((#:configure-flags _)
1869 '(list "--disable-blkid"))
1873 (define-public e2fsck/static
1875 (name "e2fsck-static")
1876 (version (package-version e2fsprogs))
1877 (build-system trivial-build-system)
1880 `(("e2fsprogs" ,e2fsprogs/static)))
1882 `(#:modules ((guix build utils))
1885 (use-modules (guix build utils)
1889 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1891 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1893 (with-directory-excursion bin
1894 (copy-file e2fsck "e2fsck")
1895 (remove-store-references "e2fsck")
1896 (chmod "e2fsck" #o555))
1898 (home-page (package-home-page e2fsprogs))
1899 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1900 (description "This package provides statically-linked e2fsck command taken
1901 from the e2fsprogs package. It is meant to be used in initrds.")
1902 (license (package-license e2fsprogs))))
1904 (define-public extundelete
1906 (name "extundelete")
1911 (uri (string-append "mirror://sourceforge/extundelete/"
1912 "extundelete/" version "/extundelete-"
1913 version ".tar.bz2"))
1916 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1917 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1918 (build-system gnu-build-system)
1919 (inputs `(("e2fsprogs" ,e2fsprogs)))
1920 (home-page "http://extundelete.sourceforge.net/")
1921 (synopsis "Recover deleted files from ext2/3/4 partitions")
1923 "Extundelete is a set of tools that can recover deleted files from an
1924 ext3 or ext4 partition.")
1925 (license license:gpl2)))
1927 (define-public zerofree
1931 (home-page "https://frippery.org/uml/")
1934 (uri (string-append home-page name "-" version
1938 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1939 (build-system gnu-build-system)
1942 (modify-phases %standard-phases
1943 (delete 'configure) ; no configure script
1945 ;; The Makefile lacks an ‘install’ target.
1946 (lambda* (#:key outputs #:allow-other-keys)
1947 (let* ((out (assoc-ref outputs "out"))
1948 (bin (string-append out "/bin")))
1949 (chmod "zerofree" #o555)
1950 (install-file "zerofree" bin)
1952 #:tests? #f)) ; no tests
1953 (inputs `(("libext2fs" ,e2fsprogs)))
1954 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1956 "Zerofree finds the unallocated blocks with non-zero value content in an
1957 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1958 This is a simple way to make disk images more compressible.
1959 Zerofree requires the file system to be unmounted or mounted read-only.")
1960 (license license:gpl2)))
1962 (define-public strace
1966 (home-page "https://strace.io")
1969 (uri (string-append home-page "/files/" version
1970 "/strace-" version ".tar.xz"))
1973 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
1974 (build-system gnu-build-system)
1977 (modify-phases %standard-phases
1978 (add-after 'unpack 'patch-/bin/sh
1980 (substitute* "strace.c"
1981 (("/bin/sh") (which "sh")))
1983 (add-after 'unpack 'disable-failing-tests
1985 ;; XXX These hang forever even if the test time-out is extended.
1986 (substitute* "tests/Makefile.in"
1987 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
1989 ;; Don't fail if the architecture doesn't support different personalities.
1990 #:configure-flags '("--enable-mpers=check")
1991 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1992 #:parallel-tests? #f)) ; undeterministic failures
1993 (native-inputs `(("perl" ,perl)))
1994 (synopsis "System call tracer for Linux")
1996 "strace is a system call tracer, i.e. a debugging tool which prints out a
1997 trace of all the system calls made by a another process/program.")
1998 (license license:lgpl2.1+)))
2000 (define-public ltrace
2006 (uri (string-append "http://www.ltrace.org/ltrace_" version
2010 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2011 (build-system gnu-build-system)
2012 (inputs `(("libelf" ,libelf)))
2014 ;; Compilation uses -Werror by default, but it fails.
2015 '(#:configure-flags '("--disable-werror")))
2016 (home-page "https://www.ltrace.org/")
2017 (synopsis "Library call tracer for Linux")
2019 "ltrace intercepts and records dynamic library calls which are called by
2020 an executed process and the signals received by that process. It can also
2021 intercept and print the system calls executed by the program.")
2022 (license license:gpl2+)))
2024 (define-public alsa-lib
2031 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2032 version ".tar.bz2"))
2035 "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q"))))
2036 (build-system gnu-build-system)
2038 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2039 (assoc-ref %outputs "out")
2041 (home-page "https://www.alsa-project.org/")
2042 (synopsis "The Advanced Linux Sound Architecture libraries")
2044 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2045 MIDI functionality to the Linux-based operating system.")
2046 (license license:lgpl2.1+)))
2048 (define-public alsa-utils
2054 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2055 name "-" version ".tar.bz2"))
2058 "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024"))))
2059 (build-system gnu-build-system)
2061 ;; XXX: Disable man page creation until we have DocBook.
2062 '(#:configure-flags (list "--disable-xmlto"
2064 ;; The udev rule is responsible for restoring
2066 (string-append "--with-udev-rules-dir="
2067 (assoc-ref %outputs "out")
2068 "/lib/udev/rules.d"))
2070 (modify-phases %standard-phases
2071 (add-before 'check 'disable-broken-test
2073 ;; XXX: The 1.1.8 release tarball is missing a header that's
2074 ;; required for this test to work. Fixed in 1.1.9.
2075 (substitute* "axfer/test/Makefile"
2076 ((".*container-test.*") ""))
2079 'install 'pre-install
2081 ;; Don't try to mkdir /var/lib/alsa.
2082 (substitute* "Makefile"
2083 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2087 `(("gettext" ,gettext-minimal)))
2089 `(("libsamplerate" ,libsamplerate)
2090 ("ncurses" ,ncurses)
2091 ("alsa-lib" ,alsa-lib)
2093 (home-page "http://www.alsa-project.org/")
2094 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2096 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2097 MIDI functionality to the Linux-based operating system.")
2099 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2101 (license license:gpl2)))
2103 (define-public alsa-plugins
2105 (name "alsa-plugins")
2109 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2110 name "-" version ".tar.bz2"))
2113 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2114 (build-system gnu-build-system)
2115 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2116 ;; be split, there are references to both in files.
2117 ;; TODO: Remove OSS related plugins, they add support to run native
2118 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2120 (outputs '("out" "pulseaudio" "jack"))
2122 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2123 ;; for /etc/alsa. On Guix System plugins are loaded from
2124 ;; the ALSA service, and other distributions likely
2125 ;; won't use these files.
2126 "--with-alsalconfdir=/tmp/noop")
2128 (modify-phases %standard-phases
2129 (add-after 'install 'split
2130 (lambda* (#:key inputs outputs #:allow-other-keys)
2131 ;; Distribute the binaries to the various outputs.
2132 (let* ((out (assoc-ref outputs "out"))
2133 (jack (assoc-ref outputs "jack"))
2134 (jacklib (string-append jack "/lib/alsa-lib"))
2135 (pua (assoc-ref outputs "pulseaudio"))
2136 (pualib (string-append pua "/lib/alsa-lib")))
2139 (for-each (lambda (file)
2140 (rename-file file (string-append jacklib "/" (basename file))))
2141 (find-files out ".*jack\\.(la|so)"))
2144 (for-each (lambda (file)
2145 (rename-file file (string-append pualib "/" (basename file))))
2146 (find-files out ".*pulse\\.(la|so)"))
2149 `(("alsa-lib" ,alsa-lib)
2151 ("speex" ,speex) ; libspeexdsp resampling plugin
2152 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2153 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2154 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2156 `(("pkg-config" ,pkg-config)))
2157 (home-page "http://www.alsa-project.org/")
2158 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2160 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2161 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2162 by providing additional plugins which include: upmixing, downmixing, jackd and
2163 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2164 external rate conversion.")
2165 (license (list license:gpl2+
2166 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2167 license:lgpl2.1+))))
2169 (define-public iptables
2172 ;; XXX When updating, remove the ‘install-missing-script’ phase.
2177 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2179 (string-append "https://www.netfilter.org/projects/iptables/"
2180 "files/iptables-" version ".tar.bz2")))
2182 (base32 "02a3575ypdpg6a2x752mhk3f7h1381ymkq1n0gss6fp6292xfmyl"))))
2183 (build-system gnu-build-system)
2185 `(("pkg-config" ,pkg-config)
2189 `(("libmnl" ,libmnl)
2190 ("libnftnl" ,libnftnl)))
2192 '(#:tests? #f ; no test suite
2193 #:configure-flags ; add $libdir to the RUNPATH of executables
2194 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
2196 (modify-phases %standard-phases
2197 (add-after 'install 'install-missing-script
2198 ;; A typo prevents installation of /sbin/iptables-apply. It's been
2199 ;; fixed upstream (d4ed0c741fc789bb09d977d74d30875fdd50d08b), but
2200 ;; a patch would require bootstrapping and more inputs. Simply copy
2201 ;; the file ourselves.
2202 (lambda* (#:key outputs #:allow-other-keys)
2203 (let* ((out (assoc-ref outputs "out"))
2204 (sbin (string-append out "/sbin")))
2205 (install-file "iptables/iptables-apply" sbin)
2207 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2208 (synopsis "Programs to configure Linux IP packet filtering rules")
2210 "@command{iptables} is the user-space command line program used to
2211 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2212 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2214 This package also includes @command{ip6tables}, which is used to configure the
2217 Both commands are targeted at system administrators.")
2218 (license license:gpl2+)))
2220 (define-public lsscsi
2227 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2230 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2231 (build-system gnu-build-system)
2232 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2233 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2235 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2236 also list NVMe namespaces or controllers and show the relationship between a
2237 device's primary node name, its SCSI generic (sg) node name and its kernel
2239 (license license:gpl2)))
2241 (define-public ebtables
2248 "mirror://netfilter.org/ebtables/ebtables-"
2252 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2253 (build-system gnu-build-system)
2256 ("iptables" ,iptables)))
2257 (synopsis "Ethernet bridge frame table administration")
2258 (home-page "https://ebtables.netfilter.org/")
2260 "ebtables is an application program used to set up and maintain the
2261 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2262 analogous to the iptables application, but less complicated, due to the fact
2263 that the Ethernet protocol is much simpler than the IP protocol.")
2264 (license license:gpl2+)))
2266 (define-public iproute
2273 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2277 "0vk4vickrpahdhl3zazr2qn2bf99v5549ncirjpwiy4h0a4izkfg"))))
2278 (build-system gnu-build-system)
2280 `( ;; There is a test suite, but it wants network namespaces and sudo.
2282 #:make-flags (let ((out (assoc-ref %outputs "out")))
2284 (string-append "BASH_COMPDIR=" out
2285 "/etc/bash_completion.d")
2286 (string-append "LIBDIR=" out "/lib")
2287 (string-append "HDRDIR=" out "/include")
2288 (string-append "SBINDIR=" out "/sbin")
2289 (string-append "CONFDIR=" out "/etc")
2290 (string-append "DOCDIR=" out "/share/doc/"
2292 (string-append "MANDIR=" out "/share/man")))
2293 #:phases (modify-phases %standard-phases
2294 (add-before 'install 'pre-install
2296 ;; Don't attempt to create /var/lib/arpd.
2297 (substitute* "Makefile"
2298 (("^.*ARPDDIR.*$") ""))
2302 ("iptables" ,iptables)
2303 ("libmnl" ,libmnl)))
2307 ("pkg-config" ,pkg-config)))
2309 ;; ("libmnl" ,libmnl)
2310 ;; ("util-linux" ,util-linux)
2312 "https://wiki.linuxfoundation.org/networking/iproute2")
2314 "Utilities for controlling TCP/IP networking and traffic in Linux")
2316 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2317 and traffic with the Linux kernel. The most important of these are
2318 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2321 Most network configuration manuals still refer to ifconfig and route as the
2322 primary network configuration tools, but ifconfig is known to behave
2323 inadequately in modern network environments, and both should be deprecated.")
2324 (license license:gpl2+)))
2326 (define-public net-tools
2327 ;; XXX: This package is basically unmaintained, but it provides a few
2328 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2330 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2334 (version (string-append "1.60-" revision "." (string-take commit 7)))
2337 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2338 "n/ne/net-tools/code.git/net-tools-code-"
2340 (file-name (string-append name "-" version ".zip"))
2343 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2344 (home-page "http://net-tools.sourceforge.net/")
2345 (build-system gnu-build-system)
2347 `(#:modules ((guix build gnu-build-system)
2352 (modify-phases %standard-phases
2354 (lambda* (#:key outputs #:allow-other-keys)
2355 (let ((out (assoc-ref outputs "out")))
2356 (mkdir-p (string-append out "/bin"))
2357 (mkdir-p (string-append out "/sbin"))
2359 ;; Pretend we have everything...
2360 (system "yes | make config")
2362 ;; ... except for the things we don't have.
2363 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2364 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2365 ;; that have been removed.
2366 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2367 ;; think about adding them later.
2368 (substitute* '("config.make" "config.h")
2369 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2372 (add-after 'install 'remove-redundant-commands
2373 (lambda* (#:key outputs #:allow-other-keys)
2374 ;; Remove commands and man pages redundant with Inetutils.
2375 (let* ((out (assoc-ref outputs "out"))
2376 (dup (append-map (cut find-files out <>)
2378 "^(yp|nis|dns)?domainname"))))
2379 (for-each delete-file dup)
2381 ;; Binaries that depend on libnet-tools.a don't declare that
2382 ;; dependency, making it parallel-unsafe.
2383 #:parallel-build? #f
2385 #:tests? #f ; no test suite
2386 #:make-flags (let ((out (assoc-ref %outputs "out")))
2387 (list ,(string-append "CC=" (cc-for-target))
2388 (string-append "BASEDIR=" out)
2389 (string-append "INSTALLNLSDIR=" out "/share/locale")
2390 (string-append "mandir=/share/man")))))
2391 (native-inputs `(("gettext" ,gettext-minimal)
2393 (supported-systems (delete "i586-gnu" %supported-systems))
2394 (synopsis "Tools for controlling the network subsystem in Linux")
2396 "This package includes the important tools for controlling the network
2397 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2398 route. Additionally, this package contains utilities relating to particular
2399 network hardware types (plipconfig, slattach) and advanced aspects of IP
2400 configuration (iptunnel, ipmaddr).")
2401 (license license:gpl2+))))
2403 (define-public libcap
2410 "mirror://kernel.org/linux/libs/security/linux-privs/"
2411 "libcap2/libcap-" version ".tar.xz"))
2414 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2415 (build-system gnu-build-system)
2416 (arguments '(#:phases
2417 (modify-phases %standard-phases
2419 ;; Add $libdir to the RUNPATH of executables.
2421 (substitute* "Make.Rules"
2423 (string-append "LDFLAGS := -Wl,-rpath="
2426 #:test-target "test"
2427 #:make-flags (list "lib=lib"
2428 (string-append "prefix="
2429 (assoc-ref %outputs "out"))
2430 "RAISE_SETFCAP=no")))
2431 (native-inputs `(("perl" ,perl)))
2432 (supported-systems (delete "i586-gnu" %supported-systems))
2433 (home-page "https://sites.google.com/site/fullycapable/")
2434 (synopsis "Library for working with POSIX capabilities")
2436 "Libcap2 provides a programming interface to POSIX capabilities on
2437 Linux-based operating systems.")
2439 ;; License is BSD-3 or GPLv2, at the user's choice.
2440 (license license:gpl2)))
2442 ;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant.
2443 ;; To be merged with libcap on the next rebuild cycle.
2444 (define-public libcap/next
2451 "mirror://kernel.org/linux/libs/security/linux-privs/"
2452 "libcap2/libcap-" version ".tar.xz"))
2455 "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf"))))))
2457 (define-public bridge-utils
2459 (name "bridge-utils")
2464 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
2465 "bridge-utils-" version ".tar.xz"))
2467 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
2468 (build-system gnu-build-system)
2470 ;; The tarball lacks all the generated files.
2471 (native-inputs `(("autoconf" ,autoconf)
2472 ("automake" ,automake)))
2475 (modify-phases %standard-phases
2476 (add-before 'bootstrap 'patch-stuff
2478 ;; Fix "field ‘ip6’ has incomplete type" errors.
2479 (substitute* "libbridge/libbridge.h"
2480 (("#include <linux/if_bridge.h>")
2481 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2483 ;; Ensure that the entire build fails if one of the
2484 ;; sub-Makefiles fails.
2485 (substitute* "Makefile.in"
2486 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2487 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2490 #:tests? #f)) ; no 'check' target
2492 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2493 (synopsis "Manipulate Ethernet bridges")
2495 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2496 to connect two Ethernet segments together in a protocol independent way.
2497 Packets are forwarded based on Ethernet address, rather than IP address (like
2498 a router). Since forwarding is done at Layer 2, all protocols can go
2499 transparently through a bridge.")
2500 (license license:gpl2+)))
2502 (define-public libnl
2509 "https://github.com/thom311/libnl/releases/download/"
2510 "libnl" (string-join (string-split version #\.) "_")
2511 "/libnl-" version ".tar.gz"))
2514 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2515 (build-system gnu-build-system)
2519 ("pkg-config" ,pkg-config)
2525 "https://github.com/thom311/libnl/releases/download/libnl"
2526 (string-join (string-split version #\.) "_")
2527 "/libnl-doc-" version ".tar.gz"))
2529 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2530 (outputs `("out" "doc"))
2533 (modify-phases %standard-phases
2534 (add-after 'install 'install-doc
2535 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2536 (let ((dest (string-append (assoc-ref outputs "doc")
2537 "/share/doc/libnl")))
2539 (invoke "tar" "xf" (assoc-ref
2540 (or native-inputs inputs)
2542 "--strip-components=1" "-C" dest)))))))
2543 (home-page "https://www.infradead.org/~tgr/libnl/")
2544 (synopsis "NetLink protocol library suite")
2546 "The libnl suite is a collection of libraries providing APIs to netlink
2547 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2548 between the kernel and user space processes. It was designed to be a more
2549 flexible successor to ioctl to provide mainly networking related kernel
2550 configuration and monitoring interfaces.")
2552 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2553 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2554 (license license:gpl2)))
2556 ;; libnl python extensions used to be outputs of libnl. However, as
2557 ;; cross-compiling python extensions is currently broken, create separate
2558 ;; packages for libnl python extensions.
2559 (define (libnl-python-package python)
2560 (let ((name (string-append "libnl-" python)))
2565 ((string=? python "python2")
2566 `(("python-2" ,python-2)))
2567 ((string=? python "python3")
2568 `(("python-3" ,python-3))))))
2569 (propagated-inputs `(("libnl" ,libnl)))
2572 `(#:modules ((guix build gnu-build-system)
2576 (modify-phases %standard-phases
2578 (lambda* (#:key inputs outputs #:allow-other-keys)
2579 (define (python-inst python)
2580 (invoke python "setup.py" "build")
2581 (invoke python "setup.py" "install"
2582 (string-append "--prefix="
2583 (assoc-ref %outputs "out")))
2584 (invoke python "setup.py" "clean"))
2585 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2586 (assoc-ref inputs "libnl")))
2587 (with-directory-excursion "./python" (python-inst ,python))
2590 (define-public libnl-python2 (libnl-python-package "python2"))
2591 (define-public libnl-python3 (libnl-python-package "python3"))
2600 "mirror://kernel.org/software/network/iw/iw-"
2604 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2605 (build-system gnu-build-system)
2606 (native-inputs `(("pkg-config" ,pkg-config)))
2607 (inputs `(("libnl" ,libnl)))
2610 (let* ((target ,(%current-target-system))
2611 (pkg-config (if target
2612 (string-append target "-pkg-config")
2615 ,(string-append "CC=" (cc-for-target))
2616 (string-append "PKG_CONFIG="
2617 (assoc-ref %build-inputs "pkg-config")
2619 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2620 #:phases (modify-phases %standard-phases (delete 'configure))))
2621 (home-page "https://wireless.wiki.kernel.org/")
2622 (synopsis "Tool for configuring wireless devices")
2624 "iw is a new nl80211 based CLI configuration utility for wireless
2625 devices. It replaces @code{iwconfig}, which is deprecated.")
2626 (license license:isc)))
2628 (define-public powertop
2635 (uri (string-append "https://01.org/sites/default/files/downloads/"
2636 "powertop-" version ".tar.gz"))
2638 (base32 "0y1ixw8v17fdb1ima0zshrd0rh4zxdh10r93nrrvq6d4lhn9jpx6"))))
2639 (build-system gnu-build-system)
2642 (modify-phases %standard-phases
2643 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2644 ;; allow calibrating the network interface in Guix System.
2645 (add-after 'unpack 'patch-absolute-file-names
2646 (lambda* (#:key inputs #:allow-other-keys)
2647 (let ((kmod (assoc-ref inputs "kmod")))
2648 (substitute* (find-files "src" "\\.cpp$")
2649 ;; Give the right 'modprobe' file name so that essential
2650 ;; modules such as msr.ko can be loaded.
2651 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2652 ;; These programs are only needed to calibrate, so using
2653 ;; relative file names avoids adding extra inputs. When they
2654 ;; are missing powertop gracefully handles it.
2655 (("/usr/bin/hcitool") "hcitool")
2656 (("/usr/bin/xset") "xset")
2657 (("/usr/sbin/hciconfig") "hciconfig"))
2662 ("ncurses" ,ncurses)
2663 ("pciutils" ,pciutils)
2666 `(("pkg-config" ,pkg-config)))
2667 (home-page "https://01.org/powertop/")
2668 (synopsis "Analyze power consumption on Intel-based laptops")
2670 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2671 power management. In addition to being a diagnostic tool, PowerTOP also has
2672 an interactive mode where the user can experiment various power management
2673 settings for cases where the operating system has not enabled these
2675 (license license:gpl2)))
2677 (define-public aumix
2684 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2685 version ".tar.bz2"))
2688 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2689 (build-system gnu-build-system)
2690 (inputs `(("ncurses" ,ncurses)))
2691 (home-page "http://www.jpj.net/~trevor/aumix.html")
2692 (synopsis "Audio mixer for X and the console")
2694 "Aumix adjusts an audio mixer from X, the console, a terminal,
2695 the command line or a script.")
2696 (license license:gpl2+)))
2698 (define-public iotop
2705 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2708 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2709 (build-system python-build-system)
2712 (modify-phases %standard-phases
2713 (add-after 'unpack 'fix-build-with-python3
2715 (substitute* "setup.py"
2716 (("itervalues") "values"))
2718 ;; There are currently no checks in the package.
2720 (native-inputs `(("python" ,python)))
2721 (home-page "http://guichaz.free.fr/iotop/")
2723 "Displays the IO activity of running processes")
2725 "Iotop is a Python program with a top like user interface to show the
2726 processes currently causing I/O.")
2727 (license license:gpl2+)))
2735 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2736 "download/fuse-" version
2737 "/fuse-" version ".tar.gz"))
2740 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2741 (patches (search-patches "fuse-overlapping-headers.patch"))))
2742 (build-system gnu-build-system)
2743 (inputs `(("util-linux" ,util-linux)))
2745 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2746 (assoc-ref %outputs "out")
2748 (string-append "INIT_D_PATH="
2749 (assoc-ref %outputs "out")
2752 ;; The rule makes /dev/fuse 666.
2753 (string-append "UDEV_RULES_PATH="
2754 (assoc-ref %outputs "out")
2755 "/lib/udev/rules.d"))
2757 (modify-phases %standard-phases
2758 (add-before 'build 'set-file-names
2759 (lambda* (#:key inputs #:allow-other-keys)
2760 ;; libfuse calls out to mount(8) and umount(8). Make sure
2761 ;; it refers to the right ones.
2762 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2763 (("/bin/(u?)mount" _ maybe-u)
2764 (string-append (assoc-ref inputs "util-linux")
2765 "/bin/" maybe-u "mount")))
2766 (substitute* '("util/mount.fuse.c")
2770 ;; This hack leads libfuse to search for 'fusermount' in
2771 ;; $PATH, where it may find a setuid-root binary, instead of
2772 ;; trying solely $out/sbin/fusermount and failing because
2774 (substitute* "lib/Makefile"
2775 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2776 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2778 (supported-systems (delete "i586-gnu" %supported-systems))
2779 (home-page "https://github.com/libfuse/libfuse")
2780 (synopsis "Support file systems implemented in user space")
2782 "As a consequence of its monolithic design, file system code for Linux
2783 normally goes into the kernel itself---which is not only a robustness issue,
2784 but also an impediment to system extensibility. FUSE, for \"file systems in
2785 user space\", is a kernel module and user-space library that tries to address
2786 part of this problem by allowing users to run file system implementations as
2787 user-space processes.")
2788 (license (list license:lgpl2.1 ;library
2789 license:gpl2+)))) ;command-line utilities
2791 (define-public unionfs-fuse
2793 (name "unionfs-fuse")
2798 (url "https://github.com/rpodgorny/unionfs-fuse")
2799 (commit (string-append "v" version))))
2800 (file-name (git-file-name name version))
2803 "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6"))))
2804 (build-system cmake-build-system)
2806 `(("python" ,python)))
2807 (inputs `(("fuse" ,fuse)))
2809 ;; The tests were never actually run ("collected 0 items"), but in recent
2810 ;; versions of pytest that causes an error.
2812 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2813 (synopsis "User-space union file system")
2815 "UnionFS-FUSE is a flexible union file system implementation in user
2816 space, using the FUSE library. Mounting a union file system allows you to
2817 \"aggregate\" the contents of several directories into a single mount point.
2818 UnionFS-FUSE additionally supports copy-on-write.")
2819 (license license:bsd-3)))
2822 (package (inherit fuse)
2823 (name "fuse-static")
2824 (source (origin (inherit (package-source fuse))
2825 (modules '((guix build utils)))
2828 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2829 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2830 ;; that it doesn't do that, allowing us to remove the
2831 ;; dependency on util-linux (something that is useful in
2833 (substitute* '("lib/mount_util.c"
2834 "util/mount_util.c")
2835 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2841 (define-public unionfs-fuse/static
2842 (package (inherit unionfs-fuse)
2843 (synopsis "User-space union file system (statically linked)")
2844 (name (string-append (package-name unionfs-fuse) "-static"))
2845 (source (origin (inherit (package-source unionfs-fuse))
2846 (modules '((guix build utils)))
2849 ;; Add -ldl to the libraries, because libfuse.a needs that.
2850 (substitute* "src/CMakeLists.txt"
2851 (("target_link_libraries(.*)\\)" _ libs)
2852 (string-append "target_link_libraries"
2857 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2859 (modify-phases %standard-phases
2860 (add-after 'install 'post-install
2861 (lambda* (#:key outputs #:allow-other-keys)
2862 (let* ((out (assoc-ref outputs "out"))
2863 (exe (string-append out "/bin/unionfs")))
2864 ;; By default, 'unionfs' keeps references to
2865 ;; $glibc/share/locale and similar stuff. Remove them.
2866 (remove-store-references exe)
2868 ;; 'unionfsctl' has references to glibc as well. Since
2869 ;; we don't need it, remove it.
2870 (delete-file (string-append out "/bin/unionfsctl"))
2872 (inputs `(("fuse" ,fuse-static)))))
2874 (define-public sshfs
2880 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2881 "download/sshfs-" version "/sshfs-" version
2885 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2886 (build-system gnu-build-system)
2891 `(("pkg-config" ,pkg-config)))
2892 (home-page "https://github.com/libfuse/sshfs")
2893 (synopsis "Mount remote file systems over SSH")
2895 "This is a file system client based on the SSH File Transfer Protocol.
2896 Since most SSH servers already support this protocol it is very easy to set
2897 up: on the server side there's nothing to do; on the client side mounting the
2898 file system is as easy as logging into the server with an SSH client.")
2899 (license license:gpl2+)))
2901 (define-public sshfs-fuse
2902 (package (inherit sshfs)
2904 (properties `((superseded . ,sshfs)))))
2906 (define-public archivemount
2908 (name "archivemount")
2913 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2914 "archivemount-" version ".tar.gz"))
2916 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2917 (build-system gnu-build-system)
2918 (inputs `(("fuse" ,fuse)
2919 ("libarchive" ,libarchive)))
2920 (native-inputs `(("pkg-config" ,pkg-config)))
2921 (home-page "https://www.cybernoia.de/software/archivemount.html")
2922 (synopsis "Tool for mounting archive files with FUSE")
2923 (description "archivemount is a FUSE-based file system for Unix variants,
2924 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2925 mount point where it can be read from or written to as with any other file
2926 system. This makes accessing the contents of the archive, which may be
2927 compressed, transparent to other programs, without decompressing them.")
2928 (license license:lgpl2.0+)))
2930 (define-public numactl
2937 "https://github.com/numactl/numactl/releases/download/v"
2938 version "/numactl-" version ".tar.gz"))
2941 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
2942 (build-system gnu-build-system)
2944 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2945 ;; to run, which we can't assume to have.
2948 ;; NUMA is apparently not supported on armhf, see
2949 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2950 (supported-systems (delete "armhf-linux" %supported-systems))
2951 (home-page "https://github.com/numactl/numactl")
2952 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2954 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2955 memory is not all in one place. The @command{numactl} program allows you to
2956 run your application program on specific CPUs and memory nodes. It does this
2957 by supplying a NUMA memory policy to the operating system before running your
2960 The package contains other commands, such as @command{numastat},
2961 @command{memhog}, and @command{numademo} which provides a quick overview of
2962 NUMA performance on your system.")
2963 (license (list license:gpl2 ;programs
2964 license:lgpl2.1)))) ;library
2966 (define-public kbd-neo
2973 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2974 version "/linux/console/neo.map"))
2975 (file-name (string-append name "-" version ".map"))
2978 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2979 (build-system trivial-build-system)
2981 `(#:modules ((guix build utils))
2983 (use-modules (guix build utils))
2984 (let ((out (string-append %output "/share/keymaps"))
2985 (source (assoc-ref %build-inputs "source")))
2987 (copy-file source (string-append out "/neo.map"))
2989 (home-page "https://neo-layout.org")
2990 (synopsis "Neo2 console layout")
2992 "Kbd-neo provides the Neo2 keyboard layout for use with
2993 @command{loadkeys(1)} from @code{kbd(4)}.")
2994 ;; The file is located in an svn directory, the entire content of
2995 ;; the directory is licensed as GPL3.
2996 (license license:gpl3+)))
3004 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3008 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
3009 (modules '((guix build utils)))
3012 (substitute* "tests/Makefile.in"
3013 ;; The '%: %.in' rule incorrectly uses @VERSION@.
3016 (substitute* '("src/unicode_start" "src/unicode_stop")
3017 ;; Assume the Coreutils are in $PATH.
3021 (build-system gnu-build-system)
3024 (modify-phases %standard-phases
3025 (add-before 'build 'pre-build
3026 (lambda* (#:key inputs #:allow-other-keys)
3027 (let ((gzip (assoc-ref %build-inputs "gzip"))
3028 (bzip2 (assoc-ref %build-inputs "bzip2")))
3029 (substitute* "src/libkeymap/findfile.c"
3031 (string-append gzip "/bin/gzip"))
3033 (string-append bzip2 "/bin/bzip2")))
3035 (add-after 'install 'post-install
3036 (lambda* (#:key outputs #:allow-other-keys)
3037 ;; Make sure these programs find their comrades.
3038 (let* ((out (assoc-ref outputs "out"))
3039 (bin (string-append out "/bin")))
3040 (for-each (lambda (prog)
3041 (wrap-program (string-append bin "/" prog)
3042 `("PATH" ":" prefix (,bin))))
3043 '("unicode_start" "unicode_stop"))
3045 (inputs `(("check" ,check)
3048 ("pam" ,linux-pam)))
3049 (native-search-paths
3050 (list (search-path-specification
3051 (variable "LOADKEYS_KEYMAP_PATH")
3052 ;; Append ‘/**’ to recursively search all directories. One can then
3053 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3054 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3055 (files (list "share/keymaps/**")))))
3056 (native-inputs `(("pkg-config" ,pkg-config)))
3057 (home-page "http://kbd-project.org/")
3058 (synopsis "Linux keyboard utilities and keyboard maps")
3060 "This package contains keytable files and keyboard utilities compatible
3061 for systems using the Linux kernel. This includes commands such as
3062 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3063 (license license:gpl2+)))
3065 (define-public loadkeys-static
3068 (name "loadkeys-static")
3070 (substitute-keyword-arguments (package-arguments kbd)
3071 ((#:configure-flags flags ''())
3072 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3073 "--disable-vlock" ;so we don't need libpam
3074 "--disable-libkeymap")
3076 ((#:make-flags flags ''())
3077 `(cons "LDFLAGS=-all-static" ,flags))
3078 ((#:phases phases '%standard-phases)
3079 `(modify-phases ,phases
3081 (lambda* (#:key outputs #:allow-other-keys)
3082 (let ((out (assoc-ref outputs "out")))
3083 ;; The binary keeps references to gzip, among other things,
3084 ;; which we don't need in the initrd, so strip references.
3085 (remove-store-references "src/loadkeys")
3087 (install-file "src/loadkeys"
3088 (string-append out "/bin"))
3090 (delete 'post-install)))
3091 ((#:strip-flags _ '())
3093 ((#:allowed-references _ '())
3096 (synopsis "Statically-linked @command{loadkeys} program")
3098 ;; This package is meant to be used internally in the initrd so don't
3100 (properties '((hidden? . #t)))))
3102 (define-public inotify-tools
3104 (name "inotify-tools")
3105 (version "3.20.2.2")
3109 (url "https://github.com/rvoicilas/inotify-tools")
3111 (file-name (git-file-name name version))
3114 "1r12bglkb0bkqff6kgxjm81hk6z20nrxq3m7iv15d4nrqf9pm7s0"))))
3115 (build-system gnu-build-system)
3117 `(("autoconf" ,autoconf)
3118 ("automake" ,automake)
3119 ("libtool" ,libtool)))
3120 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3121 (synopsis "Monitor file accesses")
3123 "The inotify-tools packages provides a C library and command-line tools
3124 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3125 (license license:gpl2+)))
3134 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3135 "kmod-" version ".tar.xz"))
3138 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3139 (patches (search-patches "kmod-module-directory.patch"))))
3140 (build-system gnu-build-system)
3142 `(("pkg-config" ,pkg-config)))
3147 `(#:configure-flags '("--with-xz" "--with-zlib"
3148 "--disable-test-modules")
3150 (modify-phases %standard-phases
3151 (add-after 'unpack 'disable-tests
3153 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3154 (substitute* "Makefile.in"
3155 (("testsuite/test-modprobe") "")
3156 (("testsuite/test-depmod") "")
3157 (("testsuite/test-blacklist") ""))
3159 (add-after 'install 'install-modprobe&co
3160 (lambda* (#:key outputs #:allow-other-keys)
3161 (let* ((out (assoc-ref outputs "out"))
3162 (bin (string-append out "/bin")))
3163 (for-each (lambda (tool)
3165 (string-append bin "/" tool)))
3166 '("insmod" "rmmod" "lsmod" "modprobe"
3167 "modinfo" "depmod"))
3169 (supported-systems (delete "i586-gnu" %supported-systems))
3170 (home-page "https://www.kernel.org/")
3171 (synopsis "Kernel module tools")
3172 (description "Kmod is a set of tools to handle common tasks with Linux
3173 kernel modules like insert, remove, list, check properties, resolve
3174 dependencies and aliases.
3176 These tools are designed on top of libkmod, a library that is shipped with
3177 kmod. The aim is to be compatible with tools, configurations and indices
3178 from the module-init-tools project.")
3179 (license license:gpl2+))) ; library under lgpl2.1+
3181 (define-public earlyoom
3188 (url "https://github.com/rfjakob/earlyoom")
3189 (commit (string-append "v" version))))
3190 (file-name (git-file-name name version))
3193 "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i"))))
3194 (build-system gnu-build-system)
3196 `(#:phases (modify-phases %standard-phases
3198 (add-before 'check 'set-home
3200 (setenv "HOME" (getcwd))
3202 (add-after 'build 'install-contribs
3203 ;; Install what seems useful from the contrib directory.
3204 (lambda* (#:key outputs #:allow-other-keys)
3205 (let* ((out (assoc-ref outputs "out"))
3206 (contrib (string-append
3207 out "/share/earlyoom/contrib")))
3208 (install-file "contrib/notify_all_users.py" contrib)
3210 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3211 (list ,(string-append "CC=" (cc-for-target))
3212 (string-append "VERSION=v" ,version)
3213 (string-append "PREFIX=" prefix)
3214 (string-append "SYSCONFDIR=" prefix "/etc")))
3215 #:test-target "test"))
3216 (native-inputs `(("go" ,go) ;for the test suite
3217 ("pandoc" ,pandoc))) ;to generate the manpage
3218 (home-page "https://github.com/rfjakob/earlyoom")
3219 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3220 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3221 runs in user space and provides a more responsive and configurable alternative
3222 to the in-kernel OOM killer.")
3223 (license license:expat)))
3225 (define-public eudev
3226 ;; The post-systemd fork, maintained by Gentoo.
3232 (uri (git-reference (url "https://github.com/gentoo/eudev")
3233 (commit (string-append "v" version))))
3234 (file-name (git-file-name name version))
3237 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3238 (patches (search-patches "eudev-rules-directory.patch"))))
3239 (build-system gnu-build-system)
3242 (modify-phases %standard-phases
3243 (add-after 'unpack 'make-source-writable
3245 ;; XXX: Git checkouts are read-only, but this package needs to
3246 ;; modify some of its files.
3247 (for-each make-file-writable (find-files "."))
3249 (add-before 'bootstrap 'patch-file-names
3250 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3251 (substitute* "man/make.sh"
3252 (("/usr/bin/xsltproc")
3253 (string-append (assoc-ref
3254 (or native-inputs inputs) "xsltproc")
3257 (add-before 'configure 'patch-bindir-in-btrfs-rules
3258 (lambda* (#:key outputs #:allow-other-keys)
3259 ;; The "@bindir@" substitution incorrectly expands to a literal
3260 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3262 (let ((out (assoc-ref outputs "out")))
3263 (substitute* "rules/64-btrfs.rules.in"
3265 (string-append out "/bin")))
3267 (add-after 'install 'move-static-library
3268 (lambda* (#:key outputs #:allow-other-keys)
3269 (let* ((out (assoc-ref outputs "out"))
3270 (static (assoc-ref outputs "static"))
3271 (source (string-append out "/lib/libudev.a"))
3272 (target (string-append static "/lib/libudev.a")))
3273 (mkdir-p (dirname target))
3274 (link source target)
3275 (delete-file source)
3276 ;; Remove reference to the static library from the .la file
3277 ;; such that Libtool looks for it in the usual places.
3278 (substitute* (string-append out "/lib/libudev.la")
3280 "old_library=''\n"))
3282 (add-after 'install 'build-hwdb
3283 (lambda* (#:key outputs #:allow-other-keys)
3284 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3285 ;; similar tools to display product names.
3287 ;; XXX: This can't be done when cross-compiling. Find another way
3288 ;; to generate hwdb.bin for cross-built systems.
3289 (let ((out (assoc-ref outputs "out")))
3290 ,@(if (%current-target-system)
3292 '((invoke (string-append out "/bin/udevadm")
3293 "hwdb" "--update")))))))
3294 #:configure-flags (list "--enable-manpages")))
3296 `(("autoconf" ,autoconf)
3297 ("automake" ,automake)
3299 ("libtool" ,libtool)
3300 ("pkg-config" ,pkg-config)
3303 ("python" ,python-wrapper)
3304 ;; For documentation.
3305 ("docbook-xml" ,docbook-xml-4.2)
3306 ("docbook-xsl" ,docbook-xsl)
3307 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3308 ("xsltproc" ,libxslt)))
3310 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3311 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3312 ;; which contains the rules to do that.
3313 `(("util-linux" ,util-linux "lib") ;for blkid
3315 (outputs '("out" "static"))
3316 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3317 (synopsis "Userspace device management")
3318 (description "Udev is a daemon which dynamically creates and removes
3319 device nodes from /dev/, handles hotplug events and loads drivers at boot
3321 (license license:gpl2+)))
3323 (define-public python-evdev
3325 (name "python-evdev")
3330 (uri (pypi-uri "evdev" version))
3332 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3333 (build-system python-build-system)
3335 `(("kernel-headers" ,linux-libre-headers)))
3337 `(#:tests? #f ;no rule for tests
3339 (modify-phases %standard-phases
3340 (add-before 'build 'fix-hard-coded-directory
3341 (lambda* (#:key inputs #:allow-other-keys)
3342 (substitute* "setup.py"
3343 (("/usr/include/linux")
3345 (assoc-ref inputs "kernel-headers") "/include/linux")))
3347 (home-page "https://github.com/gvalkov/python-evdev")
3348 (synopsis "Bindings to the Linux input handling subsystem")
3350 "Python-evdev provides bindings to the generic input event interface in
3351 Linux. The @code{evdev} interface serves the purpose of passing events
3352 generated in the kernel directly to userspace through character devices that
3353 are typically located in @file{/dev/input/}.
3355 This package also comes with bindings to @code{uinput}, the userspace input
3356 subsystem. @code{uinput} allows userspace programs to create and handle input
3357 devices that can inject events directly into the input subsystem.")
3358 (license license:bsd-3)))
3366 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3368 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3372 "1l0fkn9abrgk5mfn6jfh9qhdr86b59l1c5pk6lp8jh0491d69las"))
3373 (modules '((guix build utils)))
3376 (use-modules (guix build utils))
3378 ;; Honor sysconfdir.
3379 (substitute* "make.tmpl.in"
3381 "confdir = @sysconfdir@\n")
3382 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3383 "DEFAULT_SYS_DIR = @sysconfdir@"))
3385 (patches (search-patches "lvm2-static-link.patch"))))
3386 (build-system gnu-build-system)
3388 `(("pkg-config" ,pkg-config)
3389 ("procps" ,procps))) ;tests use 'pgrep'
3391 `(("libaio" ,libaio)
3395 (modify-phases %standard-phases
3396 (add-after 'configure 'set-makefile-shell
3398 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3400 (setenv "SHELL" (which "sh"))
3402 ;; Replace /bin/sh with the right file name.
3403 (patch-makefile-SHELL "make.tmpl")
3406 #:configure-flags (list (string-append "--sysconfdir="
3407 (assoc-ref %outputs "out")
3409 "--enable-udev_sync"
3410 "--enable-udev_rules"
3411 "--enable-pkgconfig"
3413 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3415 ;; Make sure programs such as 'dmsetup' can
3416 ;; find libdevmapper.so.
3417 (string-append "LDFLAGS=-Wl,-rpath="
3418 (assoc-ref %outputs "out")
3420 (assoc-ref %outputs "out")
3421 "/lib/device-mapper")
3422 ;; This is needed when cross-compiling.
3423 ,@(if (%current-target-system)
3424 '("ac_cv_func_malloc_0_nonnull=yes"
3425 "ac_cv_func_realloc_0_nonnull=yes")
3428 ;; The tests use 'mknod', which requires root access.
3430 (supported-systems (delete "i586-gnu" %supported-systems))
3431 (home-page "https://sourceware.org/lvm2/")
3432 (synopsis "Logical volume management for Linux")
3434 "LVM2 is the logical volume management tool set for Linux-based systems.
3435 This package includes the user-space libraries and tools, including the device
3436 mapper. Kernel components are part of Linux-libre.")
3438 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3439 ;; Command-line tools are GPLv2.
3440 (license (list license:gpl2 license:lgpl2.1))))
3442 (define-public lvm2-static
3445 (name "lvm2-static")
3447 ;; Propagate udev because libdevmapper.a depends on libudev.
3448 (propagated-inputs `(("udev:static" ,eudev "static")))
3451 (substitute-keyword-arguments (package-arguments lvm2)
3452 ((#:configure-flags flags '())
3453 ;; LVM2 doesn't use Libtool, hence the custom option.
3454 `(append '("--enable-static_link")
3455 ;; Building dmeventd statically is complicated due to a
3456 ;; requirement on libdevmapper.a, which is being phased out
3457 ;; in favor of libdevice-mapper.a, which in turn is is not
3458 ;; easily made available at dmeventd build time. Just ignore
3459 ;; it until the situation improves.
3460 (delete "--enable-dmeventd" ,flags)))
3462 `(modify-phases ,phases
3463 (add-before 'configure 'adjust-Makefile
3465 ;; These fixes are related to the upstream libdm->device_mapper
3466 ;; migration and will hopefully be fixed upstream in due time.
3467 (substitute* "tools/Makefile.in"
3468 ;; This variable is empty in a static configuration and causes
3469 ;; an erroneous GCC command line.
3470 (("-L\\$\\(interfacebuilddir\\)") "")
3471 ;; Remove obsolete reference to libdevmapper.a.
3472 (("-ldevmapper") ""))
3474 (synopsis "Logical volume management for Linux (statically linked)")))
3476 (define-public thin-provisioning-tools
3478 (name "thin-provisioning-tools")
3484 (url "https://github.com/jthornber/thin-provisioning-tools")
3485 (commit (string-append "v" version))))
3486 (file-name (git-file-name name version))
3488 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3489 (build-system gnu-build-system)
3491 ;; Doesn't build with --enable-testing due to a function name collision
3492 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3495 `(("automake" ,automake)
3496 ("autoreconf" ,autoconf)))
3500 ("libaio" ,libaio)))
3501 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3502 (description "A suite of tools for manipulating the metadata of the
3503 dm-thin, dm-cache and dm-era device-mapper targets.")
3504 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3505 (license license:gpl3+)))
3507 (define-public wireless-tools
3509 (name "wireless-tools")
3513 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3517 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3520 ;; Remove the older header files that are not free software.
3521 (for-each (lambda (n)
3522 (delete-file (format #f "wireless.~a.h" n)))
3523 '(10 11 12 13 14 15 16 17 18 19 20))
3525 (build-system gnu-build-system)
3528 (list (string-append "PREFIX=" %output)
3529 (string-append "INSTALL_MAN=" %output "/share/man")
3530 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3533 (modify-phases %standard-phases
3535 (lambda* (#:key target #:allow-other-keys)
3536 (when ,(%current-target-system)
3537 ;; Cross-compilation: use the cross tools.
3538 (substitute* (find-files "." "Makefile")
3540 (string-append "CC = " target "-gcc\n"))
3542 (string-append "AR = " target "-ar\n"))
3544 (string-append "RANLIB = " target "-ranlib\n"))))
3547 (synopsis "Tools for manipulating Linux Wireless Extensions")
3548 (description "Wireless Tools are used to manipulate the now-deprecated
3549 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3550 Extension was an interface allowing you to set Wireless LAN specific
3551 parameters and get the specific stats. It is deprecated in favor the nl80211
3553 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3554 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3555 ;; other files are distributed under gpl2.
3556 (license (list license:gpl2 license:lgpl2.1+))))
3564 (uri (string-append "mirror://kernel.org/software/network/crda/"
3565 "crda-" version ".tar.xz"))
3568 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3569 (patches (search-patches "crda-optional-gcrypt.patch"))))
3570 (build-system gnu-build-system)
3572 `(#:phases (modify-phases %standard-phases
3574 (add-after 'unpack 'gzip-determinism
3576 (substitute* "Makefile"
3577 (("gzip") "gzip --no-name"))
3579 ,@(if (%current-target-system)
3581 'unpack 'fix-pkg-config
3582 (lambda* (#:key target #:allow-other-keys)
3586 (string-append target "-pkg-config")))
3590 'build 'no-werror-no-ldconfig
3592 (substitute* "Makefile"
3594 (("ldconfig") "true"))
3597 'build 'set-regulator-db-file-name
3598 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3599 ;; Tell CRDA where to find our database.
3600 (let ((regdb (assoc-ref (or native-inputs inputs)
3602 (substitute* "crda.c"
3603 (("\"/lib/crda/regulatory.bin\"")
3604 (string-append "\"" regdb
3605 "/lib/crda/regulatory.bin\"")))
3607 #:test-target "verify"
3608 #:make-flags (let ((out (assoc-ref %outputs "out"))
3609 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3611 (string-append "CC=" ,(cc-for-target))
3614 ;; Disable signature-checking on 'regulatory.bin'.
3615 ;; The reason is that this simplifies maintenance
3616 ;; on our side (no need to manage a distro key
3617 ;; pair), and we can guarantee integrity of
3618 ;; 'regulatory.bin' by other means anyway, such as
3619 ;; 'guix gc --verify'. See
3620 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3624 (string-append "PREFIX=" out)
3625 (string-append "SBINDIR=" out "/sbin/")
3626 (string-append "UDEV_RULE_DIR="
3627 out "/lib/udev/rules.d")
3628 (string-append "LDFLAGS=-Wl,-rpath="
3630 (string-append "REG_BIN=" regdb
3631 "/lib/crda/regulatory.bin")
3633 (native-inputs `(("pkg-config" ,pkg-config)
3634 ("wireless-regdb" ,wireless-regdb)))
3635 (inputs `(("libnl" ,libnl)))
3637 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3638 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3640 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3641 communication between the kernel Linux and user space for regulatory
3643 (license license:copyleft-next)))
3645 (define-public wireless-regdb
3647 (name "wireless-regdb")
3648 (version "2020.04.29")
3652 "mirror://kernel.org/software/network/wireless-regdb/"
3653 "wireless-regdb-" version ".tar.xz"))
3656 "0yicda474ygahv8da18h1p4yf42s6x2f208mlwcw4xsrxld07zc9"))
3658 ;; We're building 'regulatory.bin' by ourselves.
3660 (delete-file "regulatory.bin")
3662 (build-system gnu-build-system)
3665 (modify-phases %standard-phases
3666 (add-after 'unpack 'gzip-determinism
3668 (substitute* "Makefile"
3669 (("gzip") "gzip --no-name"))
3671 (add-after 'unpack 'omit-signature
3673 (substitute* "Makefile"
3674 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3675 ;; don't provide (see below). Disable it.
3676 ((" regulatory\\.db\\.p7s") "")
3677 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3678 ;; but ‘make install’ depends only on the latter while installing
3679 ;; both (and failing). Depend on it explicitly.
3680 (("^install: " all) (string-append all "regulatory.db ")))
3682 (delete 'configure)) ; no configure script
3684 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3685 ;; is computed and can be equal to 'maintainer-clean'; when that
3686 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3687 ;; just built. Thus, build things sequentially.
3688 #:parallel-build? #f
3690 #:tests? #f ; no tests
3692 (let ((out (assoc-ref %outputs "out")))
3693 (list (string-append "PREFIX=" out)
3694 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3696 ;; Leave this empty so that db2bin.py doesn't try to sign
3697 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3698 ;; pair for the whole distribution.
3699 (string-append "REGDB_PRIVKEY=")
3700 ;; Don't generate a public key for the same reason. These are
3701 ;; used as Makefile targets and can't be the empty string.
3702 (string-append "REGDB_PUBCERT=/dev/null")
3703 (string-append "REGDB_PUBKEY=/dev/null")))))
3705 `(("python" ,python-wrapper)))
3707 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3708 (synopsis "Wireless regulatory database")
3710 "This package contains the wireless regulatory database Central
3711 Regulatory Database Agent (CRDA) daemon. The database contains information on
3712 country-specific regulations for the wireless spectrum.")
3713 (license license:isc)))
3715 (define-public lm-sensors
3723 (url "https://github.com/groeck/lm-sensors")
3724 (commit (string-append "V" (string-join
3725 (string-split version #\.) "-")))))
3726 (file-name (git-file-name name version))
3728 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3729 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3730 (build-system gnu-build-system)
3731 (inputs `(("rrdtool" ,rrdtool)
3734 ("gnuplot" ,gnuplot)))
3735 (native-inputs `(("pkg-config" ,pkg-config)
3739 (outputs '("lib" ; avoid perl in closure
3742 `(#:tests? #f ; no 'check' target
3743 #:make-flags (list (string-append "PREFIX=" %output)
3744 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3745 (string-append "INCLUDEDIR="
3746 (assoc-ref %outputs "lib") "/include")
3747 (string-append "MANDIR=" %output "/share/man")
3748 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3750 (modify-phases %standard-phases
3752 (add-before 'build 'patch-exec-paths
3753 (lambda* (#:key inputs outputs #:allow-other-keys)
3754 (substitute* "prog/detect/sensors-detect"
3756 (string-append "`" (assoc-ref inputs "coreutils")
3758 (("(`|\")modprobe" all open-quote)
3759 (string-append open-quote
3760 (assoc-ref inputs "kmod")
3762 (substitute* '("prog/pwm/pwmconfig"
3763 "prog/pwm/fancontrol")
3765 (string-append (assoc-ref inputs "gnuplot")
3768 (string-append (assoc-ref inputs "coreutils")
3771 (string-append (assoc-ref inputs "grep")
3774 (string-append (assoc-ref inputs "sed")
3777 (string-append (assoc-ref inputs "coreutils")
3780 (string-append (assoc-ref inputs "coreutils")
3783 (string-append (assoc-ref inputs "coreutils")
3784 "/bin/readlink -f")))
3786 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3787 (synopsis "Utilities to read temperature/voltage/fan sensors")
3789 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3790 you to access information from temperature, voltage, and fan speed sensors.
3791 It works with most newer systems.")
3792 (license license:gpl2+)))
3794 (define-public iucode-tool
3796 (name "iucode-tool")
3800 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3801 "/raw/latest/iucode-tool_" version ".tar.xz"))
3804 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3805 (build-system gnu-build-system)
3806 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3807 (synopsis "Manipulate Intel microcode bundles")
3809 "@command{iucode_tool} is a utility to work with microcode packages for
3810 Intel processors. It can convert between formats, extract specific versions,
3811 create a firmware image suitable for the Linux kernel, and more.")
3812 ;; cpuid.h is available for i686, x86_64, and ia64.
3813 (supported-systems '("i686-linux" "x86_64-linux"))
3814 (license license:gpl2+)))
3816 (define-public i2c-tools
3823 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3824 version ".tar.bz2"))
3827 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3828 (build-system gnu-build-system)
3830 `(#:tests? #f ; no 'check' target
3831 #:make-flags (list (string-append "prefix=" %output)
3832 ,(string-append "CC=" (cc-for-target)))
3833 ;; No configure script.
3834 #:phases (modify-phases %standard-phases (delete 'configure))))
3837 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3838 (synopsis "I2C tools for Linux")
3840 "The i2c-tools package contains a heterogeneous set of I2C tools for
3841 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3842 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3844 (license license:gpl2+)))
3846 (define-public xsensors
3853 "http://www.linuxhardware.org/xsensors/xsensors-"
3857 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3858 (build-system gnu-build-system)
3859 (inputs `(("lm-sensors" ,lm-sensors "lib")
3861 (native-inputs `(("pkg-config" ,pkg-config)))
3864 (modify-phases %standard-phases
3865 (add-before 'configure 'enable-deprecated
3867 (substitute* "src/Makefile.in"
3868 (("-DGDK_DISABLE_DEPRECATED") "")
3869 (("-DGTK_DISABLE_DEPRECATED") ""))
3871 (add-before 'configure 'remove-Werror
3873 (substitute* '("configure" "src/Makefile.in")
3876 (home-page "http://www.linuxhardware.org/xsensors/")
3877 (synopsis "Hardware health information viewer")
3879 "Xsensors reads data from the libsensors library regarding hardware
3880 health such as temperature, voltage and fan speed and displays the information
3881 in a digital read-out.")
3882 (license license:gpl2+)))
3887 (version (package-version linux-libre))
3888 (source (package-source linux-libre))
3889 (build-system gnu-build-system)
3892 (modify-phases %standard-phases
3894 (lambda* (#:key inputs #:allow-other-keys)
3895 (setenv "SHELL_PATH" (which "bash"))
3896 (chdir "tools/perf")
3898 #:make-flags (list (string-append "prefix="
3899 (assoc-ref %outputs "out"))
3903 ;; By default, 'config/Makefile' uses lib64 on
3904 ;; x86_64. Work around that.
3906 #:tests? #f)) ;no tests
3908 `(("pkg-config" ,pkg-config)
3912 ;; There are build scripts written in these languages.
3914 ("python2" ,python-2)
3915 ("python3" ,python-3)))
3917 `(("slang" ,slang) ;for the interactive TUI
3919 ("python" ,python-2) ;'perf' links against libpython
3920 ("elfutils" ,elfutils)
3921 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3922 ("libunwind" ,libunwind) ;better stack walking
3923 ("numactl" ,numactl) ;for 'perf bench numa mem'
3926 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3927 ("docbook-xsl" ,docbook-xsl)
3929 ("asciidoc" ,asciidoc)))
3930 (home-page "https://perf.wiki.kernel.org/")
3931 (synopsis "Linux profiling with performance counters")
3933 "perf is a tool suite for profiling using hardware performance counters,
3934 with support in the Linux kernel. perf can instrument CPU performance
3935 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3936 of lightweight profiling. This package contains the user-land tools and in
3937 particular the @code{perf} command.")
3938 (license (package-license linux-libre))))
3940 (define-public pflask
3947 (url "https://github.com/ghedo/pflask")
3948 (commit (string-append "v" version))))
3949 (file-name (git-file-name name version))
3952 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
3953 (build-system cmake-build-system)
3955 '(#:tests? #f)) ; no tests
3956 (home-page "https://ghedo.github.io/pflask/")
3957 (synopsis "Simple tool for creating Linux namespace containers")
3958 (description "pflask is a simple tool for creating Linux namespace
3959 containers. It can be used for running a command or even booting an OS inside
3960 an isolated container, created with the help of Linux namespaces. It is
3961 similar in functionality to chroot, although pflask provides better isolation
3962 thanks to the use of namespaces.")
3963 (license license:bsd-2)))
3965 (define-public singularity
3967 (name "singularity")
3971 (uri (string-append "https://github.com/singularityware/singularity/"
3972 "releases/download/" version
3973 "/singularity-" version ".tar.gz"))
3976 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3977 (modules '((guix build utils)))
3980 ;; Do not create directories in /var.
3981 (substitute* "Makefile.in"
3982 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3984 ;; The original source overrides PATH so that it points to
3985 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3986 ;; on Guix System. Leave PATH unchanged so we refer to the
3987 ;; installed Coreutils, grep, etc.
3988 (substitute* "bin/singularity.in"
3990 (string-append "#" all "\n")))
3992 (substitute* (find-files "libexec/cli" "\\.exec$")
3993 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3995 (string-append "/run/setuid-programs/singularity-"
3996 program "-helper")))
3998 ;; These squashfs mount options are apparently no longer
3999 ;; supported since Linux-libre 5.4.5.
4000 (substitute* "src/lib/image/squashfs/mount.c"
4001 (("\"errors=remount-ro\"")
4004 (build-system gnu-build-system)
4006 `(#:configure-flags '("--localstatedir=/var")
4008 (modify-phases %standard-phases
4009 (add-after 'unpack 'patch-references
4011 (substitute* "libexec/cli/build.exec"
4012 (("if ! singularity_which mksquashfs") "if 0")
4013 (("if ! mksquashfs")
4014 (string-append "if ! " (which "mksquashfs"))))
4015 (substitute* (list "libexec/cli/help.exec"
4016 "libexec/bootstrap-scripts/functions"
4017 "libexec/bootstrap-scripts/post.sh"
4018 "libexec/functions")
4020 (string-append "| " (which "grep") " "))
4022 (string-append (which "egrep") " ")))
4024 (add-after 'install 'set-PATH
4025 (lambda* (#:key inputs outputs #:allow-other-keys)
4026 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4027 (let ((out (assoc-ref outputs "out"))
4028 (coreutils (assoc-ref inputs "coreutils")))
4029 (wrap-program (string-append out "/bin/singularity")
4030 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4031 (substitute* (string-append out "/bin/run-singularity")
4032 (("/usr/bin/env singularity")
4033 (string-append (which "env") " "
4034 out "/bin/singularity")))
4037 `(("libarchive" ,libarchive)
4038 ("python" ,python-wrapper)
4040 ("squashfs-tools" ,squashfs-tools)))
4041 (home-page "https://singularity.lbl.gov/")
4042 (synopsis "Container platform")
4043 (description "Singularity is a container platform supporting a number of
4044 container image formats. It can build SquashFS container images or import
4045 existing Docker images. Singularity requires kernel support for container
4046 isolation or root privileges.")
4047 (license license:bsd-3)))
4049 (define-public hdparm
4055 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4056 "hdparm-" version ".tar.gz"))
4059 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
4060 (build-system gnu-build-system)
4063 (let ((out (assoc-ref %outputs "out")))
4064 (list (string-append "binprefix=" out)
4065 (string-append "manprefix=" out)
4066 ,(string-append "CC=" (cc-for-target))
4067 ;; Let Guix strip the binaries and not break cross-compilation.
4070 (modify-phases %standard-phases
4071 (delete 'configure)) ; no configure script
4072 #:tests? #f)) ; no test suite
4073 (home-page "https://sourceforge.net/projects/hdparm/")
4074 (synopsis "View and tune ATA disk drive parameters")
4076 "@command{hdparm} is a command-line utility to control ATA controllers and
4077 disk drives. It can increase performance and/or reliability by careful tuning
4078 of hardware settings like power and acoustic management, DMA modes, and caching.
4079 It can also display detailed device information, or be used as a simple
4080 performance benchmarking tool.
4082 @command{hdparm} provides a command line interface to various Linux kernel
4083 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4084 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4085 Translation (@dfn{SAT}) are also supported.")
4086 (license (license:non-copyleft "file://LICENSE.TXT"))))
4088 (define-public nvme-cli
4092 (home-page "https://github.com/linux-nvme/nvme-cli")
4097 (commit (string-append "v" version))))
4099 (base32 "0ldky34sn0m5c4hgiip0fkzm465nca69bhxicpd5dg8wxhzxqrp3"))
4100 (file-name (git-file-name name version))))
4101 (build-system gnu-build-system)
4104 (list ,(string-append "CC=" (cc-for-target)))
4105 #:phases (modify-phases %standard-phases
4106 (delete 'configure) ; no ./configure script
4109 (invoke "make" "install-spec" "PREFIX="
4110 (string-append "DESTDIR=" %output)))))
4111 ;; The tests require sysfs, which is not accessible from from the build
4114 (synopsis "NVM-Express user space tooling for Linux")
4115 (description "Nvme-cli is a utility to provide standards compliant tooling
4116 for NVM-Express drives. It was made specifically for Linux as it relies on the
4117 IOCTLs defined by the mainline kernel driver.")
4118 (license license:gpl2+)))
4120 (define-public rfkill
4126 (uri (string-append "mirror://kernel.org/software/network/"
4127 name "/" name "-" version ".tar.xz"))
4130 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4131 (build-system gnu-build-system)
4133 `(#:make-flags (list "CC=gcc"
4134 (string-append "PREFIX=" %output))
4135 #:phases (modify-phases %standard-phases
4136 (delete 'configure))
4138 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4139 (synopsis "Tool for enabling and disabling wireless devices")
4141 "rfkill is a simple tool for accessing the rfkill device interface,
4142 which is used to enable and disable wireless networking devices, typically
4143 WLAN, Bluetooth and mobile broadband.")
4144 (license (license:non-copyleft "file://COPYING"
4145 "See COPYING in the distribution."))
4146 ;; rfkill is part of util-linux as of 2.31.
4147 (properties `((superseded . ,util-linux)))))
4155 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4156 version "/" name "-" version ".tar.gz"))
4159 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4160 (build-system gnu-build-system)
4161 (home-page "http://acpiclient.sourceforge.net")
4162 (synopsis "Display information on ACPI devices")
4163 (description "@code{acpi} attempts to replicate the functionality of the
4164 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4165 information. It does not support ACPI suspending, only displays information
4166 about ACPI devices.")
4167 (license license:gpl2+)))
4169 (define-public acpid
4175 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4179 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4180 (build-system gnu-build-system)
4181 (home-page "https://sourceforge.net/projects/acpid2/")
4182 (synopsis "Daemon for delivering ACPI events to user-space programs")
4184 "acpid is designed to notify user-space programs of Advanced
4185 Configuration and Power Interface (ACPI) events. acpid should be started
4186 during the system boot, and will run as a background process. When an ACPI
4187 event is received from the kernel, acpid will examine the list of rules
4188 specified in /etc/acpi/events and execute the rules that match the event.")
4189 (license license:gpl2+)))
4191 (define-public sysfsutils
4200 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4203 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4204 (build-system gnu-build-system)
4205 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4206 (synopsis "System utilities based on Linux sysfs")
4208 "These are a set of utilities built upon sysfs, a virtual file system in
4209 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4210 also contains the libsysfs library.")
4211 ;; The library is under lgpl2.1+ (all files say "or any later version").
4212 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4213 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4215 (define-public sysfsutils-1
4217 (inherit sysfsutils)
4224 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4225 "/sysfsutils-" version ".tar.gz"))
4227 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4228 (modules '((guix build utils)))
4231 (substitute* "Makefile.in"
4232 (("includedir = /usr/include/sysfs")
4233 "includedir = @includedir@"))
4234 (substitute* "configure"
4235 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4236 (string-append "includedir='" orig "/sysfs'")))
4238 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4240 (define-public cpufrequtils
4242 (name "cpufrequtils")
4247 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4248 "cpufrequtils-" version ".tar.gz"))
4250 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4251 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4252 (build-system gnu-build-system)
4254 `(("sysfsutils" ,sysfsutils-1)))
4256 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4257 (assoc-ref %outputs "out") "/lib"))))
4258 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4259 (synopsis "Utilities to get and set CPU frequency on Linux")
4261 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4262 information, and set the CPU frequency if supported, using the cpufreq
4263 capabilities of the Linux kernel.")
4264 (license license:gpl2)))
4266 (define-public libraw1394
4273 "mirror://kernel.org/linux/libs/ieee1394/"
4274 name "-" version ".tar.xz"))
4277 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4278 (build-system gnu-build-system)
4279 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4280 (synopsis "Interface library for the Linux IEEE1394 drivers")
4282 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4283 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4284 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4285 send to and receive from other nodes without requiring a kernel driver for the
4286 protocol in question.")
4287 (license license:lgpl2.1+)))
4289 (define-public libavc1394
4295 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4296 name "-" version ".tar.gz"))
4299 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4300 (build-system gnu-build-system)
4302 `(("pkg-config" ,pkg-config)))
4304 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4305 (home-page "https://sourceforge.net/projects/libavc1394/")
4306 (synopsis "AV/C protocol library for IEEE 1394")
4308 "Libavc1394 is a programming interface to the AV/C specification from
4309 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4310 (license license:lgpl2.1+)))
4312 (define-public libiec61883
4314 (name "libiec61883")
4319 "mirror://kernel.org/linux/libs/ieee1394/"
4320 name "-" version ".tar.xz"))
4323 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4324 (build-system gnu-build-system)
4326 `(("pkg-config" ,pkg-config)))
4328 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4329 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4330 (synopsis "Isochronous streaming media library for IEEE 1394")
4332 "The libiec61883 library provides a higher level API for streaming DV,
4333 MPEG-2 and audio over Linux IEEE 1394.")
4334 (license license:lgpl2.1+)))
4336 (define-public mdadm
4343 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4347 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4348 (build-system gnu-build-system)
4352 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4353 (list ,(string-append "CC=" (cc-for-target))
4356 ;; TODO: tell it where to find 'sendmail'
4357 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4358 (string-append "BINDIR=" out "/sbin")
4359 (string-append "MANDIR=" out "/share/man")
4360 (string-append "UDEVDIR=" out "/lib/udev")))
4362 (modify-phases %standard-phases
4363 (add-before 'build 'patch-program-paths
4364 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4365 (let ((coreutils (assoc-ref (or native-inputs inputs)
4367 (substitute* "udev-md-raid-arrays.rules"
4368 (("/usr/bin/(readlink|basename)" all program)
4369 (string-append coreutils "/bin/" program))))
4371 (add-before 'build 'remove-W-error
4373 ;; We cannot build with -Werror on i686 due to a
4374 ;; 'sign-compare' warning in util.c.
4375 (substitute* "Makefile"
4378 (delete 'configure))
4379 ;;tests must be done as root
4381 (supported-systems (delete "i586-gnu" %supported-systems))
4382 (home-page "http://neil.brown.name/blog/mdadm")
4383 (synopsis "Tool for managing Linux Software RAID arrays")
4385 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4386 assemble, report on, and monitor arrays. It can also move spares between raid
4387 arrays when needed.")
4388 (license license:gpl2+)))
4390 (define-public mdadm-static
4393 (name "mdadm-static")
4395 (substitute-keyword-arguments (package-arguments mdadm)
4396 ((#:make-flags flags)
4397 `(cons "LDFLAGS = -static" ,flags))
4399 `(modify-phases ,phases
4400 (add-after 'install 'remove-cruft
4401 (lambda* (#:key outputs #:allow-other-keys)
4402 (let* ((out (assoc-ref outputs "out"))
4403 (precious? (lambda (file)
4404 (member file '("." ".." "sbin"))))
4405 (directories (scandir out (negate precious?))))
4406 (with-directory-excursion out
4407 (for-each delete-file-recursively directories)
4408 (remove-store-references "sbin/mdadm")
4409 (delete-file "sbin/mdmon")
4411 ((#:modules modules %gnu-build-system-modules)
4412 `((ice-9 ftw) ,@modules))
4413 ((#:strip-flags _ '())
4414 ''("--strip-all")) ;strip a few extra KiB
4415 ((#:allowed-references _ '("out"))
4416 '("out")))) ;refer only self
4417 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4419 (define-public multipath-tools
4421 (name "multipath-tools")
4426 (url "https://git.opensvc.com/multipath-tools/.git")
4428 (file-name (git-file-name name version))
4431 "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn"))
4432 (patches (search-patches "multipath-tools-sans-systemd.patch"))
4433 (modules '((guix build utils)))
4436 ;; Drop bundled valgrind headers.
4437 (delete-file-recursively "third-party")
4438 (substitute* '("multipathd/main.c"
4439 "libmultipath/debug.c")
4440 (("#include \"../third-party/")
4443 (build-system gnu-build-system)
4445 '(#:test-target "test"
4446 #:parallel-build? #f ;XXX: broken in 0.8.4
4447 #:make-flags (list "CC=gcc"
4448 (string-append "DESTDIR="
4449 (assoc-ref %outputs "out"))
4450 ;; Install Udev rules below this directory, relative
4453 (string-append "LDFLAGS=-Wl,-rpath="
4454 (assoc-ref %outputs "out")
4457 (modify-phases %standard-phases
4458 (add-after 'unpack 'patch-source
4459 (lambda* (#:key inputs #:allow-other-keys)
4460 (let ((lvm2 (assoc-ref inputs "lvm2"))
4461 (udev (assoc-ref inputs "udev")))
4462 (substitute* "Makefile.inc"
4463 (("\\$\\(prefix\\)/usr") "$(prefix)")
4464 ;; Do not save timestamp to avoid gzip "timestamp
4465 ;; out-of-range" warnings.
4466 (("gzip -9") "gzip -9n"))
4467 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4468 (("/usr/include/libdevmapper.h")
4469 (string-append lvm2 "/include/libdevmapper.h"))
4470 (("/usr/include/libudev.h")
4471 (string-append udev "/include/libudev.h")))
4473 (add-after 'unpack 'fix-maybe-uninitialized-variable
4475 ;; This variable gets initialized later if needed, but GCC 7
4476 ;; fails to notice. Should be fixed for > 0.8.4.
4477 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4478 (substitute* "libmultipath/structs_vec.c"
4479 (("bool is_queueing;")
4480 "bool is_queueing = false;"))
4482 (add-after 'unpack 'fix-linking-tests
4484 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4485 ;; for versions > 0.8.4.
4486 (substitute* "tests/Makefile"
4487 (("-lmultipath -lcmocka")
4488 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4490 (delete 'configure)))) ; no configure script
4493 ("pkg-config" ,pkg-config)
4494 ("valgrind" ,valgrind)
4497 ("cmocka" ,cmocka)))
4499 `(("json-c" ,json-c-0.13)
4501 ("liburcu" ,liburcu)
4503 ("readline" ,readline)
4505 (home-page "http://christophe.varoqui.free.fr/")
4506 (synopsis "Access block devices through multiple paths")
4508 "This package provides the following binaries to drive the
4509 Linux Device Mapper multipathing driver:
4511 @item @command{multipath} - Device mapper target autoconfig.
4512 @item @command{multipathd} - Multipath daemon.
4513 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4514 @code{dm} multipath devices.
4515 @item @command{kpartx} - Create device maps from partition tables.
4517 (license (list license:gpl2+ ; main distribution
4518 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4520 (define-public libaio
4527 (string-append "https://releases.pagure.org/libaio/"
4528 name "-" version ".tar.gz")))
4531 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4532 (build-system gnu-build-system)
4535 (let ((target ,(%current-target-system)))
4536 (list (string-append "prefix=" %output)
4539 (string-append (assoc-ref %build-inputs "cross-gcc")
4540 "/bin/" target "-gcc")
4542 #:test-target "partcheck" ; need root for a full 'check'
4544 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4545 (home-page "https://pagure.io/libaio")
4546 (synopsis "Linux-native asynchronous I/O access library")
4548 "This library enables userspace to use Linux kernel asynchronous I/O
4549 system calls, important for the performance of databases and other advanced
4551 (license license:lgpl2.1+)))
4553 (define-public blktrace
4554 ;; Take a newer commit to get the fix for CVE-2018-10689.
4555 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4559 (version (git-version "1.2.0" revision commit))
4561 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4568 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4569 (file-name (git-file-name name version))))
4570 (build-system gnu-build-system)
4573 (list ,(string-append "CC=" (cc-for-target))
4574 (string-append "prefix=" %output))
4575 #:tests? #f ; no tests
4577 (modify-phases %standard-phases
4578 (delete 'configure) ; no configure script
4579 (add-after 'unpack 'fix-gnuplot-path
4580 (lambda* (#:key inputs #:allow-other-keys)
4581 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4582 (substitute* "btt/bno_plot.py"
4584 (string-append gnuplot "/bin/gnuplot %s")))
4587 `(("libaio" ,libaio)
4588 ("gnuplot" ,gnuplot)
4589 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4590 (synopsis "Block layer IO tracing mechanism")
4591 (description "Blktrace is a block layer IO tracing mechanism which provides
4592 detailed information about request queue operations to user space. It extracts
4593 event traces from the kernel (via the relaying through the debug file system).")
4594 (license license:gpl2))))
4602 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4606 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
4607 (build-system gnu-build-system)
4609 `(("libsndfile" ,libsndfile)))
4611 `(("pkg-config" ,pkg-config)))
4612 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4613 (synopsis "Bluetooth subband audio codec")
4615 "The SBC is a digital audio encoder and decoder used to transfer data to
4616 Bluetooth audio output devices like headphones or loudspeakers.")
4617 (license license:gpl2+)))
4619 (define-public bluez
4626 "mirror://kernel.org/linux/bluetooth/bluez-"
4630 "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8"))))
4631 (build-system gnu-build-system)
4634 (let ((out (assoc-ref %outputs "out")))
4635 (list "--sysconfdir=/etc"
4636 "--localstatedir=/var"
4639 ;; Install dbus/udev files to the correct location.
4640 (string-append "--with-dbusconfdir=" out "/etc")
4641 (string-append "--with-udevdir=" out "/lib/udev")))
4643 (modify-phases %standard-phases
4644 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4645 ;; issue (discussion on upstream mailing list:
4646 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4647 (add-before 'check 'skip-wonky-test
4649 (substitute* "unit/test-gatt.c"
4650 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4652 (add-after 'install 'post-install
4653 (lambda* (#:key inputs outputs #:allow-other-keys)
4654 (let* ((out (assoc-ref outputs "out"))
4655 (servicedir (string-append out "/share/dbus-1/services"))
4656 (service "obexd/src/org.bluez.obex.service")
4657 (rule (string-append
4658 out "/lib/udev/rules.d/97-hid2hci.rules")))
4659 ;; Install the obex dbus service file.
4660 (substitute* service
4662 (string-append out "/libexec/bluetooth/obexd")))
4663 (install-file service servicedir)
4664 ;; Fix paths in the udev rule.
4666 (("hid2hci --method")
4667 (string-append out "/lib/udev/hid2hci --method"))
4669 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4672 `(("pkg-config" ,pkg-config)
4673 ("gettext" ,gettext-minimal)))
4678 ("libical" ,libical)
4679 ("readline" ,readline)))
4680 (home-page "http://www.bluez.org/")
4681 (synopsis "Linux Bluetooth protocol stack")
4683 "BlueZ provides support for the core Bluetooth layers and protocols. It
4684 is flexible, efficient and uses a modular implementation.")
4685 (license license:gpl2+)))
4687 (define-public fuse-exfat
4694 "https://github.com/relan/exfat/releases/download/v"
4695 version "/" name "-" version ".tar.gz"))
4698 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4699 (build-system gnu-build-system)
4701 `(("pkg-config" ,pkg-config)))
4704 (home-page "https://github.com/relan/exfat")
4705 (synopsis "Mount exFAT file systems")
4707 "This package provides a FUSE-based file system that provides read and
4708 write access to exFAT devices.")
4709 (license license:gpl2+)))
4711 (define-public fuseiso
4714 (version "20070708")
4717 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4718 version "/fuseiso-" version ".tar.bz2"))
4721 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4722 (build-system gnu-build-system)
4724 `(("pkg-config" ,pkg-config)))
4729 (home-page "https://sourceforge.net/projects/fuseiso/")
4730 (synopsis "Mount ISO file system images")
4732 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4733 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4734 Ridge, Joliet, and zisofs.")
4735 (license license:gpl2)))
4744 "https://www.nico.schottelius.org/software/gpm/archives/"
4745 "gpm-" version ".tar.bz2"))
4746 (patches (search-patches "gpm-glibc-2.26.patch"))
4749 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4750 (build-system gnu-build-system)
4752 '(#:phases (modify-phases %standard-phases
4755 ;; The tarball was not generated with 'make dist' so we
4756 ;; need to bootstrap things ourselves.
4757 (substitute* "autogen.sh"
4758 (("/bin/sh") (which "sh")))
4759 (invoke "./autogen.sh")
4760 (patch-makefile-SHELL "Makefile.include.in")
4763 ;; Make sure programs find libgpm.so.
4764 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4765 (assoc-ref %outputs "out")
4768 `(("texinfo" ,texinfo)
4771 ("autoconf" ,autoconf)
4772 ("automake" ,automake)
4773 ("libtool" ,libtool)))
4774 (home-page "https://www.nico.schottelius.org/software/gpm/")
4775 (synopsis "Mouse support for the Linux console")
4777 "The GPM (general-purpose mouse) daemon is a mouse server for
4778 applications running on the Linux console. It allows users to select items
4779 and copy/paste text in the console and in xterm.")
4780 (license license:gpl2+)))
4782 (define-public btrfs-progs
4784 (name "btrfs-progs")
4788 (uri (string-append "mirror://kernel.org/linux/kernel/"
4789 "people/kdave/btrfs-progs/"
4790 "btrfs-progs-v" version ".tar.xz"))
4793 "0p6ycbr8sw5bq3mj84gh9rvh5sk8sjr2l9hb9dhm4j41ij5h8bsw"))))
4794 (build-system gnu-build-system)
4796 "static")) ; static versions of the binaries in "out"
4798 '(#:phases (modify-phases %standard-phases
4799 (add-after 'unpack 'patch-makefile
4800 (lambda* (#:key outputs #:allow-other-keys)
4801 (substitute* "Makefile"
4802 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4803 (string-append (assoc-ref outputs "out")
4804 "/lib/udev/rules.d")))
4806 (add-after 'build 'build-static
4807 (lambda _ (invoke "make" "static")))
4808 (add-after 'install 'install-bash-completion
4809 (lambda* (#:key outputs #:allow-other-keys)
4810 (let* ((out (assoc-ref outputs "out"))
4811 (bashcomp (string-append out "/etc/bash_completion.d")))
4813 (copy-file "btrfs-completion"
4814 (string-append bashcomp "/btrfs"))
4816 (add-after 'install 'install-static
4817 (let ((staticbin (string-append (assoc-ref %outputs "static")
4821 (string-append "bindir=" staticbin)
4822 "install-static")))))
4823 #:tests? #f ; XXX: require the 'btrfs' kernel module.
4824 #:test-target "test"
4825 #:parallel-tests? #f)) ; tests fail when run in parallel
4826 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
4828 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
4829 ("util-linux:static" ,util-linux "static") ;ditto
4831 ("zlib:static" ,zlib "static")
4832 ("zstd" ,zstd "lib")
4833 ("zstd:static" ,zstd "static")))
4834 (native-inputs `(("pkg-config" ,pkg-config)
4835 ("asciidoc" ,asciidoc)
4838 ;; For building documentation.
4839 ("libxml2" ,libxml2)
4840 ("docbook-xsl" ,docbook-xsl)
4846 ;; The tests need 'grep' with perl regexp support.
4848 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
4849 (synopsis "Create and manage btrfs copy-on-write file systems")
4850 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
4851 aimed at implementing advanced features while focusing on fault tolerance,
4852 repair and easy administration.")
4853 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
4854 ;; GPL2: Everything else.
4855 (license (list license:gpl2 license:gpl2+))))
4857 (define-public btrfs-progs/static
4859 (name "btrfs-progs-static")
4860 (version (package-version btrfs-progs))
4862 (build-system trivial-build-system)
4864 `(("btrfs-progs:static" ,btrfs-progs "static")))
4866 `(#:modules ((guix build utils))
4869 (use-modules (guix build utils)
4873 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
4874 (out (assoc-ref %outputs "out"))
4875 (source (string-append btrfs "/bin/btrfs.static"))
4876 (target (string-append out "/bin/btrfs")))
4877 (mkdir-p (dirname target))
4878 (copy-file source target)
4879 (remove-store-references target)
4880 (chmod target #o555)
4882 (home-page (package-home-page btrfs-progs))
4883 (synopsis "Statically-linked btrfs command from btrfs-progs")
4884 (description "This package provides the statically-linked @command{btrfs}
4885 from the btrfs-progs package. It is meant to be used in initrds.")
4886 (license (package-license btrfs-progs))))
4888 (define-public cramfs-tools
4890 (name "cramfs-tools")
4891 (home-page "https://github.com/npitre/cramfs-tools")
4897 (commit (string-append "v" version))))
4899 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
4900 (file-name (git-file-name name version))))
4901 (build-system gnu-build-system)
4903 '(#:tests? #f ; No tests.
4905 (modify-phases %standard-phases
4908 (lambda* (#:key outputs #:allow-other-keys)
4909 (let ((out (assoc-ref outputs "out")))
4910 (install-file "mkcramfs" (string-append out "/sbin"))
4911 (install-file "cramfsck" (string-append out "/sbin")))
4915 (synopsis "Tools to manage Cramfs file systems")
4916 (description "Cramfs is a Linux file system designed to be simple, small,
4917 and to compress things well. It is used on a number of embedded systems and
4918 small devices. This version has additional features such as uncompressed
4919 blocks and random block placement.")
4920 (license license:gpl2+)))
4922 (define-public compsize
4926 (home-page "https://github.com/kilobyte/compsize")
4931 (commit (string-append "v" version))))
4933 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4934 (file-name (git-file-name name version))))
4935 (build-system gnu-build-system)
4937 `(("btrfs-progs" ,btrfs-progs)))
4939 `(#:tests? #f ; No tests.
4940 #:make-flags (list "CC=gcc")
4942 (modify-phases %standard-phases
4945 (lambda* (#:key outputs #:allow-other-keys)
4946 (let ((out (assoc-ref outputs "out")))
4947 (install-file "compsize" (string-append out "/bin"))
4948 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4949 (synopsis "Find compression type/ratio on Btrfs files")
4950 (description "@command{compsize} takes a list of files (given as
4951 arguments) on a Btrfs file system and measures used compression types and
4952 effective compression ratio, producing a report.
4954 A directory has no extents but has a (recursive) list of files. A non-regular
4955 file is silently ignored.
4957 As it makes no sense to talk about compression ratio of a partial extent,
4958 every referenced extent is counted whole, exactly once -- no matter if you use
4959 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4960 uncompressed size will not match the number given by @command{tar} or
4961 @command{du}. On the other hand, the space used should be accurate (although
4962 obviously it can be shared with files outside our set).")
4963 (license license:gpl2+)))
4965 (define-public f2fs-tools-1.7
4972 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
4973 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
4976 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4978 (build-system gnu-build-system)
4981 (modify-phases %standard-phases
4982 (add-after 'install 'install-headers
4983 (lambda* (#:key outputs #:allow-other-keys)
4984 (let* ((out (assoc-ref outputs "out"))
4985 (out-include (string-append out "/include")))
4986 (install-file "include/f2fs_fs.h" out-include)
4987 (install-file "mkfs/f2fs_format_utils.h" out-include)
4990 `(("autoconf" ,autoconf)
4991 ("automake" ,automake)
4992 ("libtool" ,libtool)
4993 ("pkg-config" ,pkg-config)))
4995 `(("libuuid" ,util-linux "lib")
4996 ("libselinux" ,libselinux)))
4997 (home-page "https://f2fs.wiki.kernel.org/")
4998 (synopsis "Userland tools for f2fs")
5000 "F2FS, the Flash-Friendly File System, is a modern file system
5001 designed to be fast and durable on flash devices such as solid-state
5002 disks and SD cards. This package provides the userland utilities.")
5003 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5004 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5005 (license (list license:gpl2 license:lgpl2.1))))
5007 (define-public f2fs-tools
5009 (inherit f2fs-tools-1.7)
5015 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5016 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5019 "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk"))))
5021 `(("libuuid" ,util-linux "lib")))))
5023 (define-public f2fs-tools/static
5026 (inherit f2fs-tools)
5027 (name "f2fs-tools-static")
5030 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5031 (libuuid (assoc-ref %build-inputs "libuuid")))
5033 (string-append "libuuid_CFLAGS=-I" libuuid "/include")
5034 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5035 (string-append "libblkid_CFLAGS=-I" libuuid "/include")
5036 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5037 #:disallowed-references (,util-linux)
5039 (modify-phases %standard-phases ; TODO: f2fs phases.
5040 (add-after 'unpack 'make-static
5042 (define (append-to-file name body)
5043 (let ((file (open-file name "a")))
5046 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5047 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5048 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5050 (add-after 'install 'remove-store-references
5051 (lambda* (#:key outputs #:allow-other-keys)
5052 ;; Work around bug in our util-linux.
5053 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5054 (remove-store-references (string-append (assoc-ref outputs "out")
5058 `(("libuuid:static" ,util-linux "static")
5059 ("libuuid" ,util-linux "lib")))))) ; for include files
5061 (define-public f2fs-fsck/static
5063 (name "f2fs-fsck-static")
5064 (version (package-version f2fs-tools/static))
5066 (build-system trivial-build-system)
5068 `(#:modules ((guix build utils))
5071 (use-modules (guix build utils)
5074 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5076 (out (assoc-ref %outputs "out"))
5077 (sbin (string-append out "/sbin")))
5079 (with-directory-excursion sbin
5080 (install-file (string-append f2fs-tools "/sbin/" fsck)
5082 (remove-store-references fsck)
5086 `(("f2fs-tools-static" ,f2fs-tools/static)))
5087 (home-page (package-home-page f2fs-tools/static))
5088 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5089 (description "This package provides statically-linked fsck.f2fs command taken
5090 from the f2fs-tools package. It is meant to be used in initrds.")
5091 (license (package-license f2fs-tools/static))))
5093 (define-public freefall
5096 (version (package-version linux-libre))
5097 (source (package-source linux-libre))
5098 (build-system gnu-build-system)
5100 '(#:phases (modify-phases %standard-phases
5101 (add-after 'unpack 'enter-subdirectory
5103 (chdir "tools/laptop/freefall")
5106 (add-before 'build 'increase-timeout
5108 ;; The default of 2 seconds is too low: it assumes an
5109 ;; open lid and AC power without actually checking.
5110 (substitute* "freefall.c"
5111 (("alarm\\(2\\)") "alarm(5)"))
5113 #:make-flags (list (string-append "PREFIX="
5114 (assoc-ref %outputs "out"))
5116 #:tests? #f)) ;no tests
5117 (home-page (package-home-page linux-libre))
5118 (synopsis "Free-fall protection for spinning laptop hard drives")
5120 "Prevents shock damage to the internal spinning hard drive(s) of some
5121 HP and Dell laptops. When sudden movement is detected, all input/output
5122 operations on the drive are suspended and its heads are parked on the ramp,
5123 where they are less likely to cause damage to the spinning disc. Requires a
5124 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5125 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5126 (license license:gpl2)))
5128 (define-public thinkfan
5136 (url "https://github.com/vmatare/thinkfan")
5138 (file-name (git-file-name name version))
5140 (base32 "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz"))))
5141 (build-system cmake-build-system)
5143 `(#:modules ((guix build cmake-build-system)
5146 #:tests? #f ; no test target
5148 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5149 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5151 `("-DUSE_ATASMART:BOOL=ON")
5153 (modify-phases %standard-phases
5154 (add-after 'unpack 'create-init-scripts
5155 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5156 ;; systemd to patch and install their service files. Fake their
5157 ;; presence rather than duplicating the build system below. Leave
5158 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5159 ;; The sysvinit needs manual patching, but since upstream doesn't
5160 ;; even provide the option to install it: don't.
5161 (lambda* (#:key outputs #:allow-other-keys)
5162 (let* ((out (assoc-ref outputs "out"))
5163 (share (string-append out "/share/" ,name)))
5164 (substitute* "CMakeLists.txt"
5165 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5166 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5167 ;; That was easy! Now we just need to fix the destinations.
5169 (string-append out directory)))
5172 `(("pkg-config" ,pkg-config)))
5174 `(("libatasmart" ,libatasmart)
5175 ("yaml-cpp" ,yaml-cpp)))
5176 (home-page "https://github.com/vmatare/thinkfan")
5177 (synopsis "Simple fan control program")
5179 "Thinkfan is a simple fan control program. It reads temperatures,
5180 checks them against configured limits and switches to appropriate (also
5181 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5182 other @code{hwmon} driver that enables temperature reading and fan control
5184 (license license:gpl3+)))
5186 (define-public tpacpi-bat
5194 (url "https://github.com/teleshoes/tpacpi-bat")
5195 (commit (string-append "v" version))))
5196 (file-name (git-file-name name version))
5198 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5199 (build-system gnu-build-system)
5201 `(#:tests? #f ; no test target
5203 (modify-phases %standard-phases
5204 (add-after 'unpack 'refer-to-inputs
5206 (substitute* "tpacpi-bat"
5208 (format #f "~a " (which "cat")))
5209 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5210 ;; loaded. That's the administrator's prerogative; disable it.
5211 (("system \"(modprobe .*)\"" _ match)
5212 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5214 (delete 'configure) ; nothing to configure
5215 (delete 'build) ; nothing to build
5217 (lambda* (#:key outputs #:allow-other-keys)
5218 (let* ((out (assoc-ref outputs "out"))
5219 (bin (string-append out "/bin"))
5220 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5221 (install-file "tpacpi-bat" bin)
5223 ;; There's no man page. Install other forms of documentation.
5224 (for-each (lambda (file)
5225 (let ((target (string-append doc "/" file)))
5226 (mkdir-p (dirname target))
5227 (copy-recursively file target)))
5228 (list "battery_asl" "examples" "README.md"))
5232 (home-page "https://github.com/teleshoes/tpacpi-bat")
5233 (synopsis "ThinkPad battery charge controller")
5235 "Tpacpi-bat is a command-line interface to control battery charging on
5236 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5237 ThinkPad models released after 2011}, starting with the xx20 series. It can
5238 query and set the thresholds at which one or both batteries will start and stop
5239 charging, inhibit charging batteries for a set period of time, or force them to
5240 discharge when they otherwise would not.
5242 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5243 kernel module provided by the @code{acpi-call-linux-module} package, which must
5244 be installed and loaded separately. Only the original vendor firmware is
5246 (license license:gpl3+)))
5248 (define-public ntfs-3g
5251 (version "2017.3.23")
5254 (uri (string-append "https://tuxera.com/opensource/"
5255 "ntfs-3g_ntfsprogs-" version ".tgz"))
5256 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5259 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5260 (modules '((guix build utils)))
5262 ;; Install under $prefix.
5263 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5267 (build-system gnu-build-system)
5268 (inputs `(("util-linux" ,util-linux)
5269 ("fuse" ,fuse))) ;libuuid
5270 (native-inputs `(("pkg-config" ,pkg-config)))
5272 '(#:configure-flags (list "--exec-prefix=${prefix}"
5273 "--with-fuse=external" ;use our own FUSE
5274 "--enable-mount-helper"
5275 "--enable-posix-acls"
5276 "--enable-xattr-mappings")
5278 (modify-phases %standard-phases
5279 ;; If users install ntfs-3g, they probably want to make it the
5280 ;; default driver as well, so we opt for sensible defaults and link
5281 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5282 ;; mount NTFS file systems.)
5283 (add-after 'install 'install-link
5284 (lambda* (#:key outputs #:allow-other-keys)
5285 (let* ((out (assoc-ref outputs "out"))
5286 (sbin (string-append out "/sbin")))
5287 (symlink "mount.ntfs-3g"
5288 (string-append sbin "/mount.ntfs")))
5290 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5291 (synopsis "Read-write access to NTFS file systems")
5293 "NTFS-3G provides read-write access to NTFS file systems, which are
5294 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5295 The package provides additional NTFS tools.")
5296 (license license:gpl2+)))
5298 (define-public rdma-core
5304 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5305 "/releases/download/v" version "/rdma-core-"
5309 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
5310 (build-system cmake-build-system)
5312 `(#:tests? #f ; no tests
5313 ;; Upstream uses the "ninja" build system and encourage distros
5314 ;; to do the same for consistency. They also recommend using the
5315 ;; "Release" build type.
5316 #:build-type "Release"
5317 #:configure-flags (list "-GNinja"
5319 (string-append "-DRST2MAN_EXECUTABLE="
5320 (assoc-ref %build-inputs
5324 ;; On some configurations, the
5325 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
5326 ;; used by default, would return ENODEV. To
5327 ;; avoid that, use 'write' instead of ioctls,
5328 ;; as suggested in 'CMakeList.txt'.
5329 "-DIOCTL_MODE=write")
5331 (modify-phases %standard-phases
5335 "-j" (number->string (parallel-job-count)))))
5338 (invoke "ninja" "install"))))))
5341 ("pkg-config" ,pkg-config)
5342 ("python" ,python-wrapper)
5343 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5347 (home-page "https://github.com/linux-rdma/rdma-core")
5348 (synopsis "Utilities and libraries for working with RDMA devices")
5350 "This package provides userspace components for the InfiniBand
5351 subsystem of the Linux kernel. Specifically it contains userspace
5352 libraries for the following device nodes:
5355 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5356 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5357 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5360 The following service daemons are also provided:
5362 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5363 @item @code{iwpmd} (for iWARP kernel providers)
5364 @item @code{ibacm} (for InfiniBand communication management assistant)
5366 ;; All library code is dual licensed under GPL2 and a custom MIT
5367 ;; variant. The package also includes some components covered by
5368 ;; other licenses. Consult COPYING.md for full details.
5371 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5372 license:bsd-2 ; Files referring to COPYING.BSD_FB
5373 license:cc0 ; most files in ccan/
5374 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5376 (define-public perftest
5383 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5384 version "/perftest-" version ".g0927198.tar.gz"))
5386 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5387 (build-system gnu-build-system)
5390 (modify-phases %standard-phases
5391 (add-after 'unpack 'patch-header-paths
5393 (substitute* '("src/raw_ethernet_fs_rate.c"
5394 "src/raw_ethernet_resources.c"
5395 "src/raw_ethernet_resources.h"
5396 "src/raw_ethernet_send_burst_lat.c"
5397 "src/raw_ethernet_send_bw.c"
5398 "src/raw_ethernet_send_lat.c")
5399 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5401 (inputs `(("rdma-core" ,rdma-core)))
5402 (home-page "https://github.com/linux-rdma/perftest/")
5403 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5404 (description "This is a collection of tests written over uverbs intended for
5405 use as a performance micro-benchmark. The tests may be used for hardware or
5406 software tuning as well as for functional testing.
5408 The collection contains a set of bandwidth and latency benchmark such as:
5410 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5411 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5412 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5413 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5414 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5416 (license license:gpl2)))
5418 (define-public rng-tools
5421 (home-page "https://github.com/nhorman/rng-tools")
5425 (uri (git-reference (url home-page)
5426 (commit (string-append "v" version))))
5427 (file-name (git-file-name name version))
5430 "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9"))))
5431 (build-system gnu-build-system)
5433 `(;; Disable support for various hardware entropy sources as they need
5434 ;; dependencies that are not yet in Guix, and would significantly
5435 ;; increase closure size.
5436 #:configure-flags '("--without-nistbeacon"
5438 "--without-rtlsdr")))
5440 `(("autoconf" ,autoconf)
5441 ("automake" ,automake)
5442 ("pkg-config" ,pkg-config)))
5444 `(("libsysfs" ,sysfsutils)
5445 ("openssl" ,openssl)))
5446 (synopsis "Random number generator daemon")
5448 "Monitor a hardware random number generator, and supply entropy
5449 from that to the system kernel's @file{/dev/random} machinery.")
5450 ;; The source package is offered under the GPL2+, but the files
5451 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5452 (license (list license:gpl2 license:gpl2+))))
5454 (define-public cpupower
5457 (version (package-version linux-libre))
5458 (source (package-source linux-libre))
5459 (build-system gnu-build-system)
5461 '(#:phases (modify-phases %standard-phases
5462 (add-after 'unpack 'enter-subdirectory
5464 (chdir "tools/power/cpupower")
5467 (add-before 'build 'fix-makefiles
5469 (substitute* "Makefile"
5471 (("/bin/(install|pwd)" _ command) command))
5472 (substitute* "bench/Makefile"
5473 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5475 #:make-flags (let ((out (assoc-ref %outputs "out")))
5476 (list (string-append "DESTDIR=" out)
5477 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5479 "docdir=/share/doc/cpupower"
5480 "confdir=$(docdir)/examples"
5481 ;; The Makefile recommends the following changes
5483 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5484 #:tests? #f)) ;no tests
5485 (native-inputs `(("gettext" ,gettext-minimal)))
5486 (inputs `(("pciutils" ,pciutils)))
5487 (home-page (package-home-page linux-libre))
5488 (synopsis "CPU frequency and voltage scaling tools for Linux")
5490 "cpupower is a set of user-space tools that use the cpufreq feature of the
5491 Linux kernel to retrieve and control processor features related to power saving,
5492 such as frequency and voltage scaling.")
5493 (license license:gpl2)))
5495 (define-public x86-energy-perf-policy
5497 (name "x86-energy-perf-policy")
5498 (version (package-version linux-libre))
5499 (source (package-source linux-libre))
5500 (build-system gnu-build-system)
5504 (modify-phases %standard-phases
5505 (add-after 'unpack 'enter-subdirectory
5507 (chdir "tools/power/x86/x86_energy_perf_policy")
5510 (add-before 'build 'fix-makefile
5512 (substitute* "Makefile" (("/usr") ""))
5515 (let ((out (assoc-ref %outputs "out")))
5516 (list (string-append "DESTDIR=" out)
5517 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5518 (supported-systems '("i686-linux" "x86_64-linux"))
5519 (home-page (package-home-page linux-libre))
5520 (synopsis "Display and update Intel-CPU energy-performance policy")
5522 "@command{x86_energy_perf_policy} displays and updates energy-performance
5523 policy settings specific to Intel Architecture Processors. Settings are
5524 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5525 cpufreq sub-system is enabled or not.")
5526 (license license:gpl2)))
5528 (define-public haveged
5536 (url "https://github.com/jirka-h/haveged")
5537 (commit (string-append "v" version))))
5538 (file-name (git-file-name name version))
5540 (base32 "0g3hcvpky76cabgcfqh65fay7nnjkms32sgmlf33q969833hijqz"))))
5541 (build-system gnu-build-system)
5542 (home-page "https://www.issihosts.com/haveged")
5543 (synopsis "Entropy source for the Linux random number generator")
5545 "haveged generates an unpredictable stream of random numbers for use by
5546 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5547 standard mechanisms for filling the entropy pool may not be sufficient for
5548 systems with high needs or limited user interaction, such as headless servers.
5550 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5551 indirect effects of hardware events on hidden processor state using the
5552 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5553 It tunes itself to its environment and provides the same built-in test suite
5554 for the output stream as used on certified hardware security devices.
5556 The quality of the randomness produced by this algorithm has not been proven.
5557 It is recommended to run it together with another entropy source like rngd, and
5558 not as a replacement for it.")
5559 (license (list (license:non-copyleft "file://nist/mconf.h")
5560 (license:non-copyleft "file://nist/packtest.c")
5561 license:public-domain ; nist/dfft.c
5562 license:gpl3+)))) ; everything else
5564 (define-public ecryptfs-utils
5566 (name "ecryptfs-utils")
5571 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5572 version "/+download/ecryptfs-utils_"
5573 version ".orig.tar.gz"))
5576 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5577 (build-system gnu-build-system)
5579 `(#:configure-flags (list "--disable-pywrap")
5581 (modify-phases %standard-phases
5582 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5583 (lambda* (#:key inputs outputs #:allow-other-keys)
5584 (let ((out (assoc-ref outputs "out"))
5585 (utils-linux (assoc-ref inputs "utils-linux"))
5586 (cryptsetup (assoc-ref inputs "cryptsetup"))
5587 (linux-pam (assoc-ref inputs "linux-pam"))
5588 (lvm2 (assoc-ref inputs "lvm2")))
5589 (substitute* '("src/utils/ecryptfs-mount-private"
5590 "src/utils/ecryptfs-umount-private"
5591 "src/utils/ecryptfs-setup-private"
5592 "src/utils/ecryptfs-setup-swap"
5593 "src/utils/mount.ecryptfs.c"
5594 "src/utils/umount.ecryptfs.c"
5595 "src/pam_ecryptfs/pam_ecryptfs.c"
5596 "src/desktop/ecryptfs-mount-private.desktop.in"
5597 "src/desktop/ecryptfs-setup-private.desktop.in")
5599 (string-append utils-linux "/bin/mount"))
5601 (string-append utils-linux "/bin/umount"))
5602 (("/sbin/mount.ecryptfs_private")
5603 (string-append out "/sbin/mount.ecryptfs_private"))
5604 (("/sbin/umount.ecryptfs_private")
5605 (string-append out "/sbin/umount.ecryptfs_private"))
5606 (("/usr/bin/ecryptfs-mount-private")
5607 (string-append out "/bin/ecryptfs-mount-private"))
5608 (("/usr/bin/ecryptfs-rewrite-file")
5609 (string-append out "/bin/ecryptfs-rewrite-file"))
5610 (("/usr/bin/ecryptfs-setup-private")
5611 (string-append out "/bin/ecryptfs-setup-private"))
5612 (("/sbin/cryptsetup")
5613 (string-append cryptsetup "/sbin/cryptsetup"))
5614 (("/sbin/unix_chkpwd")
5615 (string-append linux-pam "/sbin/unix_chkpwd"))
5617 (string-append lvm2 "/sbin/dmsetup")))))))))
5619 `(("intltool" ,intltool)
5620 ("perl" ,perl) ; for pod2man
5621 ("pkg-config" ,pkg-config)))
5623 `(("keyutils" ,keyutils)
5624 ("linux-pam" ,linux-pam)
5625 ("utils-linux" ,util-linux)
5626 ("cryptsetup" ,cryptsetup)
5629 (home-page "https://ecryptfs.org/")
5630 (synopsis "eCryptfs cryptographic file system utilities")
5632 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5633 Each file's cryptographic meta-data is stored inside the file itself, along
5634 with the encrypted contents. This allows individual encrypted files to be
5635 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5636 native Linux file system, and has been part of the Linux kernel since version
5637 2.6.19. This package contains the userland utilities to manage it.")
5638 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5639 ;; grant additional permission to link with OpenSSL.
5640 (license license:gpl2+)))
5642 (define-public libnfsidmap
5644 (name "libnfsidmap")
5649 (uri (string-append "https://fedorapeople.org/~steved/"
5650 name "/" version "/" name "-" version ".tar.bz2"))
5652 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5653 (build-system gnu-build-system)
5655 `(#:configure-flags (list
5656 (string-append "--with-pluginpath="
5657 (assoc-ref %outputs "out")
5658 "/lib/libnfsidmap"))))
5660 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5662 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5663 (synopsis "NFSv4 support library for name/ID mapping")
5664 (description "Libnfsidmap is a library holding mulitiple methods of
5665 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5666 extensible array of mapping functions, currently consisting of two choices:
5667 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5668 (license (license:non-copyleft "file://COPYING"
5669 "See COPYING in the distribution."))))
5671 (define-public module-init-tools
5673 (name "module-init-tools")
5678 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5679 "module-init-tools-" version ".tar.bz2"))
5682 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5683 (patches (search-patches "module-init-tools-moduledir.patch"))))
5684 (build-system gnu-build-system)
5686 ;; FIXME: The upstream tarball lacks man pages, and building them would
5687 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5688 ;; but they vanished. In the meantime, fake it.
5690 (modify-phases %standard-phases
5691 (add-before 'configure 'fake-docbook
5693 (substitute* "Makefile.in"
5694 (("^DOCBOOKTOMAN.*$")
5695 "DOCBOOKTOMAN = true\n"))
5697 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5698 (synopsis "Tools for loading and managing Linux kernel modules")
5700 "Tools for loading and managing Linux kernel modules, such as
5701 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5702 (license license:gpl2+)))
5704 (define-public mcelog
5710 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
5711 "mcelog.git/snapshot/v" version ".tar.gz"))
5714 "1m11v1y7cvpm7hwsghj23z77ps1w5jzn8000iwiyxpb939h2km5l"))
5715 (file-name (string-append name "-" version ".tar.gz"))
5716 (modules '((guix build utils)))
5719 ;; The snapshots lack a .git directory,
5720 ;; breaking ‘git describe’.
5721 (substitute* "Makefile"
5722 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5724 (build-system gnu-build-system)
5726 `(#:phases (modify-phases %standard-phases
5727 (delete 'configure)) ; no configure script
5728 #:make-flags (let ((out (assoc-ref %outputs "out")))
5730 (string-append "prefix=" out)
5731 (string-append "DOCDIR=" out "/share/doc/"
5733 "etcprefix=$(DOCDIR)/examples"))
5734 ;; The tests will only run as root on certain supported CPU models.
5736 (supported-systems (list "i686-linux" "x86_64-linux"))
5737 (home-page "https://mcelog.org/")
5738 (synopsis "Machine check monitor for x86 Linux systems")
5740 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
5741 systems running the kernel Linux. It can also perform user-defined tasks, such
5742 as bringing bad pages off-line, when configurable error thresholds are
5744 (license license:gpl2)))
5746 (define-public mtd-utils
5753 "ftp://ftp.infradead.org/pub/mtd-utils/"
5754 "mtd-utils-" version ".tar.bz2"))
5757 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
5759 '(#:configure-flags '("--enable-unit-tests")))
5761 `(("cmocka" ,cmocka)
5762 ("pkg-config" ,pkg-config)))
5764 `(("acl" ,acl) ; extended attributes (xattr)
5765 ("libuuid" ,util-linux "lib")
5767 ("openssl" ,openssl) ; optional crypto support
5769 ("zstd" ,zstd "lib")))
5770 (build-system gnu-build-system)
5771 (synopsis "MTD Flash Storage Utilities")
5772 (description "This package provides utilities for testing, partitioning, etc
5774 (home-page "http://www.linux-mtd.infradead.org/")
5776 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
5777 license:mpl1.1 ; All ftl* files
5778 license:expat)))) ; libiniparser
5780 (define-public libseccomp
5786 (uri (string-append "https://github.com/seccomp/libseccomp/"
5787 "releases/download/v" version
5788 "/libseccomp-" version ".tar.gz"))
5791 "1wql62cg8f95cwpy057cl764nni9g4sdn5lqj68x22kjs8w71yhz"))))
5792 (build-system gnu-build-system)
5794 '(#:configure-flags '("--disable-static")
5795 #:phases (modify-phases %standard-phases
5796 (add-before 'check 'skip-load-test
5798 ;; This test does a native system call and fails when
5799 ;; run under QEMU user-mode emulation. Just skip it.
5800 (delete-file "tests/52-basic-load.tests")
5805 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
5806 (description "The libseccomp library provides an easy to use, platform
5807 independent, interface to the Linux Kernel's syscall filtering mechanism. The
5808 libseccomp API is designed to abstract away the underlying BPF based syscall
5809 filter language and present a more conventional function-call based filtering
5810 interface that should be familiar to, and easily adopted by, application
5812 (home-page "https://github.com/seccomp/libseccomp")
5813 (license license:lgpl2.1)))
5815 (define-public radeontop
5823 (url "https://github.com/clbr/radeontop")
5824 (commit (string-append "v" version))))
5825 (file-name (git-file-name name version))
5827 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
5828 (build-system gnu-build-system)
5830 `(#:phases (modify-phases %standard-phases
5831 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
5832 ;; dependency, and doesn't even work on release(!) tarballs.
5833 (add-after 'unpack 'report-correct-version
5835 (substitute* "getver.sh"
5837 (string-append "ver=" ,version)))
5839 (delete 'configure)) ; no configure script
5840 #:make-flags (list "CC=gcc"
5841 (string-append "PREFIX=" %output))
5842 #:tests? #f)) ; no tests
5844 `(("gettext" ,gettext-minimal)
5845 ("pkg-config" ,pkg-config)))
5847 `(("libdrm" ,libdrm)
5848 ("libpciaccess" ,libpciaccess)
5850 ("ncurses" ,ncurses)))
5851 (home-page "https://github.com/clbr/radeontop/")
5852 (synopsis "Usage monitor for AMD Radeon graphics")
5853 (description "RadeonTop monitors resource consumption on supported AMD
5854 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
5855 a terminal or saved to a file for further processing. It measures both the
5856 activity of the GPU as a whole, which is also accurate during OpenCL
5857 computations, as well as separate component statistics that are only meaningful
5858 under OpenGL graphics workloads.")
5859 (license license:gpl3)))
5861 (define-public efivar
5867 (uri (string-append "https://github.com/rhboot/" name
5868 "/releases/download/" version "/" name
5869 "-" version ".tar.bz2"))
5872 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
5873 (build-system gnu-build-system)
5875 `(;; Tests require a UEFI system and is not detected in the chroot.
5877 #:make-flags (list (string-append "prefix=" %output)
5878 (string-append "libdir=" %output "/lib")
5880 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5882 (modify-phases %standard-phases
5883 (delete 'configure))))
5885 `(("pkg-config" ,pkg-config)))
5888 (home-page "https://github.com/rhboot/efivar")
5889 (synopsis "Tool and library to manipulate EFI variables")
5890 (description "This package provides a library and a command line
5891 interface to the variable facility of UEFI boot firmware.")
5892 (license license:lgpl2.1+)))
5894 (define-public efibootmgr
5900 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
5901 "/releases/download/" version "/efibootmgr"
5902 "-" version ".tar.bz2"))
5905 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
5906 (build-system gnu-build-system)
5908 `(#:tests? #f ;no tests
5909 #:make-flags (list (string-append "prefix=" %output)
5910 (string-append "libdir=" %output "/lib")
5911 ;; EFIDIR denotes a subdirectory relative to the
5912 ;; EFI System Partition where the loader will be
5913 ;; installed (known as OS_VENDOR in the code).
5914 ;; GRUB overrides this, as such it's only used if
5915 ;; nothing else is specified on the command line.
5917 #:phases (modify-phases %standard-phases (delete 'configure))))
5919 `(("pkg-config" ,pkg-config)))
5921 `(("efivar" ,efivar)
5923 (home-page "https://github.com/rhinstaller/efibootmgr")
5924 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
5926 "@code{efibootmgr} is a user-space application to modify the Intel
5927 Extensible Firmware Interface (EFI) Boot Manager. This application can
5928 create and destroy boot entries, change the boot order, change the next
5929 running boot option, and more.")
5930 (license license:gpl2+)))
5932 (define-public sysstat
5938 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
5939 "sysstat-" version ".tar.xz"))
5942 "05idnvkhvzaynj9awx7q54x1v42jblzrxq0fn5zd1v4mjwrnqmbq"))))
5943 (build-system gnu-build-system)
5945 `(#:tests? #f ; no test suite.
5946 ;; Without this flag, it tries to install the man pages with group 'root'
5947 ;; and fails because /etc/passwd lacks an entry for the root user.
5949 (list "--disable-file-attr"
5950 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
5952 (modify-phases %standard-phases
5953 ;; The build process tries to create '/var/lib/sa', so we skip that
5955 (add-after 'build 'skip-touching-var
5957 (substitute* "Makefile"
5958 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
5961 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
5962 (synopsis "Performance monitoring tools for Linux")
5963 (description "The sysstat utilities are a collection of performance
5964 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
5965 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
5966 @code{sadf} and @code{sa}.")
5967 (license license:gpl2+)))
5969 (define-public light
5977 (url "https://github.com/haikarainen/light")
5978 (commit (string-append "v" version))))
5980 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
5981 (file-name (git-file-name name version))))
5982 (build-system gnu-build-system)
5985 (modify-phases %standard-phases
5986 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
5987 (lambda* (#:key inputs #:allow-other-keys)
5988 (substitute* "90-backlight.rules"
5989 (("/bin/chgrp") (which "chgrp"))
5990 (("/bin/chmod") (which "chmod")))
5992 (add-after 'install 'install-udev-rules
5993 (lambda* (#:key outputs #:allow-other-keys)
5994 (let ((out (assoc-ref outputs "out")))
5996 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
5999 `(("autoconf" ,autoconf)
6000 ("automake" ,automake)))
6001 (home-page "https://haikarainen.github.io/light/")
6002 (synopsis "GNU/Linux application to control backlights")
6004 "Light is a program to send commands to screen backlight controllers
6005 under GNU/Linux. Features include:
6008 @item It does not rely on X.
6009 @item Light can automatically figure out the best controller to use, making
6010 full use of underlying hardware.
6011 @item It is possible to set a minimum brightness value, as some controllers
6012 set the screen to be pitch black at a vaĺue of 0 (or higher).
6015 Light is the successor of lightscript.")
6016 (license license:gpl3+)))
6018 (define-public brightnessctl
6019 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
6021 (name "brightnessctl")
6022 (version (git-version "0.4" "0" commit))
6026 (url "https://github.com/Hummer12007/brightnessctl/")
6028 (file-name (git-file-name name version))
6031 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
6032 (build-system gnu-build-system)
6034 '(#:tests? #f ; no tests
6035 #:make-flags (list "CC=gcc"
6036 (string-append "PREFIX=" %output)
6037 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
6039 (modify-phases %standard-phases
6041 (add-after 'unpack 'adjust-udev-rules
6043 (substitute* "90-brightnessctl.rules"
6044 (("/bin/") "/run/current-system/profile/bin/"))
6046 (home-page "https://github.com/Hummer12007/brightnessctl")
6047 (synopsis "Backlight and LED brightness control")
6049 "This program allows you read and control device brightness. Devices
6050 include backlight and LEDs. It can also preserve current brightness before
6051 applying the operation, such as on lid close.
6053 The appropriate permissions must be set on the backlight or LED control
6054 interface in sysfs, which can be accomplished with the included udev rules.")
6055 (license license:expat))))
6065 (url "https://github.com/linrunner/TLP")
6067 (file-name (git-file-name name version))
6069 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6071 `(("shellcheck" ,shellcheck)))
6075 ("ethtool" ,ethtool)
6079 ("inetutils" ,inetutils)
6082 ("pciutils" ,pciutils)
6086 ("usbutils" ,usbutils)
6087 ("util-linux" ,util-linux)
6088 ("wireless-tools" ,wireless-tools)
6089 ,@(if (let ((system (or (%current-target-system)
6090 (%current-system))))
6091 (or (string-prefix? "i686-" system)
6092 (string-prefix? "x86_64-" system)))
6093 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6095 (build-system gnu-build-system)
6097 ;; XXX: The full test suite is run with "checkall" but it requires
6098 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6099 `(#:test-target "shellcheck"
6100 #:modules ((guix build gnu-build-system)
6104 (modify-phases %standard-phases
6105 (delete 'configure) ; no configure script
6106 (add-before 'build 'setenv
6107 (lambda* (#:key outputs #:allow-other-keys)
6108 (let ((out (assoc-ref outputs "out")))
6109 (setenv "TLP_WITH_SYSTEMD" "0")
6110 (setenv "TLP_NO_INIT" "1")
6111 (setenv "TLP_NO_PMUTILS" "1")
6112 (setenv "TLP_SBIN" (string-append out "/bin"))
6113 (setenv "TLP_BIN" (string-append out "/bin"))
6114 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6115 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6116 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6117 (setenv "TLP_CONFDEF"
6118 (string-append out "/share/tlp/defaults.conf"))
6119 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6121 (string-append out "/lib/elogind/system-sleep"))
6123 (string-append out "/share/bash-completion/completions"))
6124 (setenv "TLP_MAN" (string-append out "/share/man"))
6125 (setenv "TLP_META" (string-append out "/share/metainfo"))
6127 (add-before 'install 'fix-installation
6129 ;; Stop the Makefile from trying to create system directories.
6130 (substitute* "Makefile"
6131 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6132 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6135 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6136 (add-after 'install 'wrap
6137 (lambda* (#:key inputs outputs #:allow-other-keys)
6138 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6139 (bin-files (find-files bin ".*")))
6140 (define (bin-directory input-name)
6141 (let ((p (assoc-ref inputs input-name)))
6142 (and p (string-append p "/bin"))))
6143 (define (sbin-directory input-name)
6144 (string-append (assoc-ref inputs input-name) "/sbin"))
6145 (for-each (lambda (program)
6146 (wrap-program program
6149 (filter-map bin-directory
6161 "x86-energy-perf-policy"))
6162 (filter-map sbin-directory
6168 "wireless-tools"))))))
6171 (home-page "https://linrunner.de/en/tlp/tlp.html")
6172 (synopsis "Power management tool for Linux")
6173 (description "TLP is a power management tool for Linux. It comes with
6174 a default configuration already optimized for battery life. Nevertheless,
6175 TLP is customizable to fulfil system requirements. TLP settings are applied
6176 every time the power supply source is changed.")
6177 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6179 (license (list license:gpl2+ license:gpl3+))))
6184 (version "B.02.19.2")
6187 (uri (string-append "https://www.ezix.org/software/"
6188 "files/lshw-" version
6192 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6193 (build-system gnu-build-system)
6195 `(#:phases (modify-phases %standard-phases (delete 'configure))
6196 #:tests? #f ; no tests
6198 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6199 (synopsis "List hardware information")
6201 "@command{lshw} (Hardware Lister) is a small tool to provide
6202 detailed information on the hardware configuration of the machine.
6203 It can report exact memory configuration, firmware version, mainboard
6204 configuration, CPU version and speed, cache configuration, bus speed,
6205 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6206 machines (PowerMac G4 is known to work).")
6207 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6208 (license license:gpl2+)))
6210 (define-public libmnl
6217 (uri (string-append "mirror://netfilter.org/libmnl/"
6218 "libmnl-" version ".tar.bz2"))
6221 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6222 (build-system gnu-build-system)
6223 (home-page "https://www.netfilter.org/projects/libmnl/")
6224 (synopsis "Netlink utility library")
6225 (description "Libmnl is a minimalistic user-space library oriented to
6226 Netlink developers. There are a lot of common tasks in parsing, validating,
6227 constructing of both the Netlink header and TLVs that are repetitive and easy to
6228 get wrong. This library aims to provide simple helpers that allows you to
6229 re-use code and to avoid re-inventing the wheel.")
6230 (license license:lgpl2.1+)))
6232 (define-public libnftnl
6239 (uri (string-append "mirror://netfilter.org/libnftnl/"
6240 "libnftnl-" version ".tar.bz2"))
6242 (base32 "13zd90bfrr0q3j0l0cbc8kiizccw6n8gp727kqnfljh024zw3nr0"))))
6243 (build-system gnu-build-system)
6245 `(("pkg-config" ,pkg-config)))
6247 `(("libmnl" ,libmnl)))
6248 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6249 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6250 (description "Libnftnl is a userspace library providing a low-level netlink
6251 programming interface to the in-kernel nf_tables subsystem. The library
6252 libnftnl has been previously known as libnftables. This library is currently
6254 (license license:gpl2+)))
6256 (define-public nftables
6263 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6265 (string-append "https://www.nftables.org/projects/nftables"
6266 "/files/nftables-" version ".tar.bz2")))
6268 (base32 "0vmn6xwqa1nq6crfxshh049b199d0aj6hfgin7k068xhibzgvmk8"))))
6269 (build-system gnu-build-system)
6270 (arguments `(#:configure-flags
6271 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6272 (inputs `(("gmp" ,gmp)
6274 ("libnftnl" ,libnftnl)
6275 ("readline" ,readline)))
6276 (native-inputs `(("pkg-config" ,pkg-config)
6279 (home-page "https://www.nftables.org")
6280 (synopsis "Userspace utility for Linux packet filtering")
6281 (description "nftables is the project that aims to replace the existing
6282 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6283 filtering framework, a new userspace utility and also a compatibility layer for
6284 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6285 infrastructure such as the existing hooks, the connection tracking system, the
6286 userspace queueing component and the logging subsystem.")
6287 (license license:gpl2)))
6289 (define-public proot
6297 (url "https://github.com/proot-me/PRoot")
6298 (commit (string-append "v" version))))
6299 (file-name (git-file-name name version))
6301 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6302 (patches (search-patches "proot-test-fhs.patch"))))
6303 (build-system gnu-build-system)
6305 '(#:make-flags '("-C" "src")
6307 #:phases (modify-phases %standard-phases
6309 (add-before 'build 'set-shell-file-name
6310 (lambda* (#:key inputs #:allow-other-keys)
6311 (substitute* (find-files "src" "\\.[ch]$")
6314 (assoc-ref inputs "bash")
6317 (add-before 'check 'fix-fhs-assumptions-in-tests
6319 (substitute* "tests/test-c6b77b77.mk"
6320 (("/bin/bash") (which "bash"))
6321 (("/usr/bin/test") (which "test")))
6322 (substitute* '("tests/test-16573e73.c")
6323 (("/bin/([a-z-]+)" _ program)
6326 (substitute* (find-files "tests" "\\.sh$")
6327 ;; Some of the tests try to "bind-mount" /bin/true.
6329 (string-append "-b " (which "true") ":"))
6330 ;; Likewise for /bin.
6331 (("-b /bin:") "-b /gnu:")
6332 ;; Others try to run /bin/sh.
6333 (("/bin/sh") (which "sh"))
6334 ;; Others assume /etc/fstab exists.
6335 (("/etc/fstab") "/etc/passwd"))
6337 (substitute* "tests/GNUmakefile"
6338 (("-b /bin:") "-b /gnu:"))
6340 ;; XXX: This test fails in an obscure corner case, just
6342 (delete-file "tests/test-kkkkkkkk.c")
6347 (let ((n (parallel-job-count)))
6348 ;; For some reason we get lots of segfaults with
6349 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6350 (setenv "PROOT_NO_SECCOMP" "1")
6352 ;; Most of the tests expect "/bin" to be in $PATH so
6353 ;; they can run things that live in $ROOTFS/bin.
6355 (string-append (getenv "PATH") ":/bin"))
6357 (invoke "make" "check" "-C" "tests"
6359 "-j" (number->string n)))))
6361 (lambda* (#:key outputs #:allow-other-keys)
6362 ;; The 'install' rule does nearly nothing.
6363 (let* ((out (assoc-ref outputs "out"))
6364 (man1 (string-append out "/share/man/man1")))
6365 ;; TODO: 'make install-care' (does not even
6366 ;; build currently.)
6367 (invoke "make" "-C" "src" "install"
6368 (string-append "PREFIX=" out))
6371 (copy-file "doc/proot/man.1"
6372 (string-append man1 "/proot.1"))
6374 (native-inputs `(("which" ,which)
6376 ;; For 'mcookie', used by some of the tests.
6377 ("util-linux" ,util-linux)
6379 ;; XXX: Choose the old coreutils because its 'stat'
6380 ;; program does not use statx(2) when running 'stat -c
6381 ;; %a' or similar, which PRoot doesn't properly support.
6382 ("coreutils-old" ,coreutils-8.30)
6384 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6385 ;; make 4.3 to segfault.
6386 ("make-old" ,gnu-make-4.2)))
6387 (inputs `(("talloc" ,talloc)))
6388 (home-page "https://github.com/proot-me/PRoot")
6389 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6391 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6392 and @code{binfmt_misc}. This means that users don't need any privileges or
6393 setup to do things like using an arbitrary directory as the new root
6394 file system, making files accessible somewhere else in the file system
6395 hierarchy, or executing programs built for another CPU architecture
6396 transparently through QEMU user-mode. Also, developers can use PRoot as a
6397 generic process instrumentation engine thanks to its extension mechanism.
6398 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6399 available in the kernel Linux.")
6400 (license license:gpl2+)))
6402 (define-public proot-static
6405 (name "proot-static")
6407 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6408 (inputs `(("talloc" ,talloc/static)))
6410 (substitute-keyword-arguments (package-arguments proot)
6411 ((#:make-flags flags)
6412 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6414 `(modify-phases ,phases
6415 (add-after 'strip 'remove-store-references
6416 (lambda* (#:key outputs #:allow-other-keys)
6417 (let* ((out (assoc-ref outputs "out")))
6418 (with-directory-excursion out
6419 (remove-store-references "bin/proot")
6421 ((#:allowed-references _ '("out"))
6424 (define-public cpuid
6427 (version "20200427")
6430 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6431 version ".src.tar.gz"))
6434 "1m31238z2ya8f8pzpyklwp0ksf5xicqrw1z941hhhx913wzldaf1"))))
6435 (build-system gnu-build-system)
6437 '(#:make-flags '("CC=gcc")
6438 #:tests? #f ; no tests
6439 #:phases (modify-phases %standard-phases
6440 (delete 'configure) ; no configure script
6441 (add-before 'install 'fix-makefile
6442 (lambda* (#:key outputs #:allow-other-keys)
6443 (substitute* "Makefile"
6444 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6445 ;; Make the compressed manpages writable so that the
6446 ;; reset-gzip-timestamps phase does not error out.
6447 (substitute* "Makefile"
6448 (("-m 444") "-m 644"))
6450 (inputs `(("perl" ,perl)))
6451 (supported-systems '("i686-linux" "x86_64-linux"))
6452 (home-page "http://www.etallen.com/cpuid.html")
6453 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6454 (description "cpuid dumps detailed information about the CPU(s) gathered
6455 from the CPUID instruction, and also determines the exact model of CPU(s). It
6456 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6457 NexGen, Rise, and SiS CPUs.")
6458 (license license:gpl2+)))
6460 (define-public jmtpfs
6468 (url "https://github.com/JasonFerrara/jmtpfs")
6469 (commit (string-append "v" version))))
6470 (file-name (git-file-name name version))
6473 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6474 (build-system gnu-build-system)
6478 ("libmtp" ,libmtp)))
6480 `(("pkg-config" ,pkg-config)))
6481 (home-page "https://github.com/JasonFerrara/jmtpfs")
6482 (synopsis "Use a FUSE file system to access data over MTP")
6483 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6484 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6485 the MTP device as a file system.")
6486 (license license:gpl3)))
6488 (define-public procenv
6496 (url "https://github.com/jamesodhunt/procenv")
6498 (file-name (git-file-name name version))
6500 (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn"))))
6501 (build-system gnu-build-system)
6502 (arguments `(#:configure-flags '("--disable-silent-rules")))
6504 `(("pkg-config" ,pkg-config)
6512 ("libselinux" ,libselinux)))
6513 (synopsis "Utility to show process environment")
6514 (description "Procenv is a command-line tool that displays as much detail about
6515 itself and its environment as possible. It can be used as a test
6516 tool, to understand the type of environment a process runs in, and for
6517 comparing system environments.")
6518 (home-page "https://github.com/jamesodhunt/procenv/")
6519 (license license:gpl3+)))
6521 (define-public libfabric
6529 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6530 version "/libfabric-" version ".tar.bz2"))
6532 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
6533 (build-system gnu-build-system)
6534 (inputs `(("rdma-core" ,rdma-core)
6535 ,@(match (%current-system)
6536 ((member (package-supported-systems psm))
6540 (home-page "https://ofiwg.github.io/libfabric/")
6541 (synopsis "Open Fabric Interfaces")
6543 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6544 communication services to applications. OFI is best described as a collection
6545 of libraries and applications used to export fabric services. The key
6546 components of OFI are: application interfaces, provider libraries, kernel
6547 services, daemons, and test applications.
6549 Libfabric is a core component of OFI. It is the library that defines and
6550 exports the user-space API of OFI, and is typically the only software that
6551 applications deal with directly. It works in conjunction with provider
6552 libraries, which are often integrated directly into libfabric.")
6553 (license (list license:bsd-2 license:gpl2)))) ;dual
6558 (version "3.3.20170428")
6559 (home-page "https://github.com/intel/psm")
6563 (uri (git-reference (url home-page)
6564 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6565 (file-name (string-append "psm-" version ".tar.gz"))
6567 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6568 (patches (search-patches
6569 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6570 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6571 "psm-repro.patch" ; reproducibility
6572 "psm-disable-memory-stats.patch"))))
6573 (build-system gnu-build-system)
6574 (outputs '("out" "debug"))
6575 (inputs `(("libuuid" ,util-linux "lib")))
6577 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6578 ,(string-append "INSTALL_PREFIX=" %output)
6579 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6581 #:phases (modify-phases %standard-phases
6583 (add-after 'unpack 'patch-/usr/include
6585 (substitute* "Makefile"
6586 (("\\$\\{DESTDIR}/usr/include")
6587 (string-append %output "/include")))
6588 (substitute* "Makefile"
6589 (("/lib64") "/lib"))
6591 (add-after 'unpack 'patch-sysmacros
6593 (substitute* "ipath/ipath_proto.c"
6594 (("#include <sys/poll.h>" m)
6595 (string-append m "\n"
6596 "#include <sys/sysmacros.h>")))
6598 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6600 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6601 communications interface for the True Scale family of products. PSM users are
6602 enabled with mechanisms necessary to implement higher level communications
6603 interfaces in parallel environments.")
6604 ;; Only Intel-compatable processors are supported.
6605 (supported-systems '("i686-linux" "x86_64-linux"))
6606 (license (list license:bsd-2 license:gpl2)))) ;dual
6608 (define-public snapscreenshot
6610 (name "snapscreenshot")
6611 (version "1.0.14.3")
6615 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6616 name "-" version ".tar.bz2"))
6618 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6619 (build-system gnu-build-system)
6622 (let ((out (assoc-ref %outputs "out")))
6623 (list (string-append "BINDIR=" out "/bin")
6624 (string-append "MANDIR=" out "/share/man")))
6625 #:tests? #f ; no test suite
6627 (modify-phases %standard-phases
6628 (delete 'configure) ; ./configure is a snarky no-op
6629 (add-before 'install 'fix-ownership
6630 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6632 (substitute* "depfun.mak"
6633 ((" -o bin -g bin ") " "))
6635 (add-before 'install 'create-output-directories
6636 (lambda* (#:key outputs #:allow-other-keys)
6637 (let ((out (assoc-ref outputs "out")))
6638 (mkdir-p (string-append out "/share/man/man1"))
6640 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6641 (synopsis "Take screenshots of one or more Linux text consoles")
6643 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6644 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6645 relevant @file{/dev/vcs*} file(s).")
6646 (license license:gpl2)))
6648 (define-public fbcat
6655 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6656 version "/" name "-" version ".tar.gz"))
6658 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6659 (build-system gnu-build-system)
6661 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6662 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6663 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6664 `(("pnmtopng" ,netpbm)))
6665 (outputs (list "out" "fbgrab"))
6669 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6670 #:tests? #f ; no tests
6672 (modify-phases %standard-phases
6673 (delete 'configure) ; no configure script
6674 (add-after 'build 'qualify-references
6675 (lambda* (#:key inputs outputs #:allow-other-keys)
6676 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6677 (out (assoc-ref outputs "out")))
6678 (substitute* "fbgrab"
6680 (string-append out "/bin/" all))
6682 (string-append pnmtopng "/bin/" all)))
6684 (add-after 'install 'split-fbgrab-output
6685 (lambda* (#:key outputs #:allow-other-keys)
6686 (let* ((out (assoc-ref outputs "out"))
6687 (out:fbgrab (assoc-ref outputs "fbgrab")))
6688 (for-each (lambda (file)
6689 (let ((old (string-append out "/" file))
6690 (new (string-append out:fbgrab "/" file)))
6691 (mkdir-p (dirname new))
6692 (rename-file old new)))
6694 "share/man/man1/fbgrab.1"))
6696 (home-page "https://jwilk.net/software/fbcat")
6697 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6699 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6700 a dump therof. It supports a wide range of drivers and pixel formats.
6701 @command{fbcat} can take screenshots of virtually any application that can be
6702 made to write its output to the framebuffer, including (but not limited to)
6703 text-mode or graphical applications that don't use a display server.
6705 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6706 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6707 (license license:gpl2)))
6709 (define-public libcgroup
6717 "mirror://sourceforge/libcg/" name "/"
6718 version "/" name "-" version ".tar.bz2"))
6720 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6721 (build-system gnu-build-system)
6728 `(("linux-pam" ,linux-pam)))
6729 (home-page "https://sourceforge.net/projects/libcg/")
6730 (synopsis "Control groups management tools")
6731 (description "Control groups is Linux kernel method for process resource
6732 restriction, permission handling and more. This package provides userspace
6733 interface to this kernel feature.")
6734 (license license:lgpl2.1)))
6736 (define-public mbpfan
6744 (url "https://github.com/dgraziotin/mbpfan")
6745 (commit (string-append "v" version))))
6746 (file-name (git-file-name name version))
6748 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
6749 (build-system gnu-build-system)
6751 `(#:tests? #f ; tests ask to be run as root
6752 #:make-flags (let ((out (assoc-ref %outputs "out")))
6753 (list (string-append "DESTDIR=" out)
6754 ,(string-append "CC=" (cc-for-target))))
6756 (modify-phases %standard-phases
6757 (add-after 'unpack 'patch-paths
6759 (substitute* "Makefile"
6762 (delete 'configure)))) ; there's no configure phase
6763 (home-page "https://github.com/dgraziotin/mbpfan")
6764 (synopsis "Control fan speed on Macbooks")
6766 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
6767 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
6768 module. It can be executed as a daemon or in the foreground with root
6770 (license license:gpl3+)))
6779 (url "https://github.com/intel/opa-psm2")
6780 (commit (string-append "PSM2_" version))))
6781 (file-name (git-file-name name version))
6784 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
6785 (build-system gnu-build-system)
6788 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6790 #:phases (modify-phases %standard-phases
6792 (add-after 'unpack 'patch-Makefiles
6794 (substitute* "Makefile"
6797 (substitute* "compat/Makefile"
6803 (setenv "DESTDIR" %output)
6804 (invoke "make" "install")
6807 `(("rdma-core" ,rdma-core)
6808 ("numactl" ,numactl)))
6809 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
6811 "This package is low-level user-level Intel's communications interface.
6812 The PSM2 API is a high-performance vendor-specific protocol that provides a
6813 low-level communications interface for the Intel Omni-Path family of
6814 high-speed networking devices.")
6815 (home-page "https://github.com/intel/opa-psm2")
6816 ;; Only the x86_64 architecure is supported.
6817 (supported-systems '("x86_64-linux"))
6818 (license (list license:bsd-3 license:gpl2)))) ; dual
6820 (define-public libpfm4
6826 (uri (string-append "mirror://sourceforge/perfmon2/"
6827 name "/libpfm-" version ".tar.gz"))
6830 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
6831 (build-system gnu-build-system)
6833 '(#:modules ((guix build utils)
6834 (guix build gnu-build-system))
6835 #:phases (modify-phases %standard-phases
6839 (lambda* (#:key inputs outputs #:allow-other-keys)
6840 (let* ((out (assoc-ref outputs "out")))
6845 (lambda* (#:key outputs #:allow-other-keys)
6846 (let* ((out (assoc-ref outputs "out")))
6848 (string-append "PREFIX=" out)
6851 (synopsis "Performance event monitoring library")
6853 "This package provides a library called libpfm4, which is used to develop
6854 monitoring tools exploiting the performance monitoring events such as those
6855 provided by the Performance Monitoring Unit (PMU) of modern processors.
6857 Libpfm4 helps convert from an event name, expressed as a string, to the event
6858 encoding that is either the raw event as documented by the hardware vendor or
6859 the OS-specific encoding. In the latter case, the library is able to prepare
6860 the OS-specific data structures needed by the kernel to setup the event.
6862 libpfm4 provides support for the @code{perf_events} interface, which was
6863 introduced in Linux 2.6.31.")
6864 (home-page "http://perfmon2.sourceforge.net/")
6865 (license license:expat)))
6867 (define-public libnfnetlink
6869 (name "libnfnetlink")
6874 "https://www.netfilter.org/projects/libnfnetlink/files/"
6875 "libnfnetlink-" version ".tar.bz2"))
6878 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
6879 (build-system gnu-build-system)
6880 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
6881 (synopsis "Low-level netfilter netlink communication library")
6883 "@code{libnfnetlink} is the low-level library for netfilter related
6884 kernel/userspace communication. It provides a generic messaging
6885 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
6886 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
6887 management tools in userspace.")
6888 (license license:gpl2)))
6890 (define-public go-netlink
6897 (url "https://github.com/vishvananda/netlink")
6898 (commit (string-append "v" version))))
6899 (file-name (git-file-name name version))
6902 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
6903 (build-system go-build-system)
6905 `(#:import-path "github.com/vishvananda/netlink"))
6907 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
6908 ("go-netns" ,go-netns)))
6909 (home-page "https://github.com/vishvananda/netlink")
6910 (synopsis "Simple netlink library for Go")
6911 (description "The netlink package provides a simple netlink library for
6912 Go. Netlink is the interface a user-space program in Linux uses to
6913 communicate with the kernel. It can be used to add and remove interfaces, set
6914 IP addresses and routes, and configure IPsec.")
6915 (license license:asl2.0)))
6917 (define-public xfsprogs
6924 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
6925 "xfsprogs-" version ".tar.gz"))
6928 "0bssrfhnw5mhybgaa6d8wp87izi3c9cjpjy7vicm6y76mf7kl8p9"))))
6929 (build-system gnu-build-system)
6930 (outputs (list "out" "python"))
6932 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
6934 (modify-phases %standard-phases
6935 (add-after 'install 'separate-python-output
6936 (lambda* (#:key outputs #:allow-other-keys)
6937 (let ((out (assoc-ref outputs "out"))
6938 (python (assoc-ref outputs "python")))
6941 (mkdir-p (string-append python (dirname script)))
6942 (rename-file (string-append out script)
6943 (string-append python script)))
6944 (list "/sbin/xfs_scrub_all"))
6946 (add-after 'install 'install-headers
6948 (invoke "make" "install-dev"))))))
6950 `(("gettext" ,gettext-minimal)))
6952 `(("libuuid" ,util-linux "lib")
6953 ("python" ,python-wrapper)))
6954 (home-page "https://xfs.wiki.kernel.org/")
6955 (synopsis "XFS file system tools")
6956 (description "This package provides commands to create and check XFS
6958 ;; The library "libhandle" and the headers in "xfslibs-dev" are
6959 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
6960 (license (list license:gpl2 license:lgpl2.1))))
6962 (define-public genext2fs
6969 (url "https://github.com/jeremie-koenig/genext2fs")
6970 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
6971 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
6972 (file-name (git-file-name name version))
6974 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
6975 (build-system gnu-build-system)
6978 (modify-phases %standard-phases
6979 (add-after 'unpack 'apply-debian-patches
6980 ;; Debian changes (the revision after ‘-’ in VERSION) are
6981 ;; maintained as separate patches. Apply those relevant to us.
6985 (invoke "patch" "-p1" "-i"
6986 (string-append "debian/patches/" file-name)))
6987 (list "blocksize+creator.diff" ; add -B/-o options
6988 "byteswap_fix.diff"))
6991 `(("autoconf" ,autoconf)
6992 ("automake" ,automake)))
6993 (home-page "https://github.com/jeremie-koenig/genext2fs")
6994 (synopsis "Generate ext2 file system as a normal user")
6995 (description "This package provides a program to generate an ext2
6996 file system as a normal (non-root) user. It does not require you to mount
6997 the image file to copy files on it, nor does it require that you become
6998 the superuser to make device nodes.")
6999 (license license:gpl2)))
7001 (define-public fakeroot
7007 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7008 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7009 (file-name (string-append name "-" version ".tar.gz"))
7012 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
7013 (build-system gnu-build-system)
7016 (modify-phases %standard-phases
7017 (add-after 'configure 'patch-Makefile
7019 ;; Note: The root of the problem is already in "Makefile.am".
7020 (substitute* "Makefile"
7021 (("/bin/sh") (which "sh")))
7023 (add-after 'unpack 'patch-script
7024 (lambda* (#:key inputs #:allow-other-keys)
7025 (substitute* "scripts/fakeroot.in"
7027 (string-append (assoc-ref inputs "util-linux")
7030 (string-append (assoc-ref inputs "sed")
7033 (string-append (assoc-ref inputs "coreutils")
7036 (add-before 'configure 'setenv
7038 (setenv "LIBS" "-lacl")
7040 (add-before 'check 'prepare-check
7042 (setenv "SHELL" (which "bash"))
7043 (setenv "VERBOSE" "1")
7044 (substitute* "test/t.touchinstall"
7045 ;; We don't have the name of the root user, so use ID=0.
7046 (("grep root") "grep \"\\<0\\>\""))
7047 (substitute* "test/tartest"
7048 ;; We don't have the name of the root group, so use ID=0.
7049 (("ROOTGROUP=root") "ROOTGROUP=0")
7050 ;; We don't have the name of the daemon user, so use IDs.
7051 (("daemon:sys") "1:3")
7053 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7054 (substitute* "test/compare-tar"
7055 (("tar -tvf") "tar --numeric-owner -tvf"))
7057 ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead
7058 ;; of lstat(). fakeroot 1.24 does not support the former, so
7059 ;; adjust these tests to use 'test -b' instead of 'ls' to test for
7060 ;; block device. See <https://bugs.gnu.org/41090>.
7061 (substitute* '("test/t.mknod" "test/t.chmod_dev")
7062 (("ls -ld? \\$tmp/hda3")
7063 "test -b $tmp/hda3 && echo block || echo fail"))
7067 ("sharutils" ,sharutils) ; for the tests
7068 ("xz" ,xz))) ; for the tests
7070 `(("libcap" ,libcap/next)
7071 ("util-linux" ,util-linux)
7073 ("coreutils" ,coreutils)))
7074 (synopsis "Provides a fake root environment")
7075 (description "@command{fakeroot} runs a command in an environment where
7076 it appears to have root privileges for file manipulation. This is useful
7077 for allowing users to create archives (tar, ar, .deb etc.) with files in
7078 them with root permissions/ownership. Without fakeroot one would have to
7079 have root privileges to create the constituent files of the archives with
7080 the correct permissions and ownership, and then pack them up, or one would
7081 have to construct the archives directly, without using the archiver.")
7082 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7083 (license license:gpl3+)))
7085 (define-public fakechroot
7092 "https://github.com/dex4er/fakechroot/releases/download/"
7093 version "/fakechroot-" version ".tar.gz"))
7096 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7097 (build-system gnu-build-system)
7099 ;; XXX: The tests heavily assume they run on an FHS system so for now
7102 #:configure-flags '("--disable-static")))
7103 (synopsis "Emulate @code{chroot} by overriding file system calls")
7105 "@command{fakechroot} runs a command in an environment were is additional
7106 possibility to use @code{chroot} command without root privileges. This is
7107 useful for allowing users to create own chrooted environment with possibility
7108 to install another packages without need for root privileges.
7110 It works by providing @file{libfakechroot.so}, a shared library meant to be
7111 set as @code{LD_PRELOAD} to override the C library file system functions.")
7112 (home-page "https://github.com/dex4er/fakechroot/")
7113 (license license:lgpl2.1+)))
7115 (define-public inputattach
7117 (name "inputattach")
7122 (url "https://github.com/linuxwacom/input-wacom")
7123 (commit (string-append "input-wacom-" version))))
7124 (file-name (git-file-name name version))
7126 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7127 (build-system gnu-build-system)
7130 (modify-phases %standard-phases
7134 (lambda* (#:key inputs #:allow-other-keys)
7135 (with-directory-excursion "inputattach"
7136 (invoke (string-append (assoc-ref inputs "gcc")
7138 "-O2" "-o" "inputattach" "inputattach.c"))
7142 (lambda* (#:key outputs #:allow-other-keys)
7143 (let ((target-dir (string-append
7144 (assoc-ref outputs "out")
7146 (mkdir-p target-dir)
7147 (copy-file "inputattach/inputattach"
7148 (string-append target-dir
7151 (home-page "https://linuxwacom.github.io/")
7152 (synopsis "Dispatch input peripherals events to a device file")
7153 (description "inputattach dispatches input events from several device
7154 types and interfaces and translates so that the X server can use them.")
7155 (license license:gpl2+)))
7157 (define-public pipewire
7164 (url "https://github.com/PipeWire/pipewire")
7166 (file-name (git-file-name name version))
7169 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7170 (build-system meson-build-system)
7172 '(#:configure-flags '("-Dsystemd=false")))
7174 `(("pkg-config" ,pkg-config)))
7176 `(("alsa-lib" ,alsa-lib)
7180 ("gstreamer" ,gstreamer)
7181 ("gst-plugins-base" ,gst-plugins-base)
7185 (home-page "https://pipewire.org/")
7186 (synopsis "Server and user space API to deal with multimedia pipelines")
7188 "PipeWire is a project that aims to greatly improve handling of audio and
7189 video under Linux. It aims to support the usecases currently handled by both
7190 PulseAudio and Jack and at the same time provide same level of powerful handling
7191 of Video input and output. It also introduces a security model that makes
7192 interacting with audio and video devices from containerized applications easy,
7193 with supporting Flatpak applications being the primary goal. Alongside Wayland
7194 and Flatpak we expect PipeWire to provide a core building block for the future
7195 of Linux application development.")
7196 (license license:lgpl2.0+)))
7198 (define-public pipewire-0.3
7206 (url "https://github.com/PipeWire/pipewire")
7208 (file-name (git-file-name name version))
7211 "1y293sfhhmzbgnlvs46bpiyimlii5nk71f8115qxs8sviwlsdr3w"))))
7214 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7215 "/lib/udev/rules.d")
7218 (modify-phases %standard-phases
7219 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7220 (delete 'shrink-runpath))))
7222 (append (package-inputs pipewire)
7225 ("pulseaudio" ,pulseaudio)
7226 ("vulkan-loader" ,vulkan-loader)
7227 ("vulkan-headers" ,vulkan-headers))))))
7236 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7238 (file-name (git-file-name name version))
7241 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
7242 (build-system gnu-build-system)
7245 (modify-phases %standard-phases
7246 (add-after 'unpack 'fix-dbus-tests
7248 (substitute* '("unit/test-dbus-message-fds.c"
7249 "unit/test-dbus-properties.c"
7251 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7256 `(("autoconf" ,autoconf)
7257 ("libtool" ,libtool)
7258 ("pkgconfig" ,pkg-config)
7259 ("automake" ,automake)))
7260 (home-page "https://01.org/ell")
7261 (synopsis "Embedded Linux Library")
7262 (description "The Embedded Linux* Library (ELL) provides core, low-level
7263 functionality for system daemons. It typically has no dependencies other than
7264 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7265 ELL is designed to be efficient and compact enough for use on embedded Linux
7266 platforms, it is not limited to resource-constrained systems.")
7267 (license license:lgpl2.1+)))
7269 (define-public lttng-ust
7275 (uri (string-append "https://lttng.org/files/lttng-ust/"
7276 "lttng-ust-" version ".tar.bz2"))
7279 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7280 (build-system gnu-build-system)
7282 `(("liburcu" ,liburcu)
7283 ("numactl" ,numactl)))
7285 `(("python" ,python-3)))
7286 (home-page "https://lttng.org/")
7287 (synopsis "LTTng userspace tracer libraries")
7288 (description "The user space tracing library, liblttng-ust, is the LTTng
7289 user space tracer. It receives commands from a session daemon, for example to
7290 enable and disable specific instrumentation points, and writes event records
7291 to ring buffers shared with a consumer daemon.")
7292 (license license:lgpl2.1+)))
7294 (define-public kexec-tools
7296 (name "kexec-tools")
7300 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7301 "/kexec/kexec-tools-" version ".tar.xz"))
7304 "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s"))))
7305 (build-system gnu-build-system)
7307 ;; There are no automated tests.
7309 (home-page "https://projects.horms.net/projects/kexec/")
7310 (synopsis "Tools for booting directly into different kernels")
7311 (description "This package provides the @code{kexec} program and ancillary
7312 utilities. Using @code{kexec}, it is possible to boot directly into a new
7313 kernel from the context of an already-running kernel, bypassing the normal
7314 system boot process.")
7315 (license license:gpl2)))
7317 (define-public cachefilesd
7319 (name "cachefilesd")
7324 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7325 "/cachefilesd.git/snapshot/cachefilesd-"
7329 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7330 (build-system gnu-build-system)
7333 `(#:tests? #f ; there are no tests
7335 (let ((prefix-dir (lambda (var dir)
7336 (string-append var "=" %output "/" dir))))
7337 (list (string-append "CC=" ,(cc-for-target))
7338 (prefix-dir "SBINDIR" "sbin/")
7339 (prefix-dir "ETCDIR" "etc/")
7340 (prefix-dir "MANDIR" "share/man/")))
7341 #:phases (modify-phases %standard-phases (delete 'configure))))
7342 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7343 (synopsis "CacheFiles userspace management daemon")
7344 (description "@code{cachefilesd} is a userspace daemon that manages the
7345 cache data store that is used by network file systems such as @code{AFS} and
7346 @code{NFS} to cache data locally on disk. The content of the cache is
7347 persistent over reboots.")
7348 (license license:gpl2+)))
7350 (define-public libbpf
7358 (url "https://github.com/libbpf/libbpf")
7359 (commit (string-append "v" version))))
7360 (file-name (git-file-name name version))
7363 "18l0gff7nm841mwhr7bc7x863xcyvwh58zl7mc0amnsjqlbrvqg7"))))
7364 (build-system gnu-build-system)
7366 `(("pkg-config" ,pkg-config)))
7368 `(("libelf" ,libelf)
7371 `(#:tests? #f ; No tests
7374 (string-append "PREFIX=''")
7375 (string-append "DESTDIR=" (assoc-ref %outputs "out"))
7376 (string-append "LIBDIR=/lib")
7378 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7380 (modify-phases %standard-phases
7382 (add-before 'build 'pre-build
7383 (lambda* (#:key inputs #:allow-other-keys)
7384 (substitute* "scripts/check-reallocarray.sh"
7386 (string-append (assoc-ref inputs "coreutils") rm)))
7389 (home-page "https://github.com/libbpf/libbpf")
7390 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7392 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7393 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7395 (license `(,license:lgpl2.1 ,license:bsd-2))))
7405 (url "https://github.com/iovisor/bcc")
7406 (commit (string-append "v" version))))
7407 (file-name (git-file-name name version))
7410 "1d5j9zanffa1c7lpi5fcrdlx1n7hy86xl82fam2xqr0s41q4ipxw"))))
7411 (build-system cmake-build-system)
7416 `(("clang-toolchain" ,clang-toolchain)
7417 ("libbpf" ,(package-source libbpf))
7418 ;; LibElf required but libelf does not contain
7419 ;; archives, only object files.
7420 ;; https://github.com/iovisor/bcc/issues/504
7421 ("elfutils" ,elfutils)
7422 ("linux-libre-headers" ,linux-libre-headers)
7424 ("python-wrapper" ,python-wrapper)))
7426 `(;; Tests all require root permissions and a "standard" file hierarchy.
7429 (let ((revision ,version))
7430 `(,(string-append "-DREVISION=" revision)))
7432 (modify-phases %standard-phases
7433 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7434 (add-after 'unpack 'copy-libbpf
7435 (lambda* (#:key inputs #:allow-other-keys)
7436 (delete-file-recursively "src/cc/libbpf")
7438 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7439 (add-after 'copy-libbpf 'substitute-libbc
7440 (lambda* (#:key outputs #:allow-other-keys)
7441 (substitute* "src/python/bcc/libbcc.py"
7442 (("(libbcc\\.so.*)\\b" _ libbcc)
7444 (assoc-ref outputs "out") "/lib/" libbcc)))))
7445 (add-after 'install 'wrap-tools
7446 (lambda* (#:key outputs #:allow-other-keys)
7447 (use-modules (ice-9 textual-ports))
7448 (let* ((out (assoc-ref outputs "out"))
7449 (lib (string-append out "/lib"))
7450 (tools (string-append out "/share/bcc/tools"))
7452 (lambda (filename _)
7453 (call-with-input-file filename
7455 (string-contains (get-line port)
7458 (lambda (python-executable)
7459 (format #t "Wrapping: ~A.~%" python-executable)
7460 (wrap-program python-executable
7461 `("PYTHONPATH" ":" prefix
7462 (,(string-append lib
7464 ,(version-major+minor
7465 (package-version python))
7466 "/site-packages")))))
7467 (find-files tools python-executable?))
7469 (home-page "https://github.com/iovisor/bcc")
7470 (synopsis "Tools for BPF on Linux")
7472 "BCC is a toolkit for creating efficient kernel tracing and manipulation
7473 programs, and includes several useful tools and examples. It makes use of
7474 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7475 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
7477 (license license:asl2.0)))
7479 (define-public bpftrace
7487 (url "https://github.com/iovisor/bpftrace")
7488 (commit (string-append "v" version))))
7489 (file-name (git-file-name name version))
7492 "023ardywbw5w8815j2ny9rrp2xlpxndqaa7v2njjm8109p7ilsdn"))
7493 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
7494 (build-system cmake-build-system)
7500 ("clang-toolchain" ,clang-toolchain)
7501 ("elfutils" ,elfutils)
7503 ("linux-libre-headers" ,linux-libre-headers)))
7505 `(#:tests? #f ;Tests require googletest sources.
7507 '("-DBUILD_TESTING=OFF"
7508 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
7509 ;; the associated patch.
7510 "-DHAVE_BFD_DISASM=OFF")))
7511 (home-page "https://github.com/iovisor/bpftrace")
7512 (synopsis "High-level tracing language for Linux eBPF")
7514 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
7515 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
7516 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
7517 interacting with the Linux BPF system, as well as existing Linux tracing
7518 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
7519 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
7520 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
7521 created by Alastair Robertson.")
7522 (license license:asl2.0)))