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