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