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