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