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