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