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