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