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