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