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