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