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