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