gnu: linux-libre 4.14: Update to 4.14.227.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2021 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–2021 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>
51 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
52 ;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
53 ;;; Copyright © 2020 Zhu Zihao <all_but_last@163.com>
54 ;;; Copyright © 2020 David Dashyan <mail@davie.li>
55 ;;; Copyright © 2020 pukkamustard <pukkamustard@posteo.net>
56 ;;;
57 ;;; This file is part of GNU Guix.
58 ;;;
59 ;;; GNU Guix is free software; you can redistribute it and/or modify it
60 ;;; under the terms of the GNU General Public License as published by
61 ;;; the Free Software Foundation; either version 3 of the License, or (at
62 ;;; your option) any later version.
63 ;;;
64 ;;; GNU Guix is distributed in the hope that it will be useful, but
65 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
66 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67 ;;; GNU General Public License for more details.
68 ;;;
69 ;;; You should have received a copy of the GNU General Public License
70 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
71
72 (define-module (gnu packages linux)
73 #:use-module (gnu packages)
74 #:use-module (gnu packages acl)
75 #:use-module (gnu packages admin)
76 #:use-module (gnu packages algebra)
77 #:use-module (gnu packages audio)
78 #:use-module (gnu packages autotools)
79 #:use-module (gnu packages backup)
80 #:use-module (gnu packages base)
81 #:use-module (gnu packages bash)
82 #:use-module (gnu packages bison)
83 #:use-module (gnu packages boost)
84 #:use-module (gnu packages calendar)
85 #:use-module (gnu packages check)
86 #:use-module (gnu packages cpio)
87 #:use-module (gnu packages crypto)
88 #:use-module (gnu packages cryptsetup)
89 #:use-module (gnu packages compression)
90 #:use-module (gnu packages dbm)
91 #:use-module (gnu packages datastructures)
92 #:use-module (gnu packages docbook)
93 #:use-module (gnu packages documentation)
94 #:use-module (gnu packages elf)
95 #:use-module (gnu packages flex)
96 #:use-module (gnu packages file)
97 #:use-module (gnu packages freedesktop)
98 #:use-module (gnu packages gawk)
99 #:use-module (gnu packages gcc)
100 #:use-module (gnu packages gettext)
101 #:use-module (gnu packages glib)
102 #:use-module (gnu packages golang)
103 #:use-module (gnu packages gperf)
104 #:use-module (gnu packages gstreamer)
105 #:use-module (gnu packages gtk)
106 #:use-module (gnu packages haskell-apps)
107 #:use-module (gnu packages haskell-xyz)
108 #:use-module (gnu packages libunwind)
109 #:use-module (gnu packages libusb)
110 #:use-module (gnu packages llvm)
111 #:use-module (gnu packages lua)
112 #:use-module (gnu packages man)
113 #:use-module (gnu packages maths)
114 #:use-module (gnu packages multiprecision)
115 #:use-module (gnu packages ncurses)
116 #:use-module (gnu packages netpbm)
117 #:use-module (gnu packages networking)
118 #:use-module (gnu packages ninja)
119 #:use-module (gnu packages nss)
120 #:use-module (gnu packages perl)
121 #:use-module (gnu packages pciutils)
122 #:use-module (gnu packages pkg-config)
123 #:use-module (gnu packages popt)
124 #:use-module (gnu packages pulseaudio)
125 #:use-module (gnu packages python)
126 #:use-module (gnu packages python-xyz)
127 #:use-module (gnu packages readline)
128 #:use-module (gnu packages rrdtool)
129 #:use-module (gnu packages samba)
130 #:use-module (gnu packages sdl)
131 #:use-module (gnu packages serialization)
132 #:use-module (gnu packages slang)
133 #:use-module (gnu packages texinfo)
134 #:use-module (gnu packages tls)
135 #:use-module (gnu packages valgrind)
136 #:use-module (gnu packages video)
137 #:use-module (gnu packages vulkan)
138 #:use-module (gnu packages web)
139 #:use-module (gnu packages xiph)
140 #:use-module (gnu packages xml)
141 #:use-module (gnu packages xdisorg)
142 #:use-module (gnu packages xorg)
143 #:use-module (gnu packages groff)
144 #:use-module (gnu packages rsync)
145 #:use-module (gnu packages selinux)
146 #:use-module (gnu packages swig)
147 #:use-module (guix build-system cmake)
148 #:use-module (guix build-system gnu)
149 #:use-module (guix build-system go)
150 #:use-module (guix build-system meson)
151 #:use-module (guix build-system python)
152 #:use-module (guix build-system trivial)
153 #:use-module (guix build-system linux-module)
154 #:use-module (guix download)
155 #:use-module (guix git-download)
156 #:use-module ((guix licenses) #:prefix license:)
157 #:use-module (guix packages)
158 #:use-module (guix gexp)
159 #:use-module (guix store)
160 #:use-module (guix monads)
161 #:use-module (guix utils)
162 #:use-module (guix deprecation) ;for libcap/next
163 #:use-module (srfi srfi-1)
164 #:use-module (srfi srfi-2)
165 #:use-module (srfi srfi-26)
166 #:use-module (ice-9 match))
167
168 (define-public (system->linux-architecture arch)
169 "Return the Linux architecture name for ARCH, a Guix system name such as
170 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
171 (let ((arch (car (string-split arch #\-))))
172 (cond ((string=? arch "i686") "i386")
173 ((string-prefix? "mips" arch) "mips")
174 ((string-prefix? "arm" arch) "arm")
175 ((string-prefix? "aarch64" arch) "arm64")
176 ((string-prefix? "alpha" arch) "alpha")
177 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
178 ((string-prefix? "s390" arch) "s390")
179 ((string-prefix? "riscv" arch) "riscv")
180 (else arch))))
181
182 (define-public (system->defconfig system)
183 "Some systems (notably powerpc-linux) require a special target for kernel
184 defconfig. Return the appropriate make target if applicable, otherwise return
185 \"defconfig\"."
186 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
187 ((string-prefix? "powerpc64-" system) "ppc64_defconfig")
188 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
189 (else "defconfig")))
190
191 \f
192 ;;;
193 ;;; Kernel source code deblobbing.
194 ;;;
195
196 (define (linux-libre-deblob-scripts version
197 deblob-hash
198 deblob-check-hash)
199 (list (version-major+minor version)
200 (origin
201 (method url-fetch)
202 (uri (string-append "https://linux-libre.fsfla.org"
203 "/pub/linux-libre/releases/" version "-gnu/"
204 "deblob-" (version-major+minor version)))
205 (file-name (string-append "linux-libre-deblob-"
206 version))
207 (sha256 deblob-hash))
208 (origin
209 (method url-fetch)
210 (uri (string-append "https://linux-libre.fsfla.org"
211 "/pub/linux-libre/releases/" version "-gnu/"
212 "deblob-check"))
213 (file-name (string-append "linux-libre-deblob-check-" version))
214 (sha256 deblob-check-hash))))
215
216 (define* (computed-origin-method gexp-promise hash-algo hash
217 #:optional (name "source")
218 #:key (system (%current-system))
219 (guile (default-guile)))
220 "Return a derivation that executes the G-expression that results
221 from forcing GEXP-PROMISE."
222 (mlet %store-monad ((guile (package->derivation guile system)))
223 (gexp->derivation (or name "computed-origin")
224 (force gexp-promise)
225 #:graft? #f ;nothing to graft
226 #:system system
227 #:guile-for-build guile)))
228
229 (define (make-linux-libre-source version
230 upstream-source
231 deblob-scripts)
232 "Return a 'computed' origin that generates a Linux-libre tarball from the
233 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
234 (match deblob-scripts
235 ((deblob-version (? origin? deblob) (? origin? deblob-check))
236 (unless (string=? deblob-version (version-major+minor version))
237 ;; The deblob script cannot be expected to work properly on a
238 ;; different version (major+minor) of Linux, even if no errors
239 ;; are signaled during execution.
240 (error "deblob major+minor version mismatch"))
241 (origin
242 (method computed-origin-method)
243 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
244 (sha256 #f)
245 (uri
246 (delay
247 (with-imported-modules '((guix build utils))
248 #~(begin
249 (use-modules (guix build utils)
250 (srfi srfi-1)
251 (ice-9 match)
252 (ice-9 ftw))
253
254 (setvbuf (current-output-port) 'line)
255
256 (let ((dir (string-append "linux-" #$version)))
257
258 (mkdir "/tmp/bin")
259 (set-path-environment-variable
260 "PATH" '("bin")
261 (list "/tmp"
262 #+(canonical-package bash)
263 #+(canonical-package coreutils)
264 #+(canonical-package diffutils)
265 #+(canonical-package findutils)
266 #+(canonical-package patch)
267 #+(canonical-package xz)
268 #+(canonical-package sed)
269 #+(canonical-package grep)
270 #+(canonical-package bzip2)
271 #+(canonical-package gzip)
272 #+(canonical-package tar)
273 #+(canonical-package gawk)
274 #+python-wrapper))
275
276 (with-directory-excursion "/tmp/bin"
277
278 (copy-file #+deblob "deblob")
279 (chmod "deblob" #o755)
280 (substitute* "deblob"
281 (("/bin/sh") (which "sh")))
282
283 (copy-file #+deblob-check "deblob-check")
284 (chmod "deblob-check" #o755)
285 (substitute* "deblob-check"
286 (("/bin/sh") (which "sh"))
287 (("/bin/sed") (which "sed"))
288 (("/usr/bin/python") (which "python"))))
289
290 (if (file-is-directory? #+upstream-source)
291 (begin
292 (format #t "Copying upstream linux source...~%")
293 (invoke "cp" "--archive" #+upstream-source dir)
294 (invoke "chmod" "--recursive" "u+w" dir))
295 (begin
296 (format #t "Unpacking upstream linux tarball...~%")
297 (invoke "tar" "xf" #$upstream-source)
298 (match (scandir "."
299 (lambda (name)
300 (and (not (member name '("." "..")))
301 (file-is-directory? name))))
302 ((unpacked-dir)
303 (unless (string=? dir unpacked-dir)
304 (rename-file unpacked-dir dir)))
305 (dirs
306 (error "multiple directories found" dirs)))))
307
308 (with-directory-excursion dir
309 (format #t "Running deblob script...~%")
310 (invoke "/tmp/bin/deblob"))
311
312 (format #t "~%Packing new Linux-libre tarball...~%")
313 (invoke "tar" "cvfa" #$output
314 ;; Avoid non-determinism in the archive.
315 "--mtime=@0"
316 "--owner=root:0"
317 "--group=root:0"
318 "--sort=name"
319 "--hard-dereference"
320 dir)
321
322 (format #t "~%Scanning the generated tarball for blobs...~%")
323 (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs"
324 #$output))))))))))
325
326 \f
327 ;;;
328 ;;; Kernel sources.
329 ;;;
330
331 (define (linux-libre-urls version)
332 "Return a list of URLs for Linux-Libre VERSION."
333 (list (string-append
334 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
335 version "-gnu/linux-libre-" version "-gnu.tar.xz")
336
337 ;; XXX: Work around <http://bugs.gnu.org/14851>.
338 (string-append
339 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
340 version "-gnu.tar.xz")
341
342 ;; Maybe this URL will become valid eventually.
343 (string-append
344 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
345 version "-gnu.tar.xz")))
346
347 (define (%upstream-linux-source version hash)
348 (origin
349 (method url-fetch)
350 (uri (string-append "mirror://kernel.org"
351 "/linux/kernel/v" (version-major version) ".x/"
352 "linux-" version ".tar.xz"))
353 (sha256 hash)))
354
355 ;; The current "stable" kernels. That is, the most recently released major
356 ;; versions that are still supported upstream.
357 (define-public linux-libre-5.11-version "5.11.9")
358 (define deblob-scripts-5.11
359 (linux-libre-deblob-scripts
360 linux-libre-5.11-version
361 (base32 "1kcvwbbzlii4smx6m4hj97va5bf3drbglb24jkky93a1g37a9ksj")
362 (base32 "0yvr80g200hdryz54gdnzj4fl38pf7g4qbgj475rhcfwixhp1j7n")))
363 (define-public linux-libre-5.11-pristine-source
364 (let ((version linux-libre-5.11-version)
365 (hash (base32 "0dcqn6s85sd4zl7rv8ay88p5z12xvy2rma0dx6g6b480rg68sxal")))
366 (make-linux-libre-source version
367 (%upstream-linux-source version hash)
368 deblob-scripts-5.11)))
369
370 ;; The "longterm" kernels — the older releases with long-term upstream support.
371 ;; Here are the support timelines:
372 ;; <https://www.kernel.org/category/releases.html>
373 (define-public linux-libre-5.10-version "5.10.25")
374 (define deblob-scripts-5.10
375 (linux-libre-deblob-scripts
376 linux-libre-5.10-version
377 (base32 "0i99adbfjnir8p8ihhac58dv8p7mnqg4z2jpgvhj35lksdskngf7")
378 (base32 "0hh27ccqimagr3aij7ygwikxw66y63sqwd0xlf49bhpjd090r9a7")))
379 (define-public linux-libre-5.10-pristine-source
380 (let ((version linux-libre-5.10-version)
381 (hash (base32 "1p8s8vp5b6vjmvhj3plm0pr0d9qp5lrwm6l40a4bjr1vk9myf2lk")))
382 (make-linux-libre-source version
383 (%upstream-linux-source version hash)
384 deblob-scripts-5.10)))
385
386 (define-public linux-libre-5.4-version "5.4.108")
387 (define deblob-scripts-5.4
388 (linux-libre-deblob-scripts
389 linux-libre-5.4-version
390 (base32 "0q3gwf3b404brjld7aj9krzv0wdpzvs8fgy088ag7q106cwgqg8i")
391 (base32 "1xghbbnaisjd0k1klbyn1p7r6r4x5a1bpmkm56a3gh2zvw4s7mj8")))
392 (define-public linux-libre-5.4-pristine-source
393 (let ((version linux-libre-5.4-version)
394 (hash (base32 "0wi1ql7brfsdzvwbxrxvg12zfm54lbdjvfzxk1l3xlqvq83sq4pj")))
395 (make-linux-libre-source version
396 (%upstream-linux-source version hash)
397 deblob-scripts-5.4)))
398
399 (define-public linux-libre-4.19-version "4.19.183")
400 (define deblob-scripts-4.19
401 (linux-libre-deblob-scripts
402 linux-libre-4.19-version
403 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
404 (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf")))
405 (define-public linux-libre-4.19-pristine-source
406 (let ((version linux-libre-4.19-version)
407 (hash (base32 "1xd5hjdjbsw7kpj9csgi8kk4ki3z46sqbiigjsr71psivxfxkkxs")))
408 (make-linux-libre-source version
409 (%upstream-linux-source version hash)
410 deblob-scripts-4.19)))
411
412 (define-public linux-libre-4.14-version "4.14.227")
413 (define deblob-scripts-4.14
414 (linux-libre-deblob-scripts
415 linux-libre-4.14-version
416 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
417 (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky")))
418 (define-public linux-libre-4.14-pristine-source
419 (let ((version linux-libre-4.14-version)
420 (hash (base32 "1iz029v407xv81prrvg4gr2ql8hvm0mpj21x9picwv05pk2d68h7")))
421 (make-linux-libre-source version
422 (%upstream-linux-source version hash)
423 deblob-scripts-4.14)))
424
425 (define-public linux-libre-4.9-version "4.9.262")
426 (define deblob-scripts-4.9
427 (linux-libre-deblob-scripts
428 linux-libre-4.9-version
429 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
430 (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2")))
431 (define-public linux-libre-4.9-pristine-source
432 (let ((version linux-libre-4.9-version)
433 (hash (base32 "1zq77x9zf1wbk8n17rnblm5lfwlkin1xnxb3sxirwb9njm07cbmj")))
434 (make-linux-libre-source version
435 (%upstream-linux-source version hash)
436 deblob-scripts-4.9)))
437
438 (define-public linux-libre-4.4-version "4.4.262")
439 (define deblob-scripts-4.4
440 (linux-libre-deblob-scripts
441 linux-libre-4.4-version
442 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
443 (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf")))
444 (define-public linux-libre-4.4-pristine-source
445 (let ((version linux-libre-4.4-version)
446 (hash (base32 "0yz9qi4i46ndshxmb99kvv7lk6cbb09y7bzagq7sgvqaj4lwaw6j")))
447 (make-linux-libre-source version
448 (%upstream-linux-source version hash)
449 deblob-scripts-4.4)))
450
451 (define %boot-logo-patch
452 ;; Linux-Libre boot logo featuring Freedo and a gnu.
453 (origin
454 (method url-fetch)
455 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
456 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
457 (sha256
458 (base32
459 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
460
461 (define %linux-libre-arm-export-__sync_icache_dcache-patch
462 (origin
463 (method url-fetch)
464 (uri (string-append
465 "https://salsa.debian.org/kernel-team/linux"
466 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
467 "/debian/patches/bugfix/arm/"
468 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
469 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
470 (sha256
471 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
472
473 (define (source-with-patches source patches)
474 (origin
475 (inherit source)
476 (patches (append (origin-patches source)
477 patches))))
478
479 (define-public linux-libre-5.11-source
480 (source-with-patches linux-libre-5.11-pristine-source
481 (list %boot-logo-patch
482 %linux-libre-arm-export-__sync_icache_dcache-patch)))
483
484 (define-public linux-libre-5.10-source
485 (source-with-patches linux-libre-5.10-pristine-source
486 (list %boot-logo-patch
487 %linux-libre-arm-export-__sync_icache_dcache-patch)))
488
489 (define-public linux-libre-5.4-source
490 (source-with-patches linux-libre-5.4-pristine-source
491 (list %boot-logo-patch
492 %linux-libre-arm-export-__sync_icache_dcache-patch
493 ;; Pinebook Pro patch from linux-next,
494 ;; can be dropped for linux-libre 5.7
495 (search-patch
496 "linux-libre-support-for-Pinebook-Pro.patch"))))
497
498 (define-public linux-libre-4.19-source
499 (source-with-patches linux-libre-4.19-pristine-source
500 (list %boot-logo-patch
501 %linux-libre-arm-export-__sync_icache_dcache-patch)))
502
503 (define-public linux-libre-4.14-source
504 (source-with-patches linux-libre-4.14-pristine-source
505 (list %boot-logo-patch)))
506
507 (define-public linux-libre-4.9-source
508 (source-with-patches linux-libre-4.9-pristine-source
509 (list %boot-logo-patch)))
510
511 (define-public linux-libre-4.4-source
512 (source-with-patches linux-libre-4.4-pristine-source
513 (list %boot-logo-patch)))
514
515 \f
516 ;;;
517 ;;; Kernel headers.
518 ;;;
519
520 (define (make-linux-libre-headers version hash-string)
521 (make-linux-libre-headers* version
522 (origin
523 (method url-fetch)
524 (uri (linux-libre-urls version))
525 (sha256 (base32 hash-string)))))
526
527 (define (make-linux-libre-headers* version source)
528 (package
529 (name "linux-libre-headers")
530 (version version)
531 (source source)
532 (build-system gnu-build-system)
533 (native-inputs `(("perl" ,perl)
534 ,@(if (version>=? version "4.16")
535 `(("flex" ,flex)
536 ("bison" ,bison))
537 '())
538 ,@(if (version>=? version "5.3")
539 `(("rsync" ,rsync))
540 '())))
541 (arguments
542 `(#:modules ((guix build gnu-build-system)
543 (guix build utils)
544 (srfi srfi-1))
545 #:phases
546 (modify-phases %standard-phases
547 (delete 'configure)
548 (replace 'build
549 (lambda _
550 (let ((arch ,(system->linux-architecture
551 (or (%current-target-system)
552 (%current-system))))
553 (defconfig ,(system->defconfig
554 (or (%current-target-system)
555 (%current-system)))))
556 (setenv "ARCH" arch)
557 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
558 (invoke "make" defconfig)
559 (invoke "make" "mrproper" "headers_check"))))
560 (replace 'install
561 (lambda* (#:key outputs #:allow-other-keys)
562 (let ((out (assoc-ref outputs "out")))
563 (invoke "make"
564 (string-append "INSTALL_HDR_PATH=" out)
565 "headers_install")
566
567 (mkdir (string-append out "/include/config"))
568 (call-with-output-file
569 (string-append out
570 "/include/config/kernel.release")
571 (lambda (p)
572 (format p "~a-default~%" ,version)))
573
574 ;; Remove the '.install' and '..install.cmd' files; the
575 ;; latter contains store paths, which pulls in bootstrap
576 ;; binaries in the build environment, and prevents bit
577 ;; reproducibility for the bootstrap binaries.
578 (for-each delete-file (find-files out "\\.install"))
579
580 #t))))
581 #:allowed-references ()
582 #:tests? #f))
583 (home-page "https://www.gnu.org/software/linux-libre/")
584 (synopsis "GNU Linux-Libre kernel headers")
585 (description "Headers of the Linux-Libre kernel.")
586 (license license:gpl2)))
587
588 (define-public linux-libre-headers-5.11
589 (make-linux-libre-headers* linux-libre-5.11-version
590 linux-libre-5.11-source))
591
592 (define-public linux-libre-headers-5.10
593 (make-linux-libre-headers* linux-libre-5.10-version
594 linux-libre-5.10-source))
595
596 (define-public linux-libre-headers-5.4
597 (make-linux-libre-headers* linux-libre-5.4-version
598 linux-libre-5.4-source))
599
600 (define-public linux-libre-headers-4.19
601 (make-linux-libre-headers* linux-libre-4.19-version
602 linux-libre-4.19-source))
603
604 (define-public linux-libre-headers-4.14
605 (make-linux-libre-headers* linux-libre-4.14-version
606 linux-libre-4.14-source))
607
608 (define-public linux-libre-headers-4.9
609 (make-linux-libre-headers* linux-libre-4.9-version
610 linux-libre-4.9-source))
611
612 (define-public linux-libre-headers-4.4
613 (make-linux-libre-headers* linux-libre-4.4-version
614 linux-libre-4.4-source))
615
616 ;; The following package is used in the early bootstrap, and thus must be kept
617 ;; stable and with minimal build requirements.
618 (define-public linux-libre-headers-5.4.20
619 (make-linux-libre-headers "5.4.20"
620 "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47"))
621
622 (define-public linux-libre-headers linux-libre-headers-5.4.20)
623
624 \f
625 ;;;
626 ;;; Kernel configurations.
627 ;;;
628
629 (define* (kernel-config arch #:key variant)
630 "Return the absolute file name of the Linux-Libre build configuration file
631 for ARCH and optionally VARIANT, or #f if there is no such configuration."
632 (let* ((name (string-append (if variant (string-append variant "-") "")
633 (if (string=? "i386" arch) "i686" arch) ".conf"))
634 (file (string-append "linux-libre/" name)))
635 (search-auxiliary-file file)))
636
637 (define %default-extra-linux-options
638 `(;; Some very mild hardening.
639 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
640 ;; All kernels should have NAMESPACES options enabled
641 ("CONFIG_NAMESPACES" . #t)
642 ("CONFIG_UTS_NS" . #t)
643 ("CONFIG_IPC_NS" . #t)
644 ("CONFIG_USER_NS" . #t)
645 ("CONFIG_PID_NS" . #t)
646 ("CONFIG_NET_NS" . #t)
647 ;; Various options needed for elogind service:
648 ;; https://issues.guix.gnu.org/43078
649 ("CONFIG_CGROUP_FREEZER" . #t)
650 ("CONFIG_BLK_CGROUP" . #t)
651 ("CONFIG_CGROUP_WRITEBACK" . #t)
652 ("CONFIG_CGROUP_SCHED" . #t)
653 ("CONFIG_CGROUP_PIDS" . #t)
654 ("CONFIG_CGROUP_FREEZER" . #t)
655 ("CONFIG_CGROUP_DEVICE" . #t)
656 ("CONFIG_CGROUP_CPUACCT" . #t)
657 ("CONFIG_CGROUP_PERF" . #t)
658 ("CONFIG_SOCK_CGROUP_DATA" . #t)
659 ("CONFIG_BLK_CGROUP_IOCOST" . #t)
660 ("CONFIG_CGROUP_NET_PRIO" . #t)
661 ("CONFIG_CGROUP_NET_CLASSID" . #t)
662 ("CONFIG_MEMCG" . #t)
663 ("CONFIG_MEMCG_SWAP" . #t)
664 ("CONFIG_MEMCG_KMEM" . #t)
665 ("CONFIG_CPUSETS" . #t)
666 ("CONFIG_PROC_PID_CPUSET" . #t)
667 ;; Allow disk encryption by default
668 ("CONFIG_DM_CRYPT" . m)
669 ;; Modules required for initrd:
670 ("CONFIG_NET_9P" . m)
671 ("CONFIG_NET_9P_VIRTIO" . m)
672 ("CONFIG_VIRTIO_BLK" . m)
673 ("CONFIG_VIRTIO_NET" . m)
674 ("CONFIG_VIRTIO_PCI" . m)
675 ("CONFIG_VIRTIO_BALLOON" . m)
676 ("CONFIG_VIRTIO_MMIO" . m)
677 ("CONFIG_FUSE_FS" . m)
678 ("CONFIG_CIFS" . m)
679 ("CONFIG_9P_FS" . m)))
680
681 ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration
682 (define %bpf-extra-linux-options
683 `(;; Needed for probes
684 ("CONFIG_UPROBE_EVENTS" . #t)
685 ("CONFIG_KPROBE_EVENTS" . #t)
686 ;; kheaders module also helpful for tracing
687 ("CONFIG_IKHEADERS" . #t)
688 ("CONFIG_BPF" . #t)
689 ("CONFIG_BPF_SYSCALL" . #t)
690 ("CONFIG_BPF_JIT_ALWAYS_ON" . #t)
691 ;; optional, for tc filters
692 ("CONFIG_NET_CLS_BPF" . m)
693 ;; optional, for tc actions
694 ("CONFIG_NET_ACT_BPF" . m)
695 ("CONFIG_BPF_JIT" . #t)
696 ;; for Linux kernel versions 4.1 through 4.6
697 ;; ("CONFIG_HAVE_BPF_JIT" . y)
698 ;; for Linux kernel versions 4.7 and later
699 ("CONFIG_HAVE_EBPF_JIT" . #t)
700 ;; optional, for kprobes
701 ("CONFIG_BPF_EVENTS" . #t)
702 ;; kheaders module
703 ("CONFIG_IKHEADERS" . #t)))
704
705 (define (config->string options)
706 (string-join (map (match-lambda
707 ((option . 'm)
708 (string-append option "=m"))
709 ((option . #t)
710 (string-append option "=y"))
711 ((option . #f)
712 (string-append option "=n")))
713 options)
714 "\n"))
715
716 \f
717 ;;;
718 ;;; Kernel package utilities.
719 ;;;
720
721 (define* (make-linux-libre version hash-string supported-systems
722 #:key
723 ;; A function that takes an arch and a variant.
724 ;; See kernel-config for an example.
725 (extra-version #f)
726 (configuration-file #f)
727 (defconfig "defconfig")
728 (extra-options %default-extra-linux-options)
729 (patches (list %boot-logo-patch)))
730 (make-linux-libre* version
731 (origin
732 (method url-fetch)
733 (uri (linux-libre-urls version))
734 (sha256 (base32 hash-string))
735 (patches patches))
736 supported-systems
737 #:extra-version extra-version
738 #:configuration-file configuration-file
739 #:defconfig defconfig
740 #:extra-options extra-options))
741
742 (define* (make-linux-libre* version source supported-systems
743 #:key
744 ;; A function that takes an arch and a variant.
745 ;; See kernel-config for an example.
746 (extra-version #f)
747 (configuration-file #f)
748 (defconfig "defconfig")
749 (extra-options %default-extra-linux-options))
750 (package
751 (name (if extra-version
752 (string-append "linux-libre-" extra-version)
753 "linux-libre"))
754 (version version)
755 (source source)
756 (supported-systems supported-systems)
757 (build-system gnu-build-system)
758 (native-inputs
759 `(("perl" ,perl)
760 ("bc" ,bc)
761 ("openssl" ,openssl)
762 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
763 ("flex" ,flex)
764 ("bison" ,bison)
765
766 ;; These are needed to compile the GCC plugins.
767 ("gmp" ,gmp)
768 ("mpfr" ,mpfr)
769 ("mpc" ,mpc)
770
771 ,@(match (and configuration-file
772 (configuration-file
773 (system->linux-architecture
774 (or (%current-target-system) (%current-system)))
775 #:variant (version-major+minor version)))
776 (#f ;no config for this platform
777 '())
778 ((? string? config)
779 `(("kconfig" ,config))))))
780 (arguments
781 `(#:modules ((guix build gnu-build-system)
782 (guix build utils)
783 (srfi srfi-1)
784 (srfi srfi-26)
785 (ice-9 ftw)
786 (ice-9 match))
787 #:phases
788 (modify-phases %standard-phases
789 (add-after 'unpack 'patch-/bin/pwd
790 (lambda _
791 (substitute* (find-files "." "^Makefile(\\.include)?$")
792 (("/bin/pwd") "pwd"))
793 #t))
794 (replace 'configure
795 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
796 ;; Avoid introducing timestamps
797 (setenv "KCONFIG_NOTIMESTAMP" "1")
798 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
799
800 ;; Set ARCH and CROSS_COMPILE
801 (let ((arch ,(system->linux-architecture
802 (or (%current-target-system)
803 (%current-system)))))
804 (setenv "ARCH" arch)
805 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
806
807 (when target
808 (setenv "CROSS_COMPILE" (string-append target "-"))
809 (format #t "`CROSS_COMPILE' set to `~a'~%"
810 (getenv "CROSS_COMPILE"))))
811
812 (setenv "EXTRA_VERSION" ,extra-version)
813
814 (let ((build (assoc-ref %standard-phases 'build))
815 (config (assoc-ref (or native-inputs inputs) "kconfig")))
816
817 ;; Use a custom kernel configuration file or a default
818 ;; configuration file.
819 (if config
820 (begin
821 (copy-file config ".config")
822 (chmod ".config" #o666))
823 (invoke "make" ,defconfig))
824
825 ;; Appending works even when the option wasn't in the
826 ;; file. The last one prevails if duplicated.
827 (let ((port (open-file ".config" "a"))
828 (extra-configuration ,(config->string extra-options)))
829 (display extra-configuration port)
830 (close-port port))
831
832 (invoke "make" "oldconfig"))))
833 (replace 'install
834 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
835 (let* ((out (assoc-ref outputs "out"))
836 (moddir (string-append out "/lib/modules"))
837 (dtbdir (string-append out "/lib/dtbs")))
838 ;; Install kernel image, kernel configuration and link map.
839 (for-each (lambda (file) (install-file file out))
840 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
841 ;; Install device tree files
842 (unless (null? (find-files "." "\\.dtb$"))
843 (mkdir-p dtbdir)
844 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
845 "dtbs_install"))
846 ;; Install kernel modules
847 (mkdir-p moddir)
848 (invoke "make"
849 ;; Disable depmod because the Guix system's module directory
850 ;; is an union of potentially multiple packages. It is not
851 ;; possible to use depmod to usefully calculate a dependency
852 ;; graph while building only one of those packages.
853 "DEPMOD=true"
854 (string-append "MODULE_DIR=" moddir)
855 (string-append "INSTALL_PATH=" out)
856 (string-append "INSTALL_MOD_PATH=" out)
857 "INSTALL_MOD_STRIP=1"
858 "modules_install")
859 (let* ((versions (filter (lambda (name)
860 (not (string-prefix? "." name)))
861 (scandir moddir)))
862 (version (match versions
863 ((x) x))))
864 ;; There are symlinks to the build and source directory,
865 ;; both of which will point to target /tmp/guix-build*
866 ;; and thus not be useful in a profile. Delete the symlinks.
867 (false-if-file-not-found
868 (delete-file (string-append moddir "/" version "/build")))
869 (false-if-file-not-found
870 (delete-file (string-append moddir "/" version "/source"))))
871 #t))))
872 #:tests? #f))
873 (home-page "https://www.gnu.org/software/linux-libre/")
874 (synopsis "100% free redistribution of a cleaned Linux kernel")
875 (description
876 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
877 It has been modified to remove all non-free binary blobs.")
878 (license license:gpl2)
879 (properties '((max-silent-time . 3600))))) ;don't timeout on blob scan.
880
881 \f
882 ;;;
883 ;;; Generic kernel packages.
884 ;;;
885
886 (define-public linux-libre-5.11
887 (make-linux-libre* linux-libre-5.11-version
888 linux-libre-5.11-source
889 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
890 #:configuration-file kernel-config))
891
892 (define-public linux-libre-version linux-libre-5.11-version)
893 (define-public linux-libre-pristine-source linux-libre-5.11-pristine-source)
894 (define-public linux-libre-source linux-libre-5.11-source)
895 (define-public linux-libre linux-libre-5.11)
896
897 (define-public linux-libre-5.10
898 (make-linux-libre* linux-libre-5.10-version
899 linux-libre-5.10-source
900 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
901 #:configuration-file kernel-config))
902
903 (define-public linux-libre-5.4
904 (make-linux-libre* linux-libre-5.4-version
905 linux-libre-5.4-source
906 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux")
907 #:configuration-file kernel-config))
908
909 (define-public linux-libre-4.19
910 (make-linux-libre* linux-libre-4.19-version
911 linux-libre-4.19-source
912 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
913 #:configuration-file kernel-config))
914
915 (define-public linux-libre-4.14
916 (make-linux-libre* linux-libre-4.14-version
917 linux-libre-4.14-source
918 '("x86_64-linux" "i686-linux" "armhf-linux")
919 #:configuration-file kernel-config))
920
921 (define-public linux-libre-4.9
922 (make-linux-libre* linux-libre-4.9-version
923 linux-libre-4.9-source
924 '("x86_64-linux" "i686-linux")
925 #:configuration-file kernel-config))
926
927 (define-public linux-libre-4.4
928 (make-linux-libre* linux-libre-4.4-version
929 linux-libre-4.4-source
930 '("x86_64-linux" "i686-linux")
931 #:configuration-file kernel-config
932 #:extra-options
933 (append
934 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
935 ;; This option was removed upstream in version 4.7.
936 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
937 %default-extra-linux-options)))
938
939 ;; Linux-Libre-LTS points to the *newest* released long-term support version of
940 ;; Linux-Libre.
941 ;; Reference: https://jxself.org/linux-libre/
942
943 (define-public linux-libre-lts-version linux-libre-5.10-version)
944 (define-public linux-libre-lts-pristine-source linux-libre-5.10-pristine-source)
945 (define-public linux-libre-lts-source linux-libre-5.10-source)
946 (define-public linux-libre-lts linux-libre-5.10)
947
948 \f
949 ;;;
950 ;;; Specialized kernel variants.
951 ;;;
952
953 (define-public linux-libre-arm-generic
954 (make-linux-libre* linux-libre-version
955 linux-libre-source
956 '("armhf-linux")
957 #:defconfig "multi_v7_defconfig"
958 #:extra-version "arm-generic"
959 #:extra-options
960 (append
961 `(;; needed to fix the RTC on rockchip platforms
962 ("CONFIG_RTC_DRV_RK808" . #t))
963 %default-extra-linux-options)))
964
965 (define-public linux-libre-arm-veyron
966 (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic))
967
968 (define-public linux-libre-arm-generic-5.10
969 (make-linux-libre* linux-libre-5.10-version
970 linux-libre-5.10-source
971 '("armhf-linux")
972 #:defconfig "multi_v7_defconfig"
973 #:extra-version "arm-generic"
974 #:extra-options
975 (append
976 `(;; needed to fix the RTC on rockchip platforms
977 ("CONFIG_RTC_DRV_RK808" . #t))
978 %default-extra-linux-options)))
979
980 (define-public linux-libre-arm-generic-5.4
981 (make-linux-libre* linux-libre-5.4-version
982 linux-libre-5.4-source
983 '("armhf-linux")
984 #:defconfig "multi_v7_defconfig"
985 #:extra-version "arm-generic"
986 #:extra-options
987 (append
988 `(;; needed to fix the RTC on rockchip platforms
989 ("CONFIG_RTC_DRV_RK808" . #t))
990 %default-extra-linux-options)))
991
992 (define-public linux-libre-arm-generic-4.19
993 (make-linux-libre* linux-libre-4.19-version
994 linux-libre-4.19-source
995 '("armhf-linux")
996 #:defconfig "multi_v7_defconfig"
997 #:extra-version "arm-generic"))
998
999 (define-public linux-libre-arm-generic-4.14
1000 (make-linux-libre* linux-libre-4.14-version
1001 linux-libre-4.14-source
1002 '("armhf-linux")
1003 #:defconfig "multi_v7_defconfig"
1004 #:extra-version "arm-generic"))
1005
1006 (define-public linux-libre-arm-omap2plus
1007 (make-linux-libre* linux-libre-version
1008 linux-libre-source
1009 '("armhf-linux")
1010 #:defconfig "omap2plus_defconfig"
1011 #:extra-version "arm-omap2plus"))
1012
1013 (define-public linux-libre-arm-omap2plus-4.19
1014 (make-linux-libre* linux-libre-4.19-version
1015 linux-libre-4.19-source
1016 '("armhf-linux")
1017 #:defconfig "omap2plus_defconfig"
1018 #:extra-version "arm-omap2plus"))
1019
1020 (define-public linux-libre-arm-omap2plus-4.14
1021 (make-linux-libre* linux-libre-4.14-version
1022 linux-libre-4.14-source
1023 '("armhf-linux")
1024 #:defconfig "omap2plus_defconfig"
1025 #:extra-version "arm-omap2plus"))
1026
1027 (define-public linux-libre-arm64-generic
1028 (make-linux-libre* linux-libre-version
1029 linux-libre-source
1030 '("aarch64-linux")
1031 #:defconfig "defconfig"
1032 #:extra-version "arm64-generic"
1033 #:extra-options
1034 (append
1035 `(;; needed to fix the RTC on rockchip platforms
1036 ("CONFIG_RTC_DRV_RK808" . #t)
1037 ;; Pinebook display, battery, charger and usb
1038 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1039 ("CONFIG_CHARGER_AXP20X" . m)
1040 ("CONFIG_INPUT_AXP20X_PEK" . m)
1041 ("CONFIG_CHARGER_AXP20X" . m)
1042 ("CONFIG_BATTERY_AXP20X" . m)
1043 ("CONFIG_PINCTRL_AXP209" . m)
1044 ("CONFIG_AXP20X_POWER" . m)
1045 ("CONFIG_AXP20X_ADC" . m))
1046 %default-extra-linux-options)))
1047
1048 (define-public linux-libre-arm64-generic-5.10
1049 (make-linux-libre* linux-libre-5.10-version
1050 linux-libre-5.10-source
1051 '("aarch64-linux")
1052 #:defconfig "defconfig"
1053 #:extra-version "arm64-generic"
1054 #:extra-options
1055 (append
1056 `(;; needed to fix the RTC on rockchip platforms
1057 ("CONFIG_RTC_DRV_RK808" . #t)
1058 ;; Pinebook display, battery, charger and usb
1059 ("CONFIG_DRM_ANALOGIX_ANX6345" . m)
1060 ("CONFIG_CHARGER_AXP20X" . m)
1061 ("CONFIG_INPUT_AXP20X_PEK" . m)
1062 ("CONFIG_CHARGER_AXP20X" . m)
1063 ("CONFIG_BATTERY_AXP20X" . m)
1064 ("CONFIG_PINCTRL_AXP209" . m)
1065 ("CONFIG_AXP20X_POWER" . m)
1066 ("CONFIG_AXP20X_ADC" . m))
1067 %default-extra-linux-options)))
1068
1069 (define-public linux-libre-arm64-generic-5.4
1070 (make-linux-libre* linux-libre-5.4-version
1071 linux-libre-5.4-source
1072 '("aarch64-linux")
1073 #:defconfig "defconfig"
1074 #:extra-version "arm64-generic"
1075 #:extra-options
1076 (append
1077 `(;; needed to fix the RTC on rockchip platforms
1078 ("CONFIG_RTC_DRV_RK808" . #t))
1079 %default-extra-linux-options)))
1080
1081 (define-public linux-libre-riscv64-generic
1082 (make-linux-libre* linux-libre-version
1083 linux-libre-source
1084 '("riscv64-linux")
1085 #:extra-version "riscv64-generic"))
1086
1087 (define-public linux-libre-mips64el-fuloong2e
1088 (make-linux-libre* linux-libre-version
1089 linux-libre-source
1090 '("mips64el-linux")
1091 #:defconfig "fuloong2e_defconfig"
1092 #:extra-version "mips64el-fuloong2e"
1093 #:extra-options
1094 (append
1095 `(("CONFIG_OVERLAY_FS" . m))
1096 %default-extra-linux-options)))
1097
1098 (define-public linux-libre-with-bpf
1099 (let ((base-linux-libre
1100 (make-linux-libre*
1101 linux-libre-5.11-version
1102 linux-libre-5.11-source
1103 '("x86_64-linux" "i686-linux" "armhf-linux"
1104 "aarch64-linux" "riscv64-linux")
1105 #:extra-version "bpf"
1106 #:configuration-file kernel-config
1107 #:extra-options
1108 (append %bpf-extra-linux-options
1109 %default-extra-linux-options))))
1110 (package
1111 (inherit base-linux-libre)
1112 (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre))))))
1113
1114
1115 \f
1116 ;;;
1117 ;;; Linux kernel modules.
1118 ;;;
1119
1120 (define-public acpi-call-linux-module
1121 (package
1122 (name "acpi-call-linux-module")
1123 (version "1.2.1")
1124 (source
1125 (origin
1126 (method git-fetch)
1127 (uri (git-reference
1128 (url "https://github.com/nix-community/acpi_call")
1129 (commit (string-append "v" version))))
1130 (file-name (git-file-name name version))
1131 (sha256
1132 (base32 "0mr4rjbv6fj4phf038addrgv32940bphghw2v9n1z4awvw7wzkbg"))))
1133 (build-system linux-module-build-system)
1134 (arguments
1135 `(#:tests? #f ; no tests
1136 #:phases
1137 (modify-phases %standard-phases
1138 (add-before 'install 'patch-shebangs-harder
1139 ;; The (only) shebangs in examples/ don't justify a reference.
1140 ;; However, do substitute a more portable one than the original.
1141 (lambda _
1142 (substitute* (find-files "examples" ".")
1143 (("^(#! *)/[^ ]*/" _ shebang)
1144 (string-append shebang "/usr/bin/env ")))
1145 #t))
1146 (add-after 'install 'install-documentation
1147 (lambda* (#:key outputs #:allow-other-keys)
1148 (let* ((out (assoc-ref outputs "out"))
1149 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1150 (for-each (lambda (file)
1151 (let ((target (string-append doc "/" file)))
1152 (mkdir-p (dirname target))
1153 (copy-recursively file target)))
1154 (list "README.md" "examples"))
1155 #t))))))
1156 (home-page "https://github.com/teleshoes/acpi_call")
1157 (synopsis "Linux kernel module to perform ACPI method calls")
1158 (description
1159 "This simple Linux kernel module allows calls from user space to any
1160 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
1161 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
1162 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
1163 and @code{ACPI_BUFFER}.
1164
1165 It grants direct and undocumented access to your hardware that may cause damage
1166 and should be used with caution, especially on untested models.")
1167 (license license:gpl3+))) ; see README.md (no licence headers)
1168
1169 (define-public rtl8812au-aircrack-ng-linux-module
1170 (let ((commit "62cb003043e4daeeba0b8805137fa604af450ed2")
1171 (revision "3"))
1172 (package
1173 (name "rtl8812au-aircrack-ng-linux-module")
1174 (version (git-version "5.6.4.2" revision commit))
1175 (source
1176 (origin
1177 (method git-fetch)
1178 (uri (git-reference
1179 (url "https://github.com/aircrack-ng/rtl8812au")
1180 (commit commit)))
1181 (file-name (git-file-name name version))
1182 (sha256
1183 (base32 "1kragxkjprjy7nl9h2rd0mwcry1ygw07zb1p2qkj7cmz0r2035yz"))
1184 (modules '((guix build utils)))
1185 (snippet
1186 '(begin
1187 ;; Remove bundled tarballs, APKs, word lists, speadsheets,
1188 ;; and other unnecessary unlicenced things.
1189 (for-each delete-file-recursively (list "android"
1190 "docs"
1191 "tools"))
1192 #t))))
1193 (build-system linux-module-build-system)
1194 (arguments
1195 `(#:make-flags
1196 (list (string-append "KSRC="
1197 (assoc-ref %build-inputs "linux-module-builder")
1198 "/lib/modules/build"))
1199 #:phases
1200 (modify-phases %standard-phases
1201 (replace 'build
1202 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1203 (apply invoke "make" make-flags))))
1204 #:tests? #f)) ; no test suite
1205 (supported-systems '("x86_64-linux" "i686-linux"))
1206 (home-page "https://github.com/aircrack-ng/rtl8812au")
1207 (synopsis "Linux driver for Realtek USB wireless network adapters")
1208 (description
1209 "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless
1210 network adapters, modified by the aircrack-ng project to support monitor mode
1211 and frame injection. It provides a @code{88XXau} kernel module that supports
1212 RTL8812AU, RTL8821AU, and RTL8814AU chips.")
1213 (license license:gpl2+))))
1214
1215 (define-public rtl8821ce-linux-module
1216 (let ((commit "14b536f0c9ad2d0abbdab8afc7ade684900ca9cf")
1217 (revision "2"))
1218 (package
1219 (name "rtl8821ce-linux-module")
1220 (version (git-version "0.0.0" revision commit))
1221 (source
1222 (origin
1223 (method git-fetch)
1224 (uri (git-reference
1225 (url "https://github.com/tomaspinho/rtl8821ce")
1226 (commit commit)))
1227 (file-name (git-file-name name version))
1228 (sha256
1229 (base32
1230 "0z7r7spsgn22gwv9pcmkdjn9ingi8jj7xkxasph8118h46fw8ip2"))))
1231 (build-system linux-module-build-system)
1232 (arguments
1233 `(#:make-flags
1234 (list "CC=gcc"
1235 (string-append "KSRC="
1236 (assoc-ref %build-inputs "linux-module-builder")
1237 "/lib/modules/build"))
1238 #:phases
1239 (modify-phases %standard-phases
1240 (replace 'build
1241 (lambda* (#:key (make-flags '()) #:allow-other-keys)
1242 (apply invoke "make" make-flags))))
1243 #:tests? #f)) ; no test suite
1244 (home-page "https://github.com/tomaspinho/rtl8821ce")
1245 (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters")
1246 (description "This is Realtek's RTL8821CE Linux driver for wireless
1247 network adapters.")
1248 (license license:gpl2))))
1249
1250 (define-public vhba-module
1251 (package
1252 (name "vhba-module")
1253 (version "20200106")
1254 (source (origin
1255 (method url-fetch)
1256 (uri (string-append
1257 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
1258 version ".tar.bz2"))
1259 (sha256
1260 (base32
1261 "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr"))))
1262 (build-system linux-module-build-system)
1263 (arguments
1264 ;; TODO: No tests?
1265 `(#:tests? #f))
1266 (home-page "https://cdemu.sourceforge.io/")
1267 (synopsis "Kernel module that emulates SCSI devices")
1268 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
1269 between the CDemu userspace daemon and linux kernel.")
1270 (license license:gpl2+)))
1271
1272 (define-public bbswitch-module
1273 ;; Use "develop" branch since stable release does not build on Linux >= 5.6.
1274 ;; See https://github.com/Bumblebee-Project/bbswitch/issues/205.
1275 (let ((commit "ddbd243638c7bc2baecf43a78aff46cdc12e9b2e"))
1276 (package
1277 (name "bbswitch-module")
1278 (version (git-version "0.8" "1" commit))
1279 (source (origin
1280 (method git-fetch)
1281 (uri (git-reference
1282 (url "https://github.com/Bumblebee-Project/bbswitch")
1283 (commit commit)))
1284 (file-name (git-file-name name version))
1285 (sha256
1286 (base32
1287 "1pgldnza7mzd0flrxg4q69dwbq1fhl58m5c62ary5drb0xyf3lqb"))))
1288 (build-system linux-module-build-system)
1289 (arguments
1290 ;; No tests.
1291 `(#:tests? #f))
1292 (home-page "https://github.com/Bumblebee-Project/bbswitch")
1293 (synopsis "Kernel module that disables discrete Nvidia graphics cards")
1294 (description "The bbswitch module provides a way to toggle the Nvidia
1295 graphics card on Optimus laptops.")
1296 (license license:gpl2))))
1297
1298 (define-public ddcci-driver-linux
1299 (package
1300 (name "ddcci-driver-linux")
1301 (version "0.3.3")
1302 (source
1303 (origin
1304 (method git-fetch)
1305 (uri
1306 (git-reference
1307 (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
1308 (commit (string-append "v" version))))
1309 (file-name (git-file-name name version))
1310 (sha256
1311 (base32
1312 "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
1313 (build-system linux-module-build-system)
1314 (arguments
1315 `(#:tests? #f ; no tests
1316 #:phases
1317 (modify-phases %standard-phases
1318 (replace 'build
1319 (lambda args
1320 (for-each
1321 (lambda (module)
1322 (with-directory-excursion module
1323 (apply (assoc-ref %standard-phases 'build) args)))
1324 '("ddcci" "ddcci-backlight"))
1325 #t))
1326 (replace 'install
1327 (lambda args
1328 (for-each
1329 (lambda (module)
1330 (with-directory-excursion module
1331 (apply (assoc-ref %standard-phases 'install) args)))
1332 '("ddcci" "ddcci-backlight"))
1333 #t)))))
1334 (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
1335 (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
1336 (description "This package provides two Linux kernel drivers, ddcci and
1337 ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs
1338 interface. The ddcci module creates a character device for each DDC/CI
1339 monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight
1340 module allows the control of the backlight level or luminance property when
1341 supported under @file{/sys/class/backlight/}.")
1342 (license license:gpl2+)))
1343
1344 (define-public v4l2loopback-linux-module
1345 (package
1346 (name "v4l2loopback-linux-module")
1347 (version "0.12.5")
1348 (source (origin
1349 (method git-fetch)
1350 (uri (git-reference
1351 (url "https://github.com/umlaeute/v4l2loopback")
1352 (commit (string-append "v" version))))
1353 (file-name (git-file-name name version))
1354 (sha256
1355 (base32
1356 "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn"))))
1357 (build-system linux-module-build-system)
1358 (arguments
1359 `(#:tests? #f)) ; no test suite
1360 (home-page "https://github.com/umlaeute/v4l2loopback")
1361 (synopsis "Linux kernel module to create virtual V4L2 video devices")
1362 (description
1363 "This Linux module creates virtual video devices. @acronym{V4L2, Video
1364 for Linux 2} applications will treat these as ordinary video devices but read
1365 video data generated by another application, instead of a hardware device such
1366 as a capture card.
1367
1368 This lets you apply nifty effects to your Jitsi video, for example, but also
1369 allows some more serious things like adding streaming capabilities to an
1370 application by hooking GStreamer into the loopback device.")
1371 (license license:gpl2+)))
1372
1373 \f
1374 ;;;
1375 ;;; Pluggable authentication modules (PAM).
1376 ;;;
1377
1378 (define-public linux-pam
1379 (package
1380 (name "linux-pam")
1381 (version "1.5.1")
1382 (source
1383 (origin
1384 (method url-fetch)
1385 (uri (string-append
1386 "https://github.com/linux-pam/linux-pam/releases/download/v"
1387 version "/Linux-PAM-" version ".tar.xz"))
1388 (sha256
1389 (base32
1390 "1z4jayf69qyyxln1gl6ch4qxfd66ib1g42garnrv2d8i1drl0790"))
1391 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
1392
1393 (build-system gnu-build-system)
1394 (native-inputs
1395 `(("flex" ,flex)
1396
1397 ;; TODO: optional dependencies
1398 ;; ("libxcrypt" ,libxcrypt)
1399 ;; ("cracklib" ,cracklib)
1400 ))
1401 (arguments
1402 `(;; Most users, such as `shadow', expect the headers to be under
1403 ;; `security'.
1404 #:configure-flags (list (string-append "--includedir="
1405 (assoc-ref %outputs "out")
1406 "/include/security")
1407
1408 ;; XXX: <rpc/rpc.h> is missing from glibc when
1409 ;; cross-compiling, so we have to disable NIS
1410 ;; support altogether.
1411 ,@(if (%current-target-system)
1412 '("--disable-nis")
1413 '()))
1414
1415 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
1416 ;; isn't available.
1417 #:tests? #f))
1418 (home-page "http://www.linux-pam.org/")
1419 (synopsis "Pluggable authentication modules for Linux")
1420 (description
1421 "A *Free* project to implement OSF's RFC 86.0.
1422 Pluggable authentication modules are small shared object files that can
1423 be used through the PAM API to perform tasks, like authenticating a user
1424 at login. Local and dynamic reconfiguration are its key features.")
1425 (license license:bsd-3)))
1426
1427 (define-public linux-pam-1.2
1428 (package
1429 (inherit linux-pam)
1430 (version "1.2.1")
1431 (source
1432 (origin
1433 (method url-fetch)
1434 (uri (string-append
1435 "http://www.linux-pam.org/library/"
1436 "Linux-PAM-" version ".tar.bz2"))
1437 (sha256
1438 (base32
1439 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
1440 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
1441
1442 (define-public python-pamela
1443 (package
1444 (name "python-pamela")
1445 (version "1.0.0")
1446 (source
1447 (origin
1448 ;; Tests not distributed in pypi release.
1449 (method git-fetch)
1450 (uri (git-reference
1451 (url "https://github.com/minrk/pamela")
1452 (commit version)))
1453 (file-name (git-file-name name version))
1454 (sha256
1455 (base32
1456 "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr"))))
1457 (build-system python-build-system)
1458 (arguments
1459 '(#:tests? #f ; Test suite isn't designed to be run inside a container.
1460 #:phases
1461 (modify-phases %standard-phases
1462 (add-after 'unpack 'hardcode-pam.so
1463 (lambda* (#:key inputs #:allow-other-keys)
1464 (let ((pam (assoc-ref inputs "linux-pam")))
1465 (substitute* "pamela.py"
1466 (("find_library\\(\"pam\")")
1467 (string-append "'" pam "/lib/libpam.so'")))
1468 #t)))
1469 (replace 'check
1470 (lambda* (#:key tests? #:allow-other-keys)
1471 (if tests?
1472 (if (file-exists? "test_pamela.py")
1473 (invoke "py.test" "--assert=plain" "test_pamela.py")
1474 (invoke "python" "-m" "pamela" "-a" "`whoami`"))
1475 #t))))))
1476 (inputs
1477 `(("linux-pam" ,linux-pam)))
1478 (native-inputs
1479 `(("python-pytest" ,python-pytest)))
1480 (home-page "https://github.com/minrk/pamela")
1481 (synopsis "PAM interface using ctypes")
1482 (description "This package provides a PAM interface using @code{ctypes}.")
1483 (license license:expat)))
1484
1485
1486 ;;;
1487 ;;; Miscellaneous.
1488 ;;;
1489
1490 (define-public powerstat
1491 (package
1492 (name "powerstat")
1493 (version "0.02.25")
1494 (source
1495 (origin
1496 (method url-fetch)
1497 (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/"
1498 "powerstat/powerstat-" version ".tar.gz"))
1499 (sha256
1500 (base32 "0dmixbxm4qd08ds26i0wvxwyy8nrjzfjj2q9ylx35564g4wh58qb"))))
1501 (build-system gnu-build-system)
1502 (arguments
1503 `(#:make-flags
1504 (list (string-append "CC=" ,(cc-for-target))
1505 (string-append "prefix=" (assoc-ref %outputs "out")))
1506 #:tests? #f ; no test suite
1507 #:phases
1508 (modify-phases %standard-phases
1509 (add-after 'unpack 'respect-$prefix
1510 ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744
1511 (lambda _
1512 (substitute* "Makefile"
1513 (("DIR=/usr/") "DIR=$(prefix)/"))
1514 #t))
1515 (delete 'configure)))) ; no configure script
1516 (home-page "https://kernel.ubuntu.com/~cking/powerstat/")
1517 (synopsis "Measure system power consumption")
1518 (description
1519 "Powerstat measures and reports your computer's power consumption in real
1520 time. On mobile PCs, it uses ACPI battery information to measure the power
1521 drain of the entire system.
1522
1523 Powerstat can also report @acronym{RAPL, Running Average Power Limit} power
1524 domain measurements. These are available only on some hardware such as Intel
1525 Sandybridge and newer, and cover only part of the machine's components such as
1526 CPU, DRAM, and graphics. However, they provide accurate and immediate readings
1527 and don't require a battery at all.
1528
1529 The output is like @command{vmstat} but also shows power consumption statistics:
1530 at the end of a run, @command{powerstat} will calculate the average, standard
1531 deviation, and minimum and maximum values. It can show a nice histogram too.")
1532 (license license:gpl2)))
1533
1534 (define-public psmisc
1535 (package
1536 (name "psmisc")
1537 (version "23.4")
1538 (source
1539 (origin
1540 (method url-fetch)
1541 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
1542 version ".tar.xz"))
1543 (sha256
1544 (base32 "0y8n1jd2dn4cvc5mh806d66qnq8xl0xmzczbycjwal10rvmcw33z"))))
1545 (build-system gnu-build-system)
1546 (arguments
1547 `(,@(if (%current-target-system)
1548 '(#:configure-flags
1549 (list
1550 "ac_cv_func_malloc_0_nonnull=yes"
1551 "ac_cv_func_realloc_0_nonnull=yes"))
1552 '())))
1553 (inputs `(("ncurses" ,ncurses)))
1554 (home-page "https://gitlab.com/psmisc/psmisc")
1555 (synopsis "Small utilities that use the proc file system")
1556 (description
1557 "This PSmisc package is a set of some small useful utilities that
1558 use the proc file system. We're not about changing the world, but
1559 providing the system administrator with some help in common tasks.")
1560 (license license:gpl2+)))
1561
1562 (define-public util-linux
1563 (package
1564 (name "util-linux")
1565 (version "2.35.1")
1566 (source (origin
1567 (method url-fetch)
1568 (uri (string-append "mirror://kernel.org/linux/utils/"
1569 "util-linux/v" (version-major+minor version) "/"
1570 "util-linux-" version ".tar.xz"))
1571 (sha256
1572 (base32
1573 "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr"))
1574 (patches (search-patches "util-linux-tests.patch"))
1575 (modules '((guix build utils)))
1576 (snippet
1577 ;; We take 'nologin' from Shadow, the 'logger' program from
1578 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1579 '(begin
1580 (substitute* "configure"
1581 (("build_nologin=yes") "build_nologin=no")
1582 (("build_logger=yes") "build_logger=no")
1583 (("build_kill=yes") "build_kill=no"))
1584 #t))))
1585 (build-system gnu-build-system)
1586 (outputs '("out" ;6.4 MiB executables and documentation
1587 "lib" ;8.8 MiB shared libraries, headers and locales
1588 "static")) ;2.9 MiB static .a libraries
1589 (arguments
1590 `(#:configure-flags (list "--disable-use-tty-group"
1591 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1592 ;; Don't try to chown root:root mount and umount
1593 "--disable-makeinstall-chown"
1594 "--localstatedir=/var"
1595 (string-append "--localedir="
1596 (assoc-ref %outputs "lib")
1597 "/share/locale")
1598 ;; Install completions where our
1599 ;; bash-completion package expects them.
1600 (string-append "--with-bashcompletiondir="
1601 (assoc-ref %outputs "out")
1602 "/etc/bash_completion.d"))
1603 #:phases (modify-phases %standard-phases
1604 (add-before 'configure 'patch-build-scripts
1605 (lambda* (#:key outputs #:allow-other-keys)
1606 (substitute* "configure"
1607 ;; The build system assumes that we want to install
1608 ;; libraries below $exec_prefix when $libdir does not
1609 ;; match any of the "usual" locations. Fix that.
1610 (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir")
1611 "usrlib_execdir=$libdir"))
1612 #t))
1613 (add-before 'build 'set-umount-file-name
1614 (lambda* (#:key outputs #:allow-other-keys)
1615 ;; Tell 'eject' the right file name of 'umount'.
1616 (let ((out (assoc-ref outputs "out")))
1617 (substitute* "sys-utils/eject.c"
1618 (("\"/bin/umount\"")
1619 (string-append "\"" out "/bin/umount\"")))
1620 #t)))
1621 (add-before 'check 'pre-check
1622 (lambda* (#:key inputs outputs #:allow-other-keys)
1623 (let ((out (assoc-ref outputs "out"))
1624 (net (assoc-ref inputs "net-base")))
1625 ;; Change the test to refer to the right file.
1626 (substitute* "tests/ts/misc/mcookie"
1627 (("/etc/services")
1628 (string-append net "/etc/services")))
1629
1630 ;; The C.UTF-8 locale does not exist in our libc.
1631 (substitute* "tests/ts/column/invalid-multibyte"
1632 (("C\\.UTF-8") "en_US.utf8"))
1633 #t)))
1634 ;; TODO: Remove the conditional on the next rebuild cycle.
1635 ,@(if (string-prefix? "arm" (%current-system))
1636 '((add-before 'check 'disable-setarch-test
1637 (lambda _
1638 ;; The setarch tests are unreliable in QEMU's
1639 ;; user-mode emulation, which is our primary
1640 ;; method of building ARMv7 packages.
1641 ;; <https://github.com/karelzak/util-linux/issues/601>
1642 (substitute* "tests/ts/misc/setarch"
1643 (("ts_init_subtest.*" all)
1644 (string-append
1645 all "\n"
1646 "ts_skip \"setarch tests are unreliable under QEMU\"")))
1647 #t)))
1648 '())
1649 (add-after 'install 'move-static-libraries
1650 (lambda* (#:key outputs #:allow-other-keys)
1651 (let ((lib (assoc-ref outputs "lib"))
1652 (static (assoc-ref outputs "static")))
1653
1654 ;; Move static libraries to the "static" output.
1655 (mkdir-p (string-append static "/lib"))
1656 (with-directory-excursion lib
1657 (for-each (lambda (file)
1658 (rename-file file
1659 (string-append static "/"
1660 file)))
1661 (find-files "lib" "\\.a$"))
1662
1663 ;; Remove references to the static library from the '.la'
1664 ;; files so that Libtool does the right thing when both
1665 ;; the shared and static library is available.
1666 (substitute* (find-files "lib" "\\.la$")
1667 (("old_library=.*") "old_library=''\n")))
1668
1669 #t)))
1670 (add-after 'install 'adjust-pkg-config-files
1671 (lambda* (#:key outputs #:allow-other-keys)
1672 (let ((lib (assoc-ref outputs "lib")))
1673 ;; Drop the unused "prefix=" and "exec_prefix=" variables from
1674 ;; the pkg-config files to avoid a cyclic reference on "out".
1675 (substitute* (find-files (string-append lib "/lib/pkgconfig")
1676 "\\.pc$")
1677 (("^(exec_)?prefix=.*") "")))
1678 #t)))))
1679 (inputs `(("zlib" ,zlib)
1680 ("ncurses" ,ncurses)
1681
1682 ;; XXX: This is so that the 'pre-check' phase can find it.
1683 ,@(if (%current-target-system)
1684 `(("net-base" ,net-base))
1685 '())))
1686 (native-inputs
1687 `(("perl" ,perl)
1688 ("net-base" ,net-base))) ;for tests
1689 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1690 (synopsis "Collection of utilities for the Linux kernel")
1691 (description "Util-linux is a diverse collection of Linux kernel
1692 utilities. It provides dmesg and includes tools for working with file systems,
1693 block devices, UUIDs, TTYs, and many other tools.")
1694
1695 ;; Note that util-linux doesn't use the same license for all the
1696 ;; code. GPLv2+ is the default license for a code without an
1697 ;; explicitly defined license.
1698 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1699 license:bsd-4 license:public-domain))))
1700
1701 ;; util-linux optionally supports udev, which allows lsblk to read file system
1702 ;; metadata without special privileges. Add it as a separate package to avoid
1703 ;; a circular dependency, and to keep the size small.
1704 (define-public util-linux+udev
1705 (package/inherit
1706 util-linux
1707 (name "util-linux-with-udev")
1708 (inputs
1709 `(("udev" ,eudev)
1710 ,@(package-inputs util-linux)))))
1711
1712 (define-public ddate
1713 (package
1714 (name "ddate")
1715 (version "0.2.2")
1716 (source (origin
1717 (method git-fetch)
1718 (uri (git-reference
1719 (url "https://github.com/bo0ts/ddate")
1720 (commit (string-append "v" version))))
1721 (file-name (git-file-name name version))
1722 (sha256
1723 (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f"))))
1724 (build-system cmake-build-system)
1725 (arguments '(#:tests? #f))
1726 (home-page "https://github.com/bo0ts/ddate")
1727 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1728 (description
1729 "ddate displays the Discordian date and holidays of a given date.
1730 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1731 by Robert Shea and Robert Anton Wilson.")
1732 (license license:public-domain)))
1733
1734 (define-public fbset
1735 (package
1736 (name "fbset")
1737 (version "2.1")
1738 (source
1739 (origin
1740 (method url-fetch)
1741 (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-"
1742 version ".tar.gz"))
1743 (sha256
1744 (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0"))))
1745 (build-system gnu-build-system)
1746 (arguments
1747 '(#:modules ((guix build gnu-build-system)
1748 (guix build utils)
1749 (srfi srfi-26))
1750 #:phases
1751 (modify-phases %standard-phases
1752 (delete 'configure) ; no configure script
1753 (add-before 'install 'pre-install
1754 (lambda* (#:key outputs #:allow-other-keys)
1755 (let ((out (assoc-ref outputs "out")))
1756 (substitute* "Makefile"
1757 (("mknod ") "true ")
1758 ;; The Makefile doesn't honour PREFIX or similar.
1759 (("/usr") out))
1760 (mkdir out)
1761 (with-directory-excursion out
1762 (for-each mkdir-p (list "sbin"
1763 "man/man5"
1764 "man/man8")))
1765 #t)))
1766 (add-after 'install 'install-fb.modes
1767 (lambda* (#:key outputs #:allow-other-keys)
1768 (let* ((out (assoc-ref outputs "out"))
1769 (etc (string-append out "/etc")))
1770 (for-each (cut install-file <> etc)
1771 (find-files "etc" "^fb\\.modes"))
1772 (symlink "fb.modes.ATI"
1773 (string-append etc "/fb.modes"))
1774 #t))))
1775 ;; Parallel building races to create modes.tab.c.
1776 #:parallel-build? #f
1777 #:tests? #f)) ; no test suite
1778 (native-inputs
1779 `(("bison" ,bison)
1780 ("flex" ,flex)))
1781 (home-page "http://users.telenet.be/geertu/Linux/fbdev/")
1782 (synopsis "Show and modify Linux frame buffer settings")
1783 (description
1784 "The kernel Linux's @dfn{frame buffers} provide a simple interface to
1785 different kinds of graphic displays. The @command{fbset} utility can query and
1786 change various device settings such as depth, virtual resolution, and timing
1787 parameters.")
1788 (license license:gpl2)))
1789
1790 (define-public procps
1791 (package
1792 (name "procps")
1793 (version "3.3.16")
1794 (source (origin
1795 (method url-fetch)
1796 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1797 "procps-ng-" version ".tar.xz"))
1798 (sha256
1799 (base32
1800 "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj"))))
1801 (build-system gnu-build-system)
1802 (arguments
1803 `(#:modules ((guix build utils)
1804 (guix build gnu-build-system)
1805 (srfi srfi-1)
1806 (srfi srfi-26))
1807 ,@(if (%current-target-system)
1808 '(#:configure-flags
1809 (list
1810 "ac_cv_func_malloc_0_nonnull=yes"
1811 "ac_cv_func_realloc_0_nonnull=yes"))
1812 '())
1813 #:phases
1814 (modify-phases %standard-phases
1815 (add-after
1816 'install 'post-install
1817 ;; Remove commands and man pages redudant with
1818 ;; Coreutils.
1819 (lambda* (#:key outputs #:allow-other-keys)
1820 (let* ((out (assoc-ref outputs "out"))
1821 (dup (append-map (cut find-files out <>)
1822 '("^kill" "^uptime"))))
1823 (for-each delete-file dup)
1824 #t))))))
1825 (inputs `(("ncurses" ,ncurses)))
1826 (home-page "https://gitlab.com/procps-ng/procps/")
1827 (synopsis "Utilities that give information about processes")
1828 (description
1829 "Procps is the package that has a bunch of small useful utilities
1830 that give information about processes using the Linux /proc file system.
1831 The package includes the programs free, pgrep, pidof, pkill, pmap, ps, pwdx,
1832 slabtop, tload, top, vmstat, w, watch and sysctl.")
1833 (license license:gpl2)))
1834
1835 (define-public usbutils
1836 (package
1837 (name "usbutils")
1838 (version "013")
1839 (source
1840 (origin
1841 (method url-fetch)
1842 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1843 "usbutils-" version ".tar.xz"))
1844 (sha256
1845 (base32 "0f0klk6d3hmbpf6p4dcwa1qjzblmkhbxs1wsw87aidvqri7lj8wy"))))
1846 (build-system gnu-build-system)
1847 (outputs (list "out" "python"))
1848 (arguments
1849 `(#:phases
1850 (modify-phases %standard-phases
1851 (add-before 'bootstrap 'patch-bootstrap-scripts
1852 (lambda _
1853 (substitute* "usbhid-dump/bootstrap"
1854 (("/bin/sh") (which "sh")))
1855
1856 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1857 (substitute* "autogen.sh"
1858 (("^\\./configure.*") ""))
1859 #t))
1860 (add-after 'install 'separate-python-output
1861 ;; Separating one Python script shaves more than 106 MiB from :out.
1862 (lambda* (#:key outputs #:allow-other-keys)
1863 (let ((out (assoc-ref outputs "out"))
1864 (out:python (assoc-ref outputs "python")))
1865 (for-each (lambda (file)
1866 (let ((old (string-append out "/" file))
1867 (new (string-append out:python "/" file)))
1868 (mkdir-p (dirname new))
1869 (rename-file old new)))
1870 (list "bin/lsusb.py"))
1871 #t))))))
1872 (inputs
1873 `(("eudev" ,eudev)
1874 ("libusb" ,libusb)
1875 ("python" ,python)))
1876 (native-inputs
1877 `(("autoconf" ,autoconf)
1878 ("automake" ,automake)
1879 ("libtool" ,libtool)
1880 ("pkg-config" ,pkg-config)))
1881 (home-page "http://www.linux-usb.org/")
1882 (synopsis
1883 "Tools for working with USB devices, such as lsusb")
1884 (description
1885 "Tools for working with USB devices, such as lsusb.")
1886 (license license:gpl2+)))
1887
1888 (define-public e2fsprogs
1889 (package
1890 (name "e2fsprogs")
1891 (version "1.45.6")
1892 (source (origin
1893 (method url-fetch)
1894 (uri (string-append
1895 "mirror://kernel.org/linux/kernel/people/tytso/"
1896 "e2fsprogs/v" version "/"
1897 "e2fsprogs-" version ".tar.xz"))
1898 (sha256
1899 (base32
1900 "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz"))))
1901 (build-system gnu-build-system)
1902 (inputs `(("util-linux" ,util-linux "lib")))
1903 (native-inputs `(("pkg-config" ,pkg-config)
1904 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1905
1906 ;; For tests.
1907 ("perl" ,perl)
1908 ("procps" ,procps)))
1909 (arguments
1910 '(;; util-linux is the preferred source for some of the libraries and
1911 ;; commands, so disable them (see, e.g.,
1912 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1913 #:configure-flags (list "--disable-libblkid"
1914 "--disable-libuuid" "--disable-uuidd"
1915 "--disable-fsck"
1916
1917 ;; Use symlinks instead of hard links for
1918 ;; 'fsck.extN' etc. This makes the resulting nar
1919 ;; smaller and is preserved across copies.
1920 "--enable-symlink-install"
1921
1922 (string-append "LDFLAGS=-Wl,-rpath="
1923 (assoc-ref %outputs "out")
1924 "/lib")
1925
1926 ;; Install libext2fs et al.
1927 "--enable-elf-shlibs")
1928
1929 #:phases
1930 (modify-phases %standard-phases
1931 (add-before 'configure 'patch-shells
1932 (lambda _
1933 (substitute* "configure"
1934 (("/bin/sh (.*)parse-types.sh" _ dir)
1935 (string-append (which "sh") " " dir
1936 "parse-types.sh")))
1937 (substitute* "MCONFIG.in"
1938 (("INSTALL_SYMLINK = /bin/sh")
1939 "INSTALL_SYMLINK = sh"))
1940 (substitute* (find-files "." "^Makefile.in$")
1941 (("#!/bin/sh")
1942 (string-append "#!" (which "sh"))))
1943 #t))
1944 (add-after 'install 'install-libs
1945 (lambda* (#:key outputs #:allow-other-keys)
1946 (let* ((out (assoc-ref outputs "out"))
1947 (lib (string-append out "/lib")))
1948 (invoke "make" "install-libs")
1949
1950 ;; Make the .a writable so that 'strip' works.
1951 ;; Failing to do that, due to debug symbols, we
1952 ;; retain a reference to the final
1953 ;; linux-libre-headers, which refer to the
1954 ;; bootstrap binaries.
1955 (let ((archives (find-files lib "\\.a$")))
1956 (for-each (lambda (file)
1957 (chmod file #o666))
1958 archives))
1959 #t))))))
1960 (home-page "http://e2fsprogs.sourceforge.net/")
1961 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1962 (description
1963 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1964 (license (list license:gpl2 ;programs
1965 license:lgpl2.0 ;libext2fs
1966 license:x11)))) ;libuuid
1967
1968 (define e2fsprogs/static
1969 (static-package
1970 (package (inherit e2fsprogs)
1971 (arguments
1972 ;; Do not build shared libraries.
1973 (substitute-keyword-arguments (package-arguments e2fsprogs)
1974 ((#:configure-flags _)
1975 '(list "--disable-blkid"))
1976 ((#:make-flags _)
1977 '(list)))))))
1978
1979 (define-public e2fsck/static
1980 (package
1981 (name "e2fsck-static")
1982 (version (package-version e2fsprogs))
1983 (build-system trivial-build-system)
1984 (source #f)
1985 (inputs
1986 `(("e2fsprogs" ,e2fsprogs/static)))
1987 (arguments
1988 `(#:modules ((guix build utils))
1989 #:builder
1990 (begin
1991 (use-modules (guix build utils)
1992 (ice-9 ftw)
1993 (srfi srfi-26))
1994
1995 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1996 "/sbin/e2fsck"))
1997 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1998 (mkdir-p bin)
1999 (with-directory-excursion bin
2000 (copy-file e2fsck "e2fsck")
2001 (remove-store-references "e2fsck")
2002 (chmod "e2fsck" #o555))
2003 #t))))
2004 (home-page (package-home-page e2fsprogs))
2005 (synopsis "Statically-linked e2fsck command from e2fsprogs")
2006 (description "This package provides statically-linked e2fsck command taken
2007 from the e2fsprogs package. It is meant to be used in initrds.")
2008 (license (package-license e2fsprogs))))
2009
2010 (define-public extundelete
2011 (package
2012 (name "extundelete")
2013 (version "0.2.4")
2014 (source
2015 (origin
2016 (method url-fetch)
2017 (uri (string-append "mirror://sourceforge/extundelete/"
2018 "extundelete/" version "/extundelete-"
2019 version ".tar.bz2"))
2020 (sha256
2021 (base32
2022 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
2023 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
2024 (build-system gnu-build-system)
2025 (inputs `(("e2fsprogs" ,e2fsprogs)))
2026 (home-page "http://extundelete.sourceforge.net/")
2027 (synopsis "Recover deleted files from ext2/3/4 partitions")
2028 (description
2029 "Extundelete is a set of tools that can recover deleted files from an
2030 ext3 or ext4 partition.")
2031 (license license:gpl2)))
2032
2033 (define-public zerofree
2034 (package
2035 (name "zerofree")
2036 (version "1.1.1")
2037 (home-page "https://frippery.org/uml/")
2038 (source (origin
2039 (method url-fetch)
2040 (uri (string-append home-page name "-" version
2041 ".tgz"))
2042 (sha256
2043 (base32
2044 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
2045 (build-system gnu-build-system)
2046 (arguments
2047 '(#:phases
2048 (modify-phases %standard-phases
2049 (delete 'configure) ; no configure script
2050 (replace 'install
2051 ;; The Makefile lacks an ‘install’ target.
2052 (lambda* (#:key outputs #:allow-other-keys)
2053 (let* ((out (assoc-ref outputs "out"))
2054 (bin (string-append out "/bin")))
2055 (chmod "zerofree" #o555)
2056 (install-file "zerofree" bin)
2057 #t))))
2058 #:tests? #f)) ; no tests
2059 (inputs `(("libext2fs" ,e2fsprogs)))
2060 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
2061 (description
2062 "Zerofree finds the unallocated blocks with non-zero value content in an
2063 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
2064 This is a simple way to make disk images more compressible.
2065 Zerofree requires the file system to be unmounted or mounted read-only.")
2066 (license license:gpl2)))
2067
2068 (define-public strace
2069 (package
2070 (name "strace")
2071 (version "5.8")
2072 (home-page "https://strace.io")
2073 (source (origin
2074 (method url-fetch)
2075 (uri (string-append home-page "/files/" version
2076 "/strace-" version ".tar.xz"))
2077 (sha256
2078 (base32
2079 "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz"))))
2080 (build-system gnu-build-system)
2081 (arguments
2082 '(#:phases
2083 (modify-phases %standard-phases
2084 (add-after 'unpack 'patch-/bin/sh
2085 (lambda _
2086 (substitute* "strace.c"
2087 (("/bin/sh") (which "sh")))
2088 #t))
2089 (add-after 'unpack 'disable-failing-tests
2090 (lambda _
2091 ;; XXX These hang forever even if the test time-out is extended.
2092 (substitute* "tests/Makefile.in"
2093 (("^\tstrace-DD?D?\\.test \\\\.*") ""))
2094 #t)))
2095 ;; Don't fail if the architecture doesn't support different personalities.
2096 #:configure-flags '("--enable-mpers=check")
2097 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
2098 #:parallel-tests? #f)) ; undeterministic failures
2099 (native-inputs `(("perl" ,perl)))
2100 (synopsis "System call tracer for Linux")
2101 (description
2102 "strace is a system call tracer, i.e. a debugging tool which prints out a
2103 trace of all the system calls made by a another process/program.")
2104 (license license:lgpl2.1+)))
2105
2106 (define-public ltrace
2107 (package
2108 (name "ltrace")
2109 (version "0.7.3")
2110 (source (origin
2111 (method url-fetch)
2112 (uri (string-append "http://www.ltrace.org/ltrace_" version
2113 ".orig.tar.bz2"))
2114 (sha256
2115 (base32
2116 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
2117 (build-system gnu-build-system)
2118 (inputs `(("libelf" ,elfutils)))
2119 (arguments
2120 ;; Compilation uses -Werror by default, but it fails.
2121 '(#:configure-flags '("--disable-werror")))
2122 (home-page "https://www.ltrace.org/")
2123 (synopsis "Library call tracer for Linux")
2124 (description
2125 "ltrace intercepts and records dynamic library calls which are called by
2126 an executed process and the signals received by that process. It can also
2127 intercept and print the system calls executed by the program.")
2128 (license license:gpl2+)))
2129
2130 (define-public alsa-lib
2131 (package
2132 (name "alsa-lib")
2133 (version "1.2.4")
2134 (source (origin
2135 (method url-fetch)
2136 (uri (string-append
2137 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
2138 version ".tar.bz2"))
2139 (sha256
2140 (base32
2141 "1xq8d48wfy59qw4x7383j32n8j5njndw5hcgnmlg9pvclphlnmgp"))))
2142 (build-system gnu-build-system)
2143 (arguments
2144 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2145 (assoc-ref %outputs "out")
2146 "/lib"))))
2147 (home-page "https://www.alsa-project.org/")
2148 (synopsis "The Advanced Linux Sound Architecture libraries")
2149 (description
2150 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2151 MIDI functionality to the Linux-based operating system.")
2152 (license license:lgpl2.1+)))
2153
2154 (define-public alsa-utils
2155 (package
2156 (name "alsa-utils")
2157 (version "1.2.4")
2158 (source (origin
2159 (method url-fetch)
2160 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
2161 name "-" version ".tar.bz2"))
2162 (sha256
2163 (base32
2164 "09m4dnn4kplawprd2bl15nwa0b4r1brab3x44ga7f1fyk7aw5zwq"))))
2165 (build-system gnu-build-system)
2166 (arguments
2167 ;; XXX: Disable man page creation until we have DocBook.
2168 '(#:configure-flags (list "--disable-xmlto"
2169
2170 ;; The udev rule is responsible for restoring
2171 ;; the volume.
2172 (string-append "--with-udev-rules-dir="
2173 (assoc-ref %outputs "out")
2174 "/lib/udev/rules.d"))
2175 #:phases
2176 (modify-phases %standard-phases
2177 (add-before 'check 'disable-broken-test
2178 (lambda _
2179 ;; XXX: The 1.1.8 release tarball is missing a header that's
2180 ;; required for this test to work. Fixed in 1.1.9.
2181 (substitute* "axfer/test/Makefile"
2182 ((".*container-test.*") ""))
2183 #t))
2184 (add-before
2185 'install 'pre-install
2186 (lambda _
2187 ;; Don't try to mkdir /var/lib/alsa.
2188 (substitute* "Makefile"
2189 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
2190 "true\n"))
2191 #t)))))
2192 (native-inputs
2193 `(("gettext" ,gettext-minimal)))
2194 (inputs
2195 `(("libsamplerate" ,libsamplerate)
2196 ("ncurses" ,ncurses)
2197 ("alsa-lib" ,alsa-lib)
2198 ("xmlto" ,xmlto)))
2199 (home-page "http://www.alsa-project.org/")
2200 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
2201 (description
2202 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2203 MIDI functionality to the Linux-based operating system.")
2204
2205 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
2206 ;; GPLv2-only.
2207 (license license:gpl2)))
2208
2209 (define-public alsa-plugins
2210 (package
2211 (name "alsa-plugins")
2212 (version "1.2.2")
2213 (source (origin
2214 (method url-fetch)
2215 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
2216 name "-" version ".tar.bz2"))
2217 (sha256
2218 (base32
2219 "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw"))))
2220 (build-system gnu-build-system)
2221 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
2222 ;; be split, there are references to both in files.
2223 ;; TODO: Remove OSS related plugins, they add support to run native
2224 ;; ALSA applications on OSS however we do not offer OSS and OSS is
2225 ;; obsolete.
2226 (outputs '("out" "pulseaudio" "jack"))
2227 (native-search-paths
2228 (list (search-path-specification
2229 (variable "ALSA_PLUGIN_DIR")
2230 (files '("lib/alsa-lib"))
2231 (separator #f))))
2232 (arguments
2233 `(#:configure-flags '(;; Do not install a "local" configuration targeted
2234 ;; for /etc/alsa. On Guix System plugins are loaded from
2235 ;; the ALSA service, and other distributions likely
2236 ;; won't use these files.
2237 "--with-alsalconfdir=/tmp/noop")
2238 #:phases
2239 (modify-phases %standard-phases
2240 (add-after 'install 'split
2241 (lambda* (#:key inputs outputs #:allow-other-keys)
2242 ;; Distribute the binaries to the various outputs.
2243 (let* ((out (assoc-ref outputs "out"))
2244 (jack (assoc-ref outputs "jack"))
2245 (jacklib (string-append jack "/lib/alsa-lib"))
2246 (pua (assoc-ref outputs "pulseaudio"))
2247 (pualib (string-append pua "/lib/alsa-lib")))
2248 ;; For jack.
2249 (mkdir-p jacklib)
2250 (for-each (lambda (file)
2251 (rename-file file (string-append jacklib "/" (basename file))))
2252 (find-files out ".*jack\\.(la|so)"))
2253 ;; For pulseaudio.
2254 (mkdir-p pualib)
2255 (for-each (lambda (file)
2256 (rename-file file (string-append pualib "/" (basename file))))
2257 (find-files out ".*pulse\\.(la|so)"))
2258 #t))))))
2259 (inputs
2260 `(("alsa-lib" ,alsa-lib)
2261 ("jack" ,jack-1)
2262 ("speex" ,speex) ; libspeexdsp resampling plugin
2263 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
2264 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
2265 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
2266 (native-inputs
2267 `(("pkg-config" ,pkg-config)))
2268 (home-page "http://www.alsa-project.org/")
2269 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
2270 (description
2271 "The Advanced Linux Sound Architecture (ALSA) provides audio and
2272 MIDI functionality to the Linux-based operating system. This package enhances ALSA
2273 by providing additional plugins which include: upmixing, downmixing, jackd and
2274 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
2275 external rate conversion.")
2276 (license (list license:gpl2+
2277 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
2278 license:lgpl2.1+))))
2279
2280 (define-public iptables
2281 (package
2282 (name "iptables")
2283 (version "1.8.7")
2284 (source
2285 (origin
2286 (method url-fetch)
2287 (uri (list (string-append "mirror://netfilter.org/iptables/iptables-"
2288 version ".tar.bz2")
2289 (string-append "https://www.netfilter.org/projects/iptables/"
2290 "files/iptables-" version ".tar.bz2")))
2291 (sha256
2292 (base32 "1w6qx3sxzkv80shk21f63rq41c84irpx68k62m2cv629n1mwj2f1"))))
2293 (build-system gnu-build-system)
2294 (native-inputs
2295 `(("pkg-config" ,pkg-config)
2296 ("flex" ,flex)
2297 ("bison" ,bison)))
2298 (inputs
2299 `(("libmnl" ,libmnl)
2300 ("libnftnl" ,libnftnl)))
2301 (arguments
2302 '(#:tests? #f ; no test suite
2303 #:configure-flags ; add $libdir to the RUNPATH of executables
2304 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
2305 (home-page "https://www.netfilter.org/projects/iptables/index.html")
2306 (synopsis "Programs to configure Linux IP packet filtering rules")
2307 (description
2308 "@command{iptables} is the user-space command line program used to
2309 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
2310 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
2311
2312 This package also includes @command{ip6tables}, which is used to configure the
2313 IPv6 packet filter.
2314
2315 Both commands are targeted at system administrators.")
2316 (license license:gpl2+)))
2317
2318 (define-public jitterentropy-rngd
2319 (package
2320 (name "jitterentropy-rngd")
2321 (version "1.2.0")
2322 (source
2323 (origin
2324 (method git-fetch)
2325 (uri (git-reference
2326 (url "https://github.com/smuellerDD/jitterentropy-rngd")
2327 (commit (string-append "v" version))))
2328 (file-name (git-file-name name version))
2329 (sha256
2330 (base32 "1fb8zfwhwkl1d8n4cdn7rdv5rwd75qgc00d36pmkl7wgnj3c9xda"))))
2331 (build-system gnu-build-system)
2332 (arguments
2333 `(#:tests? #f ; no test suite
2334 #:make-flags
2335 (list (string-append "CC=" ,(cc-for-target))
2336 (string-append "PREFIX=" (assoc-ref %outputs "out"))
2337 "UNITDIR=$(PREFIX)/lib/systemd/system")
2338 #:phases
2339 (modify-phases %standard-phases
2340 (delete 'configure)))) ; no ./configure script
2341 (home-page "https://www.chronox.de/jent.html")
2342 (synopsis "CPU jitter random number generator daemon")
2343 (description
2344 "This simple daemon feeds entropy from the CPU Jitter @acronym{RNG, random
2345 number generator} core to the kernel Linux's entropy estimator. This prevents
2346 the @file{/dev/random} device from blocking and should benefit users of the
2347 preferred @file{/dev/urandom} and @code{getrandom()} interfaces too.
2348
2349 The CPU Jitter RNG itself is part of the kernel and claims to provide good
2350 entropy by collecting and magnifying differences in CPU execution time as
2351 measured by the high-resolution timer built into modern CPUs. It requires no
2352 additional hardware or external entropy source.
2353
2354 The random bit stream generated by @command{jitterentropy-rngd} is not processed
2355 by a cryptographically secure whitening function. Nonetheless, its authors
2356 believe it to be a suitable source of cryptographically secure key material or
2357 other cryptographically sensitive data.
2358
2359 If you agree with them, start this daemon as early as possible to provide
2360 properly seeded random numbers to services like SSH or those using TLS during
2361 early boot when entropy may be low, especially in virtualised environments.")
2362 (license (list license:bsd-3 ; or
2363 license:gpl2+))))
2364
2365 (define-public lsscsi
2366 (package
2367 (name "lsscsi")
2368 (version "0.31")
2369 (source (origin
2370 (method url-fetch)
2371 (uri (string-append
2372 "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz"))
2373 (sha256
2374 (base32
2375 "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75"))))
2376 (build-system gnu-build-system)
2377 (synopsis "Lists information about SCSI or NVMe devices in Linux")
2378 (home-page "http://sg.danny.cz/scsi/lsscsi.html")
2379 (description
2380 "@command{lsscsi} lists SCSI logical units or SCSI targets. It can
2381 also list NVMe namespaces or controllers and show the relationship between a
2382 device's primary node name, its SCSI generic (sg) node name and its kernel
2383 name.")
2384 (license license:gpl2)))
2385
2386 (define-public ebtables
2387 (package
2388 (name "ebtables")
2389 (version "2.0.11")
2390 (source (origin
2391 (method url-fetch)
2392 (uri (string-append
2393 "mirror://netfilter.org/ebtables/ebtables-"
2394 version ".tar.gz"))
2395 (sha256
2396 (base32
2397 "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp"))))
2398 (build-system gnu-build-system)
2399 (inputs
2400 `(("perl" ,perl)
2401 ("iptables" ,iptables)))
2402 (synopsis "Ethernet bridge frame table administration")
2403 (home-page "https://ebtables.netfilter.org/")
2404 (description
2405 "ebtables is an application program used to set up and maintain the
2406 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
2407 analogous to the iptables application, but less complicated, due to the fact
2408 that the Ethernet protocol is much simpler than the IP protocol.")
2409 (license license:gpl2+)))
2410
2411 (define-public iproute
2412 (package
2413 (name "iproute2")
2414 (version "5.10.0")
2415 (source (origin
2416 (method url-fetch)
2417 (uri (string-append
2418 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
2419 version ".tar.xz"))
2420 (sha256
2421 (base32
2422 "1sakmhvh40gh4x55vzgy6cyvizqkhqalcfpvs6r0c14w62p38jm5"))))
2423 (build-system gnu-build-system)
2424 (arguments
2425 `( ;; There is a test suite, but it wants network namespaces and sudo.
2426 #:tests? #f
2427 #:make-flags (let ((out (assoc-ref %outputs "out")))
2428 (list "DESTDIR="
2429 (string-append "CC=" ,(cc-for-target))
2430 "HOSTCC=gcc"
2431 (string-append "BASH_COMPDIR=" out
2432 "/etc/bash_completion.d")
2433 (string-append "LIBDIR=" out "/lib")
2434 (string-append "HDRDIR=" out "/include")
2435 (string-append "SBINDIR=" out "/sbin")
2436 (string-append "CONFDIR=" out "/etc")
2437 (string-append "DOCDIR=" out "/share/doc/"
2438 ,name "-" ,version)
2439 (string-append "MANDIR=" out "/share/man")))
2440 #:phases (modify-phases %standard-phases
2441 (add-before 'install 'pre-install
2442 (lambda _
2443 ;; Don't attempt to create /var/lib/arpd.
2444 (substitute* "Makefile"
2445 (("^.*ARPDDIR.*$") ""))
2446 #t))
2447 (add-after 'unpack 'patch-configure
2448 (lambda _
2449 (let ((target ,(%current-target-system)))
2450 (substitute* "configure"
2451 (("pkg-config")
2452 (if target
2453 (string-append target "-pkg-config")
2454 "pkg-config")))
2455 #t))))))
2456 (inputs
2457 `(("db4" ,bdb)
2458 ("iptables" ,iptables)
2459 ("libmnl" ,libmnl)))
2460 (native-inputs
2461 `(("bison" ,bison)
2462 ("flex" ,flex)
2463 ("pkg-config" ,pkg-config)))
2464 ;; For tests.
2465 ;; ("libmnl" ,libmnl)
2466 ;; ("util-linux" ,util-linux)
2467 (home-page
2468 "https://wiki.linuxfoundation.org/networking/iproute2")
2469 (synopsis
2470 "Utilities for controlling TCP/IP networking and traffic in Linux")
2471 (description
2472 "Iproute2 is a collection of utilities for controlling TCP/IP networking
2473 and traffic with the Linux kernel. The most important of these are
2474 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
2475 control.
2476
2477 Most network configuration manuals still refer to ifconfig and route as the
2478 primary network configuration tools, but ifconfig is known to behave
2479 inadequately in modern network environments, and both should be deprecated.")
2480 (license license:gpl2+)))
2481
2482 (define-public net-tools
2483 ;; XXX: This package is basically unmaintained, but it provides a few
2484 ;; commands not yet provided by Inetutils, such as 'route', so we have to
2485 ;; live with it.
2486 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
2487 (revision "0"))
2488 (package
2489 (name "net-tools")
2490 (version (string-append "1.60-" revision "." (string-take commit 7)))
2491 (source (origin
2492 (method url-fetch)
2493 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
2494 "n/ne/net-tools/code.git/net-tools-code-"
2495 commit ".zip"))
2496 (file-name (string-append name "-" version ".zip"))
2497 (sha256
2498 (base32
2499 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
2500 (home-page "http://net-tools.sourceforge.net/")
2501 (build-system gnu-build-system)
2502 (arguments
2503 `(#:modules ((guix build gnu-build-system)
2504 (guix build utils)
2505 (srfi srfi-1)
2506 (srfi srfi-26))
2507 #:phases
2508 (modify-phases %standard-phases
2509 (replace 'configure
2510 (lambda* (#:key outputs #:allow-other-keys)
2511 (let ((out (assoc-ref outputs "out")))
2512 (mkdir-p (string-append out "/bin"))
2513 (mkdir-p (string-append out "/sbin"))
2514
2515 ;; Pretend we have everything...
2516 (system "yes | make config")
2517
2518 ;; ... except for the things we don't have.
2519 ;; HAVE_AFDECnet requires libdnet, which we don't have.
2520 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
2521 ;; that have been removed.
2522 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
2523 ;; think about adding them later.
2524 (substitute* '("config.make" "config.h")
2525 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
2526 ""))
2527 #t)))
2528 (add-after 'install 'remove-redundant-commands
2529 (lambda* (#:key outputs #:allow-other-keys)
2530 ;; Remove commands and man pages redundant with Inetutils.
2531 (let* ((out (assoc-ref outputs "out"))
2532 (dup (append-map (cut find-files out <>)
2533 '("^hostname"
2534 "^(yp|nis|dns)?domainname"))))
2535 (for-each delete-file dup)
2536 #t))))
2537 ;; Binaries that depend on libnet-tools.a don't declare that
2538 ;; dependency, making it parallel-unsafe.
2539 #:parallel-build? #f
2540
2541 #:tests? #f ; no test suite
2542 #:make-flags (let ((out (assoc-ref %outputs "out")))
2543 (list ,(string-append "CC=" (cc-for-target))
2544 (string-append "BASEDIR=" out)
2545 (string-append "INSTALLNLSDIR=" out "/share/locale")
2546 (string-append "mandir=/share/man")))))
2547 (native-inputs `(("gettext" ,gettext-minimal)
2548 ("unzip" ,unzip)))
2549 (supported-systems (delete "i586-gnu" %supported-systems))
2550 (synopsis "Tools for controlling the network subsystem in Linux")
2551 (description
2552 "This package includes the important tools for controlling the network
2553 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
2554 route. Additionally, this package contains utilities relating to particular
2555 network hardware types (plipconfig, slattach) and advanced aspects of IP
2556 configuration (iptunnel, ipmaddr).")
2557 (license license:gpl2+))))
2558
2559 (define-public libcap-2.31
2560 (package
2561 (name "libcap")
2562 (version "2.31")
2563 (source (origin
2564 (method url-fetch)
2565 (uri (string-append
2566 "mirror://kernel.org/linux/libs/security/linux-privs/"
2567 "libcap2/libcap-" version ".tar.xz"))
2568 (sha256
2569 (base32
2570 "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266"))))
2571 (build-system gnu-build-system)
2572 (arguments '(#:phases
2573 (modify-phases %standard-phases
2574 (replace 'configure
2575 ;; Add $libdir to the RUNPATH of executables.
2576 (lambda _
2577 (substitute* "Make.Rules"
2578 (("LDFLAGS := #-g")
2579 (string-append "LDFLAGS := -Wl,-rpath="
2580 %output "/lib")))
2581 #t)))
2582 #:test-target "test"
2583 #:make-flags (list "lib=lib"
2584 (string-append "prefix="
2585 (assoc-ref %outputs "out"))
2586 "RAISE_SETFCAP=no")))
2587 (native-inputs `(("perl" ,perl)))
2588 (supported-systems (delete "i586-gnu" %supported-systems))
2589 (home-page "https://sites.google.com/site/fullycapable/")
2590 (synopsis "Library for working with POSIX capabilities")
2591 (description
2592 "Libcap2 provides a programming interface to POSIX capabilities on
2593 Linux-based operating systems.")
2594
2595 ;; License is BSD-3 or GPLv2, at the user's choice.
2596 (license license:gpl2)))
2597
2598 ;; libcap 2.31 has problems with newer kernels, so provide this newer variant.
2599 ;; Keep the old libcap around to avoid rebuilding 'coreutils' and 'avahi'.
2600 ;; To be merged with libcap on the next rebuild cycle.
2601 (define-public libcap
2602 (package
2603 (inherit libcap-2.31)
2604 (version "2.45")
2605 (source (origin
2606 (method url-fetch)
2607 (uri (string-append
2608 "mirror://kernel.org/linux/libs/security/linux-privs/"
2609 "libcap2/libcap-" version ".tar.xz"))
2610 (sha256
2611 (base32
2612 "11ijmi7jik9iw6pdszc6bylhggghr8cza03bcrbhbqf0cpvkjrnn"))))
2613 (arguments
2614 (substitute-keyword-arguments (package-arguments libcap-2.31)
2615 ((#:phases phases)
2616 `(modify-phases ,phases
2617 (replace 'configure
2618 (lambda _
2619 ;; Add $libdir to the RUNPATH of executables.
2620 (substitute* "Make.Rules"
2621 (("LDFLAGS \\?= #-g")
2622 (string-append "LDFLAGS ?= -Wl,-rpath="
2623 %output "/lib")))
2624 #t))))))))
2625
2626 (define-deprecated libcap/next libcap)
2627 (export libcap/next)
2628
2629 (define-public bridge-utils
2630 (package
2631 (name "bridge-utils")
2632 (version "1.7")
2633 (source
2634 (origin
2635 (method url-fetch)
2636 (uri (string-append "mirror://kernel.org/linux/kernel/people/shemminger/"
2637 "bridge-utils/bridge-utils-" version ".tar.xz"))
2638 (sha256
2639 (base32 "0zlrigizac2nfwgvksm92v4wafrpgxlbci3gwimc795ib7k8g6ck"))))
2640 (build-system gnu-build-system)
2641
2642 ;; The tarball lacks all the generated files.
2643 (native-inputs `(("autoconf" ,autoconf)
2644 ("automake" ,automake)))
2645 (arguments
2646 '(#:phases
2647 (modify-phases %standard-phases
2648 (add-before 'bootstrap 'patch-stuff
2649 (lambda _
2650 ;; Fix "field ‘ip6’ has incomplete type" errors.
2651 (substitute* "libbridge/libbridge.h"
2652 (("#include <linux/if_bridge.h>")
2653 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
2654
2655 ;; Ensure that the entire build fails if one of the
2656 ;; sub-Makefiles fails.
2657 (substitute* "Makefile.in"
2658 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
2659 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
2660
2661 #t)))
2662 #:tests? #f)) ; no 'check' target
2663
2664 (home-page "https://wiki.linuxfoundation.org/networking/bridge")
2665 (synopsis "Manipulate Ethernet bridges")
2666 (description
2667 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
2668 to connect two Ethernet segments together in a protocol independent way.
2669 Packets are forwarded based on Ethernet address, rather than IP address (like
2670 a router). Since forwarding is done at Layer 2, all protocols can go
2671 transparently through a bridge.")
2672 (license license:gpl2+)))
2673
2674 (define-public libnl
2675 (package
2676 (name "libnl")
2677 (version "3.5.0")
2678 (source (origin
2679 (method url-fetch)
2680 (uri (string-append
2681 "https://github.com/thom311/libnl/releases/download/"
2682 "libnl" (string-join (string-split version #\.) "_")
2683 "/libnl-" version ".tar.gz"))
2684 (sha256
2685 (base32
2686 "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m"))))
2687 (build-system gnu-build-system)
2688 (native-inputs
2689 `(("bison" ,bison)
2690 ("flex" ,flex)
2691 ("pkg-config" ,pkg-config)
2692 ("swig" ,swig)
2693 ("libnl3-doc"
2694 ,(origin
2695 (method url-fetch)
2696 (uri (string-append
2697 "https://github.com/thom311/libnl/releases/download/libnl"
2698 (string-join (string-split version #\.) "_")
2699 "/libnl-doc-" version ".tar.gz"))
2700 (sha256
2701 (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h"))))))
2702 (outputs `("out" "doc"))
2703 (arguments
2704 `(#:phases
2705 (modify-phases %standard-phases
2706 (add-after 'install 'install-doc
2707 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
2708 (let ((dest (string-append (assoc-ref outputs "doc")
2709 "/share/doc/libnl")))
2710 (mkdir-p dest)
2711 (invoke "tar" "xf" (assoc-ref
2712 (or native-inputs inputs)
2713 "libnl3-doc")
2714 "--strip-components=1" "-C" dest)))))))
2715 (home-page "https://www.infradead.org/~tgr/libnl/")
2716 (synopsis "NetLink protocol library suite")
2717 (description
2718 "The libnl suite is a collection of libraries providing APIs to netlink
2719 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
2720 between the kernel and user space processes. It was designed to be a more
2721 flexible successor to ioctl to provide mainly networking related kernel
2722 configuration and monitoring interfaces.")
2723
2724 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
2725 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
2726 (license license:gpl2)))
2727
2728 ;; libnl python extensions used to be outputs of libnl. However, as
2729 ;; cross-compiling python extensions is currently broken, create separate
2730 ;; packages for libnl python extensions.
2731 (define (libnl-python-package python)
2732 (let ((name (string-append "libnl-" python)))
2733 (package
2734 (inherit libnl)
2735 (name name)
2736 (inputs `(,@(cond
2737 ((string=? python "python2")
2738 `(("python-2" ,python-2)))
2739 ((string=? python "python3")
2740 `(("python-3" ,python-3))))))
2741 (propagated-inputs `(("libnl" ,libnl)))
2742 (outputs '("out"))
2743 (arguments
2744 `(#:modules ((guix build gnu-build-system)
2745 (guix build utils)
2746 (srfi srfi-1))
2747 #:phases
2748 (modify-phases %standard-phases
2749 (replace 'install
2750 (lambda* (#:key inputs outputs #:allow-other-keys)
2751 (define (python-inst python)
2752 (invoke python "setup.py" "build")
2753 (invoke python "setup.py" "install"
2754 (string-append "--prefix="
2755 (assoc-ref %outputs "out")))
2756 (invoke python "setup.py" "clean"))
2757 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
2758 (assoc-ref inputs "libnl")))
2759 (with-directory-excursion "./python" (python-inst ,python))
2760 #t))))))))
2761
2762 (define-public libnl-python2 (libnl-python-package "python2"))
2763 (define-public libnl-python3 (libnl-python-package "python3"))
2764
2765 (define-public iw
2766 (package
2767 (name "iw")
2768 (version "4.14")
2769 (source (origin
2770 (method url-fetch)
2771 (uri (string-append
2772 "mirror://kernel.org/software/network/iw/iw-"
2773 version ".tar.xz"))
2774 (sha256
2775 (base32
2776 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
2777 (build-system gnu-build-system)
2778 (native-inputs `(("pkg-config" ,pkg-config)))
2779 (inputs `(("libnl" ,libnl)))
2780 (arguments
2781 `(#:make-flags
2782 (let* ((target ,(%current-target-system))
2783 (pkg-config (if target
2784 (string-append target "-pkg-config")
2785 "pkg-config")))
2786 (list
2787 ,(string-append "CC=" (cc-for-target))
2788 (string-append "PKG_CONFIG="
2789 (assoc-ref %build-inputs "pkg-config")
2790 "/bin/" pkg-config)
2791 (string-append "PREFIX=" (assoc-ref %outputs "out"))))
2792 #:phases (modify-phases %standard-phases (delete 'configure))))
2793 (home-page "https://wireless.wiki.kernel.org/")
2794 (synopsis "Tool for configuring wireless devices")
2795 (description
2796 "iw is a new nl80211 based CLI configuration utility for wireless
2797 devices. It replaces @code{iwconfig}, which is deprecated.")
2798 (license license:isc)))
2799
2800 (define-public powertop
2801 (package
2802 (name "powertop")
2803 (version "2.13")
2804 (source
2805 (origin
2806 (method url-fetch)
2807 (uri (string-append "https://01.org/sites/default/files/downloads/"
2808 "powertop-" version ".tar.gz"))
2809 (sha256
2810 (base32 "0y1ixw8v17fdb1ima0zshrd0rh4zxdh10r93nrrvq6d4lhn9jpx6"))))
2811 (build-system gnu-build-system)
2812 (arguments
2813 '(#:phases
2814 (modify-phases %standard-phases
2815 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2816 ;; allow calibrating the network interface in Guix System.
2817 (add-after 'unpack 'patch-absolute-file-names
2818 (lambda* (#:key inputs #:allow-other-keys)
2819 (let ((kmod (assoc-ref inputs "kmod")))
2820 (substitute* (find-files "src" "\\.cpp$")
2821 ;; Give the right 'modprobe' file name so that essential
2822 ;; modules such as msr.ko can be loaded.
2823 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2824 ;; These programs are only needed to calibrate, so using
2825 ;; relative file names avoids adding extra inputs. When they
2826 ;; are missing powertop gracefully handles it.
2827 (("/usr/bin/hcitool") "hcitool")
2828 (("/usr/bin/xset") "xset")
2829 (("/usr/sbin/hciconfig") "hciconfig"))
2830 #t))))))
2831 (inputs
2832 `(("kmod" ,kmod)
2833 ("libnl" ,libnl)
2834 ("ncurses" ,ncurses)
2835 ("pciutils" ,pciutils)
2836 ("zlib" ,zlib)))
2837 (native-inputs
2838 `(("pkg-config" ,pkg-config)))
2839 (home-page "https://01.org/powertop/")
2840 (synopsis "Analyze power consumption on Intel-based laptops")
2841 (description
2842 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2843 power management. In addition to being a diagnostic tool, PowerTOP also has
2844 an interactive mode where the user can experiment various power management
2845 settings for cases where the operating system has not enabled these
2846 settings.")
2847 (license license:gpl2)))
2848
2849 (define-public aumix
2850 (package
2851 (name "aumix")
2852 (version "2.9.1")
2853 (source (origin
2854 (method url-fetch)
2855 (uri (string-append
2856 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2857 version ".tar.bz2"))
2858 (sha256
2859 (base32
2860 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2861 (build-system gnu-build-system)
2862 (inputs `(("ncurses" ,ncurses)))
2863 (home-page "http://www.jpj.net/~trevor/aumix.html")
2864 (synopsis "Audio mixer for X and the console")
2865 (description
2866 "Aumix adjusts an audio mixer from X, the console, a terminal,
2867 the command line or a script.")
2868 (license license:gpl2+)))
2869
2870 (define-public iotop
2871 (package
2872 (name "iotop")
2873 (version "0.6")
2874 (source
2875 (origin
2876 (method url-fetch)
2877 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2878 version ".tar.gz"))
2879 (sha256 (base32
2880 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2881 (build-system python-build-system)
2882 (arguments
2883 '(#:phases
2884 (modify-phases %standard-phases
2885 (add-after 'unpack 'fix-build-with-python3
2886 (lambda _
2887 (substitute* "setup.py"
2888 (("itervalues") "values"))
2889 #t)))
2890 ;; There are currently no checks in the package.
2891 #:tests? #f))
2892 (native-inputs `(("python" ,python)))
2893 (home-page "http://guichaz.free.fr/iotop/")
2894 (synopsis
2895 "Displays the IO activity of running processes")
2896 (description
2897 "Iotop is a Python program with a top like user interface to show the
2898 processes currently causing I/O.")
2899 (license license:gpl2+)))
2900
2901 (define-public fuse
2902 (package
2903 (name "fuse")
2904 (version "2.9.9")
2905 (source (origin
2906 (method url-fetch)
2907 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2908 "download/fuse-" version
2909 "/fuse-" version ".tar.gz"))
2910 (sha256
2911 (base32
2912 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
2913 (patches (search-patches "fuse-overlapping-headers.patch"))))
2914 (build-system gnu-build-system)
2915 (inputs `(("util-linux" ,util-linux)))
2916 (arguments
2917 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2918 (assoc-ref %outputs "out")
2919 "/sbin")
2920 (string-append "INIT_D_PATH="
2921 (assoc-ref %outputs "out")
2922 "/etc/init.d")
2923
2924 ;; The rule makes /dev/fuse 666.
2925 (string-append "UDEV_RULES_PATH="
2926 (assoc-ref %outputs "out")
2927 "/lib/udev/rules.d"))
2928 #:phases
2929 (modify-phases %standard-phases
2930 (add-before 'build 'set-file-names
2931 (lambda* (#:key inputs #:allow-other-keys)
2932 ;; libfuse calls out to mount(8) and umount(8). Make sure
2933 ;; it refers to the right ones.
2934 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2935 (("/bin/(u?)mount" _ maybe-u)
2936 (string-append (assoc-ref inputs "util-linux")
2937 "/bin/" maybe-u "mount")))
2938 (substitute* '("util/mount.fuse.c")
2939 (("/bin/sh")
2940 (which "sh")))
2941
2942 ;; This hack leads libfuse to search for 'fusermount' in
2943 ;; $PATH, where it may find a setuid-root binary, instead of
2944 ;; trying solely $out/sbin/fusermount and failing because
2945 ;; it's not setuid.
2946 (substitute* "lib/Makefile"
2947 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2948 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2949 #t)))))
2950 (supported-systems (delete "i586-gnu" %supported-systems))
2951 (home-page "https://github.com/libfuse/libfuse")
2952 (synopsis "Support file systems implemented in user space")
2953 (description
2954 "As a consequence of its monolithic design, file system code for Linux
2955 normally goes into the kernel itself---which is not only a robustness issue,
2956 but also an impediment to system extensibility. FUSE, for \"file systems in
2957 user space\", is a kernel module and user-space library that tries to address
2958 part of this problem by allowing users to run file system implementations as
2959 user-space processes.")
2960 (license (list license:lgpl2.1 ;library
2961 license:gpl2+)))) ;command-line utilities
2962
2963 (define-public unionfs-fuse
2964 (package
2965 (name "unionfs-fuse")
2966 (version "2.1")
2967 (source (origin
2968 (method git-fetch)
2969 (uri (git-reference
2970 (url "https://github.com/rpodgorny/unionfs-fuse")
2971 (commit (string-append "v" version))))
2972 (file-name (git-file-name name version))
2973 (sha256
2974 (base32
2975 "0bwx70x834qgqh53vqp18bhbxbsny80hz922rbgj8k9wj7cbfilm"))))
2976 (build-system cmake-build-system)
2977 (native-inputs
2978 `(("python" ,python)))
2979 (inputs `(("fuse" ,fuse)))
2980 (arguments
2981 ;; The tests were never actually run ("collected 0 items"), but in recent
2982 ;; versions of pytest that causes an error.
2983 '(#:tests? #f))
2984 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2985 (synopsis "User-space union file system")
2986 (description
2987 "UnionFS-FUSE is a flexible union file system implementation in user
2988 space, using the FUSE library. Mounting a union file system allows you to
2989 \"aggregate\" the contents of several directories into a single mount point.
2990 UnionFS-FUSE additionally supports copy-on-write.")
2991 (license license:bsd-3)))
2992
2993 (define fuse-static
2994 (package (inherit fuse)
2995 (name "fuse-static")
2996 (source (origin (inherit (package-source fuse))
2997 (modules '((guix build utils)))
2998 (snippet
2999 '(begin
3000 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
3001 ;; updated. Change calls to 'mtab_needs_update' to 0 so
3002 ;; that it doesn't do that, allowing us to remove the
3003 ;; dependency on util-linux (something that is useful in
3004 ;; initrds.)
3005 (substitute* '("lib/mount_util.c"
3006 "util/mount_util.c")
3007 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
3008 "0")
3009 (("/bin/")
3010 ""))
3011 #t))))))
3012
3013 (define-public unionfs-fuse/static
3014 (package (inherit unionfs-fuse)
3015 (synopsis "User-space union file system (statically linked)")
3016 (name (string-append (package-name unionfs-fuse) "-static"))
3017 (source (origin (inherit (package-source unionfs-fuse))
3018 (modules '((guix build utils)))
3019 (snippet
3020 '(begin
3021 ;; Add -ldl to the libraries, because libfuse.a needs that.
3022 (substitute* "src/CMakeLists.txt"
3023 (("target_link_libraries(.*)\\)" _ libs)
3024 (string-append "target_link_libraries"
3025 libs " dl)")))
3026 #t))))
3027 (arguments
3028 '(#:tests? #f
3029 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
3030 #:phases
3031 (modify-phases %standard-phases
3032 (add-after 'install 'post-install
3033 (lambda* (#:key outputs #:allow-other-keys)
3034 (let* ((out (assoc-ref outputs "out"))
3035 (exe (string-append out "/bin/unionfs")))
3036 ;; By default, 'unionfs' keeps references to
3037 ;; $glibc/share/locale and similar stuff. Remove them.
3038 (remove-store-references exe)
3039
3040 ;; 'unionfsctl' has references to glibc as well. Since
3041 ;; we don't need it, remove it.
3042 (delete-file (string-append out "/bin/unionfsctl"))
3043 #t))))))
3044 (inputs `(("fuse" ,fuse-static)))))
3045
3046 (define-public sshfs
3047 (package
3048 (name "sshfs")
3049 (version "2.10")
3050 (source (origin
3051 (method url-fetch)
3052 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
3053 "download/sshfs-" version "/sshfs-" version
3054 ".tar.gz"))
3055 (sha256
3056 (base32
3057 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
3058 (build-system gnu-build-system)
3059 (inputs
3060 `(("fuse" ,fuse)
3061 ("glib" ,glib)))
3062 (native-inputs
3063 `(("pkg-config" ,pkg-config)))
3064 (home-page "https://github.com/libfuse/sshfs")
3065 (synopsis "Mount remote file systems over SSH")
3066 (description
3067 "This is a file system client based on the SSH File Transfer Protocol.
3068 Since most SSH servers already support this protocol it is very easy to set
3069 up: on the server side there's nothing to do; on the client side mounting the
3070 file system is as easy as logging into the server with an SSH client.")
3071 (license license:gpl2+)))
3072
3073 (define-public sshfs-fuse
3074 (package (inherit sshfs)
3075 (name "sshfs-fuse")
3076 (properties `((superseded . ,sshfs)))))
3077
3078 (define-public archivemount
3079 (package
3080 (name "archivemount")
3081 (version "0.9.1")
3082 (source
3083 (origin
3084 (method url-fetch)
3085 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
3086 "archivemount-" version ".tar.gz"))
3087 (sha256
3088 (base32 "1cy5b6qril9c3ry6fv7ir87s8iyy5vxxmbyx90dm86fbra0vjaf5"))))
3089 (build-system gnu-build-system)
3090 (inputs `(("fuse" ,fuse)
3091 ("libarchive" ,libarchive)))
3092 (native-inputs `(("pkg-config" ,pkg-config)))
3093 (home-page "https://www.cybernoia.de/software/archivemount.html")
3094 (synopsis "Tool for mounting archive files with FUSE")
3095 (description "archivemount is a FUSE-based file system for Unix variants,
3096 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
3097 mount point where it can be read from or written to as with any other file
3098 system. This makes accessing the contents of the archive, which may be
3099 compressed, transparent to other programs, without decompressing them.")
3100 (license license:lgpl2.0+)))
3101
3102 (define-public numactl
3103 (package
3104 (name "numactl")
3105 (version "2.0.14")
3106 (source (origin
3107 (method url-fetch)
3108 (uri (string-append
3109 "https://github.com/numactl/numactl/releases/download/v"
3110 version "/numactl-" version ".tar.gz"))
3111 (sha256
3112 (base32
3113 "1xngddsph43bxljywahi9d44fxr022slsap4hh91w8xnq54d2sw2"))))
3114 (build-system gnu-build-system)
3115 (arguments
3116 '(;; There's a 'test' target, but it requires NUMA support in the kernel
3117 ;; to run, which we can't assume to have.
3118 #:tests? #f))
3119
3120 ;; NUMA is apparently not supported on armhf, see
3121 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
3122 (supported-systems (delete "armhf-linux" %supported-systems))
3123 (home-page "https://github.com/numactl/numactl")
3124 (synopsis "Tools for non-uniform memory access (NUMA) machines")
3125 (description
3126 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
3127 memory is not all in one place. The @command{numactl} program allows you to
3128 run your application program on specific CPUs and memory nodes. It does this
3129 by supplying a NUMA memory policy to the operating system before running your
3130 program.
3131
3132 The package contains other commands, such as @command{numastat},
3133 @command{memhog}, and @command{numademo} which provides a quick overview of
3134 NUMA performance on your system.")
3135 (license (list license:gpl2 ;programs
3136 license:lgpl2.1)))) ;library
3137
3138 (define-public kbd-neo
3139 (package
3140 (name "kbd-neo")
3141 (version "2486")
3142 (source
3143 (origin
3144 (method url-fetch)
3145 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
3146 version "/linux/console/neo.map"))
3147 (file-name (string-append name "-" version ".map"))
3148 (sha256
3149 (base32
3150 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
3151 (build-system trivial-build-system)
3152 (arguments
3153 `(#:modules ((guix build utils))
3154 #:builder (begin
3155 (use-modules (guix build utils))
3156 (let ((out (string-append %output "/share/keymaps"))
3157 (source (assoc-ref %build-inputs "source")))
3158 (mkdir-p out)
3159 (copy-file source (string-append out "/neo.map"))
3160 #t))))
3161 (home-page "https://neo-layout.org")
3162 (synopsis "Neo2 console layout")
3163 (description
3164 "Kbd-neo provides the Neo2 keyboard layout for use with
3165 @command{loadkeys(1)} from @code{kbd(4)}.")
3166 ;; The file is located in an svn directory, the entire content of
3167 ;; the directory is licensed as GPL3.
3168 (license license:gpl3+)))
3169
3170 (define-public kbd
3171 (package
3172 (name "kbd")
3173 (version "2.0.4")
3174 (source (origin
3175 (method url-fetch)
3176 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
3177 version ".tar.xz"))
3178 (sha256
3179 (base32
3180 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
3181 (modules '((guix build utils)))
3182 (snippet
3183 '(begin
3184 (substitute* "tests/Makefile.in"
3185 ;; The '%: %.in' rule incorrectly uses @VERSION@.
3186 (("@VERSION@")
3187 "[@]VERSION[@]"))
3188 (substitute* '("src/unicode_start" "src/unicode_stop")
3189 ;; Assume the Coreutils are in $PATH.
3190 (("/usr/bin/tty")
3191 "tty"))
3192 #t))))
3193 (build-system gnu-build-system)
3194 (arguments
3195 '(#:phases
3196 (modify-phases %standard-phases
3197 (add-before 'build 'pre-build
3198 (lambda* (#:key inputs #:allow-other-keys)
3199 (let ((gzip (assoc-ref %build-inputs "gzip"))
3200 (bzip2 (assoc-ref %build-inputs "bzip2")))
3201 (substitute* "src/libkeymap/findfile.c"
3202 (("gzip")
3203 (string-append gzip "/bin/gzip"))
3204 (("bzip2")
3205 (string-append bzip2 "/bin/bzip2")))
3206 #t)))
3207 (add-after 'install 'post-install
3208 (lambda* (#:key outputs #:allow-other-keys)
3209 ;; Make sure these programs find their comrades.
3210 (let* ((out (assoc-ref outputs "out"))
3211 (bin (string-append out "/bin")))
3212 (for-each (lambda (prog)
3213 (wrap-program (string-append bin "/" prog)
3214 `("PATH" ":" prefix (,bin))))
3215 '("unicode_start" "unicode_stop"))
3216 #t))))))
3217 (inputs `(("check" ,check)
3218 ("gzip" ,gzip)
3219 ("bzip2" ,bzip2)
3220 ("pam" ,linux-pam)))
3221 (native-search-paths
3222 (list (search-path-specification
3223 (variable "LOADKEYS_KEYMAP_PATH")
3224 ;; Append ‘/**’ to recursively search all directories. One can then
3225 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
3226 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
3227 (files (list "share/keymaps/**")))))
3228 (native-inputs `(("pkg-config" ,pkg-config)))
3229 (home-page "http://kbd-project.org/")
3230 (synopsis "Linux keyboard utilities and keyboard maps")
3231 (description
3232 "This package contains keytable files and keyboard utilities compatible
3233 for systems using the Linux kernel. This includes commands such as
3234 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3235 (license license:gpl2+)))
3236
3237 (define-public loadkeys-static
3238 (package
3239 (inherit kbd)
3240 (name "loadkeys-static")
3241 (arguments
3242 (substitute-keyword-arguments (package-arguments kbd)
3243 ((#:configure-flags flags ''())
3244 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
3245 "--disable-vlock" ;so we don't need libpam
3246 "--disable-libkeymap")
3247 ,flags))
3248 ((#:make-flags flags ''())
3249 `(cons "LDFLAGS=-all-static" ,flags))
3250 ((#:phases phases '%standard-phases)
3251 `(modify-phases ,phases
3252 (replace 'install
3253 (lambda* (#:key outputs #:allow-other-keys)
3254 (let ((out (assoc-ref outputs "out")))
3255 ;; The binary keeps references to gzip, among other things,
3256 ;; which we don't need in the initrd, so strip references.
3257 (remove-store-references "src/loadkeys")
3258
3259 (install-file "src/loadkeys"
3260 (string-append out "/bin"))
3261 #t)))
3262 (delete 'post-install)))
3263 ((#:strip-flags _ '())
3264 ''("--strip-all"))
3265 ((#:allowed-references _ '())
3266 '())))
3267
3268 (synopsis "Statically-linked @command{loadkeys} program")
3269
3270 ;; This package is meant to be used internally in the initrd so don't
3271 ;; expose it.
3272 (properties '((hidden? . #t)))))
3273
3274 (define-public inotify-tools
3275 (package
3276 (name "inotify-tools")
3277 (version "3.20.11.0")
3278 (source (origin
3279 (method git-fetch)
3280 (uri (git-reference
3281 (url "https://github.com/rvoicilas/inotify-tools")
3282 (commit version)))
3283 (file-name (git-file-name name version))
3284 (sha256
3285 (base32
3286 "1m8avqccrhm38krlhp88a7v949f3hrzx060bbrr5dp5qw2nmw9j2"))))
3287 (build-system gnu-build-system)
3288 (native-inputs
3289 `(("autoconf" ,autoconf)
3290 ("automake" ,automake)
3291 ("libtool" ,libtool)))
3292 (arguments
3293 `(#:configure-flags
3294 (list "--disable-static")))
3295 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
3296 (synopsis "Monitor file accesses")
3297 (description
3298 "The inotify-tools packages provides a C library and command-line tools
3299 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3300 (license license:gpl2+)))
3301
3302 (define-public kmod
3303 (package
3304 (name "kmod")
3305 (version "27")
3306 (source (origin
3307 (method url-fetch)
3308 (uri
3309 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
3310 "kmod-" version ".tar.xz"))
3311 (sha256
3312 (base32
3313 "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1"))
3314 (patches (search-patches "kmod-module-directory.patch"))))
3315 (build-system gnu-build-system)
3316 (native-inputs
3317 `(("pkg-config" ,pkg-config)))
3318 (inputs
3319 `(("xz" ,xz)
3320 ("zlib" ,zlib)))
3321 (arguments
3322 `(#:configure-flags '("--with-xz" "--with-zlib"
3323 "--disable-test-modules")
3324 #:phases
3325 (modify-phases %standard-phases
3326 (add-after 'unpack 'disable-tests
3327 (lambda _
3328 ;; XXX: These tests need '--sysconfdir=/etc' to pass.
3329 (substitute* "Makefile.in"
3330 (("testsuite/test-modprobe") "")
3331 (("testsuite/test-depmod") "")
3332 (("testsuite/test-blacklist") ""))
3333 #t))
3334 (add-after 'install 'install-modprobe&co
3335 (lambda* (#:key outputs #:allow-other-keys)
3336 (let* ((out (assoc-ref outputs "out"))
3337 (bin (string-append out "/bin")))
3338 (for-each (lambda (tool)
3339 (symlink "kmod"
3340 (string-append bin "/" tool)))
3341 '("insmod" "rmmod" "lsmod" "modprobe"
3342 "modinfo" "depmod"))
3343 #t))))))
3344 (supported-systems (delete "i586-gnu" %supported-systems))
3345 (home-page "https://www.kernel.org/")
3346 (synopsis "Kernel module tools")
3347 (description "Kmod is a set of tools to handle common tasks with Linux
3348 kernel modules like insert, remove, list, check properties, resolve
3349 dependencies and aliases.
3350
3351 These tools are designed on top of libkmod, a library that is shipped with
3352 kmod. The aim is to be compatible with tools, configurations and indices
3353 from the module-init-tools project.")
3354 (license license:gpl2+))) ; library under lgpl2.1+
3355
3356 (define-public earlyoom
3357 (package
3358 (name "earlyoom")
3359 (version "1.6.2")
3360 (source (origin
3361 (method git-fetch)
3362 (uri (git-reference
3363 (url "https://github.com/rfjakob/earlyoom")
3364 (commit (string-append "v" version))))
3365 (file-name (git-file-name name version))
3366 (sha256
3367 (base32
3368 "16iyn51xlrsbshc7p5xl2338yyfzknaqc538sa7mamgccqwgyvvq"))))
3369 (build-system gnu-build-system)
3370 (arguments
3371 `(#:phases
3372 (modify-phases %standard-phases
3373 (delete 'configure) ; no configure script
3374 (add-before 'check 'set-go-HOME
3375 (lambda _
3376 (setenv "HOME" (getcwd))
3377 #t))
3378 (add-before 'check 'disable-failing-test
3379 (lambda _
3380 ;; This test relies on writing to /proc/%d/oom_score_adj.
3381 (substitute* "testsuite_cli_test.go"
3382 (("TestI" match)
3383 (string-append "skipped" match)))
3384 #t)))
3385 #:make-flags (let* ((prefix (assoc-ref %outputs "out")))
3386 (list ,(string-append "CC=" (cc-for-target))
3387 (string-append "VERSION=v" ,version)
3388 (string-append "PREFIX=" prefix)
3389 (string-append "SYSCONFDIR=" prefix "/etc")))
3390 #:test-target "test"))
3391 (native-inputs `(("go" ,go) ;for the test suite
3392 ("pandoc" ,pandoc))) ;to generate the manpage
3393 (home-page "https://github.com/rfjakob/earlyoom")
3394 (synopsis "Simple out of memory (OOM) daemon for the Linux kernel")
3395 (description "Early OOM is a minimalist out of memory (OOM) daemon that
3396 runs in user space and provides a more responsive and configurable alternative
3397 to the in-kernel OOM killer.")
3398 (license license:expat)))
3399
3400 (define-public eudev
3401 ;; The post-systemd fork, maintained by Gentoo.
3402 (package
3403 (name "eudev")
3404 (version "3.2.9")
3405 (source (origin
3406 (method git-fetch)
3407 (uri (git-reference (url "https://github.com/gentoo/eudev")
3408 (commit (string-append "v" version))))
3409 (file-name (git-file-name name version))
3410 (sha256
3411 (base32
3412 "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7"))
3413 (patches (search-patches "eudev-rules-directory.patch"))))
3414 (build-system gnu-build-system)
3415 (arguments
3416 `(#:phases
3417 (modify-phases %standard-phases
3418 (add-after 'unpack 'make-source-writable
3419 (lambda _
3420 ;; XXX: Git checkouts are read-only, but this package needs to
3421 ;; modify some of its files.
3422 (for-each make-file-writable (find-files "."))
3423 #t))
3424 (add-before 'bootstrap 'patch-file-names
3425 (lambda* (#:key inputs native-inputs #:allow-other-keys)
3426 (substitute* "man/make.sh"
3427 (("/usr/bin/xsltproc")
3428 (string-append (assoc-ref
3429 (or native-inputs inputs) "xsltproc")
3430 "/bin/xsltproc")))
3431 #t))
3432 (add-before 'configure 'patch-bindir-in-btrfs-rules
3433 (lambda* (#:key outputs #:allow-other-keys)
3434 ;; The "@bindir@" substitution incorrectly expands to a literal
3435 ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work
3436 ;; around it.
3437 (let ((out (assoc-ref outputs "out")))
3438 (substitute* "rules/64-btrfs.rules.in"
3439 (("@bindir@")
3440 (string-append out "/bin")))
3441 #t)))
3442 (add-after 'install 'move-static-library
3443 (lambda* (#:key outputs #:allow-other-keys)
3444 (let* ((out (assoc-ref outputs "out"))
3445 (static (assoc-ref outputs "static"))
3446 (source (string-append out "/lib/libudev.a"))
3447 (target (string-append static "/lib/libudev.a")))
3448 (mkdir-p (dirname target))
3449 (link source target)
3450 (delete-file source)
3451 ;; Remove reference to the static library from the .la file
3452 ;; such that Libtool looks for it in the usual places.
3453 (substitute* (string-append out "/lib/libudev.la")
3454 (("old_library=.*")
3455 "old_library=''\n"))
3456 #t)))
3457 (add-after 'install 'build-hwdb
3458 (lambda* (#:key outputs #:allow-other-keys)
3459 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
3460 ;; similar tools to display product names.
3461 ;;
3462 ;; XXX: This can't be done when cross-compiling. Find another way
3463 ;; to generate hwdb.bin for cross-built systems.
3464 (let ((out (assoc-ref outputs "out")))
3465 ,@(if (%current-target-system)
3466 '(#t)
3467 '((invoke (string-append out "/bin/udevadm")
3468 "hwdb" "--update")))))))
3469 #:configure-flags (list "--enable-manpages")))
3470 (native-inputs
3471 `(("autoconf" ,autoconf)
3472 ("automake" ,automake)
3473 ("gperf" ,gperf)
3474 ("libtool" ,libtool)
3475 ("pkg-config" ,pkg-config)
3476 ;; For tests.
3477 ("perl" ,perl)
3478 ("python" ,python-wrapper)
3479 ;; For documentation.
3480 ("docbook-xml" ,docbook-xml-4.2)
3481 ("docbook-xsl" ,docbook-xsl)
3482 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3483 ("xsltproc" ,libxslt)))
3484 (inputs
3485 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
3486 ;; and similar; it also installs the '60-persistent-storage.rules' file,
3487 ;; which contains the rules to do that.
3488 `(("util-linux" ,util-linux "lib") ;for blkid
3489 ("kmod" ,kmod)))
3490 (outputs '("out" "static"))
3491 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
3492 (synopsis "Userspace device management")
3493 (description "Udev is a daemon which dynamically creates and removes
3494 device nodes from /dev/, handles hotplug events and loads drivers at boot
3495 time.")
3496 (license license:gpl2+)))
3497
3498 (define-public python-evdev
3499 (package
3500 (name "python-evdev")
3501 (version "1.3.0")
3502 (source
3503 (origin
3504 (method url-fetch)
3505 (uri (pypi-uri "evdev" version))
3506 (sha256
3507 (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi"))))
3508 (build-system python-build-system)
3509 (native-inputs
3510 `(("kernel-headers" ,linux-libre-headers)))
3511 (arguments
3512 `(#:tests? #f ;no rule for tests
3513 #:phases
3514 (modify-phases %standard-phases
3515 (add-before 'build 'fix-hard-coded-directory
3516 (lambda* (#:key inputs #:allow-other-keys)
3517 (substitute* "setup.py"
3518 (("/usr/include/linux")
3519 (string-append
3520 (assoc-ref inputs "kernel-headers") "/include/linux")))
3521 #t)))))
3522 (home-page "https://github.com/gvalkov/python-evdev")
3523 (synopsis "Bindings to the Linux input handling subsystem")
3524 (description
3525 "Python-evdev provides bindings to the generic input event interface in
3526 Linux. The @code{evdev} interface serves the purpose of passing events
3527 generated in the kernel directly to userspace through character devices that
3528 are typically located in @file{/dev/input/}.
3529
3530 This package also comes with bindings to @code{uinput}, the userspace input
3531 subsystem. @code{uinput} allows userspace programs to create and handle input
3532 devices that can inject events directly into the input subsystem.")
3533 (license license:bsd-3)))
3534
3535 (define-public lvm2
3536 (package
3537 (name "lvm2")
3538 (version "2.03.11")
3539 (source (origin
3540 (method url-fetch)
3541 (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2."
3542 version ".tgz")
3543 (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
3544 version ".tgz")))
3545 (sha256
3546 (base32
3547 "1m4xpda8vbyd89ca0w8nacvnl4j34yzsa625gn990fb5sh84ab44"))
3548 (modules '((guix build utils)))
3549 (snippet
3550 '(begin
3551 (use-modules (guix build utils))
3552
3553 ;; Honor sysconfdir.
3554 (substitute* "make.tmpl.in"
3555 (("^confdir = .*$")
3556 "confdir = @sysconfdir@\n")
3557 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
3558 "DEFAULT_SYS_DIR = @sysconfdir@"))
3559 #t))
3560 (patches (search-patches "lvm2-static-link.patch"))))
3561 (build-system gnu-build-system)
3562 (native-inputs
3563 `(("pkg-config" ,pkg-config)
3564 ("procps" ,procps))) ;tests use 'pgrep'
3565 (inputs
3566 `(("libaio" ,libaio)
3567 ("udev" ,eudev)))
3568 (arguments
3569 `(#:phases
3570 (modify-phases %standard-phases
3571 (add-after 'configure 'set-makefile-shell
3572 (lambda _
3573 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
3574 ;; expected.
3575 (setenv "SHELL" (which "sh"))
3576
3577 ;; Replace /bin/sh with the right file name.
3578 (patch-makefile-SHELL "make.tmpl")
3579 #t)))
3580
3581 #:configure-flags (list (string-append "--sysconfdir="
3582 (assoc-ref %outputs "out")
3583 "/etc/lvm")
3584 "--enable-udev_sync"
3585 "--enable-udev_rules"
3586 "--enable-pkgconfig"
3587 "--enable-cmdlib"
3588 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
3589
3590 ;; Make sure programs such as 'dmsetup' can
3591 ;; find libdevmapper.so.
3592 (string-append "LDFLAGS=-Wl,-rpath="
3593 (assoc-ref %outputs "out")
3594 "/lib,-rpath="
3595 (assoc-ref %outputs "out")
3596 "/lib/device-mapper")
3597 ;; This is needed when cross-compiling.
3598 ,@(if (%current-target-system)
3599 '("ac_cv_func_malloc_0_nonnull=yes"
3600 "ac_cv_func_realloc_0_nonnull=yes")
3601 '()))
3602
3603 ;; The tests use 'mknod', which requires root access.
3604 #:tests? #f))
3605 (supported-systems (delete "i586-gnu" %supported-systems))
3606 (home-page "https://sourceware.org/lvm2/")
3607 (synopsis "Logical volume management for Linux")
3608 (description
3609 "LVM2 is the logical volume management tool set for Linux-based systems.
3610 This package includes the user-space libraries and tools, including the device
3611 mapper. Kernel components are part of Linux-libre.")
3612
3613 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
3614 ;; Command-line tools are GPLv2.
3615 (license (list license:gpl2 license:lgpl2.1))))
3616
3617 (define-public lvm2-static
3618 (package
3619 (inherit lvm2)
3620 (name "lvm2-static")
3621
3622 ;; Propagate udev because libdevmapper.a depends on libudev.
3623 (propagated-inputs `(("udev:static" ,eudev "static")))
3624
3625 (arguments
3626 (substitute-keyword-arguments (package-arguments lvm2)
3627 ((#:configure-flags flags '())
3628 ;; LVM2 doesn't use Libtool, hence the custom option.
3629 `(append '("--enable-static_link")
3630 ;; Building dmeventd statically is complicated due to a
3631 ;; requirement on libdevmapper.a, which is being phased out
3632 ;; in favor of libdevice-mapper.a, which in turn is is not
3633 ;; easily made available at dmeventd build time. Just ignore
3634 ;; it until the situation improves.
3635 (delete "--enable-dmeventd" ,flags)))
3636 ((#:phases phases)
3637 `(modify-phases ,phases
3638 (add-before 'configure 'adjust-Makefile
3639 (lambda _
3640 ;; These fixes are related to the upstream libdm->device_mapper
3641 ;; migration and will hopefully be fixed upstream in due time.
3642 (substitute* "tools/Makefile.in"
3643 ;; This variable is empty in a static configuration and causes
3644 ;; an erroneous GCC command line.
3645 (("-L\\$\\(interfacebuilddir\\)") "")
3646 ;; Remove obsolete reference to libdevmapper.a.
3647 (("-ldevmapper") ""))
3648 #t))))))
3649 (synopsis "Logical volume management for Linux (statically linked)")))
3650
3651 (define-public thin-provisioning-tools
3652 (package
3653 (name "thin-provisioning-tools")
3654 (version "0.8.5")
3655 (source
3656 (origin
3657 (method git-fetch)
3658 (uri (git-reference
3659 (url "https://github.com/jthornber/thin-provisioning-tools")
3660 (commit (string-append "v" version))))
3661 (file-name (git-file-name name version))
3662 (sha256
3663 (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19"))))
3664 (build-system gnu-build-system)
3665 (arguments
3666 ;; Doesn't build with --enable-testing due to a function name collision
3667 ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released.
3668 `(#:tests? #f))
3669 (native-inputs
3670 `(("automake" ,automake)
3671 ("autoreconf" ,autoconf)))
3672 (inputs
3673 `(("boost" ,boost)
3674 ("expat" ,expat)
3675 ("libaio" ,libaio)))
3676 (synopsis "Tools for manipulating the metadata of device-mapper targets")
3677 (description "A suite of tools for manipulating the metadata of the
3678 dm-thin, dm-cache and dm-era device-mapper targets.")
3679 (home-page "https://github.com/jthornber/thin-provisioning-tools")
3680 (license license:gpl3+)))
3681
3682 (define-public wireless-tools
3683 (package
3684 (name "wireless-tools")
3685 (version "30.pre9")
3686 (source (origin
3687 (method url-fetch)
3688 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
3689 version ".tar.gz"))
3690 (sha256
3691 (base32
3692 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
3693 (snippet
3694 '(begin
3695 ;; Remove the older header files that are not free software.
3696 (for-each (lambda (n)
3697 (delete-file (format #f "wireless.~a.h" n)))
3698 '(10 11 12 13 14 15 16 17 18 19 20))
3699 #t))))
3700 (build-system gnu-build-system)
3701 (arguments
3702 `(#:make-flags
3703 (list (string-append "PREFIX=" %output)
3704 (string-append "INSTALL_MAN=" %output "/share/man")
3705 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
3706 "BUILD_STATIC=")
3707 #:phases
3708 (modify-phases %standard-phases
3709 (replace 'configure
3710 (lambda* (#:key target #:allow-other-keys)
3711 (when ,(%current-target-system)
3712 ;; Cross-compilation: use the cross tools.
3713 (substitute* (find-files "." "Makefile")
3714 (("CC = .*$")
3715 (string-append "CC = " target "-gcc\n"))
3716 (("AR = .*$")
3717 (string-append "AR = " target "-ar\n"))
3718 (("RANLIB = .*$")
3719 (string-append "RANLIB = " target "-ranlib\n"))))
3720 #t)))
3721 #:tests? #f))
3722 (synopsis "Tools for manipulating Linux Wireless Extensions")
3723 (description "Wireless Tools are used to manipulate the now-deprecated
3724 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
3725 Extension was an interface allowing you to set Wireless LAN specific
3726 parameters and get the specific stats. It is deprecated in favor the nl80211
3727 interface.")
3728 (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
3729 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
3730 ;; other files are distributed under gpl2.
3731 (license (list license:gpl2 license:lgpl2.1+))))
3732
3733 (define-public crda
3734 (package
3735 (name "crda")
3736 (version "3.18")
3737 (source (origin
3738 (method url-fetch)
3739 (uri (string-append "mirror://kernel.org/software/network/crda/"
3740 "crda-" version ".tar.xz"))
3741 (sha256
3742 (base32
3743 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
3744 (patches (search-patches "crda-optional-gcrypt.patch"))))
3745 (build-system gnu-build-system)
3746 (arguments
3747 `(#:phases (modify-phases %standard-phases
3748 (delete 'configure)
3749 (add-after 'unpack 'gzip-determinism
3750 (lambda _
3751 (substitute* "Makefile"
3752 (("gzip") "gzip --no-name"))
3753 #t))
3754 ,@(if (%current-target-system)
3755 '((add-after
3756 'unpack 'fix-pkg-config
3757 (lambda* (#:key target #:allow-other-keys)
3758 (substitute*
3759 "Makefile"
3760 (("pkg-config")
3761 (string-append target "-pkg-config")))
3762 #t)))
3763 '())
3764 (add-before
3765 'build 'no-werror-no-ldconfig
3766 (lambda _
3767 (substitute* "Makefile"
3768 (("-Werror") "")
3769 (("ldconfig") "true"))
3770 #t))
3771 (add-before
3772 'build 'set-regulator-db-file-name
3773 (lambda* (#:key native-inputs inputs #:allow-other-keys)
3774 ;; Tell CRDA where to find our database.
3775 (let ((regdb (assoc-ref (or native-inputs inputs)
3776 "wireless-regdb")))
3777 (substitute* "crda.c"
3778 (("\"/lib/crda/regulatory.bin\"")
3779 (string-append "\"" regdb
3780 "/lib/crda/regulatory.bin\"")))
3781 #t))))
3782 #:test-target "verify"
3783 #:make-flags (let ((out (assoc-ref %outputs "out"))
3784 (regdb (assoc-ref %build-inputs "wireless-regdb")))
3785 (list
3786 (string-append "CC=" ,(cc-for-target))
3787 "V=1"
3788
3789 ;; Disable signature-checking on 'regulatory.bin'.
3790 ;; The reason is that this simplifies maintenance
3791 ;; on our side (no need to manage a distro key
3792 ;; pair), and we can guarantee integrity of
3793 ;; 'regulatory.bin' by other means anyway, such as
3794 ;; 'guix gc --verify'. See
3795 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
3796 ;; for a discssion.
3797 "USE_OPENSSL=0"
3798
3799 (string-append "PREFIX=" out)
3800 (string-append "SBINDIR=" out "/sbin/")
3801 (string-append "UDEV_RULE_DIR="
3802 out "/lib/udev/rules.d")
3803 (string-append "LDFLAGS=-Wl,-rpath="
3804 out "/lib -L.")
3805 (string-append "REG_BIN=" regdb
3806 "/lib/crda/regulatory.bin")
3807 "all_noverify"))))
3808 (native-inputs `(("pkg-config" ,pkg-config)
3809 ("wireless-regdb" ,wireless-regdb)))
3810 (inputs `(("libnl" ,libnl)))
3811 (home-page
3812 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
3813 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
3814 (description
3815 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
3816 communication between the kernel Linux and user space for regulatory
3817 compliance.")
3818 (license license:copyleft-next)))
3819
3820 (define-public wireless-regdb
3821 (package
3822 (name "wireless-regdb")
3823 (version "2020.04.29")
3824 (source (origin
3825 (method url-fetch)
3826 (uri (string-append
3827 "mirror://kernel.org/software/network/wireless-regdb/"
3828 "wireless-regdb-" version ".tar.xz"))
3829 (sha256
3830 (base32
3831 "0yicda474ygahv8da18h1p4yf42s6x2f208mlwcw4xsrxld07zc9"))
3832
3833 ;; We're building 'regulatory.bin' by ourselves.
3834 (snippet '(begin
3835 (delete-file "regulatory.bin")
3836 #t))))
3837 (build-system gnu-build-system)
3838 (arguments
3839 '(#:phases
3840 (modify-phases %standard-phases
3841 (add-after 'unpack 'gzip-determinism
3842 (lambda _
3843 (substitute* "Makefile"
3844 (("gzip") "gzip --no-name"))
3845 #t))
3846 (add-after 'unpack 'omit-signature
3847 (lambda _
3848 (substitute* "Makefile"
3849 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
3850 ;; don't provide (see below). Disable it.
3851 ((" regulatory\\.db\\.p7s") "")
3852 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
3853 ;; but ‘make install’ depends only on the latter while installing
3854 ;; both (and failing). Depend on it explicitly.
3855 (("^install: " all) (string-append all "regulatory.db ")))
3856 #t))
3857 (delete 'configure)) ; no configure script
3858
3859 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
3860 ;; is computed and can be equal to 'maintainer-clean'; when that
3861 ;; happens, we can end up deleting the 'regulatory.bin' file that we
3862 ;; just built. Thus, build things sequentially.
3863 #:parallel-build? #f
3864
3865 #:tests? #f ; no tests
3866 #:make-flags
3867 (let ((out (assoc-ref %outputs "out")))
3868 (list (string-append "PREFIX=" out)
3869 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
3870
3871 ;; Leave this empty so that db2bin.py doesn't try to sign
3872 ;; ‘regulatory.bin’. This allows us to avoid managing a key
3873 ;; pair for the whole distribution.
3874 (string-append "REGDB_PRIVKEY=")
3875 ;; Don't generate a public key for the same reason. These are
3876 ;; used as Makefile targets and can't be the empty string.
3877 (string-append "REGDB_PUBCERT=/dev/null")
3878 (string-append "REGDB_PUBKEY=/dev/null")))))
3879 (native-inputs
3880 `(("python" ,python-wrapper)))
3881 (home-page
3882 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
3883 (synopsis "Wireless regulatory database")
3884 (description
3885 "This package contains the wireless regulatory database Central
3886 Regulatory Database Agent (CRDA) daemon. The database contains information on
3887 country-specific regulations for the wireless spectrum.")
3888 (license license:isc)))
3889
3890 (define-public lm-sensors
3891 (package
3892 (name "lm-sensors")
3893 (version "3.6.0")
3894 (source
3895 (origin
3896 (method git-fetch)
3897 (uri (git-reference
3898 (url "https://github.com/groeck/lm-sensors")
3899 (commit (string-append "V" (string-join
3900 (string-split version #\.) "-")))))
3901 (file-name (git-file-name name version))
3902 (sha256
3903 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
3904 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
3905 (build-system gnu-build-system)
3906 (inputs `(("rrdtool" ,rrdtool)
3907 ("perl" ,perl)
3908 ("kmod" ,kmod)
3909 ("gnuplot" ,gnuplot)))
3910 (native-inputs `(("pkg-config" ,pkg-config)
3911 ("flex" ,flex)
3912 ("bison" ,bison)
3913 ("which" ,which)))
3914 (outputs '("lib" ; avoid perl in closure
3915 "out"))
3916 (arguments
3917 `(#:tests? #f ; no 'check' target
3918 #:make-flags (list (string-append "PREFIX=" %output)
3919 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3920 (string-append "INCLUDEDIR="
3921 (assoc-ref %outputs "lib") "/include")
3922 (string-append "MANDIR=" %output "/share/man")
3923 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
3924 #:phases
3925 (modify-phases %standard-phases
3926 (delete 'configure)
3927 (add-before 'build 'patch-exec-paths
3928 (lambda* (#:key inputs outputs #:allow-other-keys)
3929 (substitute* "prog/detect/sensors-detect"
3930 (("`uname")
3931 (string-append "`" (assoc-ref inputs "coreutils")
3932 "/bin/uname"))
3933 (("(`|\")modprobe" all open-quote)
3934 (string-append open-quote
3935 (assoc-ref inputs "kmod")
3936 "/bin/modprobe")))
3937 (substitute* '("prog/pwm/pwmconfig"
3938 "prog/pwm/fancontrol")
3939 (("gnuplot")
3940 (string-append (assoc-ref inputs "gnuplot")
3941 "/bin/gnuplot"))
3942 (("cat ")
3943 (string-append (assoc-ref inputs "coreutils")
3944 "/bin/cat "))
3945 (("e?grep " match)
3946 (string-append (assoc-ref inputs "grep")
3947 "/bin/" match))
3948 (("sed -e")
3949 (string-append (assoc-ref inputs "sed")
3950 "/bin/sed -e"))
3951 (("cut -d")
3952 (string-append (assoc-ref inputs "coreutils")
3953 "/bin/cut -d"))
3954 (("sleep ")
3955 (string-append (assoc-ref inputs "coreutils")
3956 "/bin/sleep "))
3957 (("readlink -f")
3958 (string-append (assoc-ref inputs "coreutils")
3959 "/bin/readlink -f")))
3960 #t)))))
3961 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
3962 (synopsis "Utilities to read temperature/voltage/fan sensors")
3963 (description
3964 "Lm-sensors is a hardware health monitoring package for Linux. It allows
3965 you to access information from temperature, voltage, and fan speed sensors.
3966 It works with most newer systems.")
3967 (license license:gpl2+)))
3968
3969 (define-public iucode-tool
3970 (package
3971 (name "iucode-tool")
3972 (version "2.3.1")
3973 (source (origin
3974 (method url-fetch)
3975 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3976 "/raw/latest/iucode-tool_" version ".tar.xz"))
3977 (sha256
3978 (base32
3979 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
3980 (build-system gnu-build-system)
3981 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3982 (synopsis "Manipulate Intel microcode bundles")
3983 (description
3984 "@command{iucode_tool} is a utility to work with microcode packages for
3985 Intel processors. It can convert between formats, extract specific versions,
3986 create a firmware image suitable for the Linux kernel, and more.")
3987 ;; cpuid.h is available for i686, x86_64, and ia64.
3988 (supported-systems '("i686-linux" "x86_64-linux"))
3989 (license license:gpl2+)))
3990
3991 (define-public i2c-tools
3992 (package
3993 (name "i2c-tools")
3994 (version "3.1.1")
3995 (source (origin
3996 (method url-fetch)
3997 (uri (string-append
3998 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3999 version ".tar.bz2"))
4000 (sha256
4001 (base32
4002 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
4003 (build-system gnu-build-system)
4004 (arguments
4005 `(#:tests? #f ; no 'check' target
4006 #:make-flags (list (string-append "prefix=" %output)
4007 ,(string-append "CC=" (cc-for-target)))
4008 ;; No configure script.
4009 #:phases (modify-phases %standard-phases (delete 'configure))))
4010 (inputs
4011 `(("perl" ,perl)))
4012 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
4013 (synopsis "I2C tools for Linux")
4014 (description
4015 "The i2c-tools package contains a heterogeneous set of I2C tools for
4016 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
4017 EEPROM decoding scripts, EEPROM programming tools, and a python module for
4018 SMBus access.")
4019 (license license:gpl2+)))
4020
4021 (define-public xsensors
4022 (package
4023 (name "xsensors")
4024 (version "0.70")
4025 (source (origin
4026 (method url-fetch)
4027 (uri (string-append
4028 "http://www.linuxhardware.org/xsensors/xsensors-"
4029 version ".tar.gz"))
4030 (sha256
4031 (base32
4032 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
4033 (build-system gnu-build-system)
4034 (inputs `(("lm-sensors" ,lm-sensors "lib")
4035 ("gtk" ,gtk+-2)))
4036 (native-inputs `(("pkg-config" ,pkg-config)))
4037 (arguments
4038 `(#:phases
4039 (modify-phases %standard-phases
4040 (add-before 'configure 'enable-deprecated
4041 (lambda _
4042 (substitute* "src/Makefile.in"
4043 (("-DGDK_DISABLE_DEPRECATED") "")
4044 (("-DGTK_DISABLE_DEPRECATED") ""))
4045 #t))
4046 (add-before 'configure 'remove-Werror
4047 (lambda _
4048 (substitute* '("configure" "src/Makefile.in")
4049 (("-Werror") ""))
4050 #t)))))
4051 (home-page "http://www.linuxhardware.org/xsensors/")
4052 (synopsis "Hardware health information viewer")
4053 (description
4054 "Xsensors reads data from the libsensors library regarding hardware
4055 health such as temperature, voltage and fan speed and displays the information
4056 in a digital read-out.")
4057 (license license:gpl2+)))
4058
4059 (define-public perf
4060 (package
4061 (name "perf")
4062 (version (package-version linux-libre))
4063 (source (package-source linux-libre))
4064 (build-system gnu-build-system)
4065 (arguments
4066 '(#:phases
4067 (modify-phases %standard-phases
4068 (replace 'configure
4069 (lambda* (#:key inputs #:allow-other-keys)
4070 (setenv "SHELL_PATH" (which "bash"))
4071 (chdir "tools/perf")
4072 #t)))
4073 #:make-flags (list (string-append "prefix="
4074 (assoc-ref %outputs "out"))
4075 "CC=gcc"
4076 "WERROR=0"
4077
4078 ;; By default, 'config/Makefile' uses lib64 on
4079 ;; x86_64. Work around that.
4080 "lib=lib")
4081 #:tests? #f)) ;no tests
4082 (native-inputs
4083 `(("pkg-config" ,pkg-config)
4084 ("bison" ,bison)
4085 ("flex" ,flex)
4086
4087 ;; There are build scripts written in these languages.
4088 ("perl" ,perl)
4089 ("python2" ,python-2)
4090 ("python3" ,python-3)))
4091 (inputs
4092 `(("slang" ,slang) ;for the interactive TUI
4093 ;; ("newt" ,newt)
4094 ("python" ,python-2) ;'perf' links against libpython
4095 ("elfutils" ,elfutils)
4096 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
4097 ("libunwind" ,libunwind) ;better stack walking
4098 ("numactl" ,numactl) ;for 'perf bench numa mem'
4099
4100 ;; Documentation.
4101 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
4102 ("docbook-xsl" ,docbook-xsl)
4103 ("xmlto" ,xmlto)
4104 ("asciidoc" ,asciidoc)))
4105 (home-page "https://perf.wiki.kernel.org/")
4106 (synopsis "Linux profiling with performance counters")
4107 (description
4108 "perf is a tool suite for profiling using hardware performance counters,
4109 with support in the Linux kernel. perf can instrument CPU performance
4110 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
4111 of lightweight profiling. This package contains the user-land tools and in
4112 particular the @code{perf} command.")
4113 (license (package-license linux-libre))))
4114
4115 (define-public pflask
4116 (package
4117 (name "pflask")
4118 (version "0.2")
4119 (source (origin
4120 (method git-fetch)
4121 (uri (git-reference
4122 (url "https://github.com/ghedo/pflask")
4123 (commit (string-append "v" version))))
4124 (file-name (git-file-name name version))
4125 (sha256
4126 (base32
4127 "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz"))))
4128 (build-system cmake-build-system)
4129 (arguments
4130 '(#:tests? #f)) ; no tests
4131 (home-page "https://ghedo.github.io/pflask/")
4132 (synopsis "Simple tool for creating Linux namespace containers")
4133 (description "pflask is a simple tool for creating Linux namespace
4134 containers. It can be used for running a command or even booting an OS inside
4135 an isolated container, created with the help of Linux namespaces. It is
4136 similar in functionality to chroot, although pflask provides better isolation
4137 thanks to the use of namespaces.")
4138 (license license:bsd-2)))
4139
4140 (define-public singularity
4141 (package
4142 (name "singularity")
4143 (version "2.6.1")
4144 (source (origin
4145 (method url-fetch)
4146 (uri (string-append "https://github.com/singularityware/singularity/"
4147 "releases/download/" version
4148 "/singularity-" version ".tar.gz"))
4149 (sha256
4150 (base32
4151 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
4152 (modules '((guix build utils)))
4153 (snippet
4154 '(begin
4155 ;; Do not create directories in /var.
4156 (substitute* "Makefile.in"
4157 (("\\$\\(MAKE\\) .*install-data-hook") ""))
4158
4159 ;; The original source overrides PATH so that it points to
4160 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
4161 ;; on Guix System. Leave PATH unchanged so we refer to the
4162 ;; installed Coreutils, grep, etc.
4163 (substitute* "bin/singularity.in"
4164 (("^PATH=.*" all)
4165 (string-append "#" all "\n")))
4166
4167 (substitute* (find-files "libexec/cli" "\\.exec$")
4168 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
4169 _ program)
4170 (string-append "/run/setuid-programs/singularity-"
4171 program "-helper")))
4172
4173 ;; These squashfs mount options are apparently no longer
4174 ;; supported since Linux-libre 5.4.5.
4175 (substitute* "src/lib/image/squashfs/mount.c"
4176 (("\"errors=remount-ro\"")
4177 "NULL"))
4178 #t))))
4179 (build-system gnu-build-system)
4180 (arguments
4181 `(#:configure-flags '("--localstatedir=/var")
4182 #:phases
4183 (modify-phases %standard-phases
4184 (add-after 'unpack 'patch-references
4185 (lambda _
4186 (substitute* "libexec/cli/build.exec.in"
4187 (("-mksquashfs") (string-append "-" (which "mksquashfs"))))
4188 (substitute* (append
4189 (find-files "libexec" "functions")
4190 (find-files "libexec/bootstrap-scripts" ".*sh$")
4191 (find-files "libexec/cli" ".*exec$"))
4192 (("\\| grep ")
4193 (string-append "| " (which "grep") " "))
4194 (("egrep ")
4195 (string-append (which "egrep") " "))
4196 ((" sed ")
4197 (string-append " " (which "sed") " ")))
4198 #t))
4199 (add-after 'install 'set-PATH
4200 (lambda* (#:key inputs outputs #:allow-other-keys)
4201 ;; Have the 'singularity' and 'run-singularity' self-sufficient.
4202 (let ((out (assoc-ref outputs "out"))
4203 (coreutils (assoc-ref inputs "coreutils")))
4204 (wrap-program (string-append out "/bin/singularity")
4205 `("PATH" ":" = (,(string-append coreutils "/bin"))))
4206 (substitute* (string-append out "/bin/run-singularity")
4207 (("/usr/bin/env singularity")
4208 (string-append (which "env") " "
4209 out "/bin/singularity")))
4210 #t))))))
4211 (inputs
4212 `(("libarchive" ,libarchive)
4213 ("python" ,python-wrapper)
4214 ("zlib" ,zlib)
4215 ("squashfs-tools" ,squashfs-tools)))
4216 (home-page "https://singularity.lbl.gov/")
4217 (synopsis "Container platform")
4218 (description "Singularity is a container platform supporting a number of
4219 container image formats. It can build SquashFS container images or import
4220 existing Docker images. Singularity requires kernel support for container
4221 isolation or root privileges.")
4222 (license license:bsd-3)))
4223
4224 (define-public hdparm
4225 (package
4226 (name "hdparm")
4227 (version "9.60")
4228 (source (origin
4229 (method url-fetch)
4230 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
4231 "hdparm-" version ".tar.gz"))
4232 (sha256
4233 (base32
4234 "1k1mcv7naiacw1y6bdd1adnjfiq1kkx2ivsadjwmlkg4fff775w3"))))
4235 (build-system gnu-build-system)
4236 (arguments
4237 `(#:make-flags
4238 (let ((out (assoc-ref %outputs "out")))
4239 (list (string-append "binprefix=" out)
4240 (string-append "manprefix=" out)
4241 ,(string-append "CC=" (cc-for-target))
4242 ;; Let Guix strip the binaries and not break cross-compilation.
4243 "STRIP=true"))
4244 #:phases
4245 (modify-phases %standard-phases
4246 (delete 'configure)) ; no configure script
4247 #:tests? #f)) ; no test suite
4248 (home-page "https://sourceforge.net/projects/hdparm/")
4249 (synopsis "View and tune ATA disk drive parameters")
4250 (description
4251 "@command{hdparm} is a command-line utility to control ATA controllers and
4252 disk drives. It can increase performance and/or reliability by careful tuning
4253 of hardware settings like power and acoustic management, DMA modes, and caching.
4254 It can also display detailed device information, or be used as a simple
4255 performance benchmarking tool.
4256
4257 @command{hdparm} provides a command line interface to various Linux kernel
4258 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
4259 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
4260 Translation (@dfn{SAT}) are also supported.")
4261 (license (license:non-copyleft "file://LICENSE.TXT"))))
4262
4263 (define-public nvme-cli
4264 (package
4265 (name "nvme-cli")
4266 (version "1.13")
4267 (home-page "https://github.com/linux-nvme/nvme-cli")
4268 (source (origin
4269 (method git-fetch)
4270 (uri (git-reference
4271 (url home-page)
4272 (commit (string-append "v" version))))
4273 (sha256
4274 (base32 "1d538kp841bjh8h8d9q7inqz56rdcwb3m78zfx8607ddykv7wcqb"))
4275 (file-name (git-file-name name version))))
4276 (build-system gnu-build-system)
4277 (arguments
4278 `(#:make-flags
4279 (list ,(string-append "CC=" (cc-for-target)))
4280 #:phases (modify-phases %standard-phases
4281 (delete 'configure) ; no ./configure script
4282 (replace 'install
4283 (lambda _
4284 (invoke "make" "install-spec" "PREFIX="
4285 (string-append "DESTDIR=" %output)))))
4286 ;; The tests require sysfs, which is not accessible from from the build
4287 ;; environment
4288 #:tests? #f))
4289 (synopsis "NVM-Express user space tooling for Linux")
4290 (description "Nvme-cli is a utility to provide standards compliant tooling
4291 for NVM-Express drives. It was made specifically for Linux as it relies on the
4292 IOCTLs defined by the mainline kernel driver.")
4293 (license license:gpl2+)))
4294
4295 (define-public rfkill
4296 (package
4297 (name "rfkill")
4298 (version "0.5")
4299 (source (origin
4300 (method url-fetch)
4301 (uri (string-append "mirror://kernel.org/software/network/"
4302 name "/" name "-" version ".tar.xz"))
4303 (sha256
4304 (base32
4305 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
4306 (build-system gnu-build-system)
4307 (arguments
4308 `(#:make-flags (list "CC=gcc"
4309 (string-append "PREFIX=" %output))
4310 #:phases (modify-phases %standard-phases
4311 (delete 'configure))
4312 #:tests? #f))
4313 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
4314 (synopsis "Tool for enabling and disabling wireless devices")
4315 (description
4316 "rfkill is a simple tool for accessing the rfkill device interface,
4317 which is used to enable and disable wireless networking devices, typically
4318 WLAN, Bluetooth and mobile broadband.")
4319 (license (license:non-copyleft "file://COPYING"
4320 "See COPYING in the distribution."))
4321 ;; rfkill is part of util-linux as of 2.31.
4322 (properties `((superseded . ,util-linux)))))
4323
4324 (define-public acpi
4325 (package
4326 (name "acpi")
4327 (version "1.7")
4328 (source (origin
4329 (method url-fetch)
4330 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
4331 version "/" name "-" version ".tar.gz"))
4332 (sha256
4333 (base32
4334 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
4335 (build-system gnu-build-system)
4336 (home-page "http://acpiclient.sourceforge.net")
4337 (synopsis "Display information on ACPI devices")
4338 (description "@code{acpi} attempts to replicate the functionality of the
4339 \"old\" @code{apm} command on ACPI systems, including battery and thermal
4340 information. It does not support ACPI suspending, only displays information
4341 about ACPI devices.")
4342 (license license:gpl2+)))
4343
4344 (define-public acpid
4345 (package
4346 (name "acpid")
4347 (version "2.0.32")
4348 (source (origin
4349 (method url-fetch)
4350 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
4351 version ".tar.xz"))
4352 (sha256
4353 (base32
4354 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
4355 (build-system gnu-build-system)
4356 (home-page "https://sourceforge.net/projects/acpid2/")
4357 (synopsis "Daemon for delivering ACPI events to user-space programs")
4358 (description
4359 "acpid is designed to notify user-space programs of Advanced
4360 Configuration and Power Interface (ACPI) events. acpid should be started
4361 during the system boot, and will run as a background process. When an ACPI
4362 event is received from the kernel, acpid will examine the list of rules
4363 specified in /etc/acpi/events and execute the rules that match the event.")
4364 (license license:gpl2+)))
4365
4366 (define-public sysfsutils
4367 (package
4368 (name "sysfsutils")
4369 (version "2.1.0")
4370 (source
4371 (origin
4372 (method url-fetch)
4373 (uri
4374 (string-append
4375 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
4376 version ".tar.gz"))
4377 (sha256
4378 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
4379 (build-system gnu-build-system)
4380 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
4381 (synopsis "System utilities based on Linux sysfs")
4382 (description
4383 "These are a set of utilities built upon sysfs, a virtual file system in
4384 Linux kernel versions 2.5+ that exposes a system's device tree. The package
4385 also contains the libsysfs library.")
4386 ;; The library is under lgpl2.1+ (all files say "or any later version").
4387 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
4388 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
4389
4390 (define-public sysfsutils-1
4391 (package
4392 (inherit sysfsutils)
4393 (version "1.3.0")
4394 (source
4395 (origin
4396 (method url-fetch)
4397 (uri
4398 (string-append
4399 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
4400 "/sysfsutils-" version ".tar.gz"))
4401 (sha256
4402 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
4403 (modules '((guix build utils)))
4404 (snippet
4405 '(begin
4406 (substitute* "Makefile.in"
4407 (("includedir = /usr/include/sysfs")
4408 "includedir = @includedir@"))
4409 (substitute* "configure"
4410 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
4411 (string-append "includedir='" orig "/sysfs'")))
4412 #t))))
4413 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
4414
4415 (define-public cpufrequtils
4416 (package
4417 (name "cpufrequtils")
4418 (version "0.3")
4419 (source
4420 (origin
4421 (method url-fetch)
4422 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
4423 "cpufrequtils-" version ".tar.gz"))
4424 (sha256
4425 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
4426 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
4427 (build-system gnu-build-system)
4428 (native-inputs
4429 `(("sysfsutils" ,sysfsutils-1)))
4430 (arguments
4431 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4432 (assoc-ref %outputs "out") "/lib"))))
4433 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
4434 (synopsis "Utilities to get and set CPU frequency on Linux")
4435 (description
4436 "The cpufrequtils suite contains utilities to retrieve CPU frequency
4437 information, and set the CPU frequency if supported, using the cpufreq
4438 capabilities of the Linux kernel.")
4439 (license license:gpl2)))
4440
4441 (define-public libraw1394
4442 (package
4443 (name "libraw1394")
4444 (version "2.1.2")
4445 (source (origin
4446 (method url-fetch)
4447 (uri (string-append
4448 "mirror://kernel.org/linux/libs/ieee1394/"
4449 name "-" version ".tar.xz"))
4450 (sha256
4451 (base32
4452 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
4453 (build-system gnu-build-system)
4454 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4455 (synopsis "Interface library for the Linux IEEE1394 drivers")
4456 (description
4457 "Libraw1394 is the only supported interface to the kernel side raw1394 of
4458 the Linux IEEE-1394 subsystem, which provides direct access to the connected
4459 1394 buses to user space. Through libraw1394/raw1394, applications can directly
4460 send to and receive from other nodes without requiring a kernel driver for the
4461 protocol in question.")
4462 (license license:lgpl2.1+)))
4463
4464 (define-public libavc1394
4465 (package
4466 (name "libavc1394")
4467 (version "0.5.4")
4468 (source (origin
4469 (method url-fetch)
4470 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
4471 name "-" version ".tar.gz"))
4472 (sha256
4473 (base32
4474 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
4475 (build-system gnu-build-system)
4476 (native-inputs
4477 `(("pkg-config" ,pkg-config)))
4478 (propagated-inputs
4479 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
4480 (home-page "https://sourceforge.net/projects/libavc1394/")
4481 (synopsis "AV/C protocol library for IEEE 1394")
4482 (description
4483 "Libavc1394 is a programming interface to the AV/C specification from
4484 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
4485 (license license:lgpl2.1+)))
4486
4487 (define-public libiec61883
4488 (package
4489 (name "libiec61883")
4490 (version "1.2.0")
4491 (source (origin
4492 (method url-fetch)
4493 (uri (string-append
4494 "mirror://kernel.org/linux/libs/ieee1394/"
4495 name "-" version ".tar.xz"))
4496 (sha256
4497 (base32
4498 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
4499 (build-system gnu-build-system)
4500 (native-inputs
4501 `(("pkg-config" ,pkg-config)))
4502 (propagated-inputs
4503 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
4504 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
4505 (synopsis "Isochronous streaming media library for IEEE 1394")
4506 (description
4507 "The libiec61883 library provides a higher level API for streaming DV,
4508 MPEG-2 and audio over Linux IEEE 1394.")
4509 (license license:lgpl2.1+)))
4510
4511 (define-public mdadm
4512 (package
4513 (name "mdadm")
4514 (version "4.1")
4515 (source (origin
4516 (method url-fetch)
4517 (uri (string-append
4518 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
4519 version ".tar.xz"))
4520 (sha256
4521 (base32
4522 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
4523 (build-system gnu-build-system)
4524 (inputs
4525 `(("udev" ,eudev)))
4526 (arguments
4527 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
4528 (list ,(string-append "CC=" (cc-for-target))
4529 "INSTALL=install"
4530 "CHECK_RUN_DIR=0"
4531 ;; TODO: tell it where to find 'sendmail'
4532 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
4533 (string-append "BINDIR=" out "/sbin")
4534 (string-append "MANDIR=" out "/share/man")
4535 (string-append "UDEVDIR=" out "/lib/udev")))
4536 #:phases
4537 (modify-phases %standard-phases
4538 (add-before 'build 'patch-program-paths
4539 (lambda* (#:key native-inputs inputs #:allow-other-keys)
4540 (let ((coreutils (assoc-ref (or native-inputs inputs)
4541 "coreutils")))
4542 (substitute* "udev-md-raid-arrays.rules"
4543 (("/usr/bin/(readlink|basename)" all program)
4544 (string-append coreutils "/bin/" program))))
4545 #t))
4546 (add-before 'build 'remove-W-error
4547 (lambda _
4548 ;; We cannot build with -Werror on i686 due to a
4549 ;; 'sign-compare' warning in util.c.
4550 (substitute* "Makefile"
4551 (("-Werror") ""))
4552 #t))
4553 (delete 'configure))
4554 ;;tests must be done as root
4555 #:tests? #f))
4556 (supported-systems (delete "i586-gnu" %supported-systems))
4557 (home-page "http://neil.brown.name/blog/mdadm")
4558 (synopsis "Tool for managing Linux Software RAID arrays")
4559 (description
4560 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
4561 assemble, report on, and monitor arrays. It can also move spares between raid
4562 arrays when needed.")
4563 (license license:gpl2+)))
4564
4565 (define-public mdadm-static
4566 (package
4567 (inherit mdadm)
4568 (name "mdadm-static")
4569 (arguments
4570 (substitute-keyword-arguments (package-arguments mdadm)
4571 ((#:make-flags flags)
4572 `(cons "LDFLAGS = -static" ,flags))
4573 ((#:phases phases)
4574 `(modify-phases ,phases
4575 (add-after 'install 'remove-cruft
4576 (lambda* (#:key outputs #:allow-other-keys)
4577 (let* ((out (assoc-ref outputs "out"))
4578 (precious? (lambda (file)
4579 (member file '("." ".." "sbin"))))
4580 (directories (scandir out (negate precious?))))
4581 (with-directory-excursion out
4582 (for-each delete-file-recursively directories)
4583 (remove-store-references "sbin/mdadm")
4584 (delete-file "sbin/mdmon")
4585 #t))))))
4586 ((#:modules modules %gnu-build-system-modules)
4587 `((ice-9 ftw) ,@modules))
4588 ((#:strip-flags _ '())
4589 ''("--strip-all")) ;strip a few extra KiB
4590 ((#:allowed-references _ '("out"))
4591 '("out")))) ;refer only self
4592 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
4593
4594 (define-public multipath-tools
4595 (package
4596 (name "multipath-tools")
4597 (version "0.8.5")
4598 (source (origin
4599 (method git-fetch)
4600 (uri (git-reference
4601 (url "https://git.opensvc.com/multipath-tools/.git")
4602 (commit version)))
4603 (file-name (git-file-name name version))
4604 (sha256
4605 (base32
4606 "0gipg0z79h76j0f449cx4wcrfsv69ravjlpphsac11h302g3nrvg"))
4607 (modules '((guix build utils)))
4608 (snippet
4609 '(begin
4610 ;; Drop bundled valgrind headers.
4611 (delete-file-recursively "third-party")
4612 (substitute* '("multipathd/main.c"
4613 "libmultipath/debug.c")
4614 (("#include \"../third-party/")
4615 "#include \""))
4616 #t))))
4617 (build-system gnu-build-system)
4618 (arguments
4619 '(#:test-target "test"
4620 #:parallel-build? #f ;XXX: broken in 0.8.4
4621 #:make-flags (list "CC=gcc"
4622 (string-append "DESTDIR="
4623 (assoc-ref %outputs "out"))
4624 ;; Install Udev rules below this directory, relative
4625 ;; to the prefix.
4626 "SYSTEMDPATH=lib"
4627 (string-append "LDFLAGS=-Wl,-rpath="
4628 (assoc-ref %outputs "out")
4629 "/lib"))
4630 #:phases
4631 (modify-phases %standard-phases
4632 (add-after 'unpack 'patch-source
4633 (lambda* (#:key inputs #:allow-other-keys)
4634 (let ((lvm2 (assoc-ref inputs "lvm2"))
4635 (udev (assoc-ref inputs "udev")))
4636 (substitute* "Makefile.inc"
4637 (("\\$\\(prefix\\)/usr") "$(prefix)")
4638 ;; Do not save timestamp to avoid gzip "timestamp
4639 ;; out-of-range" warnings.
4640 (("gzip -9") "gzip -9n"))
4641 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
4642 (("/usr/include/libdevmapper.h")
4643 (string-append lvm2 "/include/libdevmapper.h"))
4644 (("/usr/include/libudev.h")
4645 (string-append udev "/include/libudev.h")))
4646 #t)))
4647 (add-after 'unpack 'fix-maybe-uninitialized-variable
4648 (lambda _
4649 ;; This variable gets initialized later if needed, but GCC 7
4650 ;; fails to notice. Should be fixed for > 0.8.4.
4651 ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html
4652 (substitute* "libmultipath/structs_vec.c"
4653 (("bool is_queueing;")
4654 "bool is_queueing = false;"))
4655 #t))
4656 (add-after 'unpack 'fix-linking-tests
4657 (lambda _
4658 ;; Add missing linker flag for -lmpathcmd. This should be fixed
4659 ;; for versions > 0.8.4.
4660 (substitute* "tests/Makefile"
4661 (("-lmultipath -lcmocka")
4662 "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka"))
4663 #t))
4664 (add-after 'unpack 'skip-failing-tests
4665 (lambda _
4666 ;; This test and the module's setup() test an arbitrary block
4667 ;; device node name, but the build environment has none.
4668 (substitute* "tests/devt.c"
4669 (("return get_one_devt.*") "return 0;\n")
4670 (("cmocka_unit_test\\(test_devt2devname_devt_good\\),") ""))
4671 ;; The above triggers -Werror=unused-function. Ignore it.
4672 (substitute* "tests/Makefile"
4673 (("CFLAGS \\+= " match)
4674 (string-append match "-Wno-error=unused-function ")))
4675 #t))
4676 (delete 'configure)))) ; no configure script
4677 (native-inputs
4678 `(("perl" ,perl)
4679 ("pkg-config" ,pkg-config)
4680 ("valgrind" ,valgrind)
4681
4682 ;; For tests.
4683 ("cmocka" ,cmocka)))
4684 (inputs
4685 `(("json-c" ,json-c)
4686 ("libaio" ,libaio)
4687 ("liburcu" ,liburcu)
4688 ("lvm2" ,lvm2)
4689 ("readline" ,readline)
4690 ("udev" ,eudev)))
4691 (home-page "http://christophe.varoqui.free.fr/")
4692 (synopsis "Access block devices through multiple paths")
4693 (description
4694 "This package provides the following binaries to drive the
4695 Linux Device Mapper multipathing driver:
4696 @enumerate
4697 @item @command{multipath} - Device mapper target autoconfig.
4698 @item @command{multipathd} - Multipath daemon.
4699 @item @command{mpathpersist} - Manages SCSI persistent reservations on
4700 @code{dm} multipath devices.
4701 @item @command{kpartx} - Create device maps from partition tables.
4702 @end enumerate")
4703 (license (list license:gpl2+ ; main distribution
4704 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
4705
4706 (define-public libaio
4707 (package
4708 (name "libaio")
4709 (version "0.3.112")
4710 (source (origin
4711 (method url-fetch)
4712 (uri (list
4713 (string-append "https://releases.pagure.org/libaio/"
4714 name "-" version ".tar.gz")))
4715 (sha256
4716 (base32
4717 "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
4718 (build-system gnu-build-system)
4719 (arguments
4720 `(#:make-flags
4721 (let ((target ,(%current-target-system)))
4722 (list (string-append "prefix=" %output)
4723 (string-append
4724 "CC=" (if target
4725 (string-append (assoc-ref %build-inputs "cross-gcc")
4726 "/bin/" target "-gcc")
4727 "gcc"))))
4728 #:test-target "partcheck" ; need root for a full 'check'
4729 #:phases
4730 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
4731 (home-page "https://pagure.io/libaio")
4732 (synopsis "Linux-native asynchronous I/O access library")
4733 (description
4734 "This library enables userspace to use Linux kernel asynchronous I/O
4735 system calls, important for the performance of databases and other advanced
4736 applications.")
4737 (license license:lgpl2.1+)))
4738
4739 (define-public blktrace
4740 ;; Take a newer commit to get the fix for CVE-2018-10689.
4741 (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58")
4742 (revision "1"))
4743 (package
4744 (name "blktrace")
4745 (version (git-version "1.2.0" revision commit))
4746 (home-page
4747 "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git")
4748 (source (origin
4749 (method git-fetch)
4750 (uri (git-reference
4751 (url home-page)
4752 (commit commit)))
4753 (sha256
4754 (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp"))
4755 (file-name (git-file-name name version))))
4756 (build-system gnu-build-system)
4757 (arguments
4758 `(#:make-flags
4759 (list ,(string-append "CC=" (cc-for-target))
4760 (string-append "prefix=" %output))
4761 #:tests? #f ; no tests
4762 #:phases
4763 (modify-phases %standard-phases
4764 (delete 'configure) ; no configure script
4765 (add-after 'unpack 'fix-gnuplot-path
4766 (lambda* (#:key inputs #:allow-other-keys)
4767 (let ((gnuplot (assoc-ref inputs "gnuplot")))
4768 (substitute* "btt/bno_plot.py"
4769 (("gnuplot %s")
4770 (string-append gnuplot "/bin/gnuplot %s")))
4771 #t))))))
4772 (inputs
4773 `(("libaio" ,libaio)
4774 ("gnuplot" ,gnuplot)
4775 ("python" ,python-wrapper))) ;for 'bno_plot.py'
4776 (synopsis "Block layer IO tracing mechanism")
4777 (description "Blktrace is a block layer IO tracing mechanism which provides
4778 detailed information about request queue operations to user space. It extracts
4779 event traces from the kernel (via the relaying through the debug file system).")
4780 (license license:gpl2))))
4781
4782 (define-public sbc
4783 (package
4784 (name "sbc")
4785 (version "1.5")
4786 (source (origin
4787 (method url-fetch)
4788 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
4789 version ".tar.xz"))
4790 (patches (search-patches "sbc-fix-build-non-x86.patch"))
4791 (sha256
4792 (base32
4793 "1liig5856crb331dps18mp0s13zbkv7yh007zqhq97m94fcddfhc"))))
4794 (build-system gnu-build-system)
4795 (inputs
4796 `(("libsndfile" ,libsndfile)))
4797 (native-inputs
4798 `(("pkg-config" ,pkg-config)))
4799 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
4800 (synopsis "Bluetooth subband audio codec")
4801 (description
4802 "The SBC is a digital audio encoder and decoder used to transfer data to
4803 Bluetooth audio output devices like headphones or loudspeakers.")
4804 (license license:gpl2+)))
4805
4806 (define-public bluez
4807 (package
4808 (name "bluez")
4809 (version "5.55")
4810 (source (origin
4811 (method url-fetch)
4812 (uri (string-append
4813 "mirror://kernel.org/linux/bluetooth/bluez-"
4814 version ".tar.xz"))
4815 (sha256
4816 (base32
4817 "124v9s4y1s7s6klx5vlmzpk1jlr4x84ch7r7scm7x2f42dqp2qw8"))))
4818 (build-system gnu-build-system)
4819 (arguments
4820 `(#:configure-flags
4821 (let ((out (assoc-ref %outputs "out")))
4822 (list "--sysconfdir=/etc"
4823 "--localstatedir=/var"
4824 "--enable-library"
4825 "--disable-systemd"
4826 ;; TODO: is this needed? Not installed by default since 5.55.
4827 "--enable-hid2hci"
4828 ;; Install dbus/udev files to the correct location.
4829 (string-append "--with-dbusconfdir=" out "/etc")
4830 (string-append "--with-udevdir=" out "/lib/udev")))
4831 #:phases
4832 (modify-phases %standard-phases
4833 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
4834 ;; issue (discussion on upstream mailing list:
4835 ;; https://marc.info/?t=149578476300002&r=1&w=2)
4836 (add-before 'check 'skip-wonky-test
4837 (lambda _
4838 (substitute* "unit/test-gatt.c"
4839 (("tester_init\\(&argc, &argv\\);") "return 77;"))
4840 #t))
4841 (add-after 'install 'post-install
4842 (lambda* (#:key inputs outputs #:allow-other-keys)
4843 (let* ((out (assoc-ref outputs "out"))
4844 (servicedir (string-append out "/share/dbus-1/services"))
4845 (service "obexd/src/org.bluez.obex.service")
4846 (rule (string-append
4847 out "/lib/udev/rules.d/97-hid2hci.rules")))
4848 ;; Install the obex dbus service file.
4849 (substitute* service
4850 (("/bin/false")
4851 (string-append out "/libexec/bluetooth/obexd")))
4852 (install-file service servicedir)
4853 ;; Fix paths in the udev rule.
4854 (substitute* rule
4855 (("hid2hci --method")
4856 (string-append out "/lib/udev/hid2hci --method"))
4857 (("/sbin/udevadm")
4858 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
4859 #t))))))
4860 (native-inputs
4861 `(("pkg-config" ,pkg-config)
4862 ("gettext" ,gettext-minimal)))
4863 (inputs
4864 `(("glib" ,glib)
4865 ("dbus" ,dbus)
4866 ("eudev" ,eudev)
4867 ("libical" ,libical)
4868 ("readline" ,readline)))
4869 (home-page "http://www.bluez.org/")
4870 (synopsis "Linux Bluetooth protocol stack")
4871 (description
4872 "BlueZ provides support for the core Bluetooth layers and protocols. It
4873 is flexible, efficient and uses a modular implementation.")
4874 (license license:gpl2+)))
4875
4876 (define-public fuse-exfat
4877 (package
4878 (name "fuse-exfat")
4879 (version "1.3.0")
4880 (source (origin
4881 (method url-fetch)
4882 (uri (string-append
4883 "https://github.com/relan/exfat/releases/download/v"
4884 version "/" name "-" version ".tar.gz"))
4885 (sha256
4886 (base32
4887 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
4888 (build-system gnu-build-system)
4889 (native-inputs
4890 `(("pkg-config" ,pkg-config)))
4891 (inputs
4892 `(("fuse" ,fuse)))
4893 (home-page "https://github.com/relan/exfat")
4894 (synopsis "Mount exFAT file systems")
4895 (description
4896 "This package provides a FUSE-based file system that provides read and
4897 write access to exFAT devices.")
4898 (license license:gpl2+)))
4899
4900 (define-public fuseiso
4901 (package
4902 (name "fuseiso")
4903 (version "20070708")
4904 (source (origin
4905 (method url-fetch)
4906 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
4907 version "/fuseiso-" version ".tar.bz2"))
4908 (sha256
4909 (base32
4910 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
4911 (build-system gnu-build-system)
4912 (native-inputs
4913 `(("pkg-config" ,pkg-config)))
4914 (inputs
4915 `(("fuse" ,fuse)
4916 ("glib" ,glib)
4917 ("zlib" ,zlib)))
4918 (home-page "https://sourceforge.net/projects/fuseiso/")
4919 (synopsis "Mount ISO file system images")
4920 (description
4921 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
4922 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
4923 Ridge, Joliet, and zisofs.")
4924 (license license:gpl2)))
4925
4926 (define-public gpm
4927 (package
4928 (name "gpm")
4929 (version "1.20.7")
4930 (source (origin
4931 (method url-fetch)
4932 (uri (string-append
4933 "https://www.nico.schottelius.org/software/gpm/archives/"
4934 "gpm-" version ".tar.bz2"))
4935 (patches (search-patches "gpm-glibc-2.26.patch"))
4936 (sha256
4937 (base32
4938 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
4939 (build-system gnu-build-system)
4940 (arguments
4941 '(#:phases (modify-phases %standard-phases
4942 (replace 'bootstrap
4943 (lambda _
4944 ;; The tarball was not generated with 'make dist' so we
4945 ;; need to bootstrap things ourselves.
4946 (substitute* "autogen.sh"
4947 (("/bin/sh") (which "sh")))
4948 (invoke "./autogen.sh")
4949 (patch-makefile-SHELL "Makefile.include.in")
4950 #t)))
4951
4952 ;; Make sure programs find libgpm.so.
4953 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
4954 (assoc-ref %outputs "out")
4955 "/lib"))))
4956 (native-inputs
4957 `(("texinfo" ,texinfo)
4958 ("bison" ,bison)
4959 ("flex" ,flex)
4960 ("autoconf" ,autoconf)
4961 ("automake" ,automake)
4962 ("libtool" ,libtool)))
4963 (home-page "https://www.nico.schottelius.org/software/gpm/")
4964 (synopsis "Mouse support for the Linux console")
4965 (description
4966 "The GPM (general-purpose mouse) daemon is a mouse server for
4967 applications running on the Linux console. It allows users to select items
4968 and copy/paste text in the console and in xterm.")
4969 (license license:gpl2+)))
4970
4971 (define-public btrfs-progs
4972 (package
4973 (name "btrfs-progs")
4974 (version "5.11")
4975 (source (origin
4976 (method url-fetch)
4977 (uri (string-append "mirror://kernel.org/linux/kernel/"
4978 "people/kdave/btrfs-progs/"
4979 "btrfs-progs-v" version ".tar.xz"))
4980 (sha256
4981 (base32
4982 "0dq1ryji9hmq10zbyk083lp9r212524a3naai47whq11m6q626fl"))))
4983 (build-system gnu-build-system)
4984 (outputs '("out"
4985 "static")) ; static versions of the binaries in "out"
4986 (arguments
4987 '(#:phases (modify-phases %standard-phases
4988 (add-after 'unpack 'patch-makefile
4989 (lambda* (#:key outputs #:allow-other-keys)
4990 (substitute* "Makefile"
4991 (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)")
4992 (string-append (assoc-ref outputs "out")
4993 "/lib/udev/rules.d")))
4994 #t))
4995 (add-after 'build 'build-static
4996 (lambda _ (invoke "make" "static")))
4997 (add-after 'install 'install-bash-completion
4998 (lambda* (#:key outputs #:allow-other-keys)
4999 (let* ((out (assoc-ref outputs "out"))
5000 (bashcomp (string-append out "/etc/bash_completion.d")))
5001 (mkdir-p bashcomp)
5002 (copy-file "btrfs-completion"
5003 (string-append bashcomp "/btrfs"))
5004 #t)))
5005 (add-after 'install 'install-static
5006 (let ((staticbin (string-append (assoc-ref %outputs "static")
5007 "/bin")))
5008 (lambda _
5009 (invoke "make"
5010 (string-append "bindir=" staticbin)
5011 "install-static")))))
5012 #:tests? #f ; XXX: require the 'btrfs' kernel module.
5013 #:test-target "test"
5014 #:parallel-tests? #f)) ; tests fail when run in parallel
5015 (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert
5016 ("lzo" ,lzo)
5017 ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid
5018 ("util-linux:static" ,util-linux "static") ;ditto
5019 ("zlib" ,zlib)
5020 ("zlib:static" ,zlib "static")
5021 ("zstd" ,zstd "lib")
5022 ("zstd:static" ,zstd "static")))
5023 (native-inputs `(("pkg-config" ,pkg-config)
5024 ("asciidoc" ,asciidoc)
5025 ("python" ,python)
5026 ("xmlto" ,xmlto)
5027 ;; For building documentation.
5028 ("libxml2" ,libxml2)
5029 ("docbook-xsl" ,docbook-xsl)
5030 ;; For tests.
5031 ("acl" ,acl)
5032 ("which" ,which)
5033 ("dmsetup" ,lvm2)
5034 ("udevadm" ,eudev)
5035 ;; The tests need 'grep' with perl regexp support.
5036 ("grep" ,grep)))
5037 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
5038 (synopsis "Create and manage btrfs copy-on-write file systems")
5039 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
5040 aimed at implementing advanced features while focusing on fault tolerance,
5041 repair and easy administration.")
5042 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
5043 ;; GPL2: Everything else.
5044 (license (list license:gpl2 license:gpl2+))))
5045
5046 (define-public btrfs-progs/static
5047 (package
5048 (name "btrfs-progs-static")
5049 (version (package-version btrfs-progs))
5050 (source #f)
5051 (build-system trivial-build-system)
5052 (inputs
5053 `(("btrfs-progs:static" ,btrfs-progs "static")))
5054 (arguments
5055 `(#:modules ((guix build utils))
5056 #:builder
5057 (begin
5058 (use-modules (guix build utils)
5059 (ice-9 ftw)
5060 (srfi srfi-26))
5061
5062 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
5063 (out (assoc-ref %outputs "out"))
5064 (source (string-append btrfs "/bin/btrfs.static"))
5065 (target (string-append out "/bin/btrfs")))
5066 (mkdir-p (dirname target))
5067 (copy-file source target)
5068 (remove-store-references target)
5069 (chmod target #o555)
5070 #t))))
5071 (home-page (package-home-page btrfs-progs))
5072 (synopsis "Statically-linked btrfs command from btrfs-progs")
5073 (description "This package provides the statically-linked @command{btrfs}
5074 from the btrfs-progs package. It is meant to be used in initrds.")
5075 (license (package-license btrfs-progs))))
5076
5077 (define-public cramfs-tools
5078 (package
5079 (name "cramfs-tools")
5080 (home-page "https://github.com/npitre/cramfs-tools")
5081 (version "2.1")
5082 (source (origin
5083 (method git-fetch)
5084 (uri (git-reference
5085 (url home-page)
5086 (commit (string-append "v" version))))
5087 (sha256
5088 (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p"))
5089 (file-name (git-file-name name version))))
5090 (build-system gnu-build-system)
5091 (arguments
5092 '(#:tests? #f ; No tests.
5093 #:phases
5094 (modify-phases %standard-phases
5095 (delete 'configure)
5096 (replace 'install
5097 (lambda* (#:key outputs #:allow-other-keys)
5098 (let ((out (assoc-ref outputs "out")))
5099 (install-file "mkcramfs" (string-append out "/sbin"))
5100 (install-file "cramfsck" (string-append out "/sbin")))
5101 #t)))))
5102 (inputs
5103 `(("zlib" ,zlib)))
5104 (synopsis "Tools to manage Cramfs file systems")
5105 (description "Cramfs is a Linux file system designed to be simple, small,
5106 and to compress things well. It is used on a number of embedded systems and
5107 small devices. This version has additional features such as uncompressed
5108 blocks and random block placement.")
5109 (license license:gpl2+)))
5110
5111 (define-public compsize
5112 (package
5113 (name "compsize")
5114 (version "1.5")
5115 (home-page "https://github.com/kilobyte/compsize")
5116 (source (origin
5117 (method git-fetch)
5118 (uri (git-reference
5119 (url home-page)
5120 (commit (string-append "v" version))))
5121 (sha256
5122 (base32 "0vqnrwgpv6pc1yjl0g4gl71xyl6v0xl3pyqjanjpwps73c53azir"))
5123 (file-name (git-file-name name version))))
5124 (build-system gnu-build-system)
5125 (inputs
5126 `(("btrfs-progs" ,btrfs-progs)))
5127 (arguments
5128 `(#:tests? #f ; No tests.
5129 #:make-flags
5130 (list (string-append "CC=" ,(cc-for-target)))
5131 #:phases
5132 (modify-phases %standard-phases
5133 (delete 'configure)
5134 (replace 'install
5135 (lambda* (#:key outputs #:allow-other-keys)
5136 (let ((out (assoc-ref outputs "out")))
5137 (install-file "compsize" (string-append out "/bin"))
5138 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
5139 (synopsis "Find compression type/ratio on Btrfs files")
5140 (description "@command{compsize} takes a list of files (given as
5141 arguments) on a Btrfs file system and measures used compression types and
5142 effective compression ratio, producing a report.
5143
5144 A directory has no extents but has a (recursive) list of files. A non-regular
5145 file is silently ignored.
5146
5147 As it makes no sense to talk about compression ratio of a partial extent,
5148 every referenced extent is counted whole, exactly once -- no matter if you use
5149 only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
5150 uncompressed size will not match the number given by @command{tar} or
5151 @command{du}. On the other hand, the space used should be accurate (although
5152 obviously it can be shared with files outside our set).")
5153 (license license:gpl2+)))
5154
5155 (define-public f2fs-tools-1.7
5156 (package
5157 (name "f2fs-tools")
5158 (version "1.7.0")
5159 (source (origin
5160 (method url-fetch)
5161 (uri (string-append
5162 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5163 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5164 (sha256
5165 (base32
5166 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
5167
5168 (build-system gnu-build-system)
5169 (arguments
5170 `(#:phases
5171 (modify-phases %standard-phases
5172 (add-after 'install 'install-headers
5173 (lambda* (#:key outputs #:allow-other-keys)
5174 (let* ((out (assoc-ref outputs "out"))
5175 (out-include (string-append out "/include")))
5176 (install-file "include/f2fs_fs.h" out-include)
5177 (install-file "mkfs/f2fs_format_utils.h" out-include)
5178 #t))))))
5179 (native-inputs
5180 `(("autoconf" ,autoconf)
5181 ("automake" ,automake)
5182 ("libtool" ,libtool)
5183 ("pkg-config" ,pkg-config)))
5184 (inputs
5185 `(("libuuid" ,util-linux "lib")
5186 ("libselinux" ,libselinux)))
5187 (home-page "https://f2fs.wiki.kernel.org/")
5188 (synopsis "Userland tools for f2fs")
5189 (description
5190 "F2FS, the Flash-Friendly File System, is a modern file system
5191 designed to be fast and durable on flash devices such as solid-state
5192 disks and SD cards. This package provides the userland utilities.")
5193 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
5194 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
5195 (license (list license:gpl2 license:lgpl2.1))))
5196
5197 (define-public f2fs-tools
5198 (package
5199 (inherit f2fs-tools-1.7)
5200 (name "f2fs-tools")
5201 (version "1.14.0")
5202 (source (origin
5203 (method url-fetch)
5204 (uri (string-append
5205 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
5206 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
5207 (sha256
5208 (base32
5209 "1lab1446c78xsjwhpki7s85z4171m8p9279c8yhm4882wba674k1"))))
5210 (inputs
5211 `(("libuuid" ,util-linux "lib")))))
5212
5213 (define-public f2fs-tools/static
5214 (static-package
5215 (package
5216 (inherit f2fs-tools)
5217 (name "f2fs-tools-static")
5218 (arguments
5219 `(#:configure-flags
5220 (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static"))
5221 (libuuid (assoc-ref %build-inputs "libuuid")))
5222 (list
5223 (string-append "libuuid_CFLAGS=-I" libuuid "/include/uuid")
5224 (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid")
5225 (string-append "libblkid_CFLAGS=-I" libuuid "/include/uuid "
5226 "-I" libuuid "/include/blkid")
5227 (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid")))
5228 #:disallowed-references (,util-linux)
5229 #:phases
5230 (modify-phases %standard-phases ; TODO: f2fs phases.
5231 (add-after 'unpack 'make-static
5232 (lambda _
5233 (define (append-to-file name body)
5234 (let ((file (open-file name "a")))
5235 (display body file)
5236 (close-port file)))
5237 (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n")
5238 (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n")
5239 (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n")
5240 #t))
5241 (add-after 'install 'remove-store-references
5242 (lambda* (#:key outputs #:allow-other-keys)
5243 ;; Work around bug in our util-linux.
5244 ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>.
5245 (remove-store-references (string-append (assoc-ref outputs "out")
5246 "/sbin/mkfs.f2fs"))
5247 #t)))))
5248 (inputs
5249 `(("libuuid:static" ,util-linux "static")
5250 ("libuuid" ,util-linux "lib")))))) ; for include files
5251
5252 (define-public f2fs-fsck/static
5253 (package
5254 (name "f2fs-fsck-static")
5255 (version (package-version f2fs-tools/static))
5256 (source #f)
5257 (build-system trivial-build-system)
5258 (arguments
5259 `(#:modules ((guix build utils))
5260 #:builder
5261 (begin
5262 (use-modules (guix build utils)
5263 (ice-9 ftw)
5264 (srfi srfi-26))
5265 (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static"))
5266 (fsck "fsck.f2fs")
5267 (out (assoc-ref %outputs "out"))
5268 (sbin (string-append out "/sbin")))
5269 (mkdir-p sbin)
5270 (with-directory-excursion sbin
5271 (install-file (string-append f2fs-tools "/sbin/" fsck)
5272 ".")
5273 (remove-store-references fsck)
5274 (chmod fsck #o555))
5275 #t))))
5276 (inputs
5277 `(("f2fs-tools-static" ,f2fs-tools/static)))
5278 (home-page (package-home-page f2fs-tools/static))
5279 (synopsis "Statically-linked fsck.f2fs command from f2fs-tools")
5280 (description "This package provides statically-linked fsck.f2fs command taken
5281 from the f2fs-tools package. It is meant to be used in initrds.")
5282 (license (package-license f2fs-tools/static))))
5283
5284 (define-public freefall
5285 (package
5286 (name "freefall")
5287 (version (package-version linux-libre))
5288 (source (package-source linux-libre))
5289 (build-system gnu-build-system)
5290 (arguments
5291 '(#:phases (modify-phases %standard-phases
5292 (add-after 'unpack 'enter-subdirectory
5293 (lambda _
5294 (chdir "tools/laptop/freefall")
5295 #t))
5296 (delete 'configure)
5297 (add-before 'build 'increase-timeout
5298 (lambda _
5299 ;; The default of 2 seconds is too low: it assumes an
5300 ;; open lid and AC power without actually checking.
5301 (substitute* "freefall.c"
5302 (("alarm\\(2\\)") "alarm(5)"))
5303 #t)))
5304 #:make-flags (list (string-append "PREFIX="
5305 (assoc-ref %outputs "out"))
5306 "CC=gcc")
5307 #:tests? #f)) ;no tests
5308 (home-page (package-home-page linux-libre))
5309 (synopsis "Free-fall protection for spinning laptop hard drives")
5310 (description
5311 "Prevents shock damage to the internal spinning hard drive(s) of some
5312 HP and Dell laptops. When sudden movement is detected, all input/output
5313 operations on the drive are suspended and its heads are parked on the ramp,
5314 where they are less likely to cause damage to the spinning disc. Requires a
5315 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
5316 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
5317 (license license:gpl2)))
5318
5319 (define-public thinkfan
5320 (package
5321 (name "thinkfan")
5322 (version "1.2.1")
5323 (source
5324 (origin
5325 (method git-fetch)
5326 (uri (git-reference
5327 (url "https://github.com/vmatare/thinkfan")
5328 (commit version)))
5329 (file-name (git-file-name name version))
5330 (sha256
5331 (base32 "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz"))))
5332 (build-system cmake-build-system)
5333 (arguments
5334 `(#:modules ((guix build cmake-build-system)
5335 (guix build utils)
5336 (srfi srfi-26))
5337 #:tests? #f ; no test target
5338 #:configure-flags
5339 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
5340 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
5341 ;; inefficient’.
5342 `("-DUSE_ATASMART:BOOL=ON")
5343 #:phases
5344 (modify-phases %standard-phases
5345 (add-after 'unpack 'create-init-scripts
5346 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
5347 ;; systemd to patch and install their service files. Fake their
5348 ;; presence rather than duplicating the build system below. Leave
5349 ;; things like ‘/bin/kill’ because they're not worth a dependency.
5350 ;; The sysvinit needs manual patching, but since upstream doesn't
5351 ;; even provide the option to install it: don't.
5352 (lambda* (#:key outputs #:allow-other-keys)
5353 (let* ((out (assoc-ref outputs "out"))
5354 (share (string-append out "/share/" ,name)))
5355 (substitute* "CMakeLists.txt"
5356 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
5357 (format #f "option(~a_FOUND \"Faked\" ON)\n" package))
5358 ;; That was easy! Now we just need to fix the destinations.
5359 (("/etc" directory)
5360 (string-append out directory)))
5361 #t))))))
5362 (native-inputs
5363 `(("pkg-config" ,pkg-config)))
5364 (inputs
5365 `(("libatasmart" ,libatasmart)
5366 ("yaml-cpp" ,yaml-cpp)))
5367 (home-page "https://github.com/vmatare/thinkfan")
5368 (synopsis "Simple fan control program")
5369 (description
5370 "Thinkfan is a simple fan control program. It reads temperatures,
5371 checks them against configured limits and switches to appropriate (also
5372 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
5373 other @code{hwmon} driver that enables temperature reading and fan control
5374 from userspace.")
5375 (license license:gpl3+)))
5376
5377 (define-public tpacpi-bat
5378 (package
5379 (name "tpacpi-bat")
5380 (version "3.1")
5381 (source
5382 (origin
5383 (method git-fetch)
5384 (uri (git-reference
5385 (url "https://github.com/teleshoes/tpacpi-bat")
5386 (commit (string-append "v" version))))
5387 (file-name (git-file-name name version))
5388 (sha256
5389 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
5390 (build-system gnu-build-system)
5391 (arguments
5392 `(#:tests? #f ; no test target
5393 #:phases
5394 (modify-phases %standard-phases
5395 (add-after 'unpack 'refer-to-inputs
5396 (lambda _
5397 (substitute* "tpacpi-bat"
5398 (("cat ")
5399 (format #f "~a " (which "cat")))
5400 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
5401 ;; loaded. That's the administrator's prerogative; disable it.
5402 (("system \"(modprobe .*)\"" _ match)
5403 (format #f "die \"Please run ‘~a’ first.\\n\"" match)))
5404 #t))
5405 (delete 'configure) ; nothing to configure
5406 (delete 'build) ; nothing to build
5407 (replace 'install
5408 (lambda* (#:key outputs #:allow-other-keys)
5409 (let* ((out (assoc-ref outputs "out"))
5410 (bin (string-append out "/bin"))
5411 (doc (string-append out "/share/doc/" ,name "-" ,version)))
5412 (install-file "tpacpi-bat" bin)
5413
5414 ;; There's no man page. Install other forms of documentation.
5415 (for-each (lambda (file)
5416 (let ((target (string-append doc "/" file)))
5417 (mkdir-p (dirname target))
5418 (copy-recursively file target)))
5419 (list "battery_asl" "examples" "README.md"))
5420 #t))))))
5421 (inputs
5422 `(("perl" ,perl)))
5423 (home-page "https://github.com/teleshoes/tpacpi-bat")
5424 (synopsis "ThinkPad battery charge controller")
5425 (description
5426 "Tpacpi-bat is a command-line interface to control battery charging on
5427 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
5428 ThinkPad models released after 2011}, starting with the xx20 series. It can
5429 query and set the thresholds at which one or both batteries will start and stop
5430 charging, inhibit charging batteries for a set period of time, or force them to
5431 discharge when they otherwise would not.
5432
5433 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
5434 kernel module provided by the @code{acpi-call-linux-module} package, which must
5435 be installed and loaded separately. Only the original vendor firmware is
5436 supported.")
5437 (license license:gpl3+)))
5438
5439 (define-public tmon
5440 (package
5441 (name "tmon")
5442 ;; Tmon's ‘VERSION = 1.0’ hasn't been touched since 2013; the code has.
5443 (version (package-version linux-libre))
5444 (source (package-source linux-libre))
5445 (build-system gnu-build-system)
5446 (arguments
5447 `(#:tests? #f ; no test suite
5448 #:make-flags
5449 (list (string-append "CC=" ,(cc-for-target))
5450 (string-append "INSTALL_ROOT=" (assoc-ref %outputs "out"))
5451 "BINDIR=bin")
5452 #:phases
5453 (modify-phases %standard-phases
5454 (add-after 'unpack 'enter-subdirectory
5455 (lambda _
5456 (chdir "tools/thermal/tmon")
5457 #t))
5458 (add-after 'install 'install-man-page
5459 (lambda* (#:key outputs #:allow-other-keys)
5460 (let* ((out (assoc-ref outputs "out"))
5461 (man8 (string-append out "/share/man/man8")))
5462 (install-file "tmon.8" man8)
5463 #t)))
5464 (delete 'configure)))) ; no configure script
5465 (inputs
5466 `(("ncurses" ,ncurses)))
5467 (home-page (package-home-page linux-libre))
5468 (synopsis "Monitor and test the Linux thermal subsystem in real time")
5469 (description
5470 "Tmon is a tool to interact with the complex thermal subsystem of the
5471 kernel Linux. It helps visualize thermal relationships and real-time thermal
5472 data, tune and test cooling devices and sensors, and collect thermal data for
5473 further analysis.
5474
5475 As computers become smaller and more thermally constrained, more sensors are
5476 added and new cooling capabilities introduced. Thermal relationships can change
5477 dynamically. Their complexity grows exponentially among cooling devices, zones,
5478 sensors, and trip points.
5479
5480 Linux exposes this relationship through @file{/sys/class/thermal} with a matrix
5481 of symbolic links, trip point bindings, and device instances. To traverse it
5482 by hand is no trivial task: @command{tmon} aims to make it understandable.")
5483 (license (list license:gpl2 ; the man page
5484 license:gpl2+)))) ; the actual rest
5485
5486 (define-public turbostat
5487 (package
5488 (name "turbostat")
5489 ;; XXX turbostat reports a version like ‘20.09.30’ but using it here would
5490 ;; make it harder to benefit from ‘free’ linux-libre package updates.
5491 (version (package-version linux-libre))
5492 (source (package-source linux-libre))
5493 (build-system gnu-build-system)
5494 (arguments
5495 `(#:tests? #f ; no test suite
5496 #:make-flags
5497 (list (string-append "CC=" ,(cc-for-target))
5498 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5499 #:phases
5500 (modify-phases %standard-phases
5501 (add-after 'unpack 'enter-subdirectory
5502 (lambda _
5503 (chdir "tools/power/x86/turbostat")
5504 #t))
5505 (delete 'configure)))) ; no configure script
5506 (inputs
5507 `(("libcap" ,libcap)))
5508 (supported-systems '("i686-linux" "x86_64-linux"))
5509 (home-page (package-home-page linux-libre))
5510 (synopsis "Report x86 processor frequency and idle statistics")
5511 (description
5512 "Turbostat reports x86 processor topology, frequency, idle power state
5513 statistics, temperature, and power consumption. Some information is unavailable
5514 on older processors.
5515
5516 It can be used to identify machines that are inefficient in terms of power usage
5517 or idle time, report the rate of @acronym{SMI, system management interrupt}s
5518 occurring on the system, or verify the effects of power management tuning.
5519
5520 @command{turbostat} reads hardware counters but doesn't write to them, so it
5521 won't interfere with the OS or other running processes---including multiple
5522 invocations of itself.")
5523 (license license:gpl2)))
5524
5525 (define-public ntfs-3g
5526 (package
5527 (name "ntfs-3g")
5528 (version "2017.3.23")
5529 (source (origin
5530 (method url-fetch)
5531 (uri (string-append "https://tuxera.com/opensource/"
5532 "ntfs-3g_ntfsprogs-" version ".tgz"))
5533 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
5534 (sha256
5535 (base32
5536 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
5537 (modules '((guix build utils)))
5538 (snippet '(begin
5539 ;; Install under $prefix.
5540 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
5541 (("/sbin")
5542 "@sbindir@"))
5543 #t))))
5544 (build-system gnu-build-system)
5545 (inputs `(("util-linux" ,util-linux)
5546 ("fuse" ,fuse))) ;libuuid
5547 (native-inputs `(("pkg-config" ,pkg-config)))
5548 (arguments
5549 '(#:configure-flags (list "--disable-static"
5550 "--exec-prefix=${prefix}"
5551 "--with-fuse=external" ;use our own FUSE
5552 "--enable-mount-helper"
5553 "--enable-posix-acls"
5554 "--enable-xattr-mappings")
5555 #:phases
5556 (modify-phases %standard-phases
5557 ;; If users install ntfs-3g, they probably want to make it the
5558 ;; default driver as well, so we opt for sensible defaults and link
5559 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
5560 ;; mount NTFS file systems.)
5561 (add-after 'install 'install-link
5562 (lambda* (#:key outputs #:allow-other-keys)
5563 (let* ((out (assoc-ref outputs "out"))
5564 (sbin (string-append out "/sbin")))
5565 (symlink "mount.ntfs-3g"
5566 (string-append sbin "/mount.ntfs")))
5567 #t)))))
5568 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
5569 (synopsis "Read-write access to NTFS file systems")
5570 (description
5571 "NTFS-3G provides read-write access to NTFS file systems, which are
5572 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
5573 The package provides additional NTFS tools.")
5574 (license license:gpl2+)))
5575
5576 (define-public rdma-core
5577 (package
5578 (name "rdma-core")
5579 (version "33.1")
5580 (source (origin
5581 (method url-fetch)
5582 (uri (string-append "https://github.com/linux-rdma/rdma-core"
5583 "/releases/download/v" version "/rdma-core-"
5584 version ".tar.gz"))
5585 (sha256
5586 (base32
5587 "1rah0v9gq9rksqd2c17nmydsxcjz178n7m2y4ricwlf5pq1b2yfi"))))
5588 (build-system cmake-build-system)
5589 (arguments
5590 `(#:tests? #f ; no tests
5591 ;; Upstream uses the "ninja" build system and encourage distros
5592 ;; to do the same for consistency.
5593 #:configure-flags (list "-GNinja"
5594
5595 (string-append "-DRST2MAN_EXECUTABLE="
5596 (assoc-ref %build-inputs
5597 "python-docutils")
5598 "/bin/rst2man.py"))
5599 #:phases
5600 (modify-phases %standard-phases
5601 (replace 'build
5602 (lambda _
5603 (invoke "ninja"
5604 "-j" (number->string (parallel-job-count)))))
5605 (replace 'install
5606 (lambda _
5607 (invoke "ninja" "install"))))))
5608 (native-inputs
5609 `(("ninja" ,ninja)
5610 ("pkg-config" ,pkg-config)
5611 ("python" ,python-wrapper)
5612 ("python-docutils" ,python-docutils))) ;for 'rst2man'
5613 (inputs
5614 `(("libnl" ,libnl)
5615 ("udev" ,eudev)))
5616 (home-page "https://github.com/linux-rdma/rdma-core")
5617 (synopsis "Utilities and libraries for working with RDMA devices")
5618 (description
5619 "This package provides userspace components for the InfiniBand
5620 subsystem of the Linux kernel. Specifically it contains userspace
5621 libraries for the following device nodes:
5622
5623 @enumerate
5624 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
5625 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
5626 @item @file{/dev/infiniband/umadX} (@code{libibumad})
5627 @end enumerate
5628
5629 The following service daemons are also provided:
5630 @enumerate
5631 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
5632 @item @code{iwpmd} (for iWARP kernel providers)
5633 @item @code{ibacm} (for InfiniBand communication management assistant)
5634 @end enumerate")
5635 ;; All library code is dual licensed under GPL2 and a custom MIT
5636 ;; variant. The package also includes some components covered by
5637 ;; other licenses. Consult COPYING.md for full details.
5638 (license
5639 (list license:gpl2
5640 (license:x11-style "See COPYING.BSD_MIT in the distribution")
5641 license:bsd-2 ; Files referring to COPYING.BSD_FB
5642 license:cc0 ; most files in ccan/
5643 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
5644
5645 (define-public perftest
5646 (package
5647 (name "perftest")
5648 (version "4.4-0.4")
5649 (source
5650 (origin
5651 (method url-fetch)
5652 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
5653 version "/perftest-" version ".g0927198.tar.gz"))
5654 (sha256
5655 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
5656 (build-system gnu-build-system)
5657 (arguments
5658 `(#:phases
5659 (modify-phases %standard-phases
5660 (add-after 'unpack 'patch-header-paths
5661 (lambda _
5662 (substitute* '("src/raw_ethernet_fs_rate.c"
5663 "src/raw_ethernet_resources.c"
5664 "src/raw_ethernet_resources.h"
5665 "src/raw_ethernet_send_burst_lat.c"
5666 "src/raw_ethernet_send_bw.c"
5667 "src/raw_ethernet_send_lat.c")
5668 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
5669 #t)))))
5670 (inputs `(("rdma-core" ,rdma-core)))
5671 (home-page "https://github.com/linux-rdma/perftest/")
5672 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
5673 (description "This is a collection of tests written over uverbs intended for
5674 use as a performance micro-benchmark. The tests may be used for hardware or
5675 software tuning as well as for functional testing.
5676
5677 The collection contains a set of bandwidth and latency benchmark such as:
5678 @enumerate
5679 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
5680 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
5681 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
5682 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
5683 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
5684 @end enumerate")
5685 (license license:gpl2)))
5686
5687 (define-public rng-tools
5688 (package
5689 (name "rng-tools")
5690 (home-page "https://github.com/nhorman/rng-tools")
5691 (version "6.12")
5692 (source (origin
5693 (method git-fetch)
5694 (uri (git-reference (url home-page)
5695 (commit (string-append "v" version))))
5696 (file-name (git-file-name name version))
5697 (sha256
5698 (base32
5699 "0z4j3kqh9k3zsrx6257hwh4fa51vqg79c6dnfrj6lhpcll0wh0hm"))))
5700 (build-system gnu-build-system)
5701 (arguments
5702 `(;; Disable support for various hardware entropy sources as they need
5703 ;; dependencies that are not yet in Guix, and would significantly
5704 ;; increase closure size.
5705 #:configure-flags '("--without-nistbeacon"
5706 "--without-pkcs11"
5707 "--without-rtlsdr")))
5708 (native-inputs
5709 `(("autoconf" ,autoconf)
5710 ("automake" ,automake)
5711 ("pkg-config" ,pkg-config)))
5712 (inputs
5713 `(("libsysfs" ,sysfsutils)
5714 ("openssl" ,openssl)))
5715 (synopsis "Random number generator daemon")
5716 (description
5717 "Monitor a hardware random number generator, and supply entropy
5718 from that to the system kernel's @file{/dev/random} machinery.")
5719 ;; The source package is offered under the GPL2+, but the files
5720 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
5721 (license (list license:gpl2 license:gpl2+))))
5722
5723 (define-public cpupower
5724 (package
5725 (name "cpupower")
5726 (version (package-version linux-libre))
5727 (source (package-source linux-libre))
5728 (build-system gnu-build-system)
5729 (arguments
5730 '(#:phases (modify-phases %standard-phases
5731 (add-after 'unpack 'enter-subdirectory
5732 (lambda _
5733 (chdir "tools/power/cpupower")
5734 #t))
5735 (delete 'configure)
5736 (add-before 'build 'fix-makefiles
5737 (lambda _
5738 (substitute* "Makefile"
5739 (("/usr/") "/")
5740 (("/bin/(install|pwd)" _ command) command))
5741 (substitute* "bench/Makefile"
5742 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
5743 #t)))
5744 #:make-flags (let ((out (assoc-ref %outputs "out")))
5745 (list (string-append "DESTDIR=" out)
5746 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
5747 "libdir=/lib"
5748 "docdir=/share/doc/cpupower"
5749 "confdir=$(docdir)/examples"
5750 ;; The Makefile recommends the following changes
5751 "DEBUG=false"
5752 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
5753 #:tests? #f)) ;no tests
5754 (native-inputs `(("gettext" ,gettext-minimal)))
5755 (inputs `(("pciutils" ,pciutils)))
5756 (home-page (package-home-page linux-libre))
5757 (synopsis "CPU frequency and voltage scaling tools for Linux")
5758 (description
5759 "cpupower is a set of user-space tools that use the cpufreq feature of the
5760 Linux kernel to retrieve and control processor features related to power saving,
5761 such as frequency and voltage scaling.")
5762 (license license:gpl2)))
5763
5764 (define-public x86-energy-perf-policy
5765 (package
5766 (name "x86-energy-perf-policy")
5767 (version (package-version linux-libre))
5768 (source (package-source linux-libre))
5769 (build-system gnu-build-system)
5770 (arguments
5771 '(#:tests? #f
5772 #:phases
5773 (modify-phases %standard-phases
5774 (add-after 'unpack 'enter-subdirectory
5775 (lambda _
5776 (chdir "tools/power/x86/x86_energy_perf_policy")
5777 #t))
5778 (delete 'configure)
5779 (add-before 'build 'fix-makefile
5780 (lambda _
5781 (substitute* "Makefile" (("/usr") ""))
5782 #t)))
5783 #:make-flags
5784 (let ((out (assoc-ref %outputs "out")))
5785 (list (string-append "DESTDIR=" out)
5786 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
5787 (supported-systems '("i686-linux" "x86_64-linux"))
5788 (home-page (package-home-page linux-libre))
5789 (synopsis "Display and update Intel-CPU energy-performance policy")
5790 (description
5791 "@command{x86_energy_perf_policy} displays and updates energy-performance
5792 policy settings specific to Intel Architecture Processors. Settings are
5793 accessed via Model Specific Register (MSR) updates, no matter if the Linux
5794 cpufreq sub-system is enabled or not.")
5795 (license license:gpl2)))
5796
5797 (define-public haveged
5798 (package
5799 (name "haveged")
5800 (version "1.9.14")
5801 (source
5802 (origin
5803 (method git-fetch)
5804 (uri (git-reference
5805 (url "https://github.com/jirka-h/haveged")
5806 (commit (string-append "v" version))))
5807 (file-name (git-file-name name version))
5808 (sha256
5809 (base32 "050hmnh5s2s4mb83f4d1fk23mk27pprg840c1aagc6v1sz6x5dhq"))))
5810 (build-system gnu-build-system)
5811 (home-page "https://www.issihosts.com/haveged")
5812 (synopsis "Entropy source for the Linux random number generator")
5813 (description
5814 "haveged generates an unpredictable stream of random numbers for use by
5815 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
5816 standard mechanisms for filling the entropy pool may not be sufficient for
5817 systems with high needs or limited user interaction, such as headless servers.
5818
5819 @command{haveged} runs as a privileged daemon, harvesting randomness from the
5820 indirect effects of hardware events on hidden processor state using the
5821 @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
5822 It tunes itself to its environment and provides the same built-in test suite
5823 for the output stream as used on certified hardware security devices.
5824
5825 The quality of the randomness produced by this algorithm has not been proven.
5826 It is recommended to run it together with another entropy source like rngd, and
5827 not as a replacement for it.")
5828 (license (list (license:non-copyleft "file://nist/mconf.h")
5829 (license:non-copyleft "file://nist/packtest.c")
5830 license:public-domain ; nist/dfft.c
5831 license:gpl3+)))) ; everything else
5832
5833 (define-public ecryptfs-utils
5834 (package
5835 (name "ecryptfs-utils")
5836 (version "111")
5837 (source
5838 (origin
5839 (method url-fetch)
5840 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
5841 version "/+download/ecryptfs-utils_"
5842 version ".orig.tar.gz"))
5843 (sha256
5844 (base32
5845 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
5846 (build-system gnu-build-system)
5847 (arguments
5848 `(#:configure-flags (list "--disable-pywrap")
5849 #:phases
5850 (modify-phases %standard-phases
5851 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
5852 (lambda* (#:key inputs outputs #:allow-other-keys)
5853 (let ((out (assoc-ref outputs "out"))
5854 (utils-linux (assoc-ref inputs "utils-linux"))
5855 (cryptsetup (assoc-ref inputs "cryptsetup"))
5856 (linux-pam (assoc-ref inputs "linux-pam"))
5857 (lvm2 (assoc-ref inputs "lvm2")))
5858 (substitute* '("src/utils/ecryptfs-mount-private"
5859 "src/utils/ecryptfs-umount-private"
5860 "src/utils/ecryptfs-setup-private"
5861 "src/utils/ecryptfs-setup-swap"
5862 "src/utils/mount.ecryptfs.c"
5863 "src/utils/umount.ecryptfs.c"
5864 "src/pam_ecryptfs/pam_ecryptfs.c"
5865 "src/desktop/ecryptfs-mount-private.desktop.in"
5866 "src/desktop/ecryptfs-setup-private.desktop.in")
5867 (("/bin/mount")
5868 (string-append utils-linux "/bin/mount"))
5869 (("/bin/umount")
5870 (string-append utils-linux "/bin/umount"))
5871 (("/sbin/mount.ecryptfs_private")
5872 (string-append out "/sbin/mount.ecryptfs_private"))
5873 (("/sbin/umount.ecryptfs_private")
5874 (string-append out "/sbin/umount.ecryptfs_private"))
5875 (("/usr/bin/ecryptfs-mount-private")
5876 (string-append out "/bin/ecryptfs-mount-private"))
5877 (("/usr/bin/ecryptfs-rewrite-file")
5878 (string-append out "/bin/ecryptfs-rewrite-file"))
5879 (("/usr/bin/ecryptfs-setup-private")
5880 (string-append out "/bin/ecryptfs-setup-private"))
5881 (("/sbin/cryptsetup")
5882 (string-append cryptsetup "/sbin/cryptsetup"))
5883 (("/sbin/unix_chkpwd")
5884 (string-append linux-pam "/sbin/unix_chkpwd"))
5885 (("/sbin/dmsetup")
5886 (string-append lvm2 "/sbin/dmsetup")))))))))
5887 (native-inputs
5888 `(("intltool" ,intltool)
5889 ("perl" ,perl) ; for pod2man
5890 ("pkg-config" ,pkg-config)))
5891 (inputs
5892 `(("keyutils" ,keyutils)
5893 ("linux-pam" ,linux-pam)
5894 ("utils-linux" ,util-linux)
5895 ("cryptsetup" ,cryptsetup)
5896 ("lvm2" ,lvm2)
5897 ("nss" ,nss)))
5898 (home-page "https://ecryptfs.org/")
5899 (synopsis "eCryptfs cryptographic file system utilities")
5900 (description
5901 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
5902 Each file's cryptographic meta-data is stored inside the file itself, along
5903 with the encrypted contents. This allows individual encrypted files to be
5904 copied between hosts and still be decrypted with the proper key. eCryptfs is a
5905 native Linux file system, and has been part of the Linux kernel since version
5906 2.6.19. This package contains the userland utilities to manage it.")
5907 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
5908 ;; grant additional permission to link with OpenSSL.
5909 (license license:gpl2+)))
5910
5911 (define-public libnfsidmap
5912 (package
5913 (name "libnfsidmap")
5914 (version "0.27")
5915 (source
5916 (origin
5917 (method url-fetch)
5918 (uri (string-append "https://fedorapeople.org/~steved/"
5919 name "/" version "/" name "-" version ".tar.bz2"))
5920 (sha256
5921 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
5922 (build-system gnu-build-system)
5923 (arguments
5924 `(#:configure-flags (list
5925 (string-append "--with-pluginpath="
5926 (assoc-ref %outputs "out")
5927 "/lib/libnfsidmap"))))
5928 (native-inputs
5929 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
5930 (home-page
5931 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
5932 (synopsis "NFSv4 support library for name/ID mapping")
5933 (description "Libnfsidmap is a library holding mulitiple methods of
5934 mapping names to ids and visa versa, mainly for NFSv4. It provides an
5935 extensible array of mapping functions, currently consisting of two choices:
5936 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
5937 (license (license:non-copyleft "file://COPYING"
5938 "See COPYING in the distribution."))))
5939
5940 (define-public module-init-tools
5941 (package
5942 (name "module-init-tools")
5943 (version "3.16")
5944 (source (origin
5945 (method url-fetch)
5946 (uri (string-append
5947 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
5948 "module-init-tools-" version ".tar.bz2"))
5949 (sha256
5950 (base32
5951 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
5952 (patches (search-patches "module-init-tools-moduledir.patch"))))
5953 (build-system gnu-build-system)
5954 (arguments
5955 ;; FIXME: The upstream tarball lacks man pages, and building them would
5956 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
5957 ;; but they vanished. In the meantime, fake it.
5958 '(#:phases
5959 (modify-phases %standard-phases
5960 (add-before 'configure 'fake-docbook
5961 (lambda _
5962 (substitute* "Makefile.in"
5963 (("^DOCBOOKTOMAN.*$")
5964 "DOCBOOKTOMAN = true\n"))
5965 #t)))))
5966 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
5967 (synopsis "Tools for loading and managing Linux kernel modules")
5968 (description
5969 "Tools for loading and managing Linux kernel modules, such as
5970 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
5971 (license license:gpl2+)))
5972
5973 (define-public mcelog
5974 (package
5975 (name "mcelog")
5976 (version "175")
5977 (source
5978 (origin
5979 (method git-fetch)
5980 (uri (git-reference
5981 (url "https://git.kernel.org/pub/scm/utils/cpu/mce/mcelog.git")
5982 (commit (string-append "v" version))))
5983 (file-name (git-file-name name version))
5984 (sha256
5985 (base32 "0vvrnjkh1jp7f6295syydg7lplqmcm8msdls3xyk8xfiz69xqdjz"))
5986 (modules '((guix build utils)))
5987 (snippet
5988 `(begin
5989 ;; The checkout lack a .git directory, breaking ‘git describe’.
5990 (substitute* "Makefile"
5991 (("\"unknown\"") (string-append "\"v" ,version "\"")))
5992 #t))))
5993 (build-system gnu-build-system)
5994 (arguments
5995 `(#:phases (modify-phases %standard-phases
5996 (delete 'configure)) ; no configure script
5997 #:make-flags (let ((out (assoc-ref %outputs "out")))
5998 (list (string-append "CC=" ,(cc-for-target))
5999 (string-append "prefix=" out)
6000 (string-append "DOCDIR=" out "/share/doc/"
6001 ,name "-" ,version)
6002 "etcprefix=$(DOCDIR)/examples"))
6003 ;; The tests will only run as root on certain supported CPU models.
6004 #:tests? #f))
6005 (supported-systems (list "i686-linux" "x86_64-linux"))
6006 (home-page "https://mcelog.org/")
6007 (synopsis "Machine check monitor for x86 Linux systems")
6008 (description
6009 "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86
6010 systems running the kernel Linux. It can also perform user-defined tasks, such
6011 as bringing bad pages off-line, when configurable error thresholds are
6012 exceeded.")
6013 (license license:gpl2)))
6014
6015 (define-public mtd-utils
6016 (package
6017 (name "mtd-utils")
6018 (version "2.1.2")
6019 (source (origin
6020 (method url-fetch)
6021 (uri (string-append
6022 "ftp://ftp.infradead.org/pub/mtd-utils/"
6023 "mtd-utils-" version ".tar.bz2"))
6024 (sha256
6025 (base32
6026 "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a"))))
6027 (arguments
6028 '(#:configure-flags '("--enable-unit-tests")))
6029 (native-inputs
6030 `(("cmocka" ,cmocka)
6031 ("pkg-config" ,pkg-config)))
6032 (inputs
6033 `(("acl" ,acl) ; extended attributes (xattr)
6034 ("libuuid" ,util-linux "lib")
6035 ("lzo" ,lzo)
6036 ("openssl" ,openssl) ; optional crypto support
6037 ("zlib" ,zlib)
6038 ("zstd" ,zstd "lib")))
6039 (build-system gnu-build-system)
6040 (synopsis "MTD Flash Storage Utilities")
6041 (description "This package provides utilities for testing, partitioning, etc
6042 of flash storage.")
6043 (home-page "http://www.linux-mtd.infradead.org/")
6044 (license
6045 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
6046 license:mpl1.1 ; All ftl* files
6047 license:expat)))) ; libiniparser
6048
6049 (define-public libseccomp
6050 (package
6051 (name "libseccomp")
6052 (version "2.5.1")
6053 (source (origin
6054 (method url-fetch)
6055 (uri (string-append "https://github.com/seccomp/libseccomp/"
6056 "releases/download/v" version
6057 "/libseccomp-" version ".tar.gz"))
6058 (sha256
6059 (base32
6060 "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f"))))
6061 (build-system gnu-build-system)
6062 (arguments
6063 '(#:configure-flags '("--disable-static")
6064 #:phases (modify-phases %standard-phases
6065 (add-before 'check 'skip-load-test
6066 (lambda _
6067 ;; This test does a native system call and fails when
6068 ;; run under QEMU user-mode emulation. Just skip it.
6069 (delete-file "tests/52-basic-load.tests")
6070 #t)))))
6071 (native-inputs
6072 `(("gperf" ,gperf)
6073 ("which" ,which)))
6074 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
6075 (description "The libseccomp library provides an easy to use, platform
6076 independent, interface to the Linux Kernel's syscall filtering mechanism. The
6077 libseccomp API is designed to abstract away the underlying BPF based syscall
6078 filter language and present a more conventional function-call based filtering
6079 interface that should be familiar to, and easily adopted by, application
6080 developers.")
6081 (home-page "https://github.com/seccomp/libseccomp")
6082 (license license:lgpl2.1)))
6083
6084 (define-public radeontop
6085 (package
6086 (name "radeontop")
6087 (version "1.3")
6088 (source
6089 (origin
6090 (method git-fetch)
6091 (uri (git-reference
6092 (url "https://github.com/clbr/radeontop")
6093 (commit (string-append "v" version))))
6094 (file-name (git-file-name name version))
6095 (sha256
6096 (base32 "0ay6vl9zsz9b2scy0fnsy482pzizj52i27syxwny4z4i9wrk2wmn"))))
6097 (build-system gnu-build-system)
6098 (arguments
6099 `(#:phases (modify-phases %standard-phases
6100 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
6101 ;; dependency, and doesn't even work on release(!) tarballs.
6102 (add-after 'unpack 'report-correct-version
6103 (lambda _
6104 (substitute* "getver.sh"
6105 (("ver=unknown")
6106 (string-append "ver=" ,version)))
6107 #t))
6108 (delete 'configure)) ; no configure script
6109 #:make-flags (list "CC=gcc"
6110 (string-append "PREFIX=" %output))
6111 #:tests? #f)) ; no tests
6112 (native-inputs
6113 `(("gettext" ,gettext-minimal)
6114 ("pkg-config" ,pkg-config)))
6115 (inputs
6116 `(("libdrm" ,libdrm)
6117 ("libpciaccess" ,libpciaccess)
6118 ("libxcb" ,libxcb)
6119 ("ncurses" ,ncurses)))
6120 (home-page "https://github.com/clbr/radeontop/")
6121 (synopsis "Usage monitor for AMD Radeon graphics")
6122 (description "RadeonTop monitors resource consumption on supported AMD
6123 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
6124 a terminal or saved to a file for further processing. It measures both the
6125 activity of the GPU as a whole, which is also accurate during OpenCL
6126 computations, as well as separate component statistics that are only meaningful
6127 under OpenGL graphics workloads.")
6128 (license license:gpl3)))
6129
6130 (define-public efivar
6131 (package
6132 (name "efivar")
6133 (version "37")
6134 (source (origin
6135 (method url-fetch)
6136 (uri (string-append "https://github.com/rhboot/" name
6137 "/releases/download/" version "/" name
6138 "-" version ".tar.bz2"))
6139 (sha256
6140 (base32
6141 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
6142 (build-system gnu-build-system)
6143 (arguments
6144 `(;; Tests require a UEFI system and is not detected in the chroot.
6145 #:tests? #f
6146 #:make-flags (list (string-append "prefix=" %output)
6147 (string-append "libdir=" %output "/lib")
6148 "CC_FOR_BUILD=gcc"
6149 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6150 #:phases
6151 (modify-phases %standard-phases
6152 (delete 'configure))))
6153 (native-inputs
6154 `(("pkg-config" ,pkg-config)))
6155 (inputs
6156 `(("popt" ,popt)))
6157 (home-page "https://github.com/rhboot/efivar")
6158 (synopsis "Tool and library to manipulate EFI variables")
6159 (description "This package provides a library and a command line
6160 interface to the variable facility of UEFI boot firmware.")
6161 (license license:lgpl2.1+)))
6162
6163 (define-public efibootmgr
6164 (package
6165 (name "efibootmgr")
6166 (version "17")
6167 (source
6168 (origin
6169 (method git-fetch)
6170 (uri (git-reference
6171 (url "https://github.com/rhinstaller/efibootmgr")
6172 (commit version)))
6173 (file-name (git-file-name name version))
6174 (sha256
6175 (base32 "1niicijxg59rsmiw3rsjwy4bvi1n42dynvm01lnp9haixdzdpq03"))
6176 (patches (search-patches "efibootmgr-remove-extra-decl.patch"))))
6177 (build-system gnu-build-system)
6178 (arguments
6179 `(#:tests? #f ;no tests
6180 #:make-flags (list (string-append "prefix=" %output)
6181 (string-append "libdir=" %output "/lib")
6182 ;; EFIDIR denotes a subdirectory relative to the
6183 ;; EFI System Partition where the loader will be
6184 ;; installed (known as OS_VENDOR in the code).
6185 ;; GRUB overrides this, as such it's only used if
6186 ;; nothing else is specified on the command line.
6187 "EFIDIR=gnu")
6188 #:phases (modify-phases %standard-phases (delete 'configure))))
6189 (native-inputs
6190 `(("pkg-config" ,pkg-config)))
6191 (inputs
6192 `(("efivar" ,efivar)
6193 ("popt" ,popt)))
6194 (home-page "https://github.com/rhinstaller/efibootmgr")
6195 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
6196 (description
6197 "@code{efibootmgr} is a user-space application to modify the Intel
6198 Extensible Firmware Interface (EFI) Boot Manager. This application can
6199 create and destroy boot entries, change the boot order, change the next
6200 running boot option, and more.")
6201 (license license:gpl2+)))
6202
6203 (define-public sysstat
6204 (package
6205 (name "sysstat")
6206 (version "12.4.3")
6207 (source
6208 (origin
6209 (method url-fetch)
6210 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6211 "sysstat-" version ".tar.xz"))
6212 (sha256
6213 (base32 "1z8bdyj92q0capbrdscwzb51bqh54ng15gpvmjmvrb2syhqj8hxf"))))
6214 (build-system gnu-build-system)
6215 (arguments
6216 `(#:tests? #f ; no test suite.
6217 ;; Without this flag, it tries to install the man pages with group 'root'
6218 ;; and fails because /etc/passwd lacks an entry for the root user.
6219 #:configure-flags
6220 (list "--disable-file-attr"
6221 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
6222 #:phases
6223 (modify-phases %standard-phases
6224 ;; The build process tries to create '/var/lib/sa', so we skip that
6225 ;; instruction.
6226 (add-after 'build 'skip-touching-var
6227 (lambda _
6228 (substitute* "Makefile"
6229 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
6230 ""))
6231 #t)))))
6232 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
6233 (synopsis "Performance monitoring tools for Linux")
6234 (description "The sysstat utilities are a collection of performance
6235 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
6236 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
6237 @code{sadf} and @code{sa}.")
6238 (license license:gpl2+)))
6239
6240 (define-public light
6241 (package
6242 (name "light")
6243 (version "1.2.2")
6244 (source
6245 (origin
6246 (method git-fetch)
6247 (uri (git-reference
6248 (url "https://github.com/haikarainen/light")
6249 (commit (string-append "v" version))))
6250 (sha256
6251 (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s"))
6252 (file-name (git-file-name name version))))
6253 (build-system gnu-build-system)
6254 (arguments
6255 `(#:phases
6256 (modify-phases %standard-phases
6257 (add-after 'unpack 'patch-udev-rules-absolute-path-bins
6258 (lambda* (#:key inputs #:allow-other-keys)
6259 (substitute* "90-backlight.rules"
6260 (("/bin/chgrp") (which "chgrp"))
6261 (("/bin/chmod") (which "chmod")))
6262 #t))
6263 (add-after 'install 'install-udev-rules
6264 (lambda* (#:key outputs #:allow-other-keys)
6265 (let ((out (assoc-ref outputs "out")))
6266 (install-file
6267 "90-backlight.rules" (string-append out "/lib/udev/rules.d"))
6268 #t))))))
6269 (native-inputs
6270 `(("autoconf" ,autoconf)
6271 ("automake" ,automake)))
6272 (home-page "https://haikarainen.github.io/light/")
6273 (synopsis "GNU/Linux application to control backlights")
6274 (description
6275 "Light is a program to send commands to screen backlight controllers
6276 under GNU/Linux. Features include:
6277
6278 @itemize
6279 @item It does not rely on X.
6280 @item Light can automatically figure out the best controller to use, making
6281 full use of underlying hardware.
6282 @item It is possible to set a minimum brightness value, as some controllers
6283 set the screen to be pitch black at a value of 0 (or higher).
6284 @end itemize\n")
6285 (license license:gpl3+)))
6286
6287 (define-public brightnessctl
6288 (package
6289 (name "brightnessctl")
6290 (version "0.5.1")
6291 (home-page "https://github.com/Hummer12007/brightnessctl")
6292 (source (origin
6293 (method git-fetch)
6294 (uri (git-reference (url home-page) (commit version)))
6295 (file-name (git-file-name name version))
6296 (sha256
6297 (base32
6298 "0immxc7almmpg80n3bdn834p3nrrz7bspl2syhb04s3lawa5y2lq"))))
6299 (build-system gnu-build-system)
6300 (arguments
6301 `(#:tests? #f ; no tests
6302 #:make-flags (list (string-append "CC=" ,(cc-for-target))
6303 (string-append "PREFIX=" %output)
6304 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
6305 #:phases
6306 (modify-phases %standard-phases
6307 (delete 'configure)
6308 (add-after 'unpack 'adjust-udev-rules
6309 (lambda _
6310 (substitute* "90-brightnessctl.rules"
6311 (("/bin/") "/run/current-system/profile/bin/"))
6312 #t)))))
6313 (synopsis "Backlight and LED brightness control")
6314 (description
6315 "This program allows you read and control device brightness. Devices
6316 include backlight and LEDs. It can also preserve current brightness before
6317 applying the operation, such as on lid close.
6318
6319 The appropriate permissions must be set on the backlight or LED control
6320 interface in sysfs, which can be accomplished with the included udev rules.")
6321 (license license:expat)))
6322
6323 (define-public tlp
6324 (package
6325 (name "tlp")
6326 (version "1.3.1")
6327 (source
6328 (origin
6329 (method git-fetch)
6330 (uri (git-reference
6331 (url "https://github.com/linrunner/TLP")
6332 (commit version)))
6333 (file-name (git-file-name name version))
6334 (sha256
6335 (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5"))))
6336 (native-inputs
6337 `(("shellcheck" ,shellcheck)))
6338 (inputs
6339 `(("bash" ,bash)
6340 ("dbus" ,dbus)
6341 ("ethtool" ,ethtool)
6342 ("eudev" ,eudev)
6343 ("grep" ,grep)
6344 ("hdparm" ,hdparm)
6345 ("inetutils" ,inetutils)
6346 ("iw" ,iw)
6347 ("kmod" ,kmod)
6348 ("pciutils" ,pciutils)
6349 ("perl" ,perl)
6350 ("rfkill" ,rfkill)
6351 ("sed" ,sed)
6352 ("usbutils" ,usbutils)
6353 ("util-linux" ,util-linux)
6354 ("wireless-tools" ,wireless-tools)
6355 ,@(if (let ((system (or (%current-target-system)
6356 (%current-system))))
6357 (or (string-prefix? "i686-" system)
6358 (string-prefix? "x86_64-" system)))
6359 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
6360 '())))
6361 (build-system gnu-build-system)
6362 (arguments
6363 ;; XXX: The full test suite is run with "checkall" but it requires
6364 ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
6365 `(#:test-target "shellcheck"
6366 #:modules ((guix build gnu-build-system)
6367 (guix build utils)
6368 (srfi srfi-1))
6369 #:phases
6370 (modify-phases %standard-phases
6371 (delete 'configure) ; no configure script
6372 (add-before 'build 'setenv
6373 (lambda* (#:key outputs #:allow-other-keys)
6374 (let ((out (assoc-ref outputs "out")))
6375 (setenv "TLP_WITH_SYSTEMD" "0")
6376 (setenv "TLP_NO_INIT" "1")
6377 (setenv "TLP_NO_PMUTILS" "1")
6378 (setenv "TLP_SBIN" (string-append out "/bin"))
6379 (setenv "TLP_BIN" (string-append out "/bin"))
6380 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
6381 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
6382 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
6383 (setenv "TLP_CONFDEF"
6384 (string-append out "/share/tlp/defaults.conf"))
6385 (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d"))
6386 (setenv "TLP_ELOD"
6387 (string-append out "/lib/elogind/system-sleep"))
6388 (setenv "TLP_SHCPL"
6389 (string-append out "/share/bash-completion/completions"))
6390 (setenv "TLP_MAN" (string-append out "/share/man"))
6391 (setenv "TLP_META" (string-append out "/share/metainfo"))
6392 #t)))
6393 (add-before 'install 'fix-installation
6394 (lambda _
6395 ;; Stop the Makefile from trying to create system directories.
6396 (substitute* "Makefile"
6397 (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#")
6398 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
6399 #t))
6400 (replace 'install
6401 (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
6402 (add-after 'install 'wrap
6403 (lambda* (#:key inputs outputs #:allow-other-keys)
6404 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
6405 (bin-files (find-files bin ".*")))
6406 (define (bin-directory input-name)
6407 (let ((p (assoc-ref inputs input-name)))
6408 (and p (string-append p "/bin"))))
6409 (define (sbin-directory input-name)
6410 (string-append (assoc-ref inputs input-name) "/sbin"))
6411 (for-each (lambda (program)
6412 (wrap-program program
6413 `("PATH" ":" prefix
6414 ,(append
6415 (filter-map bin-directory
6416 '("bash"
6417 "coreutils"
6418 "dbus"
6419 "eudev"
6420 "grep"
6421 "inetutils"
6422 "kmod"
6423 "perl"
6424 "sed"
6425 "usbutils"
6426 "util-linux"
6427 "x86-energy-perf-policy"))
6428 (filter-map sbin-directory
6429 '("ethtool"
6430 "hdparm"
6431 "iw"
6432 "pciutils"
6433 "rfkill"
6434 "wireless-tools"))))))
6435 bin-files)
6436 #t))))))
6437 (home-page "https://linrunner.de/en/tlp/tlp.html")
6438 (synopsis "Power management tool for Linux")
6439 (description "TLP is a power management tool for Linux. It comes with
6440 a default configuration already optimized for battery life. Nevertheless,
6441 TLP is customizable to fulfil system requirements. TLP settings are applied
6442 every time the power supply source is changed.")
6443 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
6444 ;; rest is GPLv2+.
6445 (license (list license:gpl2+ license:gpl3+))))
6446
6447 (define-public lshw
6448 (package
6449 (name "lshw")
6450 (version "B.02.19.2")
6451 (source (origin
6452 (method url-fetch)
6453 (uri (string-append "https://www.ezix.org/software/"
6454 "files/lshw-" version
6455 ".tar.gz"))
6456 (sha256
6457 (base32
6458 "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv"))))
6459 (build-system gnu-build-system)
6460 (arguments
6461 `(#:phases (modify-phases %standard-phases (delete 'configure))
6462 #:tests? #f ; no tests
6463 #:make-flags
6464 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
6465 (synopsis "List hardware information")
6466 (description
6467 "@command{lshw} (Hardware Lister) is a small tool to provide
6468 detailed information on the hardware configuration of the machine.
6469 It can report exact memory configuration, firmware version, mainboard
6470 configuration, CPU version and speed, cache configuration, bus speed,
6471 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
6472 machines (PowerMac G4 is known to work).")
6473 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
6474 (license license:gpl2+)))
6475
6476 (define-public libmnl
6477 (package
6478 (name "libmnl")
6479 (version "1.0.4")
6480 (source
6481 (origin
6482 (method url-fetch)
6483 (uri (string-append "mirror://netfilter.org/libmnl/"
6484 "libmnl-" version ".tar.bz2"))
6485 (sha256
6486 (base32
6487 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
6488 (build-system gnu-build-system)
6489 (home-page "https://www.netfilter.org/projects/libmnl/")
6490 (synopsis "Netlink utility library")
6491 (description "Libmnl is a minimalistic user-space library oriented to
6492 Netlink developers. There are a lot of common tasks in parsing, validating,
6493 constructing of both the Netlink header and TLVs that are repetitive and easy to
6494 get wrong. This library aims to provide simple helpers that allows you to
6495 re-use code and to avoid re-inventing the wheel.")
6496 (license license:lgpl2.1+)))
6497
6498 (define-public libnftnl
6499 (package
6500 (name "libnftnl")
6501 (version "1.1.9")
6502 (source
6503 (origin
6504 (method url-fetch)
6505 (uri (string-append "mirror://netfilter.org/libnftnl/"
6506 "libnftnl-" version ".tar.bz2"))
6507 (sha256
6508 (base32 "16jbp4fs5dz2yf4c3bl1sb48x9x9wi1chv39zwmfgya1k9pimcp9"))))
6509 (build-system gnu-build-system)
6510 (native-inputs
6511 `(("pkg-config" ,pkg-config)))
6512 (inputs
6513 `(("libmnl" ,libmnl)))
6514 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
6515 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
6516 (description "Libnftnl is a userspace library providing a low-level netlink
6517 programming interface to the in-kernel nf_tables subsystem. The library
6518 libnftnl has been previously known as libnftables. This library is currently
6519 used by nftables.")
6520 (license license:gpl2+)))
6521
6522 (define-public nftables
6523 (package
6524 (name "nftables")
6525 (version "0.9.8")
6526 (source
6527 (origin
6528 (method url-fetch)
6529 (uri (list (string-append "mirror://netfilter.org/nftables/nftables-"
6530 version ".tar.bz2")
6531 (string-append "https://www.nftables.org/projects/nftables"
6532 "/files/nftables-" version ".tar.bz2")))
6533 (sha256
6534 (base32 "1r4g22grhd4s1918wws9vggb8821sv4kkj8197ygxr6sar301z30"))))
6535 (build-system gnu-build-system)
6536 (arguments `(#:configure-flags
6537 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
6538 (inputs `(("gmp" ,gmp)
6539 ("libmnl" ,libmnl)
6540 ("libnftnl" ,libnftnl)
6541 ("readline" ,readline)))
6542 (native-inputs `(("pkg-config" ,pkg-config)
6543 ("bison" ,bison)
6544 ("flex" ,flex)))
6545 (home-page "https://www.nftables.org")
6546 (synopsis "Userspace utility for Linux packet filtering")
6547 (description "nftables is the project that aims to replace the existing
6548 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
6549 filtering framework, a new userspace utility and also a compatibility layer for
6550 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
6551 infrastructure such as the existing hooks, the connection tracking system, the
6552 userspace queueing component and the logging subsystem.")
6553 (license license:gpl2)))
6554
6555 (define-public proot
6556 (package
6557 (name "proot")
6558 (version "5.1.0")
6559 (source
6560 (origin
6561 (method git-fetch)
6562 (uri (git-reference
6563 (url "https://github.com/proot-me/PRoot")
6564 (commit (string-append "v" version))))
6565 (file-name (git-file-name name version))
6566 (sha256
6567 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
6568 (patches (search-patches "proot-test-fhs.patch"))))
6569 (build-system gnu-build-system)
6570 (arguments
6571 '(#:make-flags '("-C" "src")
6572
6573 #:phases (modify-phases %standard-phases
6574 (delete 'configure)
6575 (add-before 'build 'set-shell-file-name
6576 (lambda* (#:key inputs #:allow-other-keys)
6577 (substitute* (find-files "src" "\\.[ch]$")
6578 (("\"/bin/sh\"")
6579 (string-append "\""
6580 (assoc-ref inputs "bash")
6581 "/bin/sh\"")))
6582 #t))
6583 (add-before 'check 'fix-fhs-assumptions-in-tests
6584 (lambda _
6585 (substitute* "tests/test-c6b77b77.mk"
6586 (("/bin/bash") (which "bash"))
6587 (("/usr/bin/test") (which "test")))
6588 (substitute* '("tests/test-16573e73.c")
6589 (("/bin/([a-z-]+)" _ program)
6590 (which program)))
6591
6592 (substitute* (find-files "tests" "\\.sh$")
6593 ;; Some of the tests try to "bind-mount" /bin/true.
6594 (("-b /bin/true:")
6595 (string-append "-b " (which "true") ":"))
6596 ;; Likewise for /bin.
6597 (("-b /bin:") "-b /gnu:")
6598 ;; Others try to run /bin/sh.
6599 (("/bin/sh") (which "sh"))
6600 ;; Others assume /etc/fstab exists.
6601 (("/etc/fstab") "/etc/passwd"))
6602
6603 (substitute* "tests/GNUmakefile"
6604 (("-b /bin:") "-b /gnu:"))
6605
6606 ;; XXX: This test fails in an obscure corner case, just
6607 ;; skip it.
6608 (delete-file "tests/test-kkkkkkkk.c")
6609
6610 #t))
6611 (replace 'check
6612 (lambda _
6613 (let ((n (parallel-job-count)))
6614 ;; For some reason we get lots of segfaults with
6615 ;; seccomp support (x86_64, Linux-libre 4.11.0).
6616 (setenv "PROOT_NO_SECCOMP" "1")
6617
6618 ;; Most of the tests expect "/bin" to be in $PATH so
6619 ;; they can run things that live in $ROOTFS/bin.
6620 (setenv "PATH"
6621 (string-append (getenv "PATH") ":/bin"))
6622
6623 (invoke "make" "check" "-C" "tests"
6624 ;;"V=1"
6625 "-j" (number->string n)))))
6626 (replace 'install
6627 (lambda* (#:key outputs #:allow-other-keys)
6628 ;; The 'install' rule does nearly nothing.
6629 (let* ((out (assoc-ref outputs "out"))
6630 (man1 (string-append out "/share/man/man1")))
6631 ;; TODO: 'make install-care' (does not even
6632 ;; build currently.)
6633 (invoke "make" "-C" "src" "install"
6634 (string-append "PREFIX=" out))
6635
6636 (mkdir-p man1)
6637 (copy-file "doc/proot/man.1"
6638 (string-append man1 "/proot.1"))
6639 #t))))))
6640 (native-inputs `(("which" ,which)
6641
6642 ;; For 'mcookie', used by some of the tests.
6643 ("util-linux" ,util-linux)
6644
6645 ;; XXX: Choose the old coreutils because its 'stat'
6646 ;; program does not use statx(2) when running 'stat -c
6647 ;; %a' or similar, which PRoot doesn't properly support.
6648 ("coreutils-old" ,coreutils-8.30)
6649
6650 ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads
6651 ;; make 4.3 to segfault.
6652 ("make-old" ,gnu-make-4.2)))
6653 (inputs `(("talloc" ,talloc)))
6654 (home-page "https://github.com/proot-me/PRoot")
6655 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
6656 (description
6657 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
6658 and @code{binfmt_misc}. This means that users don't need any privileges or
6659 setup to do things like using an arbitrary directory as the new root
6660 file system, making files accessible somewhere else in the file system
6661 hierarchy, or executing programs built for another CPU architecture
6662 transparently through QEMU user-mode. Also, developers can use PRoot as a
6663 generic process instrumentation engine thanks to its extension mechanism.
6664 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
6665 available in the kernel Linux.")
6666 (license license:gpl2+)))
6667
6668 (define-public proot-static
6669 (package
6670 (inherit proot)
6671 (name "proot-static")
6672 (synopsis
6673 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
6674 (inputs `(("talloc" ,talloc/static)))
6675 (arguments
6676 (substitute-keyword-arguments (package-arguments proot)
6677 ((#:make-flags flags)
6678 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
6679 ((#:phases phases)
6680 `(modify-phases ,phases
6681 (add-after 'strip 'remove-store-references
6682 (lambda* (#:key outputs #:allow-other-keys)
6683 (let* ((out (assoc-ref outputs "out")))
6684 (with-directory-excursion out
6685 (remove-store-references "bin/proot")
6686 #t))))))
6687 ((#:allowed-references _ '("out"))
6688 '("out"))))))
6689
6690 (define-public cpuid
6691 (package
6692 (name "cpuid")
6693 (version "20201006")
6694 (source (origin
6695 (method url-fetch)
6696 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
6697 version ".src.tar.gz"))
6698 (sha256
6699 (base32
6700 "19jnkh57f979b78ak5mpxmdvnkgc33r55cw9shgd2hc380b3zi8k"))))
6701 (build-system gnu-build-system)
6702 (arguments
6703 `(#:make-flags
6704 (list (string-append "CC=" ,(cc-for-target)))
6705 #:tests? #f ; no tests
6706 #:phases (modify-phases %standard-phases
6707 (delete 'configure) ; no configure script
6708 (add-before 'install 'fix-makefile
6709 (lambda* (#:key outputs #:allow-other-keys)
6710 (substitute* "Makefile"
6711 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
6712 ;; Make the compressed manpages writable so that the
6713 ;; reset-gzip-timestamps phase does not error out.
6714 (substitute* "Makefile"
6715 (("-m 444") "-m 644"))
6716 #t)))))
6717 (inputs `(("perl" ,perl)))
6718 (supported-systems '("i686-linux" "x86_64-linux"))
6719 (home-page "http://www.etallen.com/cpuid.html")
6720 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
6721 (description "cpuid dumps detailed information about the CPU(s) gathered
6722 from the CPUID instruction, and also determines the exact model of CPU(s). It
6723 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
6724 NexGen, Rise, and SiS CPUs.")
6725 (license license:gpl2+)))
6726
6727 (define-public jmtpfs
6728 (package
6729 (name "jmtpfs")
6730 (version "0.5")
6731 (source
6732 (origin
6733 (method git-fetch)
6734 (uri (git-reference
6735 (url "https://github.com/JasonFerrara/jmtpfs")
6736 (commit (string-append "v" version))))
6737 (file-name (git-file-name name version))
6738 (sha256
6739 (base32
6740 "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1"))))
6741 (build-system gnu-build-system)
6742 (inputs
6743 `(("file" ,file)
6744 ("fuse" ,fuse)
6745 ("libmtp" ,libmtp)))
6746 (native-inputs
6747 `(("pkg-config" ,pkg-config)))
6748 (home-page "https://github.com/JasonFerrara/jmtpfs")
6749 (synopsis "Use a FUSE file system to access data over MTP")
6750 (description "jmtpfs uses FUSE (file system in userspace) to provide access
6751 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
6752 the MTP device as a file system.")
6753 (license license:gpl3)))
6754
6755 (define-public procenv
6756 (package
6757 (name "procenv")
6758 (version "0.51")
6759 (source
6760 (origin
6761 (method git-fetch)
6762 (uri (git-reference
6763 (url "https://github.com/jamesodhunt/procenv")
6764 (commit version)))
6765 (file-name (git-file-name name version))
6766 (sha256
6767 (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn"))))
6768 (build-system gnu-build-system)
6769 (arguments `(#:configure-flags '("--disable-silent-rules")))
6770 (native-inputs
6771 `(("pkg-config" ,pkg-config)
6772
6773 ;; For tests.
6774 ("check" ,check)
6775 ("groff" ,groff)))
6776 (inputs
6777 `(("expat" ,expat)
6778 ("libcap" ,libcap)
6779 ("libselinux" ,libselinux)))
6780 (synopsis "Utility to show process environment")
6781 (description "Procenv is a command-line tool that displays as much detail about
6782 itself and its environment as possible. It can be used as a test
6783 tool, to understand the type of environment a process runs in, and for
6784 comparing system environments.")
6785 (home-page "https://github.com/jamesodhunt/procenv/")
6786 (license license:gpl3+)))
6787
6788 (define-public libfabric
6789 (package
6790 (name "libfabric")
6791 (version "1.11.2")
6792 (source
6793 (origin
6794 (method url-fetch)
6795 (uri
6796 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
6797 version "/libfabric-" version ".tar.bz2"))
6798 (sha256
6799 (base32 "1nnpfkwxhim2nqjkb1vwrb4wj4j3l6w6yvvy69fqam2snlhshazz"))))
6800 (build-system gnu-build-system)
6801 (inputs `(("rdma-core" ,rdma-core)
6802 ,@(match (%current-system)
6803 ((member (package-supported-systems psm))
6804 `(("psm" ,psm)))
6805 (_ `()))
6806 ("libnl" ,libnl)))
6807 (home-page "https://ofiwg.github.io/libfabric/")
6808 (synopsis "Open Fabric Interfaces")
6809 (description
6810 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
6811 communication services to applications. OFI is best described as a collection
6812 of libraries and applications used to export fabric services. The key
6813 components of OFI are: application interfaces, provider libraries, kernel
6814 services, daemons, and test applications.
6815
6816 Libfabric is a core component of OFI. It is the library that defines and
6817 exports the user-space API of OFI, and is typically the only software that
6818 applications deal with directly. It works in conjunction with provider
6819 libraries, which are often integrated directly into libfabric.")
6820 (license (list license:bsd-2 license:gpl2)))) ;dual
6821
6822 (define-public psm
6823 (package
6824 (name "psm")
6825 (version "3.3.20170428")
6826 (home-page "https://github.com/intel/psm")
6827 (source
6828 (origin
6829 (method git-fetch)
6830 (uri (git-reference (url home-page)
6831 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
6832 (file-name (string-append "psm-" version ".tar.gz"))
6833 (sha256
6834 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
6835 (patches (search-patches
6836 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
6837 "psm-ldflags.patch" ; build shared lib with LDFLAGS
6838 "psm-repro.patch" ; reproducibility
6839 "psm-disable-memory-stats.patch"))))
6840 (build-system gnu-build-system)
6841 (outputs '("out" "debug"))
6842 (inputs `(("libuuid" ,util-linux "lib")))
6843 (arguments
6844 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
6845 ,(string-append "INSTALL_PREFIX=" %output)
6846 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
6847 #:tests? #f
6848 #:phases (modify-phases %standard-phases
6849 (delete 'configure)
6850 (add-after 'unpack 'patch-/usr/include
6851 (lambda _
6852 (substitute* "Makefile"
6853 (("\\$\\{DESTDIR}/usr/include")
6854 (string-append %output "/include")))
6855 (substitute* "Makefile"
6856 (("/lib64") "/lib"))
6857 #t))
6858 (add-after 'unpack 'patch-sysmacros
6859 (lambda _
6860 (substitute* "ipath/ipath_proto.c"
6861 (("#include <sys/poll.h>" m)
6862 (string-append m "\n"
6863 "#include <sys/sysmacros.h>")))
6864 #t)))))
6865 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
6866 (description
6867 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
6868 communications interface for the True Scale family of products. PSM users are
6869 enabled with mechanisms necessary to implement higher level communications
6870 interfaces in parallel environments.")
6871 ;; Only Intel-compatable processors are supported.
6872 (supported-systems '("i686-linux" "x86_64-linux"))
6873 (license (list license:bsd-2 license:gpl2)))) ;dual
6874
6875 (define-public snapscreenshot
6876 (package
6877 (name "snapscreenshot")
6878 (version "1.0.14.3")
6879 (source
6880 (origin
6881 (method url-fetch)
6882 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
6883 name "-" version ".tar.bz2"))
6884 (sha256
6885 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
6886 (build-system gnu-build-system)
6887 (arguments
6888 `(#:make-flags
6889 (let ((out (assoc-ref %outputs "out")))
6890 (list (string-append "BINDIR=" out "/bin")
6891 (string-append "MANDIR=" out "/share/man")))
6892 #:tests? #f ; no test suite
6893 #:phases
6894 (modify-phases %standard-phases
6895 (delete 'configure) ; ./configure is a snarky no-op
6896 (add-before 'install 'fix-ownership
6897 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
6898 (lambda _
6899 (substitute* "depfun.mak"
6900 ((" -o bin -g bin ") " "))
6901 #t))
6902 (add-before 'install 'create-output-directories
6903 (lambda* (#:key outputs #:allow-other-keys)
6904 (let ((out (assoc-ref outputs "out")))
6905 (mkdir-p (string-append out "/share/man/man1"))
6906 #t))))))
6907 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
6908 (synopsis "Take screenshots of one or more Linux text consoles")
6909 (description
6910 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
6911 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
6912 relevant @file{/dev/vcs*} file(s).")
6913 (license license:gpl2)))
6914
6915 (define-public fbcat
6916 (package
6917 (name "fbcat")
6918 (version "0.5.1")
6919 (source
6920 (origin
6921 (method url-fetch)
6922 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
6923 version "/" name "-" version ".tar.gz"))
6924 (sha256
6925 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
6926 (build-system gnu-build-system)
6927 (inputs
6928 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
6929 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
6930 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
6931 `(("pnmtopng" ,netpbm)))
6932 (outputs (list "out" "fbgrab"))
6933 (arguments
6934 `(#:make-flags
6935 (list "CC=gcc"
6936 (string-append "PREFIX=" (assoc-ref %outputs "out")))
6937 #:tests? #f ; no tests
6938 #:phases
6939 (modify-phases %standard-phases
6940 (delete 'configure) ; no configure script
6941 (add-after 'build 'qualify-references
6942 (lambda* (#:key inputs outputs #:allow-other-keys)
6943 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
6944 (out (assoc-ref outputs "out")))
6945 (substitute* "fbgrab"
6946 (("fbcat" all)
6947 (string-append out "/bin/" all))
6948 (("pnmtopng" all)
6949 (string-append pnmtopng "/bin/" all)))
6950 #t)))
6951 (add-after 'install 'split-fbgrab-output
6952 (lambda* (#:key outputs #:allow-other-keys)
6953 (let* ((out (assoc-ref outputs "out"))
6954 (out:fbgrab (assoc-ref outputs "fbgrab")))
6955 (for-each (lambda (file)
6956 (let ((old (string-append out "/" file))
6957 (new (string-append out:fbgrab "/" file)))
6958 (mkdir-p (dirname new))
6959 (rename-file old new)))
6960 (list "bin/fbgrab"
6961 "share/man/man1/fbgrab.1"))
6962 #t))))))
6963 (home-page "https://jwilk.net/software/fbcat")
6964 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
6965 (description
6966 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
6967 a dump therof. It supports a wide range of drivers and pixel formats.
6968 @command{fbcat} can take screenshots of virtually any application that can be
6969 made to write its output to the framebuffer, including (but not limited to)
6970 text-mode or graphical applications that don't use a display server.
6971
6972 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
6973 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
6974 (license license:gpl2)))
6975
6976 (define-public libcgroup
6977 (package
6978 (name "libcgroup")
6979 (version "0.41")
6980 (source
6981 (origin
6982 (method url-fetch)
6983 (uri (string-append
6984 "mirror://sourceforge/libcg/" name "/"
6985 version "/" name "-" version ".tar.bz2"))
6986 (sha256
6987 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
6988 (build-system gnu-build-system)
6989 (arguments
6990 `(#:tests? #f))
6991 (native-inputs
6992 `(("bison" ,bison)
6993 ("flex" ,flex)))
6994 (inputs
6995 `(("linux-pam" ,linux-pam)))
6996 (home-page "https://sourceforge.net/projects/libcg/")
6997 (synopsis "Control groups management tools")
6998 (description "Control groups is Linux kernel method for process resource
6999 restriction, permission handling and more. This package provides userspace
7000 interface to this kernel feature.")
7001 (license license:lgpl2.1)))
7002
7003 (define-public mbpfan
7004 (package
7005 (name "mbpfan")
7006 (version "2.2.1")
7007 (source
7008 (origin
7009 (method git-fetch)
7010 (uri (git-reference
7011 (url "https://github.com/dgraziotin/mbpfan")
7012 (commit (string-append "v" version))))
7013 (file-name (git-file-name name version))
7014 (sha256
7015 (base32 "0gc9ypxi55vxs77nx8ihhh9zk7fr9v0m0zfm76q7x0bi6jz11mbr"))))
7016 (build-system gnu-build-system)
7017 (arguments
7018 `(#:tests? #f ; tests ask to be run as root
7019 #:make-flags (let ((out (assoc-ref %outputs "out")))
7020 (list (string-append "DESTDIR=" out)
7021 ,(string-append "CC=" (cc-for-target))))
7022 #:phases
7023 (modify-phases %standard-phases
7024 (add-after 'unpack 'patch-paths
7025 (lambda _
7026 (substitute* "Makefile"
7027 (("/usr") ""))
7028 #t))
7029 (delete 'configure)))) ; there's no configure phase
7030 (home-page "https://github.com/dgraziotin/mbpfan")
7031 (synopsis "Control fan speed on Macbooks")
7032 (description
7033 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
7034 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
7035 module. It can be executed as a daemon or in the foreground with root
7036 privileges.")
7037 (license license:gpl3+)))
7038
7039 (define-public psm2
7040 (package
7041 (name "psm2")
7042 (version "11.2.86")
7043 (source (origin
7044 (method git-fetch)
7045 (uri (git-reference
7046 (url "https://github.com/intel/opa-psm2")
7047 (commit (string-append "PSM2_" version))))
7048 (file-name (git-file-name name version))
7049 (sha256
7050 (base32
7051 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
7052 (build-system gnu-build-system)
7053 (arguments
7054 '(#:make-flags
7055 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
7056 #:tests? #f
7057 #:phases (modify-phases %standard-phases
7058 (delete 'configure)
7059 (add-after 'unpack 'patch-Makefiles
7060 (lambda _
7061 (substitute* "Makefile"
7062 (("/lib64") "/lib")
7063 (("/usr") ""))
7064 (substitute* "compat/Makefile"
7065 (("/lib64") "/lib")
7066 (("/usr") ""))
7067 #t))
7068 (replace 'install
7069 (lambda _
7070 (setenv "DESTDIR" %output)
7071 (invoke "make" "install")
7072 #t)))))
7073 (inputs
7074 `(("rdma-core" ,rdma-core)
7075 ("numactl" ,numactl)))
7076 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
7077 (description
7078 "This package is low-level user-level Intel's communications interface.
7079 The PSM2 API is a high-performance vendor-specific protocol that provides a
7080 low-level communications interface for the Intel Omni-Path family of
7081 high-speed networking devices.")
7082 (home-page "https://github.com/intel/opa-psm2")
7083 ;; Only the x86_64 architecure is supported.
7084 (supported-systems '("x86_64-linux"))
7085 (license (list license:bsd-3 license:gpl2)))) ; dual
7086
7087 (define-public libpfm4
7088 (package
7089 (name "libpfm4")
7090 (version "4.9.0")
7091 (source (origin
7092 (method url-fetch)
7093 (uri (string-append "mirror://sourceforge/perfmon2/"
7094 name "/libpfm-" version ".tar.gz"))
7095 (sha256
7096 (base32
7097 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
7098 (build-system gnu-build-system)
7099 (arguments
7100 '(#:modules ((guix build utils)
7101 (guix build gnu-build-system))
7102 #:phases (modify-phases %standard-phases
7103 (delete 'configure)
7104 (delete 'check)
7105 (replace 'build
7106 (lambda* (#:key inputs outputs #:allow-other-keys)
7107 (let* ((out (assoc-ref outputs "out")))
7108 (setenv "CC" "gcc")
7109 (invoke "make")
7110 #t)))
7111 (replace 'install
7112 (lambda* (#:key outputs #:allow-other-keys)
7113 (let* ((out (assoc-ref outputs "out")))
7114 (invoke "make"
7115 (string-append "PREFIX=" out)
7116 "install")
7117 #t))))))
7118 (synopsis "Performance event monitoring library")
7119 (description
7120 "This package provides a library called libpfm4, which is used to develop
7121 monitoring tools exploiting the performance monitoring events such as those
7122 provided by the Performance Monitoring Unit (PMU) of modern processors.
7123
7124 Libpfm4 helps convert from an event name, expressed as a string, to the event
7125 encoding that is either the raw event as documented by the hardware vendor or
7126 the OS-specific encoding. In the latter case, the library is able to prepare
7127 the OS-specific data structures needed by the kernel to setup the event.
7128
7129 libpfm4 provides support for the @code{perf_events} interface, which was
7130 introduced in Linux 2.6.31.")
7131 (home-page "http://perfmon2.sourceforge.net/")
7132 (license license:expat)))
7133
7134 (define-public libnfnetlink
7135 (package
7136 (name "libnfnetlink")
7137 (version "1.0.1")
7138 (source (origin
7139 (method url-fetch)
7140 (uri (string-append
7141 "https://www.netfilter.org/projects/libnfnetlink/files/"
7142 "libnfnetlink-" version ".tar.bz2"))
7143 (sha256
7144 (base32
7145 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
7146 (build-system gnu-build-system)
7147 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
7148 (synopsis "Low-level netfilter netlink communication library")
7149 (description
7150 "@code{libnfnetlink} is the low-level library for netfilter related
7151 kernel/userspace communication. It provides a generic messaging
7152 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
7153 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
7154 management tools in userspace.")
7155 (license license:gpl2)))
7156
7157 (define-public go-netlink
7158 (package
7159 (name "go-netlink")
7160 (version "1.0.0")
7161 (source (origin
7162 (method git-fetch)
7163 (uri (git-reference
7164 (url "https://github.com/vishvananda/netlink")
7165 (commit (string-append "v" version))))
7166 (file-name (git-file-name name version))
7167 (sha256
7168 (base32
7169 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
7170 (build-system go-build-system)
7171 (arguments
7172 `(#:import-path "github.com/vishvananda/netlink"))
7173 (native-inputs
7174 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
7175 ("go-netns" ,go-netns)))
7176 (home-page "https://github.com/vishvananda/netlink")
7177 (synopsis "Simple netlink library for Go")
7178 (description "The netlink package provides a simple netlink library for
7179 Go. Netlink is the interface a user-space program in Linux uses to
7180 communicate with the kernel. It can be used to add and remove interfaces, set
7181 IP addresses and routes, and configure IPsec.")
7182 (license license:asl2.0)))
7183
7184 (define-public libinih
7185 (package
7186 (name "libinih")
7187 (version "53")
7188 (source (origin
7189 (method git-fetch)
7190 (uri (git-reference
7191 (url "https://github.com/benhoyt/inih")
7192 (commit (string-append "r" version))))
7193 (file-name (git-file-name name version))
7194 (sha256
7195 (base32
7196 "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6"))))
7197 (build-system meson-build-system)
7198 (arguments
7199 '(#:configure-flags '("-Ddistro_install=true" "-Ddefault_library=shared")))
7200 (home-page "https://github.com/benhoyt/inih")
7201 (synopsis "Simple .INI parser library for C")
7202 (description "The inih (INI Not Invented Here) library is a simple .INI file
7203 parser written in C. It's only a couple of pages of code, and it was designed to
7204 be small and simple, so it's good for embedded systems. It's also more or less
7205 compatible with Python's ConfigParser style of .INI files, including RFC
7206 822-style multi-line syntax and name: value entries.")
7207 (license license:bsd-3)))
7208
7209 (define-public xfsprogs
7210 (package
7211 (name "xfsprogs")
7212 (version "5.11.0")
7213 (source (origin
7214 (method url-fetch)
7215 (uri (string-append
7216 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
7217 "xfsprogs-" version ".tar.gz"))
7218 (sha256
7219 (base32
7220 "1byj53qdwsii35d0f11nz0dl618mpvwy5aa44pc9zg281g2r27ab"))))
7221 (build-system gnu-build-system)
7222 (outputs (list "out" "python"))
7223 (arguments
7224 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
7225 #:phases
7226 (modify-phases %standard-phases
7227 (add-after 'install 'separate-python-output
7228 (lambda* (#:key outputs #:allow-other-keys)
7229 (let ((out (assoc-ref outputs "out"))
7230 (python (assoc-ref outputs "python")))
7231 (for-each
7232 (lambda (script)
7233 (mkdir-p (string-append python (dirname script)))
7234 (rename-file (string-append out script)
7235 (string-append python script)))
7236 (list "/sbin/xfs_scrub_all"))
7237 #t)))
7238 (add-after 'install 'install-headers
7239 (lambda _
7240 (invoke "make" "install-dev"))))))
7241 (native-inputs
7242 `(("gettext" ,gettext-minimal)))
7243 (inputs
7244 `(("libinih" ,libinih)
7245 ("libuuid" ,util-linux "lib")
7246 ("python" ,python-wrapper)))
7247 (home-page "https://xfs.wiki.kernel.org/")
7248 (synopsis "XFS file system tools")
7249 (description "This package provides commands to create and check XFS
7250 file systems.")
7251 ;; The library "libhandle" and the headers in "xfslibs-dev" are
7252 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
7253 (license (list license:gpl2 license:lgpl2.1))))
7254
7255 (define-public genext2fs
7256 (package
7257 (name "genext2fs")
7258 (version "1.4.1-4")
7259 (source (origin
7260 (method git-fetch)
7261 (uri (git-reference
7262 (url "https://github.com/jeremie-koenig/genext2fs")
7263 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
7264 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
7265 (file-name (git-file-name name version))
7266 (sha256
7267 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
7268 (build-system gnu-build-system)
7269 (arguments
7270 `(#:phases
7271 (modify-phases %standard-phases
7272 (add-after 'unpack 'apply-debian-patches
7273 ;; Debian changes (the revision after ‘-’ in VERSION) are
7274 ;; maintained as separate patches. Apply those relevant to us.
7275 (lambda _
7276 (for-each
7277 (lambda (file-name)
7278 (invoke "patch" "-p1" "-i"
7279 (string-append "debian/patches/" file-name)))
7280 (list "blocksize+creator.diff" ; add -B/-o options
7281 "byteswap_fix.diff"))
7282 #t)))))
7283 (native-inputs
7284 `(("autoconf" ,autoconf)
7285 ("automake" ,automake)))
7286 (home-page "https://github.com/jeremie-koenig/genext2fs")
7287 (synopsis "Generate ext2 file system as a normal user")
7288 (description "This package provides a program to generate an ext2
7289 file system as a normal (non-root) user. It does not require you to mount
7290 the image file to copy files on it, nor does it require that you become
7291 the superuser to make device nodes.")
7292 (license license:gpl2)))
7293
7294 (define-public fakeroot
7295 (package
7296 (name "fakeroot")
7297 (version "1.25.3")
7298 (source (origin
7299 ;; There are no tags in the repository, so take this snapshot.
7300 (method url-fetch)
7301 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
7302 "fakeroot/fakeroot_" version ".orig.tar.gz"))
7303 (file-name (string-append name "-" version ".tar.gz"))
7304 (sha256
7305 (base32
7306 "0v4m3v1bdqvblwj3vqsb3mllgbci6dsgsydq6765nzvz6n1kd44f"))))
7307 (build-system gnu-build-system)
7308 (arguments
7309 `(#:phases
7310 (modify-phases %standard-phases
7311 (replace 'bootstrap
7312 (lambda _
7313 ;; The "preroll" script takes care of Autoconf and also
7314 ;; prepares the translated manuals.
7315 (invoke "sh" "./preroll")))
7316 (add-after 'configure 'patch-Makefile
7317 (lambda _
7318 ;; Note: The root of the problem is already in "Makefile.am".
7319 (substitute* "Makefile"
7320 (("/bin/sh") (which "sh")))
7321 #t))
7322 (add-after 'unpack 'patch-script
7323 (lambda* (#:key inputs #:allow-other-keys)
7324 (substitute* "scripts/fakeroot.in"
7325 (("getopt")
7326 (string-append (assoc-ref inputs "util-linux")
7327 "/bin/getopt"))
7328 (("sed")
7329 (string-append (assoc-ref inputs "sed")
7330 "/bin/sed"))
7331 (("cut")
7332 (string-append (assoc-ref inputs "coreutils")
7333 "/bin/cut")) )
7334 #t))
7335 (add-before 'configure 'setenv
7336 (lambda _
7337 (setenv "LIBS" "-lacl")
7338 #t))
7339 (add-before 'check 'prepare-check
7340 (lambda _
7341 (setenv "SHELL" (which "bash"))
7342 (setenv "VERBOSE" "1")
7343 (substitute* "test/t.touchinstall"
7344 ;; We don't have the name of the root user, so use ID=0.
7345 (("grep root") "grep \"\\<0\\>\""))
7346 (substitute* "test/tartest"
7347 ;; We don't have the name of the root group, so use ID=0.
7348 (("ROOTGROUP=root") "ROOTGROUP=0")
7349 ;; We don't have the name of the daemon user, so use IDs.
7350 (("daemon:sys") "1:3")
7351 (("daemon:") "1:"))
7352 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
7353 (substitute* "test/compare-tar"
7354 (("tar -tvf") "tar --numeric-owner -tvf"))
7355 #t)))))
7356 (native-inputs
7357 `(;; For bootstrapping the package.
7358 ("autoconf" ,autoconf)
7359 ("automake" ,automake)
7360 ("libtool" ,libtool)
7361 ("gettext" ,gettext-minimal)
7362 ("po4a" ,po4a)
7363
7364 ;; For tests.
7365 ("sharutils" ,sharutils)
7366 ("xz" ,xz)))
7367 (inputs
7368 `(("acl" ,acl)
7369 ("libcap" ,libcap)
7370 ("util-linux" ,util-linux)
7371 ("sed" ,sed)
7372 ("coreutils" ,coreutils)))
7373 (synopsis "Provides a fake root environment")
7374 (description "@command{fakeroot} runs a command in an environment where
7375 it appears to have root privileges for file manipulation. This is useful
7376 for allowing users to create archives (tar, ar, .deb etc.) with files in
7377 them with root permissions/ownership. Without fakeroot one would have to
7378 have root privileges to create the constituent files of the archives with
7379 the correct permissions and ownership, and then pack them up, or one would
7380 have to construct the archives directly, without using the archiver.")
7381 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
7382 (license license:gpl3+)))
7383
7384 (define-public fakechroot
7385 (package
7386 (name "fakechroot")
7387 (version "2.20.1")
7388 (source (origin
7389 (method url-fetch)
7390 (uri (string-append
7391 "https://github.com/dex4er/fakechroot/releases/download/"
7392 version "/fakechroot-" version ".tar.gz"))
7393 (sha256
7394 (base32
7395 "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas"))))
7396 (build-system gnu-build-system)
7397 (arguments
7398 ;; XXX: The tests heavily assume they run on an FHS system so for now
7399 ;; skip them.
7400 '(#:tests? #f
7401 #:configure-flags '("--disable-static")))
7402 (synopsis "Emulate @code{chroot} by overriding file system calls")
7403 (description
7404 "@command{fakechroot} runs a command in an environment were is additional
7405 possibility to use @code{chroot} command without root privileges. This is
7406 useful for allowing users to create own chrooted environment with possibility
7407 to install another packages without need for root privileges.
7408
7409 It works by providing @file{libfakechroot.so}, a shared library meant to be
7410 set as @code{LD_PRELOAD} to override the C library file system functions.")
7411 (home-page "https://github.com/dex4er/fakechroot/")
7412 (license license:lgpl2.1+)))
7413
7414 (define-public inputattach
7415 (package
7416 (name "inputattach")
7417 (version "0.42.0")
7418 (source (origin
7419 (method git-fetch)
7420 (uri (git-reference
7421 (url "https://github.com/linuxwacom/input-wacom")
7422 (commit (string-append "input-wacom-" version))))
7423 (file-name (git-file-name name version))
7424 (sha256
7425 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
7426 (build-system gnu-build-system)
7427 (arguments
7428 `(#:phases
7429 (modify-phases %standard-phases
7430 (delete 'bootstrap)
7431 (delete 'configure)
7432 (replace 'build
7433 (lambda* (#:key inputs #:allow-other-keys)
7434 (with-directory-excursion "inputattach"
7435 (invoke (string-append (assoc-ref inputs "gcc")
7436 "/bin/gcc")
7437 "-O2" "-o" "inputattach" "inputattach.c"))
7438 #t))
7439 (delete 'check)
7440 (replace 'install
7441 (lambda* (#:key outputs #:allow-other-keys)
7442 (let ((target-dir (string-append
7443 (assoc-ref outputs "out")
7444 "/bin/")))
7445 (mkdir-p target-dir)
7446 (copy-file "inputattach/inputattach"
7447 (string-append target-dir
7448 "inputattach"))
7449 #t))))))
7450 (home-page "https://linuxwacom.github.io/")
7451 (synopsis "Dispatch input peripherals events to a device file")
7452 (description "inputattach dispatches input events from several device
7453 types and interfaces and translates so that the X server can use them.")
7454 (license license:gpl2+)))
7455
7456 (define-public pipewire
7457 (package
7458 (name "pipewire")
7459 (version "0.2.7")
7460 (source (origin
7461 (method git-fetch)
7462 (uri (git-reference
7463 (url "https://github.com/PipeWire/pipewire")
7464 (commit version)))
7465 (file-name (git-file-name name version))
7466 (sha256
7467 (base32
7468 "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc"))))
7469 (build-system meson-build-system)
7470 (arguments
7471 '(#:configure-flags '("-Dsystemd=false")))
7472 (native-inputs
7473 `(("pkg-config" ,pkg-config)))
7474 (inputs
7475 `(("alsa-lib" ,alsa-lib)
7476 ("dbus" ,dbus)
7477 ("eudev" ,eudev)
7478 ("ffmpeg" ,ffmpeg)
7479 ("gstreamer" ,gstreamer)
7480 ("gst-plugins-base" ,gst-plugins-base)
7481 ("libva" ,libva)
7482 ("sbc" ,sbc)
7483 ("sdl2" ,sdl2)))
7484 (home-page "https://pipewire.org/")
7485 (synopsis "Server and user space API to deal with multimedia pipelines")
7486 (description
7487 "PipeWire is a project that aims to greatly improve handling of audio and
7488 video under Linux. It aims to support the usecases currently handled by both
7489 PulseAudio and Jack and at the same time provide same level of powerful handling
7490 of Video input and output. It also introduces a security model that makes
7491 interacting with audio and video devices from containerized applications easy,
7492 with supporting Flatpak applications being the primary goal. Alongside Wayland
7493 and Flatpak we expect PipeWire to provide a core building block for the future
7494 of Linux application development.")
7495 (license license:lgpl2.0+)))
7496
7497 (define-public pipewire-0.3
7498 (package
7499 (inherit pipewire)
7500 (name "pipewire")
7501 (version "0.3.22")
7502 (source (origin
7503 (method git-fetch)
7504 (uri (git-reference
7505 (url "https://github.com/PipeWire/pipewire")
7506 (commit version)))
7507 (file-name (git-file-name name version))
7508 (sha256
7509 (base32
7510 "1ywna5f5v8s79ivrqfwwc8vy6sn3a2zvfwqyalf1fypj5d90w8g9"))))
7511 (arguments
7512 '(#:configure-flags
7513 (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out")
7514 "/lib/udev/rules.d")
7515 "-Dsystemd=false")
7516 #:phases
7517 (modify-phases %standard-phases
7518 ;; Skip shrink-runpath, otherwise validate-runpath fails.
7519 (delete 'shrink-runpath))))
7520 (inputs
7521 (append (package-inputs pipewire)
7522 `(("bluez" ,bluez)
7523 ("jack" ,jack-2)
7524 ("pulseaudio" ,pulseaudio)
7525 ("vulkan-loader" ,vulkan-loader)
7526 ("vulkan-headers" ,vulkan-headers))))))
7527
7528 (define-public ell
7529 (package
7530 (name "ell")
7531 (version "0.23")
7532 (source (origin
7533 (method git-fetch)
7534 (uri (git-reference
7535 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
7536 (commit version)))
7537 (file-name (git-file-name name version))
7538 (sha256
7539 (base32
7540 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
7541 (build-system gnu-build-system)
7542 (arguments
7543 `(#:phases
7544 (modify-phases %standard-phases
7545 (add-after 'unpack 'fix-dbus-tests
7546 (lambda _
7547 (substitute* '("unit/test-dbus-message-fds.c"
7548 "unit/test-dbus-properties.c"
7549 "unit/test-dbus.c")
7550 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
7551 #t)))))
7552 (inputs
7553 `(("dbus" ,dbus)))
7554 (native-inputs
7555 `(("autoconf" ,autoconf)
7556 ("libtool" ,libtool)
7557 ("pkgconfig" ,pkg-config)
7558 ("automake" ,automake)))
7559 (home-page "https://01.org/ell")
7560 (synopsis "Embedded Linux Library")
7561 (description "The Embedded Linux* Library (ELL) provides core, low-level
7562 functionality for system daemons. It typically has no dependencies other than
7563 the Linux kernel, C standard library, and libdl (for dynamic linking). While
7564 ELL is designed to be efficient and compact enough for use on embedded Linux
7565 platforms, it is not limited to resource-constrained systems.")
7566 (license license:lgpl2.1+)))
7567
7568 (define-public lttng-ust
7569 (package
7570 (name "lttng-ust")
7571 (version "2.11.0")
7572 (source (origin
7573 (method url-fetch)
7574 (uri (string-append "https://lttng.org/files/lttng-ust/"
7575 "lttng-ust-" version ".tar.bz2"))
7576 (sha256
7577 (base32
7578 "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8"))))
7579 (build-system gnu-build-system)
7580 (inputs
7581 `(("liburcu" ,liburcu)
7582 ("numactl" ,numactl)))
7583 (native-inputs
7584 `(("python" ,python-3)))
7585 (home-page "https://lttng.org/")
7586 (synopsis "LTTng userspace tracer libraries")
7587 (description "The user space tracing library, liblttng-ust, is the LTTng
7588 user space tracer. It receives commands from a session daemon, for example to
7589 enable and disable specific instrumentation points, and writes event records
7590 to ring buffers shared with a consumer daemon.")
7591 (license license:lgpl2.1+)))
7592
7593 (define-public kexec-tools
7594 (package
7595 (name "kexec-tools")
7596 (version "2.0.21")
7597 (source (origin
7598 (method url-fetch)
7599 (uri (string-append "mirror://kernel.org/linux/utils/kernel"
7600 "/kexec/kexec-tools-" version ".tar.xz"))
7601 (sha256
7602 (base32
7603 "00l7iqp337cr846b6w4lc5vl893v4zwjrxz0jsnkh5l9xqni84z1"))))
7604 (build-system gnu-build-system)
7605 (arguments
7606 ;; There are no automated tests.
7607 '(#:tests? #f))
7608 (home-page "https://projects.horms.net/projects/kexec/")
7609 (synopsis "Tools for booting directly into different kernels")
7610 (description "This package provides the @code{kexec} program and ancillary
7611 utilities. Using @code{kexec}, it is possible to boot directly into a new
7612 kernel from the context of an already-running kernel, bypassing the normal
7613 system boot process.")
7614 (license license:gpl2)))
7615
7616 (define-public cachefilesd
7617 (package
7618 (name "cachefilesd")
7619 (version "0.10.10")
7620 (source (origin
7621 (method url-fetch)
7622 (uri (string-append
7623 "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells"
7624 "/cachefilesd.git/snapshot/cachefilesd-"
7625 version ".tar.gz"))
7626 (sha256
7627 (base32
7628 "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi"))))
7629 (build-system gnu-build-system)
7630 (outputs '("out"))
7631 (arguments
7632 `(#:tests? #f ; there are no tests
7633 #:make-flags
7634 (let ((prefix-dir (lambda (var dir)
7635 (string-append var "=" %output "/" dir))))
7636 (list (string-append "CC=" ,(cc-for-target))
7637 (prefix-dir "SBINDIR" "sbin/")
7638 (prefix-dir "ETCDIR" "etc/")
7639 (prefix-dir "MANDIR" "share/man/")))
7640 #:phases (modify-phases %standard-phases (delete 'configure))))
7641 (home-page "https://people.redhat.com/~dhowells/cachefs/")
7642 (synopsis "CacheFiles userspace management daemon")
7643 (description "@code{cachefilesd} is a userspace daemon that manages the
7644 cache data store that is used by network file systems such as @code{AFS} and
7645 @code{NFS} to cache data locally on disk. The content of the cache is
7646 persistent over reboots.")
7647 (license license:gpl2+)))
7648
7649 (define-public libbpf
7650 (package
7651 (name "libbpf")
7652 (version "0.1.1")
7653 (source
7654 (origin
7655 (method git-fetch)
7656 (uri (git-reference
7657 (url "https://github.com/libbpf/libbpf")
7658 (commit (string-append "v" version))))
7659 (file-name (git-file-name name version))
7660 (sha256
7661 (base32
7662 "0ilnnm4q22f8fagwp8kb37licy4ks861i2iqh2djsypqhnxvx3fv"))))
7663 (build-system gnu-build-system)
7664 (native-inputs
7665 `(("pkg-config" ,pkg-config)))
7666 (propagated-inputs
7667 ;; In Requires.private of libbpf.pc.
7668 `(("libelf" ,libelf)
7669 ("zlib" ,zlib)))
7670 (arguments
7671 `(#:tests? #f ; no tests
7672 #:make-flags
7673 (list
7674 (string-append "PREFIX=" (assoc-ref %outputs "out"))
7675 (string-append "LIBDIR=$(PREFIX)/lib")
7676 (string-append
7677 "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
7678 #:phases
7679 (modify-phases %standard-phases
7680 (delete 'configure)
7681 (add-before 'build 'pre-build
7682 (lambda _
7683 (chdir "src")
7684 #t)))))
7685 (home-page "https://github.com/libbpf/libbpf")
7686 (synopsis "BPF CO-RE (Compile Once – Run Everywhere)")
7687 (description
7688 "Libbpf supports building BPF CO-RE-enabled applications, which, in
7689 contrast to BCC, do not require the Clang/LLVM runtime or linux kernel
7690 headers.")
7691 (license `(,license:lgpl2.1 ,license:bsd-2))))
7692
7693 (define-public bcc
7694 (package
7695 (name "bcc")
7696 (version "0.16.0")
7697 (source
7698 (origin
7699 (method git-fetch)
7700 (uri (git-reference
7701 (url "https://github.com/iovisor/bcc")
7702 (commit (string-append "v" version))))
7703 (file-name (git-file-name name version))
7704 (sha256
7705 (base32
7706 "1367c0bzrpclvjvmk0sxgi49rh7j2f9izqk5a7g3yvawh1fmvvjh"))))
7707 (build-system cmake-build-system)
7708 (native-inputs
7709 `(("bison" ,bison)
7710 ("flex" ,flex)))
7711 (inputs
7712 `(("clang-toolchain" ,clang-toolchain)
7713 ("libbpf" ,(package-source libbpf))
7714 ;; LibElf required but libelf does not contain
7715 ;; archives, only object files.
7716 ;; https://github.com/iovisor/bcc/issues/504
7717 ("elfutils" ,elfutils)
7718 ("linux-libre-headers" ,linux-libre-headers)
7719 ("luajit" ,luajit)
7720 ("python-wrapper" ,python-wrapper)))
7721 (arguments
7722 `(;; Tests all require root permissions and a "standard" file hierarchy.
7723 #:tests? #f
7724 #:configure-flags
7725 (let ((revision ,version))
7726 `(,(string-append "-DREVISION=" revision)))
7727 #:phases
7728 (modify-phases %standard-phases
7729 ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON".
7730 (add-after 'unpack 'copy-libbpf
7731 (lambda* (#:key inputs #:allow-other-keys)
7732 (delete-file-recursively "src/cc/libbpf")
7733 (copy-recursively
7734 (assoc-ref inputs "libbpf") "src/cc/libbpf")))
7735 (add-after 'copy-libbpf 'substitute-libbc
7736 (lambda* (#:key outputs #:allow-other-keys)
7737 (substitute* "src/python/bcc/libbcc.py"
7738 (("(libbcc\\.so.*)\\b" _ libbcc)
7739 (string-append
7740 (assoc-ref outputs "out") "/lib/" libbcc)))))
7741 (add-after 'install 'wrap-tools
7742 (lambda* (#:key outputs #:allow-other-keys)
7743 (use-modules (ice-9 textual-ports))
7744 (let* ((out (assoc-ref outputs "out"))
7745 (lib (string-append out "/lib"))
7746 (tools (string-append out "/share/bcc/tools"))
7747 (python-executable?
7748 (lambda (filename _)
7749 (call-with-input-file filename
7750 (lambda (port)
7751 (string-contains (get-line port)
7752 "/bin/python"))))))
7753 (for-each
7754 (lambda (python-executable)
7755 (format #t "Wrapping: ~A.~%" python-executable)
7756 (wrap-program python-executable
7757 `("PYTHONPATH" ":" prefix
7758 (,(string-append lib
7759 "/python"
7760 ,(version-major+minor
7761 (package-version python))
7762 "/site-packages")))))
7763 (find-files tools python-executable?))
7764 #t))))))
7765 (home-page "https://github.com/iovisor/bcc")
7766 (synopsis "Tools for BPF on Linux")
7767 (description
7768 "BCC is a toolkit for creating efficient kernel tracing and manipulation
7769 programs, and includes several useful tools and examples. It makes use of
7770 extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature
7771 that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1
7772 and above.")
7773 (license license:asl2.0)))
7774
7775 (define-public bpftrace
7776 (package
7777 (name "bpftrace")
7778 (version "0.11.4")
7779 (source
7780 (origin
7781 (method git-fetch)
7782 (uri (git-reference
7783 (url "https://github.com/iovisor/bpftrace")
7784 (commit (string-append "v" version))))
7785 (file-name (git-file-name name version))
7786 (sha256
7787 (base32 "0y4qgm2cpccrsm20rnh92hqplddqsc5q5zhw9nqn2igm3h9i0z7h"))
7788 (patches (search-patches "bpftrace-disable-bfd-disasm.patch"))))
7789 (build-system cmake-build-system)
7790 (native-inputs
7791 `(("bison" ,bison)
7792 ("flex" ,flex)))
7793 (inputs
7794 `(("bcc" ,bcc)
7795 ("clang-toolchain" ,clang-toolchain)
7796 ("elfutils" ,elfutils)
7797 ("libbpf" ,libbpf)
7798 ("linux-libre-headers" ,linux-libre-headers)))
7799 (arguments
7800 `(#:tests? #f ;Tests require googletest sources.
7801 #:configure-flags
7802 '("-DBUILD_TESTING=OFF"
7803 ;; FIXME: libbfd misses some link dependencies, when fixed, remove
7804 ;; the associated patch.
7805 "-DHAVE_BFD_DISASM=OFF")))
7806 (home-page "https://github.com/iovisor/bpftrace")
7807 (synopsis "High-level tracing language for Linux eBPF")
7808 (description
7809 "bpftrace is a high-level tracing language for Linux enhanced Berkeley
7810 Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses
7811 LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for
7812 interacting with the Linux BPF system, as well as existing Linux tracing
7813 capabilities: kernel dynamic tracing (kprobes), user-level dynamic
7814 tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk
7815 and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was
7816 created by Alastair Robertson.")
7817 (license license:asl2.0)))
7818
7819 (define-public ttyebus-linux-module
7820 (let ((revision "0")
7821 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))
7822 (package
7823 (name "ttyebus-linux-module")
7824 (version (git-version "1.5" revision commit))
7825 (source
7826 (origin
7827 (method git-fetch)
7828 (uri (git-reference
7829 (url "https://github.com/eBUS/ttyebus")
7830 (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")))
7831 (file-name (git-file-name name version))
7832 (sha256
7833 (base32
7834 "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani"))))
7835 (supported-systems '("armhf-linux" "aarch64-linux"))
7836 (build-system linux-module-build-system)
7837 (arguments
7838 `(#:tests? #f))
7839 (home-page "https://github.com/eBUS/ttyebus")
7840 (synopsis "Low-latency Raspberry Pi UART driver")
7841 (description "This package provides a Linux kernel module that will
7842 provide a serial device @code{/dev/ttyebus} with almost no latency upon
7843 receiving. It is dedicated to the PL011 UART of the Raspberry Pi.")
7844 (license license:gpl3+))))
7845
7846 (define-public ipset
7847 (package
7848 (name "ipset")
7849 (version "7.11")
7850 (source
7851 (origin
7852 (method url-fetch)
7853 (uri (string-append "https://ipset.netfilter.org/"
7854 "ipset-" version ".tar.bz2"))
7855 (sha256
7856 (base32 "0zdzp9fhpp6hmirzxy7w27fb9xx9lxd2ykxbn8by7ngi62nvll9i"))))
7857 (build-system gnu-build-system)
7858 (inputs
7859 `(("libmnl" ,libmnl)))
7860 (native-inputs
7861 `(("pkg-config" ,pkg-config)))
7862 (arguments
7863 `(#:configure-flags '("--with-kmod=no")))
7864 (home-page "https://ipset.netfilter.org/")
7865 (synopsis "Administration tool for IP sets")
7866 (description "IP sets are a framework inside the Linux 2.4.x and 2.6.x kernel which
7867 can be administered by the ipset utility. Depending on the type,
7868 currently an IP set may store IP addresses, (TCP/UDP) port numbers or
7869 IP addresses with MAC addresses in a way which ensures lightning speed
7870 when matching an entry against a set.
7871
7872 If you want to
7873 @itemize @bullet
7874 @item store multiple IP addresses or port numbers and match against the entire
7875 collection using a single iptables rule.
7876 @item dynamically update iptables rules against IP addresses or ports without
7877 performance penalty.
7878 @item express complex IP address and ports based rulesets with a single
7879 iptables rule and benefit from the speed of IP sets.
7880 @end itemize\n
7881 then IP sets may be the proper tool for you.")
7882 (license license:gpl2+)))
7883
7884 (define-public liburing
7885 (package
7886 (name "liburing")
7887 (version "0.7")
7888 (source (origin
7889 (method git-fetch)
7890 (uri (git-reference
7891 (url "https://git.kernel.dk/liburing")
7892 (commit (string-append "liburing-" version))))
7893 (file-name (git-file-name name version))
7894 (sha256
7895 (base32
7896 "15z44l7y4c6s6dlf7v8lq4znlsjbja2r4ifbni0l8cdcnq0w3zh3"))))
7897 (build-system gnu-build-system)
7898 (arguments
7899 `(;; Tests are dependent on kernel version and features
7900 #:tests? #f
7901 #:phases
7902 (modify-phases %standard-phases
7903 (replace 'configure
7904 ;; configure fails if it is followed by SHELL, CONFIG_SHELL,
7905 ;; --enable-fast-install, and --build
7906 (lambda* (#:key outputs #:allow-other-keys)
7907 (let ((out (assoc-ref outputs "out")))
7908 (setenv "SHELL" (which "sh"))
7909 (setenv "CONFIG_SHELL" (which "sh"))
7910 (invoke "./configure" (string-append "--prefix=" out))))))))
7911 (home-page "https://github.com/axboe/liburing")
7912 (synopsis "Interface to the Linux kernel @code{io_uring} interface")
7913 (description "This is the io_uring library, liburing. liburing provides
7914 helpers to setup and teardown io_uring instances, and also a simplified
7915 interface for applications that don't need (or want) to deal with the full
7916 kernel side implementation.")
7917 (license license:expat)))
7918
7919 (define-public erofs-utils
7920 (package
7921 (name "erofs-utils")
7922 (version "1.2.1")
7923 (source
7924 (origin
7925 (method git-fetch)
7926 (uri (git-reference
7927 (url "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git")
7928 (commit (string-append "v" version))))
7929 (file-name (git-file-name name version))
7930 (sha256
7931 (base32 "1vb4mxsb59g29x7l22cffsqa8x743sra4j5zbmx89hjwpwm9vvcg"))))
7932 (build-system gnu-build-system)
7933 (inputs
7934 `(("lz4" ,lz4)
7935 ("libuuid" ,util-linux "lib")))
7936 (native-inputs
7937 `(("autoconf" ,autoconf)
7938 ("automake" ,automake)
7939 ("libtool" ,libtool)
7940 ("pkg-config" ,pkg-config)))
7941 (home-page "https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/")
7942 (synopsis "User-space tools for EROFS filesystem")
7943 (description "EROFS (Enhanced Read-Only File System) is a compressed,
7944 read-only filesystem optimized for resource-scarce devices. This package
7945 provides user-space tools for creating EROFS filesystems.")
7946 (license license:gpl2+)))