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