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