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