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