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