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