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