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