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