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