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