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