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