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