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