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