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