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