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