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