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