gnu: toybox: Update to 0.8.2.
[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
2484e0b3 187 "5.3.11"
9e34a5f3 188 (base32 "15n09zq38d69y1wl28s3nasf3377qp2yil5b887zpqrm00dif7i4")
2484e0b3 189 (base32 "1xk3gzgnl9m29avka32zkggl36sdxyvps40hr12hjy42l1ysfshm")))
9e34a5f3 190
1ad9c105
MW
191(define deblob-scripts-4.19
192 (linux-libre-deblob-scripts
2484e0b3 193 "4.19.84"
1ad9c105 194 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
2484e0b3 195 (base32 "1s89hmy4ihd65by2p1xxkxj476f6c9s5g9r9yvqncb50xlhilk50")))
1ad9c105
MW
196
197(define deblob-scripts-4.14
198 (linux-libre-deblob-scripts
2484e0b3 199 "4.14.154"
1ad9c105 200 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
2484e0b3 201 (base32 "1pcsfzpcv3bs30iyhwpk1x64r0gyv7wi22spnq6avzj1ayva10kw")))
1ad9c105
MW
202
203(define deblob-scripts-4.9
204 (linux-libre-deblob-scripts
2484e0b3 205 "4.9.201"
1ad9c105 206 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
7a9f5756 207 (base32 "0is8gn4qdd7h5l6lacvhqdch26lmrbgxfm8ab7fx8n85ha7y358w")))
1ad9c105
MW
208
209(define deblob-scripts-4.4
210 (linux-libre-deblob-scripts
2484e0b3 211 "4.4.201"
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
a6513238 355(define-public linux-libre-5.3-version "5.3.14")
9e34a5f3
TGR
356(define-public linux-libre-5.3-pristine-source
357 (let ((version linux-libre-5.3-version)
a6513238 358 (hash (base32 "0ckrbzwsc4lxd3l287wsd88mkfsd0kpf8nzchd9nfmkjiil14mwm")))
9e34a5f3
TGR
359 (make-linux-libre-source version
360 (%upstream-linux-source version hash)
361 deblob-scripts-5.3)))
362
6c693a6e 363(define-public linux-libre-4.19-version "4.19.86")
1ad9c105
MW
364(define-public linux-libre-4.19-pristine-source
365 (let ((version linux-libre-4.19-version)
6c693a6e 366 (hash (base32 "1xmzcxsiydym574y7k313qd8s4c3mdahpb3nx3cingfl36ivnb5z")))
1ad9c105
MW
367 (make-linux-libre-source version
368 (%upstream-linux-source version hash)
369 deblob-scripts-4.19)))
370
79832fb2 371(define-public linux-libre-4.14-version "4.14.156")
1ad9c105
MW
372(define-public linux-libre-4.14-pristine-source
373 (let ((version linux-libre-4.14-version)
79832fb2 374 (hash (base32 "1h47fxfbq0d5ry7j3jxz45v5c4103qncgm2vydpz6zdx1kmrz27q")))
1ad9c105
MW
375 (make-linux-libre-source version
376 (%upstream-linux-source version hash)
377 deblob-scripts-4.14)))
378
45f81021 379(define-public linux-libre-4.9-version "4.9.205")
1ad9c105
MW
380(define-public linux-libre-4.9-pristine-source
381 (let ((version linux-libre-4.9-version)
45f81021 382 (hash (base32 "01cbqxw77g6rdg7dgk73pg9a2n9v4sxp48q2a77w1b068xjfifcq")))
1ad9c105
MW
383 (make-linux-libre-source version
384 (%upstream-linux-source version hash)
385 deblob-scripts-4.9)))
386
aa56ca3d 387(define-public linux-libre-4.4-version "4.4.205")
1ad9c105
MW
388(define-public linux-libre-4.4-pristine-source
389 (let ((version linux-libre-4.4-version)
aa56ca3d 390 (hash (base32 "19pasidvfmf94rs86v80x7hpirz9gavmkxwcl76ya61fq7lqy7zs")))
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
d79db39d
EF
2163 '(#:phases
2164 (modify-phases %standard-phases
2165 (add-after 'unpack 'fix-build-with-python3
2166 (lambda _
2167 (substitute* "setup.py"
2168 (("itervalues") "values"))
2169 #t)))
35cebf01 2170 ;; There are currently no checks in the package.
7c0dbe78 2171 #:tests? #f))
d79db39d 2172 (native-inputs `(("python" ,python)))
7c0dbe78
SHT
2173 (home-page "http://guichaz.free.fr/iotop/")
2174 (synopsis
2175 "Displays the IO activity of running processes")
2176 (description
2177 "Iotop is a Python program with a top like user interface to show the
2178processes currently causing I/O.")
3ac73271 2179 (license license:gpl2+)))
e30835e2
LC
2180
2181(define-public fuse
2182 (package
2183 (name "fuse")
e905c8d6 2184 (version "2.9.9")
e30835e2
LC
2185 (source (origin
2186 (method url-fetch)
0e9bc883
LF
2187 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2188 "download/fuse-" version
2189 "/fuse-" version ".tar.gz"))
e30835e2
LC
2190 (sha256
2191 (base32
e905c8d6 2192 "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh"))
cd48a549 2193 (patches (search-patches "fuse-overlapping-headers.patch"))))
e30835e2 2194 (build-system gnu-build-system)
b148bd71 2195 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
2196 (arguments
2197 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2198 (assoc-ref %outputs "out")
2199 "/sbin")
2200 (string-append "INIT_D_PATH="
2201 (assoc-ref %outputs "out")
2202 "/etc/init.d")
9a4efac9
LC
2203
2204 ;; The rule makes /dev/fuse 666.
e30835e2
LC
2205 (string-append "UDEV_RULES_PATH="
2206 (assoc-ref %outputs "out")
9a4efac9 2207 "/lib/udev/rules.d"))
dc1d3cde
KK
2208 #:phases
2209 (modify-phases %standard-phases
2210 (add-before 'build 'set-file-names
2211 (lambda* (#:key inputs #:allow-other-keys)
2212 ;; libfuse calls out to mount(8) and umount(8). Make sure
2213 ;; it refers to the right ones.
2214 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2215 (("/bin/(u?)mount" _ maybe-u)
2216 (string-append (assoc-ref inputs "util-linux")
2217 "/bin/" maybe-u "mount")))
2218 (substitute* '("util/mount.fuse.c")
2219 (("/bin/sh")
2220 (which "sh")))
2221
2222 ;; This hack leads libfuse to search for 'fusermount' in
2223 ;; $PATH, where it may find a setuid-root binary, instead of
2224 ;; trying solely $out/sbin/fusermount and failing because
2225 ;; it's not setuid.
2226 (substitute* "lib/Makefile"
2227 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2228 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2229 #t)))))
0e9bc883 2230 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
2231 (synopsis "Support file systems implemented in user space")
2232 (description
2233 "As a consequence of its monolithic design, file system code for Linux
2234normally goes into the kernel itself---which is not only a robustness issue,
2235but also an impediment to system extensibility. FUSE, for \"file systems in
2236user space\", is a kernel module and user-space library that tries to address
2237part of this problem by allowing users to run file system implementations as
2238user-space processes.")
3ac73271
LC
2239 (license (list license:lgpl2.1 ;library
2240 license:gpl2+)))) ;command-line utilities
220193ad
LC
2241
2242(define-public unionfs-fuse
2243 (package
2244 (name "unionfs-fuse")
2f861edf 2245 (version "2.0")
220193ad
LC
2246 (source (origin
2247 (method url-fetch)
2248 (uri (string-append
2f861edf
EF
2249 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2250 version ".tar.gz"))
2251 (file-name (string-append name "-" version ".tar.gz"))
220193ad
LC
2252 (sha256
2253 (base32
2f861edf 2254 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
220193ad 2255 (build-system cmake-build-system)
094f4b53 2256 (native-inputs
3ef27337 2257 `(("python" ,python)))
220193ad 2258 (inputs `(("fuse" ,fuse)))
094f4b53 2259 (arguments
3ef27337
LF
2260 ;; The tests were never actually run ("collected 0 items"), but in recent
2261 ;; versions of pytest that causes an error.
2262 '(#:tests? #f))
2f861edf 2263 (home-page "https://github.com/rpodgorny/unionfs-fuse")
220193ad
LC
2264 (synopsis "User-space union file system")
2265 (description
2266 "UnionFS-FUSE is a flexible union file system implementation in user
2267space, using the FUSE library. Mounting a union file system allows you to
2268\"aggregate\" the contents of several directories into a single mount point.
2269UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 2270 (license license:bsd-3)))
ed748588 2271
0b7a0c20
LC
2272(define fuse-static
2273 (package (inherit fuse)
2274 (name "fuse-static")
2275 (source (origin (inherit (package-source fuse))
2276 (modules '((guix build utils)))
2277 (snippet
6cbee49d
MW
2278 '(begin
2279 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2280 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2281 ;; that it doesn't do that, allowing us to remove the
2282 ;; dependency on util-linux (something that is useful in
2283 ;; initrds.)
2284 (substitute* '("lib/mount_util.c"
2285 "util/mount_util.c")
2286 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2287 "0")
2288 (("/bin/")
2289 ""))
2290 #t))))))
0b7a0c20 2291
ed748588
LC
2292(define-public unionfs-fuse/static
2293 (package (inherit unionfs-fuse)
2294 (synopsis "User-space union file system (statically linked)")
2295 (name (string-append (package-name unionfs-fuse) "-static"))
2296 (source (origin (inherit (package-source unionfs-fuse))
2297 (modules '((guix build utils)))
2298 (snippet
6cbee49d
MW
2299 '(begin
2300 ;; Add -ldl to the libraries, because libfuse.a needs that.
2301 (substitute* "src/CMakeLists.txt"
2302 (("target_link_libraries(.*)\\)" _ libs)
2303 (string-append "target_link_libraries"
2304 libs " dl)")))
2305 #t))))
ed748588
LC
2306 (arguments
2307 '(#:tests? #f
1456cff1 2308 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
dc1d3cde
KK
2309 #:phases
2310 (modify-phases %standard-phases
2311 (add-after 'install 'post-install
2312 (lambda* (#:key outputs #:allow-other-keys)
2313 (let* ((out (assoc-ref outputs "out"))
2314 (exe (string-append out "/bin/unionfs")))
2315 ;; By default, 'unionfs' keeps references to
2316 ;; $glibc/share/locale and similar stuff. Remove them.
2317 (remove-store-references exe)
2318
2319 ;; 'unionfsctl' has references to glibc as well. Since
2320 ;; we don't need it, remove it.
2321 (delete-file (string-append out "/bin/unionfsctl"))
2322 #t))))))
0b7a0c20 2323 (inputs `(("fuse" ,fuse-static)))))
67b66003 2324
357b9f9d 2325(define-public sshfs
db288efa 2326 (package
357b9f9d 2327 (name "sshfs")
20f8d1dd 2328 (version "2.10")
db288efa
LC
2329 (source (origin
2330 (method url-fetch)
b58c1b2d 2331 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
f5c6edd6
TGR
2332 "download/sshfs-" version "/sshfs-" version
2333 ".tar.gz"))
db288efa
LC
2334 (sha256
2335 (base32
20f8d1dd 2336 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
db288efa
LC
2337 (build-system gnu-build-system)
2338 (inputs
2339 `(("fuse" ,fuse)
2340 ("glib" ,glib)))
2341 (native-inputs
2342 `(("pkg-config" ,pkg-config)))
f5c6edd6 2343 (home-page "https://github.com/libfuse/sshfs")
db288efa
LC
2344 (synopsis "Mount remote file systems over SSH")
2345 (description
2346 "This is a file system client based on the SSH File Transfer Protocol.
2347Since most SSH servers already support this protocol it is very easy to set
2348up: on the server side there's nothing to do; on the client side mounting the
2349file system is as easy as logging into the server with an SSH client.")
3ac73271 2350 (license license:gpl2+)))
db288efa 2351
357b9f9d 2352(define-public sshfs-fuse
2353 (package (inherit sshfs)
2354 (name "sshfs-fuse")
2355 (properties `((superseded . ,sshfs)))))
2356
1eacffb9
RH
2357(define-public archivemount
2358 (package
2359 (name "archivemount")
903deeea 2360 (version "0.8.12")
1eacffb9
RH
2361 (source
2362 (origin
2363 (method url-fetch)
c6d8817e 2364 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
1eacffb9
RH
2365 "archivemount-" version ".tar.gz"))
2366 (sha256
903deeea 2367 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
1eacffb9 2368 (build-system gnu-build-system)
c695fb76
TGR
2369 (inputs `(("fuse" ,fuse)
2370 ("libarchive" ,libarchive)))
2371 (native-inputs `(("pkg-config" ,pkg-config)))
c6d8817e 2372 (home-page "https://www.cybernoia.de/software/archivemount.html")
1eacffb9
RH
2373 (synopsis "Tool for mounting archive files with FUSE")
2374 (description "archivemount is a FUSE-based file system for Unix variants,
2375including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2376mount point where it can be read from or written to as with any other file
2377system. This makes accessing the contents of the archive, which may be
2378compressed, transparent to other programs, without decompressing them.")
2379 (license license:lgpl2.0+)))
2380
67b66003
LC
2381(define-public numactl
2382 (package
2383 (name "numactl")
93a16e4d 2384 (version "2.0.13")
67b66003
LC
2385 (source (origin
2386 (method url-fetch)
2387 (uri (string-append
0b4f8767 2388 "https://github.com/numactl/numactl/releases/download/v"
1ec29dff 2389 version "/numactl-" version ".tar.gz"))
67b66003
LC
2390 (sha256
2391 (base32
93a16e4d 2392 "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr"))))
67b66003
LC
2393 (build-system gnu-build-system)
2394 (arguments
e35dff97 2395 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
2396 ;; to run, which we can't assume to have.
2397 #:tests? #f))
b0015064 2398
35dfcdd7
AE
2399 ;; NUMA is apparently not supported on armhf, see
2400 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2401 (supported-systems (delete "armhf-linux" %supported-systems))
0b4f8767 2402 (home-page "https://github.com/numactl/numactl")
67b66003
LC
2403 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2404 (description
2405 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
79d5ac59
TGR
2406memory is not all in one place. The @command{numactl} program allows you to
2407run your application program on specific CPUs and memory nodes. It does this
2408by supplying a NUMA memory policy to the operating system before running your
67b66003
LC
2409program.
2410
79d5ac59
TGR
2411The package contains other commands, such as @command{numastat},
2412@command{memhog}, and @command{numademo} which provides a quick overview of
2413NUMA performance on your system.")
3ac73271
LC
2414 (license (list license:gpl2 ;programs
2415 license:lgpl2.1)))) ;library
b10e9ff6 2416
103b7e79 2417(define-public kbd-neo
2418 (package
2419 (name "kbd-neo")
2420 (version "2486")
2421 (source
2422 (origin
2423 (method url-fetch)
2424 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2425 version "/linux/console/neo.map"))
2426 (file-name (string-append name "-" version ".map"))
2427 (sha256
2428 (base32
2429 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2430 (build-system trivial-build-system)
2431 (arguments
2432 `(#:modules ((guix build utils))
2433 #:builder (begin
2434 (use-modules (guix build utils))
2435 (let ((out (string-append %output "/share/keymaps"))
2436 (source (assoc-ref %build-inputs "source")))
2437 (mkdir-p out)
2438 (copy-file source (string-append out "/neo.map"))
2439 #t))))
2440 (home-page "https://neo-layout.org")
2441 (synopsis "Neo2 console layout")
2442 (description
2443 "Kbd-neo provides the Neo2 keyboard layout for use with
2444@command{loadkeys(1)} from @code{kbd(4)}.")
2445 ;; The file is located in an svn directory, the entire content of
2446 ;; the directory is licensed as GPL3.
2447 (license license:gpl3+)))
2448
b10e9ff6
LC
2449(define-public kbd
2450 (package
2451 (name "kbd")
8555a609 2452 (version "2.0.4")
b10e9ff6
LC
2453 (source (origin
2454 (method url-fetch)
2455 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 2456 version ".tar.xz"))
b10e9ff6
LC
2457 (sha256
2458 (base32
8555a609 2459 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
c8f60748
LC
2460 (modules '((guix build utils)))
2461 (snippet
f2cdcafb
LC
2462 '(begin
2463 (substitute* "tests/Makefile.in"
2464 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2465 (("@VERSION@")
2466 "[@]VERSION[@]"))
2467 (substitute* '("src/unicode_start" "src/unicode_stop")
2468 ;; Assume the Coreutils are in $PATH.
2469 (("/usr/bin/tty")
6cbee49d
MW
2470 "tty"))
2471 #t))))
b10e9ff6
LC
2472 (build-system gnu-build-system)
2473 (arguments
5953d2b7
AK
2474 '(#:phases
2475 (modify-phases %standard-phases
2476 (add-before 'build 'pre-build
2477 (lambda* (#:key inputs #:allow-other-keys)
2478 (let ((gzip (assoc-ref %build-inputs "gzip"))
2479 (bzip2 (assoc-ref %build-inputs "bzip2")))
2480 (substitute* "src/libkeymap/findfile.c"
2481 (("gzip")
2482 (string-append gzip "/bin/gzip"))
2483 (("bzip2")
0d47fdf8
MW
2484 (string-append bzip2 "/bin/bzip2")))
2485 #t)))
5953d2b7
AK
2486 (add-after 'install 'post-install
2487 (lambda* (#:key outputs #:allow-other-keys)
2488 ;; Make sure these programs find their comrades.
2489 (let* ((out (assoc-ref outputs "out"))
2490 (bin (string-append out "/bin")))
2491 (for-each (lambda (prog)
2492 (wrap-program (string-append bin "/" prog)
2493 `("PATH" ":" prefix (,bin))))
0d47fdf8
MW
2494 '("unicode_start" "unicode_stop"))
2495 #t))))))
b10e9ff6 2496 (inputs `(("check" ,check)
f61e0e79
LC
2497 ("gzip" ,gzip)
2498 ("bzip2" ,bzip2)
b10e9ff6 2499 ("pam" ,linux-pam)))
fd7000fe 2500 (native-search-paths
2501 (list (search-path-specification
2502 (variable "LOADKEYS_KEYMAP_PATH")
674d4e13
TGR
2503 ;; Append ‘/**’ to recursively search all directories. One can then
2504 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2505 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2506 (files (list "share/keymaps/**")))))
b10e9ff6 2507 (native-inputs `(("pkg-config" ,pkg-config)))
0ed81d04 2508 (home-page "http://kbd-project.org/")
b10e9ff6
LC
2509 (synopsis "Linux keyboard utilities and keyboard maps")
2510 (description
2511 "This package contains keytable files and keyboard utilities compatible
2512for systems using the Linux kernel. This includes commands such as
36a4366d 2513@code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
3ac73271 2514 (license license:gpl2+)))
de0b620e 2515
48e595b7
LC
2516(define-public loadkeys-static
2517 (package
2518 (inherit kbd)
2519 (name "loadkeys-static")
2520 (arguments
2521 (substitute-keyword-arguments (package-arguments kbd)
2522 ((#:configure-flags flags ''())
2523 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2524 "--disable-vlock" ;so we don't need libpam
2525 "--disable-libkeymap")
2526 ,flags))
2527 ((#:make-flags flags ''())
2528 `(cons "LDFLAGS=-all-static" ,flags))
2529 ((#:phases phases '%standard-phases)
2530 `(modify-phases ,phases
2531 (replace 'install
2532 (lambda* (#:key outputs #:allow-other-keys)
2533 (let ((out (assoc-ref outputs "out")))
2534 ;; The binary keeps references to gzip, among other things,
2535 ;; which we don't need in the initrd, so strip references.
2536 (remove-store-references "src/loadkeys")
2537
2538 (install-file "src/loadkeys"
2539 (string-append out "/bin"))
2540 #t)))
2541 (delete 'post-install)))
2542 ((#:strip-flags _ '())
2543 ''("--strip-all"))
2544 ((#:allowed-references _ '())
2545 '())))
2546
2547 (synopsis "Statically-linked @command{loadkeys} program")
2548
2549 ;; This package is meant to be used internally in the initrd so don't
2550 ;; expose it.
2551 (properties '((hidden? . #t)))))
2552
de0b620e
LC
2553(define-public inotify-tools
2554 (package
2555 (name "inotify-tools")
fb5b359d 2556 (version "3.20.1")
de0b620e 2557 (source (origin
88f9fea7
RW
2558 (method git-fetch)
2559 (uri (git-reference
2560 (url "https://github.com/rvoicilas/inotify-tools.git")
2561 (commit version)))
2562 (file-name (git-file-name name version))
de0b620e
LC
2563 (sha256
2564 (base32
88f9fea7 2565 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
de0b620e 2566 (build-system gnu-build-system)
fb5b359d
MB
2567 (native-inputs
2568 `(("autoconf" ,autoconf)
2569 ("automake" ,automake)
2570 ("libtool" ,libtool)))
2571 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
de0b620e
LC
2572 (synopsis "Monitor file accesses")
2573 (description
2574 "The inotify-tools packages provides a C library and command-line tools
2575to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 2576 (license license:gpl2+)))
e062d542
AE
2577
2578(define-public kmod
2579 (package
2580 (name "kmod")
3c258998 2581 (version "26")
e062d542
AE
2582 (source (origin
2583 (method url-fetch)
2584 (uri
2585 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2586 "kmod-" version ".tar.xz"))
2587 (sha256
2588 (base32
3c258998 2589 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
fc1adab1 2590 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
2591 (build-system gnu-build-system)
2592 (native-inputs
2593 `(("pkg-config" ,pkg-config)))
2594 (inputs
f61e0e79
LC
2595 `(("xz" ,xz)
2596 ("zlib" ,zlib)))
e062d542 2597 (arguments
9f2eb4ff 2598 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25 2599 #:configure-flags '("--with-xz" "--with-zlib")
9f2eb4ff
TGR
2600 #:phases
2601 (modify-phases %standard-phases
2602 (add-after 'install 'install-modprobe&co
2603 (lambda* (#:key outputs #:allow-other-keys)
2604 (let* ((out (assoc-ref outputs "out"))
2605 (bin (string-append out "/bin")))
2606 (for-each (lambda (tool)
2607 (symlink "kmod"
2608 (string-append bin "/" tool)))
2609 '("insmod" "rmmod" "lsmod" "modprobe"
2610 "modinfo" "depmod"))
2611 #t))))))
e062d542
AE
2612 (home-page "https://www.kernel.org/")
2613 (synopsis "Kernel module tools")
35b9e423 2614 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
2615kernel modules like insert, remove, list, check properties, resolve
2616dependencies and aliases.
2617
2618These tools are designed on top of libkmod, a library that is shipped with
2619kmod. The aim is to be compatible with tools, configurations and indices
2620from the module-init-tools project.")
3ac73271 2621 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 2622
7fa715e7
LC
2623(define-public eudev
2624 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 2625 (package
7fa715e7 2626 (name "eudev")
736b66a0 2627 (version "3.2.8")
7fa715e7 2628 (source (origin
ee2d63db
MB
2629 (method git-fetch)
2630 (uri (git-reference (url "https://github.com/gentoo/eudev")
2631 (commit (string-append "v" version))))
2632 (file-name (git-file-name name version))
7fa715e7
LC
2633 (sha256
2634 (base32
736b66a0 2635 "1g95yzzx4qxm5qhhylbi930lrq4gsbz207n72018nkvswj6gmpjw"))
202342fd 2636 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7 2637 (build-system gnu-build-system)
4e859e92 2638 (arguments
172a9b44
MC
2639 '(#:phases
2640 (modify-phases %standard-phases
ee2d63db
MB
2641 (add-after 'unpack 'make-source-writable
2642 (lambda _
2643 ;; XXX: Git checkouts are read-only, but this package needs to
2644 ;; modify some of its files.
2645 (for-each make-file-writable (find-files "."))
2646 #t))
189be331 2647 (add-before 'bootstrap 'patch-file-names
172a9b44
MC
2648 (lambda* (#:key inputs #:allow-other-keys)
2649 (substitute* "man/make.sh"
2650 (("/usr/bin/xsltproc")
2651 (string-append (assoc-ref inputs "xsltproc")
2652 "/bin/xsltproc")))
189be331 2653 #t))
172a9b44
MC
2654 (add-after 'install 'build-hwdb
2655 (lambda* (#:key outputs #:allow-other-keys)
2656 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2657 ;; similar tools to display product names.
2658 (let ((out (assoc-ref outputs "out")))
957a99ab
MW
2659 (invoke (string-append out "/bin/udevadm")
2660 "hwdb" "--update")))))
172a9b44 2661 #:configure-flags (list "--enable-manpages")))
fe32c7f7 2662 (native-inputs
172a9b44
MC
2663 `(("autoconf" ,autoconf)
2664 ("automake" ,automake)
2665 ("gperf" ,gperf)
2666 ("libtool" ,libtool)
2667 ("pkg-config" ,pkg-config)
2668 ;; For tests.
e75230c1 2669 ("perl" ,perl)
172a9b44
MC
2670 ("python" ,python-wrapper)
2671 ;; For documentation.
2672 ("docbook-xml" ,docbook-xml-4.2)
2673 ("docbook-xsl" ,docbook-xsl)
2674 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
c695fb76 2675 ("xsltproc" ,libxslt)))
fe32c7f7 2676 (inputs
255f7308
LC
2677 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2678 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2679 ;; which contains the rules to do that.
2680 `(("util-linux" ,util-linux) ;for blkid
2681 ("kmod" ,kmod)))
e1921a38 2682 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
2683 (synopsis "Userspace device management")
2684 (description "Udev is a daemon which dynamically creates and removes
2685device nodes from /dev/, handles hotplug events and loads drivers at boot
2686time.")
3ac73271 2687 (license license:gpl2+)))
7fa715e7 2688
e5d861f3 2689(define-public eudev-with-hwdb
4e859e92 2690 (deprecated-package "eudev-with-hwdb" eudev))
e5d861f3 2691
66269d47
LC
2692(define-public lvm2
2693 (package
2694 (name "lvm2")
63899ca7 2695 (version "2.02.177")
66269d47
LC
2696 (source (origin
2697 (method url-fetch)
2698 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2699 version ".tgz"))
2700 (sha256
2701 (base32
63899ca7 2702 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
66269d47
LC
2703 (modules '((guix build utils)))
2704 (snippet
2705 '(begin
2706 (use-modules (guix build utils))
2707
2708 ;; Honor sysconfdir.
2709 (substitute* "make.tmpl.in"
2710 (("confdir = .*$")
2711 "confdir = @sysconfdir@\n")
2712 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6cbee49d
MW
2713 "DEFAULT_SYS_DIR = @sysconfdir@"))
2714 #t))
01f94cca 2715 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
2716 (build-system gnu-build-system)
2717 (native-inputs
2718 `(("pkg-config" ,pkg-config)
2719 ("procps" ,procps))) ;tests use 'pgrep'
2720 (inputs
8fcaf8b1 2721 `(("udev" ,eudev)))
66269d47 2722 (arguments
3afbc6b3
LF
2723 '(#:phases
2724 (modify-phases %standard-phases
2725 (add-after 'configure 'set-makefile-shell
2726 (lambda _
2727 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2728 ;; expected.
2729 (setenv "SHELL" (which "sh"))
66269d47 2730
3afbc6b3
LF
2731 ;; Replace /bin/sh with the right file name.
2732 (patch-makefile-SHELL "make.tmpl")
1ac18721 2733 #t)))
66269d47
LC
2734
2735 #:configure-flags (list (string-append "--sysconfdir="
2736 (assoc-ref %outputs "out")
2737 "/etc/lvm")
2738 "--enable-udev_sync"
f2817d43 2739 "--enable-udev_rules"
9324d92e 2740 "--enable-pkgconfig"
a3ed69b6
PN
2741 "--enable-cmdlib"
2742 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
f2817d43
LC
2743
2744 ;; Make sure programs such as 'dmsetup' can
2745 ;; find libdevmapper.so.
2746 (string-append "LDFLAGS=-Wl,-rpath="
2747 (assoc-ref %outputs "out")
a3ed69b6
PN
2748 "/lib,-rpath="
2749 (assoc-ref %outputs "out")
2750 "/lib/device-mapper")
2751 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2752 ;; into account so that we don't need to also
2753 ;; set CLDFLAGS.
2754 (string-append "CLDFLAGS=-Wl,-rpath="
2755 (assoc-ref %outputs "out")
2756 "/lib,-rpath="
2757 (assoc-ref %outputs "out")
2758 "/lib/device-mapper"))
66269d47
LC
2759
2760 ;; The tests use 'mknod', which requires root access.
2761 #:tests? #f))
62ec02bf 2762 (home-page "https://sourceware.org/lvm2/")
66269d47
LC
2763 (synopsis "Logical volume management for Linux")
2764 (description
2765 "LVM2 is the logical volume management tool set for Linux-based systems.
2766This package includes the user-space libraries and tools, including the device
2767mapper. Kernel components are part of Linux-libre.")
2768
2769 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2770 ;; Command-line tools are GPLv2.
3ac73271 2771 (license (list license:gpl2 license:lgpl2.1))))
66269d47 2772
01f94cca
LC
2773(define-public lvm2-static
2774 (package
2775 (inherit lvm2)
2776 (name "lvm2-static")
2777
2778 ;; Propagate udev because libdevmapper.a depends on libudev.
2779 (inputs (alist-delete "udev" (package-inputs lvm2)))
2780 (propagated-inputs `(("udev" ,eudev)))
2781
2782 (arguments
2783 (substitute-keyword-arguments (package-arguments lvm2)
2784 ((#:configure-flags flags '())
2785 ;; LVM2 doesn't use Libtool, hence the custom option.
2786 `(cons "--enable-static_link" ,flags))))
2787 (synopsis "Logical volume management for Linux (statically linked)")))
2788
000f7559
DT
2789(define-public wireless-tools
2790 (package
2791 (name "wireless-tools")
2792 (version "30.pre9")
2793 (source (origin
2794 (method url-fetch)
2795 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2796 version ".tar.gz"))
2797 (sha256
2798 (base32
ec01f22d 2799 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 2800 (snippet
c2099a4c
MW
2801 '(begin
2802 ;; Remove the older header files that are not free software.
2803 (for-each (lambda (n)
2804 (delete-file (format #f "wireless.~a.h" n)))
2805 '(10 11 12 13 14 15 16 17 18 19 20))
2806 #t))))
000f7559
DT
2807 (build-system gnu-build-system)
2808 (arguments
c2099a4c
MW
2809 `(#:make-flags
2810 (list (string-append "PREFIX=" %output)
2811 (string-append "INSTALL_MAN=" %output "/share/man")
2812 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2813 "BUILD_STATIC=")
2814 #:phases (modify-phases %standard-phases
2815 (delete 'configure))
000f7559
DT
2816 #:tests? #f))
2817 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2 2818 (description "Wireless Tools are used to manipulate the now-deprecated
36a4366d 2819Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
fb9b7ce2
LC
2820Extension was an interface allowing you to set Wireless LAN specific
2821parameters and get the specific stats. It is deprecated in favor the nl80211
2822interface.")
000f7559 2823 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
2824 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2825 ;; other files are distributed under gpl2.
3ac73271 2826 (license (list license:gpl2 license:lgpl2.1+))))
30016044 2827
cc205dac
LC
2828(define-public crda
2829 (package
2830 (name "crda")
2831 (version "3.18")
2832 (source (origin
2833 (method url-fetch)
2834 (uri (string-append "mirror://kernel.org/software/network/crda/"
2835 "crda-" version ".tar.xz"))
2836 (sha256
2837 (base32
2838 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 2839 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
2840 (build-system gnu-build-system)
2841 (arguments
2842 '(#:phases (modify-phases %standard-phases
2843 (delete 'configure)
0bc7c2e4
MW
2844 (add-after 'unpack 'gzip-determinism
2845 (lambda _
2846 (substitute* "Makefile"
2847 (("gzip") "gzip --no-name"))
2848 #t))
cc205dac
LC
2849 (add-before
2850 'build 'no-werror-no-ldconfig
2851 (lambda _
2852 (substitute* "Makefile"
2853 (("-Werror") "")
2854 (("ldconfig") "true"))
2855 #t))
2856 (add-before
2857 'build 'set-regulator-db-file-name
2858 (lambda* (#:key inputs #:allow-other-keys)
2859 ;; Tell CRDA where to find our database.
2860 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2861 (substitute* "crda.c"
2862 (("\"/lib/crda/regulatory.bin\"")
2863 (string-append "\"" regdb
2864 "/lib/crda/regulatory.bin\"")))
2865 #t))))
2866 #:test-target "verify"
2867 #:make-flags (let ((out (assoc-ref %outputs "out"))
2868 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2869 (list "CC=gcc" "V=1"
2870
2871 ;; Disable signature-checking on 'regulatory.bin'.
2872 ;; The reason is that this simplifies maintenance
2873 ;; on our side (no need to manage a distro key
2874 ;; pair), and we can guarantee integrity of
2875 ;; 'regulatory.bin' by other means anyway, such as
2876 ;; 'guix gc --verify'. See
2877 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2878 ;; for a discssion.
2879 "USE_OPENSSL=0"
2880
2881 (string-append "PREFIX=" out)
2882 (string-append "SBINDIR=" out "/sbin/")
2883 (string-append "UDEV_RULE_DIR="
2884 out "/lib/udev/rules.d")
2885 (string-append "LDFLAGS=-Wl,-rpath="
2886 out "/lib -L.")
2887 (string-append "REG_BIN=" regdb
2888 "/lib/crda/regulatory.bin")))))
2889 (native-inputs `(("pkg-config" ,pkg-config)
cc205dac
LC
2890 ("wireless-regdb" ,wireless-regdb)))
2891 (inputs `(("libnl" ,libnl)))
2892 (home-page
2893 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2894 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2895 (description
2896 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2897communication between the kernel Linux and user space for regulatory
2898compliance.")
3ac73271 2899 (license license:copyleft-next)))
cc205dac 2900
c80b4a3e
LC
2901(define-public wireless-regdb
2902 (package
2903 (name "wireless-regdb")
321292e1 2904 (version "2019.06.03")
c80b4a3e
LC
2905 (source (origin
2906 (method url-fetch)
2907 (uri (string-append
2908 "mirror://kernel.org/software/network/wireless-regdb/"
2909 "wireless-regdb-" version ".tar.xz"))
2910 (sha256
2911 (base32
321292e1 2912 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
5568151f
LC
2913
2914 ;; We're building 'regulatory.bin' by ourselves.
6cbee49d
MW
2915 (snippet '(begin
2916 (delete-file "regulatory.bin")
2917 #t))))
c80b4a3e
LC
2918 (build-system gnu-build-system)
2919 (arguments
321292e1
TGR
2920 '(#:phases
2921 (modify-phases %standard-phases
2922 (add-after 'unpack 'gzip-determinism
2923 (lambda _
2924 (substitute* "Makefile"
2925 (("gzip") "gzip --no-name"))
2926 #t))
2927 (add-after 'unpack 'omit-signature
2928 (lambda _
2929 (substitute* "Makefile"
2930 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
2931 ;; don't provide (see below). Disable it.
2932 ((" regulatory\\.db\\.p7s") "")
2933 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
2934 ;; but ‘make install’ depends only on the latter while installing
2935 ;; both (and failing). Depend on it explicitly.
2936 (("^install: " all) (string-append all "regulatory.db ")))
2937 #t))
2938 (delete 'configure)) ; no configure script
5568151f
LC
2939
2940 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2941 ;; is computed and can be equal to 'maintainer-clean'; when that
2942 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2943 ;; just built. Thus, build things sequentially.
2944 #:parallel-build? #f
2945
321292e1
TGR
2946 #:tests? #f ; no tests
2947 #:make-flags
2948 (let ((out (assoc-ref %outputs "out")))
2949 (list (string-append "PREFIX=" out)
2950 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
2951
2952 ;; Leave this empty so that db2bin.py doesn't try to sign
2953 ;; ‘regulatory.bin’. This allows us to avoid managing a key
2954 ;; pair for the whole distribution.
2955 (string-append "REGDB_PRIVKEY=")
2956 ;; Don't generate a public key for the same reason. These are
2957 ;; used as Makefile targets and can't be the empty string.
2958 (string-append "REGDB_PUBCERT=/dev/null")
2959 (string-append "REGDB_PUBKEY=/dev/null")))))
2960 (native-inputs
2961 `(("python" ,python-wrapper)))
c80b4a3e
LC
2962 (home-page
2963 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2964 (synopsis "Wireless regulatory database")
2965 (description
2966 "This package contains the wireless regulatory database Central
2967Regulatory Database Agent (CRDA) daemon. The database contains information on
2968country-specific regulations for the wireless spectrum.")
3ac73271 2969 (license license:isc)))
c80b4a3e 2970
30016044
MW
2971(define-public lm-sensors
2972 (package
2973 (name "lm-sensors")
3feae386 2974 (version "3.6.0")
b7448627
TGR
2975 (source
2976 (origin
2977 (method git-fetch)
2978 (uri (git-reference
2979 (url "https://github.com/groeck/lm-sensors.git")
2980 (commit (string-append "V" (string-join
2981 (string-split version #\.) "-")))))
2982 (file-name (git-file-name name version))
2983 (sha256
3feae386 2984 (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn"))
b7448627 2985 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
2986 (build-system gnu-build-system)
2987 (inputs `(("rrdtool" ,rrdtool)
2988 ("perl" ,perl)
2989 ("kmod" ,kmod)
2990 ("gnuplot" ,gnuplot)))
2991 (native-inputs `(("pkg-config" ,pkg-config)
2992 ("flex" ,flex)
2993 ("bison" ,bison)
2994 ("which" ,which)))
3feae386 2995 (outputs '("lib" ; avoid perl in closure
8ddf20b2 2996 "out"))
30016044 2997 (arguments
3feae386 2998 `(#:tests? #f ; no 'check' target
30016044 2999 #:make-flags (list (string-append "PREFIX=" %output)
8ddf20b2
DL
3000 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
3001 (string-append "INCLUDEDIR="
3002 (assoc-ref %outputs "lib") "/include")
3003 (string-append "MANDIR=" %output "/share/man")
3004 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
30016044 3005 #:phases
dc1d3cde
KK
3006 (modify-phases %standard-phases
3007 (delete 'configure)
3008 (add-before 'build 'patch-exec-paths
3009 (lambda* (#:key inputs outputs #:allow-other-keys)
3010 (substitute* "prog/detect/sensors-detect"
3011 (("`uname")
3012 (string-append "`" (assoc-ref inputs "coreutils")
3013 "/bin/uname"))
3014 (("(`|\")modprobe" all open-quote)
3015 (string-append open-quote
3016 (assoc-ref inputs "kmod")
3017 "/bin/modprobe")))
3018 (substitute* '("prog/pwm/pwmconfig"
3019 "prog/pwm/fancontrol")
3020 (("gnuplot")
3021 (string-append (assoc-ref inputs "gnuplot")
3022 "/bin/gnuplot"))
3023 (("cat ")
3024 (string-append (assoc-ref inputs "coreutils")
3025 "/bin/cat "))
3026 (("egrep ")
3027 (string-append (assoc-ref inputs "grep")
3028 "/bin/egrep "))
3029 (("sed -e")
3030 (string-append (assoc-ref inputs "sed")
3031 "/bin/sed -e"))
3032 (("cut -d")
3033 (string-append (assoc-ref inputs "coreutils")
3034 "/bin/cut -d"))
3035 (("sleep ")
3036 (string-append (assoc-ref inputs "coreutils")
3037 "/bin/sleep "))
3038 (("readlink -f")
3039 (string-append (assoc-ref inputs "coreutils")
3040 "/bin/readlink -f")))
3041 #t)))))
afab450c 3042 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
30016044
MW
3043 (synopsis "Utilities to read temperature/voltage/fan sensors")
3044 (description
35b9e423 3045 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
3046you to access information from temperature, voltage, and fan speed sensors.
3047It works with most newer systems.")
3ac73271 3048 (license license:gpl2+)))
b087d413 3049
55e1d39b
MB
3050(define-public iucode-tool
3051 (package
3052 (name "iucode-tool")
9eb7cde0 3053 (version "2.3.1")
55e1d39b
MB
3054 (source (origin
3055 (method url-fetch)
3056 (uri (string-append "https://gitlab.com/iucode-tool/releases"
3057 "/raw/latest/iucode-tool_" version ".tar.xz"))
3058 (sha256
3059 (base32
9eb7cde0 3060 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
55e1d39b
MB
3061 (build-system gnu-build-system)
3062 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
3063 (synopsis "Manipulate Intel microcode bundles")
3064 (description
3065 "@command{iucode_tool} is a utility to work with microcode packages for
3066Intel processors. It can convert between formats, extract specific versions,
3067create a firmware image suitable for the Linux kernel, and more.")
513dc568
EF
3068 ;; cpuid.h is available for i686, x86_64, and ia64.
3069 (supported-systems '("i686-linux" "x86_64-linux"))
55e1d39b
MB
3070 (license license:gpl2+)))
3071
f5b2a53d
RW
3072(define-public i2c-tools
3073 (package
3074 (name "i2c-tools")
3075 (version "3.1.1")
3076 (source (origin
3077 (method url-fetch)
3078 (uri (string-append
f32274a7 3079 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
3080 version ".tar.bz2"))
3081 (sha256
3082 (base32
3083 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3084 (build-system gnu-build-system)
3085 (arguments
3086 `(#:tests? #f ; no 'check' target
3087 #:make-flags (list (string-append "prefix=" %output)
3088 "CC=gcc")
3089 ;; no configure script
dc1d3cde 3090 #:phases (modify-phases %standard-phases (delete 'configure))))
bccf27cb
RW
3091 (inputs
3092 `(("perl" ,perl)))
f32274a7 3093 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
3094 (synopsis "I2C tools for Linux")
3095 (description
3096 "The i2c-tools package contains a heterogeneous set of I2C tools for
3097Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3098EEPROM decoding scripts, EEPROM programming tools, and a python module for
3099SMBus access.")
3ac73271 3100 (license license:gpl2+)))
f5b2a53d 3101
b087d413
MW
3102(define-public xsensors
3103 (package
3104 (name "xsensors")
3105 (version "0.70")
3106 (source (origin
3107 (method url-fetch)
3108 (uri (string-append
3109 "http://www.linuxhardware.org/xsensors/xsensors-"
3110 version ".tar.gz"))
3111 (sha256
3112 (base32
3113 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3114 (build-system gnu-build-system)
8ddf20b2 3115 (inputs `(("lm-sensors" ,lm-sensors "lib")
b087d413
MW
3116 ("gtk" ,gtk+-2)))
3117 (native-inputs `(("pkg-config" ,pkg-config)))
3118 (arguments
dc1d3cde
KK
3119 `(#:phases
3120 (modify-phases %standard-phases
3121 (add-before 'configure 'enable-deprecated
3122 (lambda _
3123 (substitute* "src/Makefile.in"
3124 (("-DGDK_DISABLE_DEPRECATED") "")
3125 (("-DGTK_DISABLE_DEPRECATED") ""))
3126 #t))
3127 (add-before 'configure 'remove-Werror
3128 (lambda _
3129 (substitute* '("configure" "src/Makefile.in")
3130 (("-Werror") ""))
3131 #t)))))
b087d413
MW
3132 (home-page "http://www.linuxhardware.org/xsensors/")
3133 (synopsis "Hardware health information viewer")
3134 (description
35b9e423 3135 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
3136health such as temperature, voltage and fan speed and displays the information
3137in a digital read-out.")
3ac73271 3138 (license license:gpl2+)))
b62fe07f
LC
3139
3140(define-public perf
3141 (package
3142 (name "perf")
3143 (version (package-version linux-libre))
fb76ef84 3144 (source (package-source linux-libre))
b62fe07f
LC
3145 (build-system gnu-build-system)
3146 (arguments
dc1d3cde
KK
3147 '(#:phases
3148 (modify-phases %standard-phases
3149 (replace 'configure
3150 (lambda* (#:key inputs #:allow-other-keys)
3151 (setenv "SHELL_PATH" (which "bash"))
3152 (chdir "tools/perf")
3153 #t)))
65dabe4e 3154 #:make-flags (list (string-append "prefix="
b62fe07f 3155 (assoc-ref %outputs "out"))
5157edd8
MB
3156 ;; Make sure the kernel headers are treated as system
3157 ;; headers to suppress warnings from those.
3158 (string-append "C_INCLUDE_PATH="
3159 (assoc-ref %build-inputs "kernel-headers")
3160 "/include")
2af29d23
LC
3161 "WERROR=0"
3162
3163 ;; By default, 'config/Makefile' uses lib64 on
3164 ;; x86_64. Work around that.
3165 "lib=lib")
b62fe07f
LC
3166 #:tests? #f)) ;no tests
3167 (native-inputs
3168 `(("pkg-config" ,pkg-config)
3169 ("bison" ,bison)
3170 ("flex" ,flex)
3171
3172 ;; There are build scripts written in these languages.
3173 ("perl" ,perl)
3174 ("python" ,python-2)))
3175 (inputs
b1fb4b23 3176 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 3177 ;; ("newt" ,newt)
6c030d10 3178 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 3179 ("elfutils" ,elfutils)
b25d3bd9 3180 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
1d484507
LC
3181 ("libunwind" ,libunwind) ;better stack walking
3182 ("numactl" ,numactl) ;for 'perf bench numa mem'
b62fe07f 3183
d7ece67a
LC
3184 ;; Documentation.
3185 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
3186 ("docbook-xsl" ,docbook-xsl)
3187 ("xmlto" ,xmlto)
3188 ("asciidoc" ,asciidoc)))
b62fe07f
LC
3189 (home-page "https://perf.wiki.kernel.org/")
3190 (synopsis "Linux profiling with performance counters")
3191 (description
3192 "perf is a tool suite for profiling using hardware performance counters,
3193with support in the Linux kernel. perf can instrument CPU performance
3194counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3195of lightweight profiling. This package contains the user-land tools and in
36a4366d 3196particular the @code{perf} command.")
b62fe07f 3197 (license (package-license linux-libre))))
c09e60e4
DT
3198
3199(define-public pflask
3200 (package
3201 (name "pflask")
3202 (version "0.2")
3203 (source (origin
3204 (method url-fetch)
3205 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3206 version ".tar.gz"))
f586c877 3207 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
3208 (sha256
3209 (base32
3210 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3211 (build-system cmake-build-system)
3212 (arguments
3213 '(#:tests? #f)) ; no tests
81e59e41 3214 (home-page "https://ghedo.github.io/pflask/")
c09e60e4
DT
3215 (synopsis "Simple tool for creating Linux namespace containers")
3216 (description "pflask is a simple tool for creating Linux namespace
3217containers. It can be used for running a command or even booting an OS inside
3218an isolated container, created with the help of Linux namespaces. It is
3219similar in functionality to chroot, although pflask provides better isolation
3220thanks to the use of namespaces.")
3ac73271 3221 (license license:bsd-2)))
288084d5 3222
3ec07ced
RW
3223(define-public singularity
3224 (package
3225 (name "singularity")
edc6dd03 3226 (version "2.6.1")
3ec07ced
RW
3227 (source (origin
3228 (method url-fetch)
3229 (uri (string-append "https://github.com/singularityware/singularity/"
3230 "releases/download/" version
3231 "/singularity-" version ".tar.gz"))
3232 (sha256
3233 (base32
fbf26cbc
LC
3234 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3235 (modules '((guix build utils)))
3236 (snippet
3237 '(begin
3238 ;; Do not create directories in /var.
3239 (substitute* "Makefile.in"
3240 (("\\$\\(MAKE\\) .*install-data-hook") ""))
af857579
LC
3241
3242 ;; The original source overrides PATH so that it points to
3243 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3244 ;; on Guix System. Leave PATH unchanged so we refer to the
3245 ;; installed Coreutils, grep, etc.
3246 (substitute* "bin/singularity.in"
3247 (("^PATH=.*" all)
3248 (string-append "#" all "\n")))
08814aec
LC
3249
3250 (substitute* (find-files "libexec/cli" "\\.exec$")
3251 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3252 _ program)
3253 (string-append "/run/setuid-programs/singularity-"
3254 program "-helper")))
fbf26cbc 3255 #t))))
3ec07ced
RW
3256 (build-system gnu-build-system)
3257 (arguments
08814aec 3258 `(#:configure-flags '("--localstatedir=/var")
3ec07ced
RW
3259 #:phases
3260 (modify-phases %standard-phases
3ec07ced
RW
3261 (add-after 'unpack 'patch-reference-to-squashfs-tools
3262 (lambda _
3263 (substitute* "libexec/cli/build.exec"
3264 (("if ! singularity_which mksquashfs") "if 0")
3265 (("if ! mksquashfs")
3266 (string-append "if ! " (which "mksquashfs"))))
3267 #t)))))
3268 (inputs
3269 `(("libarchive" ,libarchive)
3270 ("python" ,python-wrapper)
3ec07ced
RW
3271 ("zlib" ,zlib)
3272 ("squashfs-tools" ,squashfs-tools)))
3273 (home-page "https://singularity.lbl.gov/")
3274 (synopsis "Container platform")
3275 (description "Singularity is a container platform supporting a number of
3276container image formats. It can build SquashFS container images or import
3277existing Docker images. Singularity requires kernel support for container
3278isolation or root privileges.")
3279 (license license:bsd-3)))
3280
288084d5
MW
3281(define-public hdparm
3282 (package
3283 (name "hdparm")
abb90ff9 3284 (version "9.58")
288084d5
MW
3285 (source (origin
3286 (method url-fetch)
1b1ef87e
TGR
3287 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3288 "hdparm-" version ".tar.gz"))
288084d5
MW
3289 (sha256
3290 (base32
abb90ff9 3291 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
288084d5
MW
3292 (build-system gnu-build-system)
3293 (arguments
3294 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3295 (list (string-append "binprefix=" out)
3296 (string-append "manprefix=" out)
3297 "CC=gcc"))
ec238332
TGR
3298 #:phases
3299 (modify-phases %standard-phases
3300 (delete 'configure)) ; no configure script
3301 #:tests? #f)) ; no test suite
3b3b60d0 3302 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 3303 (synopsis "View and tune ATA disk drive parameters")
288084d5 3304 (description
02052b2c
TGR
3305 "@command{hdparm} is a command-line utility to control ATA controllers and
3306disk drives. It can increase performance and/or reliability by careful tuning
3307of hardware settings like power and acoustic management, DMA modes, and caching.
3308It can also display detailed device information, or be used as a simple
3309performance benchmarking tool.
3310
3311@command{hdparm} provides a command line interface to various Linux kernel
3312interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
d08be77a
TGR
3313IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3314Translation (@dfn{SAT}) are also supported.")
3ac73271 3315 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 3316
c755c854
MW
3317(define-public rfkill
3318 (package
3319 (name "rfkill")
3320 (version "0.5")
3321 (source (origin
3322 (method url-fetch)
3323 (uri (string-append "mirror://kernel.org/software/network/"
3324 name "/" name "-" version ".tar.xz"))
3325 (sha256
3326 (base32
3327 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3328 (build-system gnu-build-system)
3329 (arguments
3330 `(#:make-flags (list "CC=gcc"
3331 (string-append "PREFIX=" %output))
3332 #:phases (modify-phases %standard-phases
3333 (delete 'configure))
3334 #:tests? #f))
3335 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3336 (synopsis "Tool for enabling and disabling wireless devices")
3337 (description
3338 "rfkill is a simple tool for accessing the rfkill device interface,
3339which is used to enable and disable wireless networking devices, typically
3340WLAN, Bluetooth and mobile broadband.")
3ac73271 3341 (license (license:non-copyleft "file://COPYING"
5146f22b
EF
3342 "See COPYING in the distribution."))
3343 ;; rfkill is part of util-linux as of 2.31.
3344 (properties `((superseded . ,util-linux)))))
c755c854 3345
dc9bdb1e
ML
3346(define-public acpi
3347 (package
3348 (name "acpi")
3349 (version "1.7")
3350 (source (origin
3351 (method url-fetch)
81e59e41 3352 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
de67e922 3353 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
3354 (sha256
3355 (base32
3356 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3357 (build-system gnu-build-system)
3358 (home-page "http://acpiclient.sourceforge.net")
3359 (synopsis "Display information on ACPI devices")
3360 (description "@code{acpi} attempts to replicate the functionality of the
3361\"old\" @code{apm} command on ACPI systems, including battery and thermal
3362information. It does not support ACPI suspending, only displays information
3363about ACPI devices.")
3364 (license license:gpl2+)))
3365
57a516d3
LC
3366(define-public acpid
3367 (package
3368 (name "acpid")
b928c587 3369 (version "2.0.32")
57a516d3
LC
3370 (source (origin
3371 (method url-fetch)
3372 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3373 version ".tar.xz"))
3374 (sha256
3375 (base32
b928c587 3376 "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj"))))
57a516d3 3377 (build-system gnu-build-system)
3b3b60d0 3378 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
3379 (synopsis "Daemon for delivering ACPI events to user-space programs")
3380 (description
3381 "acpid is designed to notify user-space programs of Advanced
3382Configuration and Power Interface (ACPI) events. acpid should be started
3383during the system boot, and will run as a background process. When an ACPI
3384event is received from the kernel, acpid will examine the list of rules
3385specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 3386 (license license:gpl2+)))
37f5caec
TUBK
3387
3388(define-public sysfsutils
3389 (package
3390 (name "sysfsutils")
3391 (version "2.1.0")
3392 (source
3393 (origin
3394 (method url-fetch)
3395 (uri
3396 (string-append
3397 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3398 version ".tar.gz"))
3399 (sha256
3400 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3401 (build-system gnu-build-system)
3402 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3403 (synopsis "System utilities based on Linux sysfs")
3404 (description
8f65585b 3405 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
3406Linux kernel versions 2.5+ that exposes a system's device tree. The package
3407also contains the libsysfs library.")
3408 ;; The library is under lgpl2.1+ (all files say "or any later version").
3409 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 3410 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
3411
3412(define-public sysfsutils-1
3413 (package
3414 (inherit sysfsutils)
3415 (version "1.3.0")
3416 (source
3417 (origin
3418 (method url-fetch)
3419 (uri
3420 (string-append
3421 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3422 "/sysfsutils-" version ".tar.gz"))
3423 (sha256
3424 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3425 (modules '((guix build utils)))
3426 (snippet
3427 '(begin
3428 (substitute* "Makefile.in"
3429 (("includedir = /usr/include/sysfs")
3430 "includedir = @includedir@"))
3431 (substitute* "configure"
3432 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
6cbee49d
MW
3433 (string-append "includedir='" orig "/sysfs'")))
3434 #t))))
a9a1a40b 3435 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
3436
3437(define-public cpufrequtils
3438 (package
3439 (name "cpufrequtils")
3440 (version "0.3")
3441 (source
3442 (origin
3443 (method url-fetch)
18160c34
MB
3444 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3445 "cpufrequtils-" version ".tar.gz"))
e6caa52d
TUBK
3446 (sha256
3447 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 3448 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
3449 (build-system gnu-build-system)
3450 (native-inputs
3451 `(("sysfsutils" ,sysfsutils-1)))
3452 (arguments
3453 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3454 (assoc-ref %outputs "out") "/lib"))))
3455 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3456 (synopsis "Utilities to get and set CPU frequency on Linux")
3457 (description
e881752c 3458 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
3459information, and set the CPU frequency if supported, using the cpufreq
3460capabilities of the Linux kernel.")
3ac73271 3461 (license license:gpl2)))
0a588bf9
SB
3462
3463(define-public libraw1394
3464 (package
3465 (name "libraw1394")
7c58c852 3466 (version "2.1.2")
0a588bf9
SB
3467 (source (origin
3468 (method url-fetch)
3469 (uri (string-append
3470 "mirror://kernel.org/linux/libs/ieee1394/"
3471 name "-" version ".tar.xz"))
3472 (sha256
3473 (base32
7c58c852 3474 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
3475 (build-system gnu-build-system)
3476 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3477 (synopsis "Interface library for the Linux IEEE1394 drivers")
3478 (description
3479 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3480the Linux IEEE-1394 subsystem, which provides direct access to the connected
34811394 buses to user space. Through libraw1394/raw1394, applications can directly
3482send to and receive from other nodes without requiring a kernel driver for the
3483protocol in question.")
3ac73271 3484 (license license:lgpl2.1+)))
68e3c29d
SB
3485
3486(define-public libavc1394
3487 (package
3488 (name "libavc1394")
3489 (version "0.5.4")
3490 (source (origin
3491 (method url-fetch)
de67e922 3492 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
3493 name "-" version ".tar.gz"))
3494 (sha256
3495 (base32
3496 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3497 (build-system gnu-build-system)
3498 (native-inputs
3499 `(("pkg-config" ,pkg-config)))
3500 (propagated-inputs
3501 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 3502 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
3503 (synopsis "AV/C protocol library for IEEE 1394")
3504 (description
3505 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 3506the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 3507 (license license:lgpl2.1+)))
3f7bf86a
SB
3508
3509(define-public libiec61883
3510 (package
3511 (name "libiec61883")
3512 (version "1.2.0")
3513 (source (origin
3514 (method url-fetch)
3515 (uri (string-append
3516 "mirror://kernel.org/linux/libs/ieee1394/"
3517 name "-" version ".tar.xz"))
3518 (sha256
3519 (base32
3520 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3521 (build-system gnu-build-system)
3522 (native-inputs
3523 `(("pkg-config" ,pkg-config)))
3524 (propagated-inputs
3525 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3526 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3527 (synopsis "Isochronous streaming media library for IEEE 1394")
3528 (description
3529 "The libiec61883 library provides a higher level API for streaming DV,
3530MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 3531 (license license:lgpl2.1+)))
69159125
MW
3532
3533(define-public mdadm
3534 (package
3535 (name "mdadm")
30288ae5 3536 (version "4.1")
69159125
MW
3537 (source (origin
3538 (method url-fetch)
3539 (uri (string-append
3540 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3541 version ".tar.xz"))
3542 (sha256
3543 (base32
30288ae5 3544 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
69159125
MW
3545 (build-system gnu-build-system)
3546 (inputs
3547 `(("udev" ,eudev)))
3548 (arguments
3549 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
3550 (list "CC=gcc"
3551 "INSTALL=install"
69159125
MW
3552 "CHECK_RUN_DIR=0"
3553 ;; TODO: tell it where to find 'sendmail'
3554 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3555 (string-append "BINDIR=" out "/sbin")
3556 (string-append "MANDIR=" out "/share/man")
3557 (string-append "UDEVDIR=" out "/lib/udev")))
dc1d3cde
KK
3558 #:phases
3559 (modify-phases %standard-phases
3560 (add-before 'build 'patch-program-paths
3561 (lambda* (#:key inputs #:allow-other-keys)
3562 (let ((coreutils (assoc-ref inputs "coreutils")))
3563 (substitute* "udev-md-raid-arrays.rules"
3564 (("/usr/bin/(readlink|basename)" all program)
3565 (string-append coreutils "/bin/" program))))
3566 #t))
3567 (add-before 'build 'remove-W-error
3568 (lambda _
3569 ;; We cannot build with -Werror on i686 due to a
3570 ;; 'sign-compare' warning in util.c.
3571 (substitute* "Makefile"
3572 (("-Werror") ""))
3573 #t))
3574 (delete 'configure))
69159125
MW
3575 ;;tests must be done as root
3576 #:tests? #f))
3577 (home-page "http://neil.brown.name/blog/mdadm")
3578 (synopsis "Tool for managing Linux Software RAID arrays")
3579 (description
3580 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3581assemble, report on, and monitor arrays. It can also move spares between raid
3582arrays when needed.")
3ac73271 3583 (license license:gpl2+)))
01ccdfb6 3584
631fda7e
LC
3585(define-public mdadm-static
3586 (package
3587 (inherit mdadm)
3588 (name "mdadm-static")
3589 (arguments
3590 (substitute-keyword-arguments (package-arguments mdadm)
3591 ((#:make-flags flags)
3592 `(cons "LDFLAGS = -static" ,flags))
3593 ((#:phases phases)
3594 `(modify-phases ,phases
3595 (add-after 'install 'remove-cruft
3596 (lambda* (#:key outputs #:allow-other-keys)
3597 (let* ((out (assoc-ref outputs "out"))
3598 (precious? (lambda (file)
3599 (member file '("." ".." "sbin"))))
3600 (directories (scandir out (negate precious?))))
3601 (with-directory-excursion out
3602 (for-each delete-file-recursively directories)
3603 (remove-store-references "sbin/mdadm")
3604 (delete-file "sbin/mdmon")
3605 #t))))))
3606 ((#:modules modules %gnu-build-system-modules)
3607 `((ice-9 ftw) ,@modules))
3608 ((#:strip-flags _ '())
3609 ''("--strip-all")) ;strip a few extra KiB
3610 ((#:allowed-references _ '("out"))
3611 '("out")))) ;refer only self
3612 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3613
b3ed50e6
MB
3614(define-public multipath-tools
3615 (package
3616 (name "multipath-tools")
dcc773e5 3617 (version "0.8.2")
b3ed50e6
MB
3618 (source (origin
3619 (method url-fetch)
3e57b7d9 3620 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
b3ed50e6
MB
3621 ".git;a=snapshot;h=" version ";sf=tgz"))
3622 (file-name (string-append name "-" version ".tar.gz"))
3623 (sha256
3624 (base32
dcc773e5 3625 "0kb4mhzwyygdbikikmby6hj39pb3nrzv05v526c75wnycwnpxg31"))
b3ed50e6
MB
3626 (modules '((guix build utils)))
3627 (snippet
3628 '(begin
3629 ;; Drop bundled valgrind headers.
3630 (delete-file-recursively "third-party")
3631 (substitute* '("multipathd/main.c"
3632 "libmultipath/debug.c")
3633 (("#include \"../third-party/")
3634 "#include \""))
3635 #t))))
3636 (build-system gnu-build-system)
3637 (arguments
bd835ff2
TGR
3638 '(#:tests? #f ; no tests
3639 #:make-flags (list "CC=gcc"
3640 (string-append "DESTDIR="
b3ed50e6 3641 (assoc-ref %outputs "out"))
b5fb9430 3642 "SYSTEMDPATH=lib"
5247aab8
MB
3643 ;; Add the libaio headers to GCCs system header
3644 ;; search path to suppress -Werror=cast-qual on
3645 ;; the included headers.
3646 (string-append "C_INCLUDE_PATH="
3647 (assoc-ref %build-inputs "libaio")
3648 "/include")
b3ed50e6
MB
3649 (string-append "LDFLAGS=-Wl,-rpath="
3650 (assoc-ref %outputs "out")
3651 "/lib"))
3652 #:phases
3653 (modify-phases %standard-phases
b5fb9430 3654 (add-after 'unpack 'patch-source
7f412f33
MB
3655 (lambda* (#:key inputs #:allow-other-keys)
3656 (let ((lvm2 (assoc-ref inputs "lvm2"))
3657 (udev (assoc-ref inputs "udev")))
3658 (substitute* "Makefile.inc"
a9e7d656
MO
3659 (("\\$\\(prefix\\)/usr") "$(prefix)")
3660 ;; Do not save timestamp to avoid gzip "timestamp
3661 ;; out-of-range" warnings.
3662 (("gzip -9") "gzip -9n"))
7f412f33
MB
3663 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3664 (("/usr/include/libdevmapper.h")
3665 (string-append lvm2 "/include/libdevmapper.h"))
3666 (("/usr/include/libudev.h")
3667 (string-append udev "/include/libudev.h")))
3668 #t)))
57e3f06b 3669 (delete 'configure)))) ; no configure script
b3ed50e6 3670 (native-inputs
7f412f33
MB
3671 `(("perl" ,perl)
3672 ("pkg-config" ,pkg-config)
3673 ("valgrind" ,valgrind)))
b3ed50e6 3674 (inputs
6f850a19 3675 `(("json-c" ,json-c)
b3ed50e6
MB
3676 ("libaio" ,libaio)
3677 ("liburcu" ,liburcu)
3678 ("lvm2" ,lvm2)
3679 ("readline" ,readline)
3680 ("udev" ,eudev)))
3681 (home-page "http://christophe.varoqui.free.fr/")
3682 (synopsis "Access block devices through multiple paths")
3683 (description
3684 "This package provides the following binaries to drive the
3685Linux Device Mapper multipathing driver:
3686@enumerate
3687@item @command{multipath} - Device mapper target autoconfig.
3688@item @command{multipathd} - Multipath daemon.
3689@item @command{mpathpersist} - Manages SCSI persistent reservations on
3690@code{dm} multipath devices.
3691@item @command{kpartx} - Create device maps from partition tables.
3692@end enumerate")
57e3f06b 3693 (license (list license:gpl2+ ; main distribution
b3ed50e6
MB
3694 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3695
01ccdfb6
SB
3696(define-public libaio
3697 (package
3698 (name "libaio")
87dc306b 3699 (version "0.3.111")
01ccdfb6
SB
3700 (source (origin
3701 (method url-fetch)
87dc306b
MB
3702 (uri (list
3703 (string-append "https://releases.pagure.org/libaio/"
3704 name "-" version ".tar.gz")))
3705 (sha256
3706 (base32
3707 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
01ccdfb6
SB
3708 (build-system gnu-build-system)
3709 (arguments
3710 '(#:make-flags
3711 (list "CC=gcc" (string-append "prefix=" %output))
3712 #:test-target "partcheck" ; need root for a full 'check'
3713 #:phases
dc1d3cde 3714 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
87dc306b 3715 (home-page "https://pagure.io/libaio")
01ccdfb6
SB
3716 (synopsis "Linux-native asynchronous I/O access library")
3717 (description
3718 "This library enables userspace to use Linux kernel asynchronous I/O
3719system calls, important for the performance of databases and other advanced
3720applications.")
3ac73271 3721 (license license:lgpl2.1+)))
eb7c43c3 3722
81b98756
RW
3723(define-public sbc
3724 (package
3725 (name "sbc")
2a11a029 3726 (version "1.4")
81b98756
RW
3727 (source (origin
3728 (method url-fetch)
18160c34
MB
3729 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3730 version ".tar.xz"))
81b98756
RW
3731 (sha256
3732 (base32
2a11a029 3733 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
81b98756
RW
3734 (build-system gnu-build-system)
3735 (inputs
3736 `(("libsndfile" ,libsndfile)))
3737 (native-inputs
3738 `(("pkg-config" ,pkg-config)))
3739 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3740 (synopsis "Bluetooth subband audio codec")
3741 (description
3742 "The SBC is a digital audio encoder and decoder used to transfer data to
3743Bluetooth audio output devices like headphones or loudspeakers.")
3744 (license license:gpl2+)))
3745
eb7c43c3
DT
3746(define-public bluez
3747 (package
3748 (name "bluez")
b5724230 3749 (version "5.50")
eb7c43c3
DT
3750 (source (origin
3751 (method url-fetch)
3752 (uri (string-append
e9eb24b1 3753 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
3754 version ".tar.xz"))
3755 (sha256
3756 (base32
b5724230 3757 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
eb7c43c3
DT
3758 (build-system gnu-build-system)
3759 (arguments
90ea83ee 3760 `(#:configure-flags
eb7c43c3 3761 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
3762 (list "--sysconfdir=/etc"
3763 "--localstatedir=/var"
3764 "--enable-library"
53142109 3765 "--disable-systemd"
eb7c43c3
DT
3766 ;; Install dbus/udev files to the correct location.
3767 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
3768 (string-append "--with-udevdir=" out "/lib/udev")))
3769 #:phases
3770 (modify-phases %standard-phases
fbea821a
TD
3771 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3772 ;; issue (discussion on upstream mailing list:
3773 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3774 (add-before 'check 'skip-wonky-test
3775 (lambda _
3776 (substitute* "unit/test-gatt.c"
3777 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3778 #t))
87a16de7
SB
3779 (add-after 'install 'post-install
3780 (lambda* (#:key inputs outputs #:allow-other-keys)
3781 (let* ((out (assoc-ref outputs "out"))
3782 (servicedir (string-append out "/share/dbus-1/services"))
3783 (service "obexd/src/org.bluez.obex.service")
3784 (rule (string-append
3785 out "/lib/udev/rules.d/97-hid2hci.rules")))
3786 ;; Install the obex dbus service file.
3787 (substitute* service
3788 (("/bin/false")
3789 (string-append out "/libexec/bluetooth/obexd")))
3790 (install-file service servicedir)
3791 ;; Fix paths in the udev rule.
3792 (substitute* rule
3793 (("hid2hci --method")
3794 (string-append out "/lib/udev/hid2hci --method"))
3795 (("/sbin/udevadm")
3796 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
de47cfed 3797 #t))))))
eb7c43c3
DT
3798 (native-inputs
3799 `(("pkg-config" ,pkg-config)
b94a6ca0 3800 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
3801 (inputs
3802 `(("glib" ,glib)
3803 ("dbus" ,dbus)
3804 ("eudev" ,eudev)
3805 ("libical" ,libical)
3806 ("readline" ,readline)))
3807 (home-page "http://www.bluez.org/")
3808 (synopsis "Linux Bluetooth protocol stack")
3809 (description
3810 "BlueZ provides support for the core Bluetooth layers and protocols. It
3811is flexible, efficient and uses a modular implementation.")
3ac73271 3812 (license license:gpl2+)))
3d890318
LC
3813
3814(define-public fuse-exfat
3815 (package
3816 (name "fuse-exfat")
1372754d 3817 (version "1.3.0")
3d890318
LC
3818 (source (origin
3819 (method url-fetch)
c0cc805e
TGR
3820 (uri (string-append
3821 "https://github.com/relan/exfat/releases/download/v"
3822 version "/" name "-" version ".tar.gz"))
3d890318
LC
3823 (sha256
3824 (base32
1372754d 3825 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3d890318
LC
3826 (build-system gnu-build-system)
3827 (native-inputs
c0cc805e 3828 `(("pkg-config" ,pkg-config)))
3d890318
LC
3829 (inputs
3830 `(("fuse" ,fuse)))
c0cc805e 3831 (home-page "https://github.com/relan/exfat")
3d890318
LC
3832 (synopsis "Mount exFAT file systems")
3833 (description
3834 "This package provides a FUSE-based file system that provides read and
3835write access to exFAT devices.")
3ac73271 3836 (license license:gpl2+)))
53ec8d48 3837
1564e0fe
PN
3838(define-public fuseiso
3839 (package
3840 (name "fuseiso")
3841 (version "20070708")
3842 (source (origin
3843 (method url-fetch)
3844 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3845 version "/fuseiso-" version ".tar.bz2"))
3846 (sha256
3847 (base32
3848 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3849 (build-system gnu-build-system)
3850 (native-inputs
3851 `(("pkg-config" ,pkg-config)))
3852 (inputs
3853 `(("fuse" ,fuse)
3854 ("glib" ,glib)
3855 ("zlib" ,zlib)))
3856 (home-page "https://sourceforge.net/projects/fuseiso/")
dff79364 3857 (synopsis "Mount ISO file system images")
1564e0fe 3858 (description
52beae7b 3859 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
b60e9fb8
PN
3860.bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3861Ridge, Joliet, and zisofs.")
1564e0fe
PN
3862 (license license:gpl2)))
3863
53ec8d48
LC
3864(define-public gpm
3865 (package
3866 (name "gpm")
3867 (version "1.20.7")
3868 (source (origin
3869 (method url-fetch)
3870 (uri (string-append
3871 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3872 version ".tar.bz2"))
fddb22ac 3873 (patches (search-patches "gpm-glibc-2.26.patch"))
53ec8d48
LC
3874 (sha256
3875 (base32
3876 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3877 (build-system gnu-build-system)
3878 (arguments
3879 '(#:phases (modify-phases %standard-phases
189be331 3880 (replace 'bootstrap
53ec8d48
LC
3881 (lambda _
3882 ;; The tarball was not generated with 'make dist' so we
3883 ;; need to bootstrap things ourselves.
77bb6c22
EF
3884 (substitute* "autogen.sh"
3885 (("/bin/sh") (which "sh")))
90a54e36
MW
3886 (invoke "./autogen.sh")
3887 (patch-makefile-SHELL "Makefile.include.in")
3888 #t)))
53ec8d48
LC
3889
3890 ;; Make sure programs find libgpm.so.
3891 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3892 (assoc-ref %outputs "out")
3893 "/lib"))))
3894 (native-inputs
3895 `(("texinfo" ,texinfo)
3896 ("bison" ,bison)
3897 ("flex" ,flex)
3898 ("autoconf" ,autoconf)
3899 ("automake" ,automake)
3900 ("libtool" ,libtool)))
3901 (home-page "http://www.nico.schottelius.org/software/gpm/")
3902 (synopsis "Mouse support for the Linux console")
3903 (description
3904 "The GPM (general-purpose mouse) daemon is a mouse server for
3905applications running on the Linux console. It allows users to select items
3906and copy/paste text in the console and in xterm.")
3ac73271 3907 (license license:gpl2+)))
fc686f9a
TGR
3908
3909(define-public btrfs-progs
3910 (package
3911 (name "btrfs-progs")
ea46f9c9 3912 (version "5.3.1")
fc686f9a
TGR
3913 (source (origin
3914 (method url-fetch)
3915 (uri (string-append "mirror://kernel.org/linux/kernel/"
3916 "people/kdave/btrfs-progs/"
3917 "btrfs-progs-v" version ".tar.xz"))
3918 (sha256
3919 (base32
ea46f9c9 3920 "0f6s1iwiqbncrvxp74k50s88x6zqf85sjxg04kyni82l1vk1m8xz"))))
fc686f9a 3921 (build-system gnu-build-system)
7cad981d 3922 (outputs '("out"
c4b006ba 3923 "static")) ; static versions of the binaries in "out"
fc686f9a 3924 (arguments
7cad981d
TGR
3925 '(#:phases (modify-phases %standard-phases
3926 (add-after 'build 'build-static
caf4c7c8 3927 (lambda _ (invoke "make" "static")))
9a1c4a98
MB
3928 (add-after 'install 'install-bash-completion
3929 (lambda* (#:key outputs #:allow-other-keys)
3ce4e265
MB
3930 (let* ((out (assoc-ref outputs "out"))
3931 (bashcomp (string-append out "/etc/bash_completion.d")))
3932 (mkdir-p bashcomp)
3933 (copy-file "btrfs-completion"
3934 (string-append bashcomp "/btrfs"))
3935 #t)))
7cad981d
TGR
3936 (add-after 'install 'install-static
3937 (let ((staticbin (string-append (assoc-ref %outputs "static")
3938 "/bin")))
3939 (lambda _
caf4c7c8
MW
3940 (invoke "make"
3941 (string-append "bindir=" staticbin)
3942 "install-static")))))
d6fb0985 3943 #:tests? #f ; XXX: require the 'btrfs' kernel module.
7cad981d 3944 #:test-target "test"
fc686f9a
TGR
3945 #:parallel-tests? #f)) ; tests fail when run in parallel
3946 (inputs `(("e2fsprogs" ,e2fsprogs)
3947 ("libblkid" ,util-linux)
7cad981d 3948 ("libblkid:static" ,util-linux "static")
fc686f9a 3949 ("libuuid" ,util-linux)
7cad981d 3950 ("libuuid:static" ,util-linux "static")
e2937a55 3951 ("lzo" ,lzo)
fc686f9a 3952 ("zlib" ,zlib)
029c2ba0 3953 ("zlib:static" ,zlib "static")
ec0de9d8
MB
3954 ("zstd" ,zstd "lib")
3955 ("zstd:static" ,zstd "static")))
fc686f9a
TGR
3956 (native-inputs `(("pkg-config" ,pkg-config)
3957 ("asciidoc" ,asciidoc)
1dfb14d2 3958 ("python" ,python)
fc686f9a 3959 ("xmlto" ,xmlto)
41d23dd1 3960 ;; For building documentation.
fc686f9a 3961 ("libxml2" ,libxml2)
48b7e4a6 3962 ("docbook-xsl" ,docbook-xsl)
41d23dd1 3963 ;; For tests.
bc64676c 3964 ("acl" ,acl)
caf4c7c8
MW
3965 ("which" ,which)
3966 ;; The tests need 'grep' with perl regexp support.
3967 ("grep" ,grep)))
fc83ca2b 3968 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
fc686f9a 3969 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
3970 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3971aimed at implementing advanced features while focusing on fault tolerance,
3972repair and easy administration.")
68bcac6b
LF
3973 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3974 ;; GPL2: Everything else.
3975 (license (list license:gpl2 license:gpl2+))))
08e9daf5 3976
f3e44f5c
DC
3977(define-public btrfs-progs/static
3978 (package
3979 (name "btrfs-progs-static")
3980 (version (package-version btrfs-progs))
3981 (source #f)
3982 (build-system trivial-build-system)
3983 (inputs
3984 `(("btrfs-progs:static" ,btrfs-progs "static")))
3985 (arguments
3986 `(#:modules ((guix build utils))
3987 #:builder
3988 (begin
3989 (use-modules (guix build utils)
3990 (ice-9 ftw)
3991 (srfi srfi-26))
3992
3993 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3994 (out (assoc-ref %outputs "out"))
3995 (source (string-append btrfs "/bin/btrfs.static"))
3996 (target (string-append out "/bin/btrfs")))
3997 (mkdir-p (dirname target))
3998 (copy-file source target)
3999 (remove-store-references target)
e3cfef22
MW
4000 (chmod target #o555)
4001 #t))))
f3e44f5c 4002 (home-page (package-home-page btrfs-progs))
ff797172
TGR
4003 (synopsis "Statically-linked btrfs command from btrfs-progs")
4004 (description "This package provides the statically-linked @command{btrfs}
4005from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
4006 (license (package-license btrfs-progs))))
4007
49b28a74
PN
4008(define-public compsize
4009 (package
4010 (name "compsize")
4011 (version "1.3")
4012 (home-page "https://github.com/kilobyte/compsize")
4013 (source (origin
4014 (method git-fetch)
4015 (uri (git-reference
4016 (url home-page)
4017 (commit (string-append "v" version))))
4018 (sha256
4019 (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43"))
4020 (file-name (git-file-name name version))))
4021 (build-system gnu-build-system)
4022 (inputs
4023 `(("btrfs-progs" ,btrfs-progs)))
4024 (arguments
4025 `(#:tests? #f ; No tests.
4026 #:make-flags (list "CC=gcc")
4027 #:phases
4028 (modify-phases %standard-phases
4029 (delete 'configure)
4030 (replace 'install
4031 (lambda* (#:key outputs #:allow-other-keys)
4032 (let ((out (assoc-ref outputs "out")))
4033 (install-file "compsize" (string-append out "/bin"))
4034 (install-file "compsize.8" (string-append out "/share/man/man8"))))))))
4035 (synopsis "Find compression type/ratio on Btrfs files")
4036 (description "@command{compsize} takes a list of files (given as
4037arguments) on a Btrfs file system and measures used compression types and
4038effective compression ratio, producing a report.
4039
4040A directory has no extents but has a (recursive) list of files. A non-regular
4041file is silently ignored.
4042
4043As it makes no sense to talk about compression ratio of a partial extent,
4044every referenced extent is counted whole, exactly once -- no matter if you use
4045only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the
4046uncompressed size will not match the number given by @command{tar} or
4047@command{du}. On the other hand, the space used should be accurate (although
4048obviously it can be shared with files outside our set).")
4049 (license license:gpl2+)))
4050
72aa295e 4051(define-public f2fs-tools-1.7
2e456982
MB
4052 (package
4053 (name "f2fs-tools")
72aa295e 4054 (version "1.7.0")
2e456982
MB
4055 (source (origin
4056 (method url-fetch)
4057 (uri (string-append
4058 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4059 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
2e456982
MB
4060 (sha256
4061 (base32
72aa295e
DM
4062 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
4063
2e456982
MB
4064 (build-system gnu-build-system)
4065 (arguments
4066 `(#:phases
4067 (modify-phases %standard-phases
72aa295e
DM
4068 (add-after 'install 'install-headers
4069 (lambda* (#:key outputs #:allow-other-keys)
4070 (let* ((out (assoc-ref outputs "out"))
4071 (out-include (string-append out "/include")))
4072 (install-file "include/f2fs_fs.h" out-include)
4073 (install-file "mkfs/f2fs_format_utils.h" out-include)
4074 #t))))))
2e456982
MB
4075 (native-inputs
4076 `(("autoconf" ,autoconf)
4077 ("automake" ,automake)
4078 ("libtool" ,libtool)
4079 ("pkg-config" ,pkg-config)))
4080 (inputs
72aa295e
DM
4081 `(("libuuid" ,util-linux)
4082 ("libselinux" ,libselinux)))
2e456982
MB
4083 (home-page "https://f2fs.wiki.kernel.org/")
4084 (synopsis "Userland tools for f2fs")
4085 (description
4086 "F2FS, the Flash-Friendly File System, is a modern file system
4087designed to be fast and durable on flash devices such as solid-state
4088disks and SD cards. This package provides the userland utilities.")
4089 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
4090 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
4091 (license (list license:gpl2 license:lgpl2.1))))
4092
72aa295e
DM
4093(define-public f2fs-tools
4094 (package
4095 (inherit f2fs-tools-1.7)
4096 (name "f2fs-tools")
59ac0a2a 4097 (version "1.12.0")
72aa295e
DM
4098 (source (origin
4099 (method url-fetch)
4100 (uri (string-append
4101 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
2d588f3c 4102 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
72aa295e
DM
4103 (sha256
4104 (base32
59ac0a2a 4105 "15pn2fm9knn7p1vzfzy6msnrdl14p6y1gn4m2ka6ba5bzx6lw4p2"))))
72aa295e
DM
4106 (inputs
4107 `(("libuuid" ,util-linux)))))
4108
08e9daf5
TGR
4109(define-public freefall
4110 (package
4111 (name "freefall")
4112 (version (package-version linux-libre))
4113 (source (package-source linux-libre))
4114 (build-system gnu-build-system)
4115 (arguments
4116 '(#:phases (modify-phases %standard-phases
4117 (add-after 'unpack 'enter-subdirectory
4118 (lambda _
2ee42f7e
MW
4119 (chdir "tools/laptop/freefall")
4120 #t))
08e9daf5
TGR
4121 (delete 'configure)
4122 (add-before 'build 'increase-timeout
4123 (lambda _
4124 ;; The default of 2 seconds is too low: it assumes an
4125 ;; open lid and AC power without actually checking.
4126 (substitute* "freefall.c"
2ee42f7e
MW
4127 (("alarm\\(2\\)") "alarm(5)"))
4128 #t)))
08e9daf5 4129 #:make-flags (list (string-append "PREFIX="
c80629e7
EF
4130 (assoc-ref %outputs "out"))
4131 "CC=gcc")
08e9daf5
TGR
4132 #:tests? #f)) ;no tests
4133 (home-page (package-home-page linux-libre))
4134 (synopsis "Free-fall protection for spinning laptop hard drives")
4135 (description
4136 "Prevents shock damage to the internal spinning hard drive(s) of some
4137HP and Dell laptops. When sudden movement is detected, all input/output
4138operations on the drive are suspended and its heads are parked on the ramp,
4139where they are less likely to cause damage to the spinning disc. Requires a
4140drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4141feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4142 (license license:gpl2)))
d17ae8c0
NG
4143
4144(define-public thinkfan
4145 (package
4146 (name "thinkfan")
9a3d176e
TGR
4147 (version "1.0.2")
4148 (source
4149 (origin
4150 (method git-fetch)
4151 (uri (git-reference
4152 (url "https://github.com/vmatare/thinkfan.git")
4153 (commit version)))
4154 (file-name (git-file-name name version))
4155 (sha256
4156 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
d17ae8c0
NG
4157 (build-system cmake-build-system)
4158 (arguments
4159 `(#:modules ((guix build cmake-build-system)
4160 (guix build utils)
4161 (srfi srfi-26))
9a3d176e 4162 #:tests? #f ; no test target
d17ae8c0
NG
4163 #:configure-flags
4164 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
9a3d176e
TGR
4165 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4166 ;; inefficient’.
d17ae8c0
NG
4167 `("-DUSE_ATASMART:BOOL=ON")
4168 #:phases
4169 (modify-phases %standard-phases
908a3f36
TGR
4170 (add-after 'unpack 'create-init-scripts
4171 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4172 ;; systemd to patch and install their service files. Fake their
4173 ;; presence rather than duplicating the build system below. Leave
4174 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4175 ;; The sysvinit needs manual patching, but since upstream doesn't
4176 ;; even provide the option to install it: don't.
d17ae8c0 4177 (lambda* (#:key outputs #:allow-other-keys)
908a3f36
TGR
4178 (let* ((out (assoc-ref outputs "out"))
4179 (share (string-append out "/share/" ,name)))
4180 (substitute* "CMakeLists.txt"
4181 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4182 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4183 ;; That was easy! Now we just need to fix the destinations.
4184 (("/etc" directory)
4185 (string-append out directory)))
4186 #t))))))
9a3d176e
TGR
4187 (native-inputs
4188 `(("pkg-config" ,pkg-config)))
d17ae8c0 4189 (inputs
9a3d176e
TGR
4190 `(("libatasmart" ,libatasmart)
4191 ("yaml-cpp" ,yaml-cpp)))
d17ae8c0
NG
4192 (home-page "http://thinkfan.sourceforge.net/")
4193 (synopsis "Simple fan control program")
4194 (description
4195 "Thinkfan is a simple fan control program. It reads temperatures,
4196checks them against configured limits and switches to appropriate (also
4197pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4198other @code{hwmon} driver that enables temperature reading and fan control
4199from userspace.")
4200 (license license:gpl3+)))
91231156 4201
b313665f
TGR
4202(define-public tpacpi-bat
4203 (package
4204 (name "tpacpi-bat")
4205 (version "3.1")
4206 (source
4207 (origin
4208 (method git-fetch)
4209 (uri (git-reference
4210 (url "https://github.com/teleshoes/tpacpi-bat.git")
4211 (commit (string-append "v" version))))
4212 (file-name (git-file-name name version))
4213 (sha256
4214 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4215 (build-system gnu-build-system)
4216 (arguments
4217 `(#:tests? #f ; no test target
4218 #:phases
4219 (modify-phases %standard-phases
4220 (add-after 'unpack 'refer-to-inputs
4221 (lambda _
4222 (substitute* "tpacpi-bat"
4223 (("cat ")
4224 (format "~a " (which "cat")))
4225 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4226 ;; loaded. That's the administrator's prerogative; disable it.
4227 (("system \"(modprobe .*)\"" _ match)
4228 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4229 #t))
4230 (delete 'configure) ; nothing to configure
4231 (delete 'build) ; nothing to build
4232 (replace 'install
4233 (lambda* (#:key outputs #:allow-other-keys)
4234 (let* ((out (assoc-ref outputs "out"))
4235 (bin (string-append out "/bin"))
4236 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4237 (install-file "tpacpi-bat" bin)
4238
4239 ;; There's no man page. Install other forms of documentation.
4240 (for-each (lambda (file)
4241 (let ((target (string-append doc "/" file)))
4242 (mkdir-p (dirname target))
4243 (copy-recursively file target)))
4244 (list "battery_asl" "examples" "README.md"))
4245 #t))))))
4246 (inputs
4247 `(("perl" ,perl)))
4248 (home-page "https://github.com/teleshoes/tpacpi-bat")
4249 (synopsis "ThinkPad battery charge controller")
4250 (description
4251 "Tpacpi-bat is a command-line interface to control battery charging on
4252@uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4253ThinkPad models released after 2011}, starting with the xx20 series. It can
4254query and set the thresholds at which one or both batteries will start and stop
4255charging, inhibit charging batteries for a set period of time, or force them to
4256discharge when they otherwise would not.
4257
4258This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4259kernel module provided by the @code{acpi-call-linux-module} package, which must
4260be installed and loaded separately. Only the original vendor firmware is
4261supported.")
4262 (license license:gpl3+)))
4263
91231156
LC
4264(define-public ntfs-3g
4265 (package
4266 (name "ntfs-3g")
d8af4f6d 4267 (version "2017.3.23")
91231156
LC
4268 (source (origin
4269 (method url-fetch)
4270 (uri (string-append "https://tuxera.com/opensource/"
4271 "ntfs-3g_ntfsprogs-" version ".tgz"))
6d01a7f4 4272 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
91231156
LC
4273 (sha256
4274 (base32
d8af4f6d 4275 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
91231156 4276 (modules '((guix build utils)))
6cbee49d
MW
4277 (snippet '(begin
4278 ;; Install under $prefix.
4279 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4280 (("/sbin")
4281 "@sbindir@"))
4282 #t))))
91231156
LC
4283 (build-system gnu-build-system)
4284 (inputs `(("util-linux" ,util-linux)
4285 ("fuse" ,fuse))) ;libuuid
4286 (native-inputs `(("pkg-config" ,pkg-config)))
4287 (arguments
4288 '(#:configure-flags (list "--exec-prefix=${prefix}"
4289 "--with-fuse=external" ;use our own FUSE
4290 "--enable-mount-helper"
4291 "--enable-posix-acls"
91420521
PN
4292 "--enable-xattr-mappings")
4293 #:phases
4294 (modify-phases %standard-phases
4295 ;; If users install ntfs-3g, they probably want to make it the
4296 ;; default driver as well, so we opt for sensible defaults and link
4297 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
52beae7b 4298 ;; mount NTFS file systems.)
91420521
PN
4299 (add-after 'install 'install-link
4300 (lambda* (#:key outputs #:allow-other-keys)
4301 (let* ((out (assoc-ref outputs "out"))
4302 (sbin (string-append out "/sbin")))
4303 (symlink "mount.ntfs-3g"
9922278b
MW
4304 (string-append sbin "/mount.ntfs")))
4305 #t)))))
8bad0c0b 4306 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
91231156
LC
4307 (synopsis "Read-write access to NTFS file systems")
4308 (description
4309 "NTFS-3G provides read-write access to NTFS file systems, which are
4310commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4311The package provides additional NTFS tools.")
4312 (license license:gpl2+)))
9b0942c1 4313
f8f44dd7
MB
4314(define-public rdma-core
4315 (package
4316 (name "rdma-core")
e68f954e 4317 (version "26.0")
f8f44dd7
MB
4318 (source (origin
4319 (method url-fetch)
4320 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4321 "/releases/download/v" version "/rdma-core-"
4322 version ".tar.gz"))
4323 (sha256
4324 (base32
e68f954e 4325 "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j"))))
f8f44dd7
MB
4326 (build-system cmake-build-system)
4327 (arguments
e68f954e 4328 `(#:tests? #f ; no tests
f8f44dd7
MB
4329 ;; Upstream uses the "ninja" build system and encourage distros
4330 ;; to do the same for consistency. They also recommend using the
4331 ;; "Release" build type.
3def739d 4332 #:build-type "Release"
2b14c60d
LC
4333 #:configure-flags (list "-GNinja"
4334
e68f954e
LC
4335 (string-append "-DRST2MAN_EXECUTABLE="
4336 (assoc-ref %build-inputs
4337 "python-docutils")
4338 "/bin/rst2man.py")
4339
2b14c60d
LC
4340 ;; On some configurations, the
4341 ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is
4342 ;; used by default, would return ENODEV. To
4343 ;; avoid that, use 'write' instead of ioctls,
4344 ;; as suggested in 'CMakeList.txt'.
4345 "-DIOCTL_MODE=write")
f8f44dd7
MB
4346 #:phases
4347 (modify-phases %standard-phases
4348 (replace 'build
4349 (lambda _
8c3101b8
MW
4350 (invoke "ninja"
4351 "-j" (number->string (parallel-job-count)))))
f8f44dd7
MB
4352 (replace 'install
4353 (lambda _
8c3101b8 4354 (invoke "ninja" "install"))))))
f8f44dd7
MB
4355 (native-inputs
4356 `(("ninja" ,ninja)
4357 ("pkg-config" ,pkg-config)
e68f954e
LC
4358 ("python" ,python-wrapper)
4359 ("python-docutils" ,python-docutils))) ;for 'rst2man'
f8f44dd7
MB
4360 (inputs
4361 `(("libnl" ,libnl)
4362 ("udev" ,eudev)))
4363 (home-page "https://github.com/linux-rdma/rdma-core")
4364 (synopsis "Utilities and libraries for working with RDMA devices")
4365 (description
4366 "This package provides userspace components for the InfiniBand
4367subsystem of the Linux kernel. Specifically it contains userspace
4368libraries for the following device nodes:
4369
4370@enumerate
4371@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4372@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4373@item @file{/dev/infiniband/umadX} (@code{libibumad})
4374@end enumerate
4375
4376The following service daemons are also provided:
4377@enumerate
4378@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4379@item @code{iwpmd} (for iWARP kernel providers)
4380@item @code{ibacm} (for InfiniBand communication management assistant)
4381@end enumerate")
4382 ;; All library code is dual licensed under GPL2 and a custom MIT
4383 ;; variant. The package also includes some components covered by
4384 ;; other licenses. Consult COPYING.md for full details.
4385 (license
4386 (list license:gpl2
4387 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4388 license:bsd-2 ; Files referring to COPYING.BSD_FB
4389 license:cc0 ; most files in ccan/
4390 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4391
a0a273c1
MG
4392(define-public perftest
4393 (package
4394 (name "perftest")
50298d4a 4395 (version "4.4-0.4")
a0a273c1
MG
4396 (source
4397 (origin
4398 (method url-fetch)
50298d4a
TGR
4399 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4400 version "/perftest-" version ".g0927198.tar.gz"))
a0a273c1 4401 (sha256
50298d4a 4402 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
a0a273c1
MG
4403 (build-system gnu-build-system)
4404 (arguments
4405 `(#:phases
4406 (modify-phases %standard-phases
4407 (add-after 'unpack 'patch-header-paths
4408 (lambda _
4409 (substitute* '("src/raw_ethernet_fs_rate.c"
4410 "src/raw_ethernet_resources.c"
4411 "src/raw_ethernet_resources.h"
4412 "src/raw_ethernet_send_burst_lat.c"
4413 "src/raw_ethernet_send_bw.c"
4414 "src/raw_ethernet_send_lat.c")
4415 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4416 #t)))))
4417 (inputs `(("rdma-core" ,rdma-core)))
4418 (home-page "https://github.com/linux-rdma/perftest/")
4419 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4420 (description "This is a collection of tests written over uverbs intended for
4421use as a performance micro-benchmark. The tests may be used for hardware or
4422software tuning as well as for functional testing.
4423
4424The collection contains a set of bandwidth and latency benchmark such as:
4425@enumerate
4426@item Send - @code{ib_send_bw} and @code{ib_send_lat}
4427@item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4428@item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4429@item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4430@item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4431@end enumerate")
4432 (license license:gpl2)))
4433
9b0942c1
DC
4434(define-public rng-tools
4435 (package
4436 (name "rng-tools")
c6b772a0 4437 (home-page "https://github.com/nhorman/rng-tools")
dfd82356 4438 (version "6.8")
9b0942c1 4439 (source (origin
f289820c
MB
4440 (method git-fetch)
4441 (uri (git-reference (url home-page)
4442 (commit (string-append "v" version))))
4443 (file-name (git-file-name name version))
9b0942c1
DC
4444 (sha256
4445 (base32
dfd82356 4446 "1clm9i9xg3j79q0d6vinn6dx0nwh1fvzcmkqpcbay7mwsgkknvw2"))))
9b0942c1 4447 (build-system gnu-build-system)
8bc6956b
LF
4448 (arguments
4449 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
ae67d70d
TGR
4450 #:configure-flags '("--without-nistbeacon"
4451 "--without-pkcs11")))
8bc6956b
LF
4452 (native-inputs
4453 `(("autoconf" ,autoconf)
4454 ("automake" ,automake)
4455 ("pkg-config" ,pkg-config)))
4456 (inputs
4457 `(("libsysfs" ,sysfsutils)))
9b0942c1
DC
4458 (synopsis "Random number generator daemon")
4459 (description
4460 "Monitor a hardware random number generator, and supply entropy
4461from that to the system kernel's @file{/dev/random} machinery.")
9b0942c1
DC
4462 ;; The source package is offered under the GPL2+, but the files
4463 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4464 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
4465
4466(define-public cpupower
4467 (package
4468 (name "cpupower")
4469 (version (package-version linux-libre))
4470 (source (package-source linux-libre))
4471 (build-system gnu-build-system)
4472 (arguments
4473 '(#:phases (modify-phases %standard-phases
4474 (add-after 'unpack 'enter-subdirectory
4475 (lambda _
9922278b
MW
4476 (chdir "tools/power/cpupower")
4477 #t))
58d6a1f2
TGR
4478 (delete 'configure)
4479 (add-before 'build 'fix-makefiles
4480 (lambda _
4481 (substitute* "Makefile"
4482 (("/usr/") "/")
4483 (("/bin/(install|pwd)" _ command) command))
4484 (substitute* "bench/Makefile"
9922278b
MW
4485 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4486 #t)))
58d6a1f2
TGR
4487 #:make-flags (let ((out (assoc-ref %outputs "out")))
4488 (list (string-append "DESTDIR=" out)
4489 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4490 "docdir=/share/doc/cpupower"
4491 "confdir=$(docdir)/examples"
4492 ;; The Makefile recommends the following changes
4493 "DEBUG=false"
4494 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4495 #:tests? #f)) ;no tests
b94a6ca0 4496 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
4497 (inputs `(("pciutils" ,pciutils)))
4498 (home-page (package-home-page linux-libre))
4499 (synopsis "CPU frequency and voltage scaling tools for Linux")
4500 (description
4501 "cpupower is a set of user-space tools that use the cpufreq feature of the
4502Linux kernel to retrieve and control processor features related to power saving,
4503such as frequency and voltage scaling.")
4504 (license license:gpl2)))
2b76f135 4505
71bd55cb
SS
4506(define-public x86-energy-perf-policy
4507 (package
4508 (name "x86-energy-perf-policy")
4509 (version (package-version linux-libre))
4510 (source (package-source linux-libre))
4511 (build-system gnu-build-system)
4512 (arguments
4513 '(#:tests? #f
4514 #:phases
4515 (modify-phases %standard-phases
4516 (add-after 'unpack 'enter-subdirectory
4517 (lambda _
4518 (chdir "tools/power/x86/x86_energy_perf_policy")
4519 #t))
4520 (delete 'configure)
4521 (add-before 'build 'fix-makefile
4522 (lambda _
4523 (substitute* "Makefile" (("/usr") ""))
4524 #t)))
4525 #:make-flags
4526 (let ((out (assoc-ref %outputs "out")))
4527 (list (string-append "DESTDIR=" out)
4528 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4529 (supported-systems '("i686-linux" "x86_64-linux"))
4530 (home-page (package-home-page linux-libre))
4531 (synopsis "Display and update Intel-CPU energy-performance policy")
4532 (description
4533 "@command{x86_energy_perf_policy} displays and updates energy-performance
4534policy settings specific to Intel Architecture Processors. Settings are
4535accessed via Model Specific Register (MSR) updates, no matter if the Linux
4536cpufreq sub-system is enabled or not.")
4537 (license license:gpl2)))
4538
2b76f135
TGR
4539(define-public haveged
4540 (package
4541 (name "haveged")
389cae8b 4542 (version "1.9.6")
2b76f135
TGR
4543 (source
4544 (origin
893c340c
TGR
4545 (method git-fetch)
4546 (uri (git-reference
4547 (url "https://github.com/jirka-h/haveged.git")
389cae8b 4548 (commit (string-append "v" version))))
893c340c 4549 (file-name (git-file-name name version))
2b76f135 4550 (sha256
389cae8b 4551 (base32 "11kr19n2f87izsj341lv5amhd1wc2ckfmqr9pq5fxix8pkbs94rh"))))
2b76f135 4552 (build-system gnu-build-system)
6664ec0c 4553 (home-page "https://www.issihosts.com/haveged")
2b76f135
TGR
4554 (synopsis "Entropy source for the Linux random number generator")
4555 (description
4556 "haveged generates an unpredictable stream of random numbers for use by
4557Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4558standard mechanisms for filling the entropy pool may not be sufficient for
4559systems with high needs or limited user interaction, such as headless servers.
b71a3488 4560
2b76f135 4561@command{haveged} runs as a privileged daemon, harvesting randomness from the
8e42b087
TGR
4562indirect effects of hardware events on hidden processor state using the
4563@acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm.
4564It tunes itself to its environment and provides the same built-in test suite
4565for the output stream as used on certified hardware security devices.
4a147986
TGR
4566
4567The quality of the randomness produced by this algorithm has not been proven.
4568It is recommended to run it together with another entropy source like rngd, and
4569not as a replacement for it.")
2b76f135
TGR
4570 (license (list (license:non-copyleft "file://nist/mconf.h")
4571 (license:non-copyleft "file://nist/packtest.c")
4572 license:public-domain ; nist/dfft.c
4573 license:gpl3+)))) ; everything else
e385e957
TGR
4574
4575(define-public ecryptfs-utils
4576 (package
4577 (name "ecryptfs-utils")
4578 (version "111")
4579 (source
4580 (origin
4581 (method url-fetch)
4582 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4583 version "/+download/ecryptfs-utils_"
4584 version ".orig.tar.gz"))
4585 (sha256
4586 (base32
4587 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4588 (build-system gnu-build-system)
4589 (arguments
17a21bcf
BT
4590 `(#:configure-flags (list "--disable-pywrap")
4591 #:phases
4592 (modify-phases %standard-phases
4593 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4594 (lambda* (#:key inputs outputs #:allow-other-keys)
4595 (let ((out (assoc-ref outputs "out"))
4596 (utils-linux (assoc-ref inputs "utils-linux"))
4597 (cryptsetup (assoc-ref inputs "cryptsetup"))
4598 (linux-pam (assoc-ref inputs "linux-pam"))
4599 (lvm2 (assoc-ref inputs "lvm2")))
4600 (substitute* '("src/utils/ecryptfs-mount-private"
4601 "src/utils/ecryptfs-umount-private"
4602 "src/utils/ecryptfs-setup-private"
e8ec2dda 4603 "src/utils/ecryptfs-setup-swap"
17a21bcf 4604 "src/utils/mount.ecryptfs.c"
e8ec2dda 4605 "src/utils/umount.ecryptfs.c"
17a21bcf
BT
4606 "src/pam_ecryptfs/pam_ecryptfs.c"
4607 "src/desktop/ecryptfs-mount-private.desktop.in"
e8ec2dda 4608 "src/desktop/ecryptfs-setup-private.desktop.in")
17a21bcf
BT
4609 (("/bin/mount")
4610 (string-append utils-linux "/bin/mount"))
4611 (("/bin/umount")
4612 (string-append utils-linux "/bin/umount"))
4613 (("/sbin/mount.ecryptfs_private")
4614 (string-append out "/sbin/mount.ecryptfs_private"))
4615 (("/sbin/umount.ecryptfs_private")
4616 (string-append out "/sbin/umount.ecryptfs_private"))
4617 (("/usr/bin/ecryptfs-mount-private")
4618 (string-append out "/bin/ecryptfs-mount-private"))
4619 (("/usr/bin/ecryptfs-rewrite-file")
4620 (string-append out "/bin/ecryptfs-rewrite-file"))
4621 (("/usr/bin/ecryptfs-setup-private")
4622 (string-append out "/bin/ecryptfs-setup-private"))
4623 (("/sbin/cryptsetup")
4624 (string-append cryptsetup "/sbin/cryptsetup"))
4625 (("/sbin/unix_chkpwd")
4626 (string-append linux-pam "/sbin/unix_chkpwd"))
4627 (("/sbin/dmsetup")
4628 (string-append lvm2 "/sbin/dmsetup")))))))))
e385e957
TGR
4629 (native-inputs
4630 `(("intltool" ,intltool)
4631 ("perl" ,perl) ; for pod2man
4632 ("pkg-config" ,pkg-config)))
4633 (inputs
4634 `(("keyutils" ,keyutils)
4635 ("linux-pam" ,linux-pam)
17a21bcf
BT
4636 ("utils-linux" ,util-linux)
4637 ("cryptsetup" ,cryptsetup)
4638 ("lvm2" ,lvm2)
e385e957
TGR
4639 ("nss" ,nss)))
4640 (home-page "http://ecryptfs.org/")
4641 (synopsis "eCryptfs cryptographic file system utilities")
4642 (description
4643 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4644Each file's cryptographic meta-data is stored inside the file itself, along
4645with the encrypted contents. This allows individual encrypted files to be
4646copied between hosts and still be decrypted with the proper key. eCryptfs is a
4647native Linux file system, and has been part of the Linux kernel since version
46482.6.19. This package contains the userland utilities to manage it.")
4649 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4650 ;; grant additional permission to link with OpenSSL.
4651 (license license:gpl2+)))
cff0adec
DC
4652
4653(define-public libnfsidmap
4654 (package
4655 (name "libnfsidmap")
4505369c
TGR
4656 (version "0.27")
4657 (source
4658 (origin
4659 (method url-fetch)
4660 (uri (string-append "https://fedorapeople.org/~steved/"
4661 name "/" version "/" name "-" version ".tar.bz2"))
4662 (sha256
4663 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
cff0adec
DC
4664 (build-system gnu-build-system)
4665 (arguments
4666 `(#:configure-flags (list
4667 (string-append "--with-pluginpath="
4668 (assoc-ref %outputs "out")
4669 "/lib/libnfsidmap"))))
4505369c
TGR
4670 (native-inputs
4671 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
cff0adec
DC
4672 (home-page
4673 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4505369c 4674 (synopsis "NFSv4 support library for name/ID mapping")
cff0adec
DC
4675 (description "Libnfsidmap is a library holding mulitiple methods of
4676mapping names to ids and visa versa, mainly for NFSv4. It provides an
4677extensible array of mapping functions, currently consisting of two choices:
4678the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4679 (license (license:non-copyleft "file://COPYING"
4680 "See COPYING in the distribution."))))
035d3593
DC
4681
4682(define-public module-init-tools
4683 (package
4684 (name "module-init-tools")
4685 (version "3.16")
4686 (source (origin
4687 (method url-fetch)
4688 (uri (string-append
4689 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4690 "module-init-tools-" version ".tar.bz2"))
4691 (sha256
4692 (base32
4693 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4694 (patches (search-patches "module-init-tools-moduledir.patch"))))
4695 (build-system gnu-build-system)
4696 (arguments
4697 ;; FIXME: The upstream tarball lacks man pages, and building them would
4698 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4699 ;; but they vanished. In the meantime, fake it.
dc1d3cde
KK
4700 '(#:phases
4701 (modify-phases %standard-phases
4702 (add-before 'configure 'fake-docbook
4703 (lambda _
4704 (substitute* "Makefile.in"
4705 (("^DOCBOOKTOMAN.*$")
4706 "DOCBOOKTOMAN = true\n"))
4707 #t)))))
81e59e41 4708 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
035d3593
DC
4709 (synopsis "Tools for loading and managing Linux kernel modules")
4710 (description
36a4366d
EF
4711 "Tools for loading and managing Linux kernel modules, such as
4712@code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
035d3593 4713 (license license:gpl2+)))
dd65f3b7
TGR
4714
4715(define-public mcelog
4716 (package
4717 (name "mcelog")
e03e9c86 4718 (version "154")
dd65f3b7
TGR
4719 (source (origin
4720 (method url-fetch)
4721 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4722 "mcelog.git/snapshot/v" version ".tar.gz"))
4723 (sha256
4724 (base32
e03e9c86 4725 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
dd65f3b7
TGR
4726 (file-name (string-append name "-" version ".tar.gz"))
4727 (modules '((guix build utils)))
4728 (snippet
6cbee49d
MW
4729 `(begin
4730 ;; The snapshots lack a .git directory,
4731 ;; breaking ‘git describe’.
4732 (substitute* "Makefile"
4733 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4734 #t))))
dd65f3b7
TGR
4735 (build-system gnu-build-system)
4736 (arguments
4737 `(#:phases (modify-phases %standard-phases
4738 (delete 'configure)) ; no configure script
4739 #:make-flags (let ((out (assoc-ref %outputs "out")))
4740 (list "CC=gcc"
4741 (string-append "prefix=" out)
4742 (string-append "DOCDIR=" out "/share/doc/mcelog")
4743 "etcprefix=$(DOCDIR)/examples"))
4744 ;; The tests will only run as root on certain supported CPU models.
4745 #:tests? #f))
4746 (supported-systems (list "i686-linux" "x86_64-linux"))
71d60b96 4747 (home-page "https://mcelog.org/")
dd65f3b7
TGR
4748 (synopsis "Machine check monitor for x86 Linux systems")
4749 (description
4750 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4751and other hardware errors on x86 systems. It can also perform user-defined
4752tasks, such as bringing bad pages off-line, when configurable error thresholds
4753are exceeded.")
4754 (license license:gpl2)))
0c60cc53
DM
4755
4756(define-public mtd-utils
4757 (package
4758 (name "mtd-utils")
9ea820a5 4759 (version "2.1.1")
0c60cc53
DM
4760 (source (origin
4761 (method url-fetch)
4762 (uri (string-append
4763 "ftp://ftp.infradead.org/pub/mtd-utils/"
4764 "mtd-utils-" version ".tar.bz2"))
4765 (sha256
4766 (base32
9ea820a5 4767 "1lijl89l7hljx8xx70vrz9srd3h41v5gh4b0lvqnlv831yvyh5cd"))))
e8b9aaf0
EF
4768 (arguments
4769 '(#:configure-flags '("--enable-unit-tests")))
4770 (native-inputs
4771 `(("cmocka" ,cmocka)
4772 ("pkg-config" ,pkg-config)))
0c60cc53 4773 (inputs
f8f2b048 4774 `(("acl" ,acl) ; extended attributes (xattr)
0c60cc53 4775 ("libuuid" ,util-linux)
c695fb76 4776 ("lzo" ,lzo)
f8f2b048 4777 ("openssl" ,openssl) ; optional crypto support
9ea820a5
TGR
4778 ("zlib" ,zlib)
4779 ("zstd" ,zstd "lib")))
0c60cc53 4780 (build-system gnu-build-system)
0c60cc53
DM
4781 (synopsis "MTD Flash Storage Utilities")
4782 (description "This package provides utilities for testing, partitioning, etc
4783of flash storage.")
4784 (home-page "http://www.linux-mtd.infradead.org/")
4785 (license
4786 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4787 license:mpl1.1 ; All ftl* files
4788 license:expat)))) ; libiniparser
def6213f
LF
4789
4790(define-public libseccomp
4791 (package
4792 (name "libseccomp")
d100d5d5 4793 (version "2.4.2")
def6213f
LF
4794 (source (origin
4795 (method url-fetch)
4796 (uri (string-append "https://github.com/seccomp/libseccomp/"
4797 "releases/download/v" version
4798 "/libseccomp-" version ".tar.gz"))
4799 (sha256
4800 (base32
cf879196
LC
4801 "0nsq81acrbkdr8zairxbwa33bj2a6126npp76b4srjl472sjfkxm"))
4802 (patches (search-patches "libseccomp-open-aarch64.patch"))))
def6213f
LF
4803 (build-system gnu-build-system)
4804 (native-inputs
4805 `(("which" ,which)))
4806 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4807 (description "The libseccomp library provides an easy to use, platform
4808independent, interface to the Linux Kernel's syscall filtering mechanism. The
4809libseccomp API is designed to abstract away the underlying BPF based syscall
4810filter language and present a more conventional function-call based filtering
4811interface that should be familiar to, and easily adopted by, application
4812developers.")
4813 (home-page "https://github.com/seccomp/libseccomp")
4814 (license license:lgpl2.1)))
58c4f11e
TGR
4815
4816(define-public radeontop
4817 (package
4818 (name "radeontop")
88e1bce5 4819 (version "1.2")
ee861a54
TGR
4820 (source
4821 (origin
4822 (method git-fetch)
4823 (uri (git-reference
4824 (url "https://github.com/clbr/radeontop.git")
4825 (commit (string-append "v" version))))
4826 (file-name (git-file-name name version))
4827 (sha256
4828 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
58c4f11e
TGR
4829 (build-system gnu-build-system)
4830 (arguments
4831 `(#:phases (modify-phases %standard-phases
4832 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4833 ;; dependency, and doesn't even work on release(!) tarballs.
4834 (add-after 'unpack 'report-correct-version
9922278b
MW
4835 (lambda _
4836 (substitute* "getver.sh"
4837 (("ver=unknown")
4838 (string-append "ver=" ,version)))
4839 #t))
58c4f11e
TGR
4840 (delete 'configure)) ; no configure script
4841 #:make-flags (list "CC=gcc"
4842 (string-append "PREFIX=" %output))
4843 #:tests? #f)) ; no tests
4844 (native-inputs
7c90d0f4 4845 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
4846 ("pkg-config" ,pkg-config)))
4847 (inputs
4848 `(("libdrm" ,libdrm)
4849 ("libpciaccess" ,libpciaccess)
a7c61512 4850 ("libxcb" ,libxcb)
58c4f11e 4851 ("ncurses" ,ncurses)))
ee861a54 4852 (home-page "https://github.com/clbr/radeontop/")
58c4f11e
TGR
4853 (synopsis "Usage monitor for AMD Radeon graphics")
4854 (description "RadeonTop monitors resource consumption on supported AMD
4855Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4856a terminal or saved to a file for further processing. It measures both the
4857activity of the GPU as a whole, which is also accurate during OpenCL
4858computations, as well as separate component statistics that are only meaningful
4859under OpenGL graphics workloads.")
4860 (license license:gpl3)))
0d74462a
MB
4861
4862(define-public efivar
4863 (package
4864 (name "efivar")
f19dfeeb 4865 (version "37")
0d74462a
MB
4866 (source (origin
4867 (method url-fetch)
c6dd2790 4868 (uri (string-append "https://github.com/rhboot/" name
0d74462a
MB
4869 "/releases/download/" version "/" name
4870 "-" version ".tar.bz2"))
4871 (sha256
4872 (base32
f19dfeeb 4873 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
0d74462a
MB
4874 (build-system gnu-build-system)
4875 (arguments
4876 `(;; Tests require a UEFI system and is not detected in the chroot.
4877 #:tests? #f
4878 #:make-flags (list (string-append "prefix=" %output)
4879 (string-append "libdir=" %output "/lib")
b2b2ba40 4880 "CC_FOR_BUILD=gcc"
0d74462a
MB
4881 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4882 #:phases
4883 (modify-phases %standard-phases
f90d6c3f
MB
4884 (delete 'configure)
4885 (add-before 'build 'kernel-headers-are-system-headers
4886 (lambda* (#:key inputs #:allow-other-keys)
4887 (let ((kernel-headers (assoc-ref inputs "kernel-headers")))
4888 ;; Make sure the kernel headers are treated as system headers
4889 ;; to suppress a conflict between "util.h" and <linux/fs.h>.
4890 (setenv "C_INCLUDE_PATH" (string-append kernel-headers "/include"))
4891 #t))))))
0d74462a
MB
4892 (native-inputs
4893 `(("pkg-config" ,pkg-config)))
4894 (inputs
4895 `(("popt" ,popt)))
c6dd2790 4896 (home-page "https://github.com/rhboot/efivar")
0d74462a
MB
4897 (synopsis "Tool and library to manipulate EFI variables")
4898 (description "This package provides a library and a command line
4899interface to the variable facility of UEFI boot firmware.")
4900 (license license:lgpl2.1+)))
1581406e
MB
4901
4902(define-public efibootmgr
4903 (package
4904 (name "efibootmgr")
732825f3 4905 (version "16")
1581406e
MB
4906 (source (origin
4907 (method url-fetch)
30559d8f
MB
4908 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4909 "/releases/download/" version "/efibootmgr"
1581406e
MB
4910 "-" version ".tar.bz2"))
4911 (sha256
4912 (base32
732825f3 4913 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
1581406e
MB
4914 (build-system gnu-build-system)
4915 (arguments
82e7a51c 4916 `(#:tests? #f ;no tests
1581406e
MB
4917 #:make-flags (list (string-append "prefix=" %output)
4918 (string-append "libdir=" %output "/lib")
732825f3
MB
4919 ;; EFIDIR denotes a subdirectory relative to the
4920 ;; EFI System Partition where the loader will be
4921 ;; installed (known as OS_VENDOR in the code).
4922 ;; GRUB overrides this, as such it's only used if
4923 ;; nothing else is specified on the command line.
b9a30e0d
MB
4924 "EFIDIR=gnu"
4925 ;; Treat kernel headers as system headers to prevent
4926 ;; warnings about conflicting types.
4927 (string-append "C_INCLUDE_PATH="
4928 (assoc-ref %build-inputs "kernel-headers")
4929 "/include"))
732825f3 4930 #:phases (modify-phases %standard-phases (delete 'configure))))
1581406e
MB
4931 (native-inputs
4932 `(("pkg-config" ,pkg-config)))
4933 (inputs
4934 `(("efivar" ,efivar)
4935 ("popt" ,popt)))
4936 (home-page "https://github.com/rhinstaller/efibootmgr")
4937 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4938 (description
4939 "@code{efibootmgr} is a user-space application to modify the Intel
4940Extensible Firmware Interface (EFI) Boot Manager. This application can
4941create and destroy boot entries, change the boot order, change the next
4942running boot option, and more.")
4943 (license license:gpl2+)))
6d3e08d4
LF
4944
4945(define-public sysstat
4946 (package
4947 (name "sysstat")
3d761127 4948 (version "12.1.6")
6d3e08d4
LF
4949 (source (origin
4950 (method url-fetch)
36ac9520 4951 (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/"
6d3e08d4
LF
4952 "sysstat-" version ".tar.xz"))
4953 (sha256
4954 (base32
3d761127 4955 "0agi17n82k363mf9f7cky3isq195hw112vs98v26yfhm0v2g6lpp"))))
6d3e08d4
LF
4956 (build-system gnu-build-system)
4957 (arguments
4958 `(#:tests? #f ; No test suite.
4959 ;; Without this flag, it tries to install the man pages with group 'root'
4960 ;; and fails because /etc/passwd lacks an entry for the root user.
4961 #:configure-flags
4962 (list "--disable-file-attr"
4963 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4964 #:phases
4965 (modify-phases %standard-phases
4966 ;; The build process tries to create '/var/lib/sa', so we skip that
4967 ;; instruction.
4968 (add-after 'build 'skip-touching-var
4969 (lambda _
4970 (substitute* "Makefile"
4971 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4972 ""))
4973 #t)))))
4974 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4975 (synopsis "Performance monitoring tools for Linux")
4976 (description "The sysstat utilities are a collection of performance
4977monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4978@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4979@code{sadf} and @code{sa}.")
4980 (license license:gpl2+)))
01be4f93
JMSG
4981
4982(define-public light
4983 (package
4984 (name "light")
2053555a 4985 (version "1.2.1")
664cb939
TGR
4986 (source
4987 (origin
4988 (method git-fetch)
4989 (uri (git-reference
4990 (url "https://github.com/haikarainen/light.git")
4991 (commit (string-append "v" version))))
4992 (sha256
4993 (base32 "0zrjipd392bzjvxx0rjrb0cgi0ix1d83fwgw1mcy8kc4d16cgyjg"))
4994 (file-name (git-file-name name version))))
01be4f93 4995 (build-system gnu-build-system)
01be4f93 4996 (native-inputs
ff598353
PL
4997 `(("autoconf" ,autoconf)
4998 ("automake" ,automake)))
4999 (home-page "https://haikarainen.github.io/light/")
01be4f93
JMSG
5000 (synopsis "GNU/Linux application to control backlights")
5001 (description
5002 "Light is a program to send commands to screen backlight controllers
5003under GNU/Linux. Features include:
5004
5005@itemize
5006@item It does not rely on X.
5007@item Light can automatically figure out the best controller to use, making
5008full use of underlying hardware.
5009@item It is possible to set a minimum brightness value, as some controllers
5010set the screen to be pitch black at a vaĺue of 0 (or higher).
5011@end itemize
5012
5013Light is the successor of lightscript.")
5014 (license license:gpl3+)))
189d8422 5015
ab7f1eb9
VC
5016(define-public brightnessctl
5017 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
5018 (package
5019 (name "brightnessctl")
5020 (version (git-version "0.4" "0" commit))
5021 (source (origin
5022 (method git-fetch)
5023 (uri (git-reference
5024 (url "https://github.com/Hummer12007/brightnessctl/")
5025 (commit commit)))
5026 (file-name (git-file-name name version))
5027 (sha256
5028 (base32
5029 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
5030 (build-system gnu-build-system)
5031 (arguments
5032 '(#:tests? #f ; no tests
5033 #:make-flags (list "CC=gcc"
5034 (string-append "PREFIX=" %output)
5035 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
5036 #:phases
5037 (modify-phases %standard-phases
5038 (delete 'configure)
5039 (add-after 'unpack 'adjust-udev-rules
5040 (lambda _
5041 (substitute* "90-brightnessctl.rules"
5042 (("/bin/") "/run/current-system/profile/bin/"))
5043 #t)))))
5044 (home-page "https://github.com/Hummer12007/brightnessctl")
5045 (synopsis "Backlight and LED brightness control")
5046 (description
5047 "This program allows you read and control device brightness. Devices
5048include backlight and LEDs. It can also preserve current brightness before
5049applying the operation, such as on lid close.
5050
5051The appropriate permissions must be set on the backlight or LED control
5052interface in sysfs, which can be accomplished with the included udev rules.")
5053 (license license:expat))))
5054
c7adafa7
MO
5055(define-public tlp
5056 (package
5057 (name "tlp")
5d51a977 5058 (version "1.2.2")
c7adafa7
MO
5059 (source (origin
5060 (method url-fetch)
5061 (uri (string-append
5062 "https://github.com/linrunner/"
5063 (string-upcase name)
5064 "/archive/" version ".tar.gz"))
5065 (file-name (string-append name "-" version ".tar.gz"))
5066 (sha256
5067 (base32
5d51a977 5068 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
c7adafa7
MO
5069 (inputs `(("bash" ,bash)
5070 ("dbus" ,dbus)
5071 ("ethtool" ,ethtool)
5072 ("eudev" ,eudev)
5073 ("grep" ,grep)
5074 ("hdparm" ,hdparm)
5075 ("inetutils" ,inetutils)
5076 ("iw" ,iw)
5077 ("kmod" ,kmod)
5078 ("pciutils" ,pciutils)
5079 ("perl" ,perl)
5080 ("rfkill" ,rfkill)
5081 ("sed" ,sed)
5082 ("usbutils" ,usbutils)
5083 ("util-linux" ,util-linux)
cf342a85
SS
5084 ("wireless-tools" ,wireless-tools)
5085 ,@(if (let ((system (or (%current-target-system)
5086 (%current-system))))
5087 (or (string-prefix? "i686-" system)
5088 (string-prefix? "x86_64-" system)))
5089 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
5090 '())))
c7adafa7
MO
5091 (build-system gnu-build-system)
5092 (arguments
cf342a85
SS
5093 `(#:modules ((guix build gnu-build-system)
5094 (guix build utils)
5095 (srfi srfi-1))
5096 #:phases
c7adafa7 5097 (modify-phases %standard-phases
cef3f146 5098 (delete 'configure) ; no configure script
c7adafa7
MO
5099 (add-before 'build 'setenv
5100 (lambda* (#:key outputs #:allow-other-keys)
5101 (let ((out (assoc-ref outputs "out")))
5102 (setenv "TLP_WITH_SYSTEMD" "0")
5103 (setenv "TLP_NO_INIT" "1")
5104 (setenv "TLP_NO_PMUTILS" "1")
5105 (setenv "TLP_SBIN" (string-append out "/bin"))
5106 (setenv "TLP_BIN" (string-append out "/bin"))
c6e775a8
NG
5107 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
5108 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
c7adafa7 5109 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
32e75b48 5110 (setenv "TLP_CONF" "/etc/tlp")
5d51a977
NG
5111 (setenv "TLP_ELOD"
5112 (string-append out "/lib/elogind/system-sleep"))
c7adafa7
MO
5113 (setenv "TLP_SHCPL"
5114 (string-append out "/share/bash-completion/completions"))
6db6c3a9 5115 (setenv "TLP_MAN" (string-append out "/share/man"))
272fc9dc
TGR
5116 (setenv "TLP_META" (string-append out "/share/metainfo"))
5117 #t)))
cef3f146
TGR
5118 (delete 'check) ; no tests
5119 (add-before 'install 'fix-installation
5120 (lambda _
5121 ;; Stop the Makefile from trying to create system directories.
5d51a977
NG
5122 (substitute* "Makefile"
5123 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
5124 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
272fc9dc 5125 #t))
c7adafa7
MO
5126 (replace 'install
5127 (lambda _
9922278b 5128 (invoke "make" "install-tlp" "install-man")))
c7adafa7
MO
5129 (add-after 'install 'wrap
5130 (lambda* (#:key inputs outputs #:allow-other-keys)
5131 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
5132 (bin-files (find-files bin ".*")))
5133 (define (bin-directory input-name)
cf342a85
SS
5134 (let ((p (assoc-ref inputs input-name)))
5135 (and p (string-append p "/bin"))))
c7adafa7
MO
5136 (define (sbin-directory input-name)
5137 (string-append (assoc-ref inputs input-name) "/sbin"))
5138 (for-each (lambda (program)
5139 (wrap-program program
5140 `("PATH" ":" prefix
5141 ,(append
cf342a85
SS
5142 (filter-map bin-directory
5143 '("bash"
5144 "coreutils"
5145 "dbus"
5146 "eudev"
5147 "grep"
5148 "inetutils"
5149 "kmod"
5150 "perl"
5151 "sed"
5152 "usbutils"
5153 "util-linux"
5154 "x86-energy-perf-policy"))
5155 (filter-map sbin-directory
5156 '("ethtool"
5157 "hdparm"
5158 "iw"
5159 "pciutils"
5160 "rfkill"
5161 "wireless-tools"))))))
272fc9dc
TGR
5162 bin-files)
5163 #t))))))
c7adafa7
MO
5164 (home-page "http://linrunner.de/en/tlp/tlp.html")
5165 (synopsis "Power management tool for Linux")
5166 (description "TLP is a power management tool for Linux. It comes with
5167a default configuration already optimized for battery life. Nevertheless,
5168TLP is customizable to fulfil system requirements. TLP settings are applied
5169every time the power supply source is changed.")
c7adafa7
MO
5170 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5171 ;; rest is GPLv2+.
5172 (license (list license:gpl2+ license:gpl3+))))
5173
189d8422
BG
5174(define-public lshw
5175 (package
5176 (name "lshw")
5177 (version "B.02.18")
5178 (source (origin
5179 (method url-fetch)
5180 (uri (string-append "https://www.ezix.org/software/"
5181 "files/lshw-" version
5182 ".tar.gz"))
5183 (sha256
5184 (base32
5185 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5186 (build-system gnu-build-system)
5187 (arguments
5188 `(#:phases (modify-phases %standard-phases (delete 'configure))
5189 #:tests? #f ; no tests
5190 #:make-flags
5191 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5192 (synopsis "List hardware information")
5193 (description
5194 "@command{lshw} (Hardware Lister) is a small tool to provide
5195detailed information on the hardware configuration of the machine.
5196It can report exact memory configuration, firmware version, mainboard
5197configuration, CPU version and speed, cache configuration, bus speed,
5198and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5199machines (PowerMac G4 is known to work).")
5200 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5201 (license license:gpl2+)))
2f4a58b5
LF
5202
5203(define-public libmnl
5204 (package
5205 (name "libmnl")
5206 (version "1.0.4")
5207 (source
5208 (origin
5209 (method url-fetch)
f11ae44f 5210 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
5211 "libmnl-" version ".tar.bz2"))
5212 (sha256
5213 (base32
5214 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5215 (build-system gnu-build-system)
5216 (home-page "https://www.netfilter.org/projects/libmnl/")
5217 (synopsis "Netlink utility library")
5218 (description "Libmnl is a minimalistic user-space library oriented to
5219Netlink developers. There are a lot of common tasks in parsing, validating,
5220constructing of both the Netlink header and TLVs that are repetitive and easy to
5221get wrong. This library aims to provide simple helpers that allows you to
5222re-use code and to avoid re-inventing the wheel.")
5223 (license license:lgpl2.1+)))
b754c612
LF
5224
5225(define-public libnftnl
5226 (package
5227 (name "libnftnl")
c5e3f4f0 5228 (version "1.1.4")
b754c612 5229 (source
e569c772
TGR
5230 (origin
5231 (method url-fetch)
5232 (uri (string-append "mirror://netfilter.org/libnftnl/"
5233 "libnftnl-" version ".tar.bz2"))
5234 (sha256
c5e3f4f0 5235 (base32 "087dfc2n4saf2k68hyi4byvgz5grwpw5kfjvmkpn3wmd8y1riiy8"))))
b754c612
LF
5236 (build-system gnu-build-system)
5237 (native-inputs
5238 `(("pkg-config" ,pkg-config)))
5239 (inputs
5240 `(("libmnl" ,libmnl)))
5241 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5242 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5243 (description "Libnftnl is a userspace library providing a low-level netlink
5244programming interface to the in-kernel nf_tables subsystem. The library
5245libnftnl has been previously known as libnftables. This library is currently
5246used by nftables.")
5247 (license license:gpl2+)))
62b28c0e 5248
dfe93c9a
RH
5249(define-public nftables
5250 (package
5251 (name "nftables")
f8b7c35a 5252 (version "0.9.2")
dfe93c9a
RH
5253 (source
5254 (origin
5255 (method url-fetch)
5256 (uri (string-append "http://www.nftables.org/projects/nftables"
5257 "/files/nftables-" version ".tar.bz2"))
5258 (sha256
5259 (base32
f8b7c35a 5260 "1x8kalbggjq44j4916i6vyv1rb20dlh1dcsf9xvzqsry2j063djw"))))
dfe93c9a 5261 (build-system gnu-build-system)
9cb4bda2
RH
5262 (arguments `(#:configure-flags
5263 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
c695fb76
TGR
5264 (inputs `(("bison" ,bison)
5265 ("flex" ,flex)
5266 ("gmp" ,gmp)
5267 ("libmnl" ,libmnl)
5268 ("libnftnl" ,libnftnl)
5269 ("readline" ,readline)))
5270 (native-inputs `(("pkg-config" ,pkg-config)))
dfe93c9a
RH
5271 (home-page "http://www.nftables.org")
5272 (synopsis "Userspace utility for Linux packet filtering")
5273 (description "nftables is the project that aims to replace the existing
5274{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5275filtering framework, a new userspace utility and also a compatibility layer for
5276{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5277infrastructure such as the existing hooks, the connection tracking system, the
5278userspace queueing component and the logging subsystem.")
5279 (license license:gpl2)))
5280
62b28c0e
LC
5281(define-public proot
5282 (package
5283 (name "proot")
5284 (version "5.1.0")
674495b7
TGR
5285 (source
5286 (origin
5287 (method git-fetch)
5288 (uri (git-reference
5289 (url "https://github.com/proot-me/PRoot.git")
5290 (commit (string-append "v" version))))
5291 (file-name (git-file-name name version))
5292 (sha256
5293 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5294 (patches (search-patches "proot-test-fhs.patch"))))
62b28c0e
LC
5295 (build-system gnu-build-system)
5296 (arguments
5297 '(#:make-flags '("-C" "src")
5298
5299 #:phases (modify-phases %standard-phases
5300 (delete 'configure)
5301 (add-before 'build 'set-shell-file-name
5302 (lambda* (#:key inputs #:allow-other-keys)
5303 (substitute* (find-files "src" "\\.[ch]$")
5304 (("\"/bin/sh\"")
5305 (string-append "\""
5306 (assoc-ref inputs "bash")
5307 "/bin/sh\"")))
5308 #t))
5309 (add-before 'check 'fix-fhs-assumptions-in-tests
5310 (lambda _
5311 (substitute* "tests/test-c6b77b77.mk"
5312 (("/bin/bash") (which "bash"))
5313 (("/usr/bin/test") (which "test")))
5314 (substitute* '("tests/test-16573e73.c")
5315 (("/bin/([a-z-]+)" _ program)
5316 (which program)))
5317
5318 (substitute* (find-files "tests" "\\.sh$")
5319 ;; Some of the tests try to "bind-mount" /bin/true.
5320 (("-b /bin/true:")
5321 (string-append "-b " (which "true") ":"))
5322 ;; Likewise for /bin.
5323 (("-b /bin:") "-b /gnu:")
5324 ;; Others try to run /bin/sh.
5325 (("/bin/sh") (which "sh"))
5326 ;; Others assume /etc/fstab exists.
5327 (("/etc/fstab") "/etc/passwd"))
5328
5329 (substitute* "tests/GNUmakefile"
5330 (("-b /bin:") "-b /gnu:"))
5331
5332 ;; XXX: This test fails in an obscure corner case, just
5333 ;; skip it.
5334 (delete-file "tests/test-kkkkkkkk.c")
5335
5336 #t))
5337 (replace 'check
5338 (lambda _
5339 (let ((n (parallel-job-count)))
5340 ;; For some reason we get lots of segfaults with
5341 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5342 (setenv "PROOT_NO_SECCOMP" "1")
5343
5344 ;; Most of the tests expect "/bin" to be in $PATH so
5345 ;; they can run things that live in $ROOTFS/bin.
5346 (setenv "PATH"
5347 (string-append (getenv "PATH") ":/bin"))
5348
06153a30
MW
5349 (invoke "make" "check" "-C" "tests"
5350 ;;"V=1"
5351 "-j" (number->string n)))))
62b28c0e
LC
5352 (replace 'install
5353 (lambda* (#:key outputs #:allow-other-keys)
5354 ;; The 'install' rule does nearly nothing.
06153a30
MW
5355 (let* ((out (assoc-ref outputs "out"))
5356 (man1 (string-append out "/share/man/man1")))
5357 ;; TODO: 'make install-care' (does not even
5358 ;; build currently.)
5359 (invoke "make" "-C" "src" "install"
5360 (string-append "PREFIX=" out))
5361
5362 (mkdir-p man1)
5363 (copy-file "doc/proot/man.1"
5364 (string-append man1 "/proot.1"))
5365 #t))))))
62b28c0e
LC
5366 (native-inputs `(("which" ,which)
5367
5368 ;; For 'mcookie', used by some of the tests.
5369 ("util-linux" ,util-linux)))
5370 (inputs `(("talloc" ,talloc)))
674495b7 5371 (home-page "https://github.com/proot-me/PRoot")
62b28c0e
LC
5372 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5373 (description
5374 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5375and @code{binfmt_misc}. This means that users don't need any privileges or
5376setup to do things like using an arbitrary directory as the new root
162a1374 5377file system, making files accessible somewhere else in the file system
62b28c0e
LC
5378hierarchy, or executing programs built for another CPU architecture
5379transparently through QEMU user-mode. Also, developers can use PRoot as a
5380generic process instrumentation engine thanks to its extension mechanism.
5381Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5382available in the kernel Linux.")
5383 (license license:gpl2+)))
b9048a14
LC
5384
5385(define-public proot-static
5386 (package
5387 (inherit proot)
5388 (name "proot-static")
5389 (synopsis
5390 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5391 (inputs `(("talloc" ,talloc/static)))
5392 (arguments
5393 (substitute-keyword-arguments (package-arguments proot)
5394 ((#:make-flags flags)
5395 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5396 ((#:phases phases)
5397 `(modify-phases ,phases
5398 (add-after 'strip 'remove-store-references
5399 (lambda* (#:key outputs #:allow-other-keys)
5400 (let* ((out (assoc-ref outputs "out")))
5401 (with-directory-excursion out
5402 (remove-store-references "bin/proot")
5403 #t))))))
5404 ((#:allowed-references _ '("out"))
5405 '("out"))))))
1113386b
CL
5406
5407(define-public cpuid
5408 (package
5409 (name "cpuid")
ad21323c 5410 (version "20180519")
1113386b
CL
5411 (source (origin
5412 (method url-fetch)
5413 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5414 version ".src.tar.gz"))
5415 (sha256
5416 (base32
ad21323c 5417 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
1113386b
CL
5418 (build-system gnu-build-system)
5419 (arguments
5420 '(#:make-flags '("CC=gcc")
fb9232d7 5421 #:tests? #f ; no tests
1113386b 5422 #:phases (modify-phases %standard-phases
fb9232d7 5423 (delete 'configure) ; no configure script
1113386b
CL
5424 (add-before 'install 'fix-makefile
5425 (lambda* (#:key outputs #:allow-other-keys)
5426 (substitute* "Makefile"
5427 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5428 ;; Make the compressed manpages writable so that the
5429 ;; reset-gzip-timestamps phase does not error out.
5430 (substitute* "Makefile"
5431 (("-m 444") "-m 644"))
5432 #t)))))
5433 (inputs `(("perl" ,perl)))
5434 (supported-systems '("i686-linux" "x86_64-linux"))
5435 (home-page "http://www.etallen.com/cpuid.html")
5436 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5437 (description "cpuid dumps detailed information about the CPU(s) gathered
5438from the CPUID instruction, and also determines the exact model of CPU(s). It
5439supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5440NexGen, Rise, and SiS CPUs.")
5441 (license license:gpl2+)))
afc9d8ec
LF
5442
5443(define-public jmtpfs
5444 (package
5445 (name "jmtpfs")
5446 (version "0.5")
5447 (source
5448 (origin
5449 (method url-fetch)
5450 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5451 version ".tar.gz"))
5452 (file-name (string-append name "-" version ".tar.gz"))
5453 (sha256
5454 (base32
5455 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5456 (build-system gnu-build-system)
5457 (inputs
5458 `(("file" ,file)
5459 ("fuse" ,fuse)
5460 ("libmtp" ,libmtp)))
5461 (native-inputs
5462 `(("pkg-config" ,pkg-config)))
5463 (home-page "https://github.com/JasonFerrara/jmtpfs")
162a1374
TGR
5464 (synopsis "Use a FUSE file system to access data over MTP")
5465 (description "jmtpfs uses FUSE (file system in userspace) to provide access
afc9d8ec 5466to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
162a1374 5467the MTP device as a file system.")
afc9d8ec 5468 (license license:gpl3)))
a73e7dd3
DL
5469
5470(define-public procenv
5471 (package
5472 (name "procenv")
cb9b1a04 5473 (version "0.50")
a73e7dd3
DL
5474 (source
5475 (origin
5476 (method url-fetch)
5477 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5478 version ".tar.gz"))
5479 (file-name (string-append name "-" version ".tar.gz"))
5480 (sha256
cb9b1a04 5481 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
a73e7dd3
DL
5482 (build-system gnu-build-system)
5483 (arguments `(#:configure-flags '("--disable-silent-rules")))
86574116 5484 (native-inputs `(("pkg-config" ,pkg-config)))
a73e7dd3
DL
5485 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5486 ("groff" ,groff) ; for tests
5487 ("libselinux" ,libselinux)))
5488 (synopsis "Utility to show process environment")
5489 (description "Procenv is a command-line tool that displays as much detail about
5490itself and its environment as possible. It can be used as a test
5491tool, to understand the type of environment a process runs in, and for
5492comparing system environments.")
5493 (home-page "http://github.com/jamesodhunt/procenv/")
5494 (license license:gpl3+)))
ae5947b0
DL
5495
5496(define-public libfabric
5497 (package
5498 (name "libfabric")
5499 (version "1.4.1")
5500 (source
5501 (origin
5502 (method url-fetch)
5503 (uri
5504 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5505 version "/libfabric-" version ".tar.bz2"))
5506 (sha256
5507 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5508 (build-system gnu-build-system)
5509 (inputs `(("rdma-core" ,rdma-core)
91298042
EF
5510 ,@(match (%current-system)
5511 ((member (package-supported-systems psm))
5512 `(("psm" ,psm)))
5513 (_ `()))
ae5947b0
DL
5514 ("libnl" ,libnl)))
5515 (home-page "https://ofiwg.github.io/libfabric/")
5516 (synopsis "Open Fabric Interfaces")
5517 (description
5518 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5519communication services to applications. OFI is best described as a collection
5520of libraries and applications used to export fabric services. The key
5521components of OFI are: application interfaces, provider libraries, kernel
5522services, daemons, and test applications.
5523
5524Libfabric is a core component of OFI. It is the library that defines and
5525exports the user-space API of OFI, and is typically the only software that
5526applications deal with directly. It works in conjunction with provider
5527libraries, which are often integrated directly into libfabric.")
5528 (license (list license:bsd-2 license:gpl2)))) ;dual
fd23d259
DL
5529
5530(define-public psm
5531 (package
5532 (name "psm")
5533 (version "3.3.20170428")
b50a9cc0 5534 (home-page "https://github.com/intel/psm")
fd23d259
DL
5535 (source
5536 (origin
5537 (method git-fetch)
b50a9cc0 5538 (uri (git-reference (url home-page)
fd23d259
DL
5539 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5540 (file-name (string-append "psm-" version ".tar.gz"))
5541 (sha256
5542 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5543 (patches (search-patches
5544 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5545 "psm-ldflags.patch" ; build shared lib with LDFLAGS
d8f8adfe
LC
5546 "psm-repro.patch" ; reproducibility
5547 "psm-disable-memory-stats.patch"))))
fd23d259 5548 (build-system gnu-build-system)
348caf3d 5549 (outputs '("out" "debug"))
fd23d259
DL
5550 (inputs `(("libuuid" ,util-linux)))
5551 (arguments
5552 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5553 ,(string-append "INSTALL_PREFIX=" %output)
5554 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5555 #:tests? #f
5556 #:phases (modify-phases %standard-phases
5557 (delete 'configure)
5558 (add-after 'unpack 'patch-/usr/include
5559 (lambda _
5560 (substitute* "Makefile"
5561 (("\\$\\{DESTDIR}/usr/include")
5562 (string-append %output "/include")))
5563 (substitute* "Makefile"
5564 (("/lib64") "/lib"))
41313ace
EB
5565 #t))
5566 (add-after 'unpack 'patch-sysmacros
5567 (lambda _
5568 (substitute* "ipath/ipath_proto.c"
5569 (("#include <sys/poll.h>" m)
5570 (string-append m "\n"
5571 "#include <sys/sysmacros.h>")))
fd23d259 5572 #t)))))
fd23d259
DL
5573 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5574 (description
5575 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5576communications interface for the True Scale family of products. PSM users are
5577enabled with mechanisms necessary to implement higher level communications
5578interfaces in parallel environments.")
b516b780
EF
5579 ;; Only Intel-compatable processors are supported.
5580 (supported-systems '("i686-linux" "x86_64-linux"))
fd23d259 5581 (license (list license:bsd-2 license:gpl2)))) ;dual
c1c82584
TGR
5582
5583(define-public snapscreenshot
5584 (package
5585 (name "snapscreenshot")
5586 (version "1.0.14.3")
5587 (source
5588 (origin
5589 (method url-fetch)
5590 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5591 name "-" version ".tar.bz2"))
5592 (sha256
5593 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5594 (build-system gnu-build-system)
5595 (arguments
5596 `(#:make-flags
5597 (let ((out (assoc-ref %outputs "out")))
5598 (list (string-append "BINDIR=" out "/bin")
5599 (string-append "MANDIR=" out "/share/man")))
5600 #:tests? #f ; no test suite
5601 #:phases
5602 (modify-phases %standard-phases
5603 (delete 'configure) ; ./configure is a snarky no-op
5604 (add-before 'install 'fix-ownership
5605 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5606 (lambda _
5607 (substitute* "depfun.mak"
5608 ((" -o bin -g bin ") " "))
5609 #t))
5610 (add-before 'install 'create-output-directories
5611 (lambda* (#:key outputs #:allow-other-keys)
5612 (let ((out (assoc-ref outputs "out")))
5613 (mkdir-p (string-append out "/share/man/man1"))
5614 #t))))))
81e59e41 5615 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
c1c82584
TGR
5616 (synopsis "Take screenshots of one or more Linux text consoles")
5617 (description
5618 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5619Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5620relevant @file{/dev/vcs*} file(s).")
5621 (license license:gpl2)))
8d8d227b
TGR
5622
5623(define-public fbcat
5624 (package
5625 (name "fbcat")
7f86e5e7 5626 (version "0.5.1")
8d8d227b
TGR
5627 (source
5628 (origin
5629 (method url-fetch)
5630 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5631 version "/" name "-" version ".tar.gz"))
5632 (sha256
7f86e5e7 5633 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
8d8d227b 5634 (build-system gnu-build-system)
8d8d227b
TGR
5635 (inputs
5636 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5637 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5638 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5639 `(("pnmtopng" ,netpbm)))
5640 (outputs (list "out" "fbgrab"))
5641 (arguments
7f86e5e7
TGR
5642 `(#:make-flags
5643 (list "CC=gcc"
5644 (string-append "PREFIX=" (assoc-ref %outputs "out")))
8d8d227b
TGR
5645 #:tests? #f ; no tests
5646 #:phases
5647 (modify-phases %standard-phases
8d8d227b 5648 (delete 'configure) ; no configure script
8d8d227b
TGR
5649 (add-after 'build 'qualify-references
5650 (lambda* (#:key inputs outputs #:allow-other-keys)
5651 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5652 (out (assoc-ref outputs "out")))
5653 (substitute* "fbgrab"
5654 (("fbcat" all)
5655 (string-append out "/bin/" all))
5656 (("pnmtopng" all)
5657 (string-append pnmtopng "/bin/" all)))
5658 #t)))
7f86e5e7 5659 (add-after 'install 'split-fbgrab-output
8d8d227b
TGR
5660 (lambda* (#:key outputs #:allow-other-keys)
5661 (let* ((out (assoc-ref outputs "out"))
5662 (out:fbgrab (assoc-ref outputs "fbgrab")))
7f86e5e7
TGR
5663 (for-each (lambda (file)
5664 (let ((old (string-append out "/" file))
5665 (new (string-append out:fbgrab "/" file)))
5666 (mkdir-p (dirname new))
5667 (rename-file old new)))
5668 (list "bin/fbgrab"
5669 "share/man/man1/fbgrab.1"))
8d8d227b
TGR
5670 #t))))))
5671 (home-page "https://jwilk.net/software/fbcat")
5672 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5673 (description
5674 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5675a dump therof. It supports a wide range of drivers and pixel formats.
5676@command{fbcat} can take screenshots of virtually any application that can be
5677made to write its output to the framebuffer, including (but not limited to)
5678text-mode or graphical applications that don't use a display server.
5679
5680Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5681emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5682 (license license:gpl2)))
a69e0cf3
5683
5684(define-public libcgroup
5685 (package
5686 (name "libcgroup")
5687 (version "0.41")
5688 (source
5689 (origin
5690 (method url-fetch)
5691 (uri (string-append
5692 "mirror://sourceforge/libcg/" name "/"
5693 version "/" name "-" version ".tar.bz2"))
5694 (sha256
5695 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5696 (build-system gnu-build-system)
5697 (arguments
5698 `(#:tests? #f))
5699 (native-inputs
5700 `(("bison" ,bison)
5701 ("flex" ,flex)))
5702 (inputs
5703 `(("linux-pam" ,linux-pam)))
5704 (home-page "https://sourceforge.net/projects/libcg/")
5705 (synopsis "Control groups management tools")
5706 (description "Control groups is Linux kernel method for process resource
5707restriction, permission handling and more. This package provides userspace
5708interface to this kernel feature.")
5709 (license license:lgpl2.1)))
5849c68a
R
5710
5711(define-public mbpfan
5712 (package
5713 (name "mbpfan")
26fad5b7 5714 (version "2.1.1")
5849c68a
R
5715 (source
5716 (origin
5478ab1e
TGR
5717 (method git-fetch)
5718 (uri (git-reference
5719 (url "https://github.com/dgraziotin/mbpfan.git")
5720 (commit (string-append "v" version))))
5721 (file-name (git-file-name name version))
5849c68a 5722 (sha256
26fad5b7 5723 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5849c68a
R
5724 (build-system gnu-build-system)
5725 (arguments
697c5846 5726 '(#:tests? #f ; tests ask to be run as root
5849c68a
R
5727 #:make-flags (let ((out (assoc-ref %outputs "out")))
5728 (list (string-append "DESTDIR=" out)
5729 "CC=gcc"))
5730 #:phases
5731 (modify-phases %standard-phases
5732 (add-after 'unpack 'patch-paths
5733 (lambda _
5734 (substitute* "Makefile"
5735 (("/usr") ""))
5736 #t))
697c5846 5737 (delete 'configure)))) ; there's no configure phase
5849c68a
R
5738 (home-page "https://github.com/dgraziotin/mbpfan")
5739 (synopsis "Control fan speed on Macbooks")
5740 (description
5741 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5742the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5743module. It can be executed as a daemon or in the foreground with root
5744privileges.")
5745 (license license:gpl3+)))
25637b77
PAR
5746
5747(define-public psm2
5748 (package
5749 (name "psm2")
17a5cb45 5750 (version "11.2.86")
25637b77
PAR
5751 (source (origin
5752 (method git-fetch)
5753 (uri (git-reference
5754 (url "https://github.com/intel/opa-psm2.git")
5755 (commit (string-append "PSM2_" version))))
5756 (file-name (git-file-name name version))
5757 (sha256
5758 (base32
17a5cb45 5759 "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf"))))
25637b77
PAR
5760 (build-system gnu-build-system)
5761 (arguments
5762 '(#:make-flags
5763 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5764 #:tests? #f
5765 #:phases (modify-phases %standard-phases
5766 (delete 'configure)
5767 (add-after 'unpack 'patch-Makefiles
5768 (lambda _
5769 (substitute* "Makefile"
5770 (("/lib64") "/lib")
5771 (("/usr") ""))
5772 (substitute* "compat/Makefile"
5773 (("/lib64") "/lib")
5774 (("/usr") ""))
5775 #t))
5776 (replace 'install
5777 (lambda _
5778 (setenv "DESTDIR" %output)
5779 (invoke "make" "install")
5780 #t)))))
5781 (inputs
5782 `(("rdma-core" ,rdma-core)
5783 ("numactl" ,numactl)))
5784 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5785 (description
5786 "This package is low-level user-level Intel's communications interface.
5787The PSM2 API is a high-performance vendor-specific protocol that provides a
5788low-level communications interface for the Intel Omni-Path family of
5789high-speed networking devices.")
5790 (home-page "https://github.com/intel/opa-psm2")
5791 ;; Only the x86_64 architecure is supported.
5792 (supported-systems '("x86_64-linux"))
5793 (license (list license:bsd-3 license:gpl2)))) ; dual
2690b6ce
PAR
5794
5795(define-public libpfm4
5796 (package
5797 (name "libpfm4")
5798 (version "4.9.0")
5799 (source (origin
5800 (method url-fetch)
5801 (uri (string-append "mirror://sourceforge/perfmon2/"
5802 name "/libpfm-" version ".tar.gz"))
5803 (sha256
5804 (base32
5805 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5806 (build-system gnu-build-system)
5807 (arguments
5808 '(#:modules ((guix build utils)
5809 (guix build gnu-build-system))
5810 #:phases (modify-phases %standard-phases
5811 (delete 'configure)
5812 (delete 'check)
5813 (replace 'build
5814 (lambda* (#:key inputs outputs #:allow-other-keys)
5815 (let* ((out (assoc-ref outputs "out")))
5816 (setenv "CC" "gcc")
5817 (invoke "make")
5818 #t)))
5819 (replace 'install
5820 (lambda* (#:key outputs #:allow-other-keys)
5821 (let* ((out (assoc-ref outputs "out")))
5822 (invoke "make"
5823 (string-append "PREFIX=" out)
5824 "install")
5825 #t))))))
5826 (synopsis "Performance event monitoring library")
5827 (description
5828 "This package provides a library called libpfm4, which is used to develop
5829monitoring tools exploiting the performance monitoring events such as those
5830provided by the Performance Monitoring Unit (PMU) of modern processors.
5831
5832Libpfm4 helps convert from an event name, expressed as a string, to the event
5833encoding that is either the raw event as documented by the hardware vendor or
5834the OS-specific encoding. In the latter case, the library is able to prepare
5835the OS-specific data structures needed by the kernel to setup the event.
5836
5837libpfm4 provides support for the @code{perf_events} interface, which was
5838introduced in Linux 2.6.31.")
5839 (home-page "http://perfmon2.sourceforge.net/")
5840 (license license:expat)))
4dd1fb79
SB
5841
5842(define-public libnfnetlink
5843 (package
5844 (name "libnfnetlink")
5845 (version "1.0.1")
5846 (source (origin
5847 (method url-fetch)
5848 (uri (string-append
5849 "https://www.netfilter.org/projects/libnfnetlink/files/"
5850 "libnfnetlink-" version ".tar.bz2"))
5851 (sha256
5852 (base32
5853 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5854 (build-system gnu-build-system)
5855 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5856 (synopsis "Low-level netfilter netlink communication library")
5857 (description
5858 "@code{libnfnetlink} is the low-level library for netfilter related
5859kernel/userspace communication. It provides a generic messaging
5860infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5861nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5862management tools in userspace.")
5863 (license license:gpl2)))
e4231cfe 5864
626de0d1
MC
5865(define-public go-netlink
5866 (package
5867 (name "go-netlink")
5868 (version "1.0.0")
5869 (source (origin
5870 (method git-fetch)
5871 (uri (git-reference
5872 (url "https://github.com/vishvananda/netlink.git")
5873 (commit (string-append "v" version))))
5874 (file-name (git-file-name name version))
5875 (sha256
5876 (base32
5877 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5878 (build-system go-build-system)
5879 (arguments
5880 `(#:import-path "github.com/vishvananda/netlink"))
5881 (native-inputs
561d391b 5882 `(("go-golang-org-x-sys" ,go-golang-org-x-sys)
626de0d1
MC
5883 ("go-netns" ,go-netns)))
5884 (home-page "https://github.com/vishvananda/netlink")
5885 (synopsis "Simple netlink library for Go")
5886 (description "The netlink package provides a simple netlink library for
5887Go. Netlink is the interface a user-space program in Linux uses to
5888communicate with the kernel. It can be used to add and remove interfaces, set
5889IP addresses and routes, and configure IPsec.")
5890 (license license:asl2.0)))
5891
e4231cfe
DM
5892(define-public xfsprogs
5893 (package
5894 (name "xfsprogs")
faa78e88 5895 (version "5.2.1")
e4231cfe
DM
5896 (source (origin
5897 (method url-fetch)
5898 (uri (string-append
5899 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5900 "xfsprogs-" version ".tar.gz"))
5901 (sha256
5902 (base32
faa78e88 5903 "0q5xd4gb9g83h82mg68cx616ifzl8qkzzlgg5xna698117ph3wky"))))
e4231cfe 5904 (build-system gnu-build-system)
c78778e7 5905 (outputs (list "out" "python"))
e4231cfe 5906 (arguments
c78778e7
TGR
5907 `(#:tests? #f ; kernel/user integration tests are in package "xfstests"
5908 #:phases
5909 (modify-phases %standard-phases
5910 (add-after 'install 'separate-python-output
5911 (lambda* (#:key outputs #:allow-other-keys)
5912 (let ((out (assoc-ref outputs "out"))
5913 (python (assoc-ref outputs "python")))
5914 (for-each
5915 (lambda (script)
5916 (mkdir-p (string-append python (dirname script)))
5917 (rename-file (string-append out script)
5918 (string-append python script)))
5919 (list "/sbin/xfs_scrub_all"))
5920 #t)))
5921 (add-after 'install 'install-headers
5922 (lambda _
5923 (invoke "make" "install-dev"))))))
e4231cfe
DM
5924 (native-inputs
5925 `(("gettext" ,gettext-minimal)
5926 ("util-linux" ,util-linux)))
c78778e7
TGR
5927 (inputs
5928 `(("python" ,python-wrapper)))
e4231cfe
DM
5929 (home-page "https://xfs.wiki.kernel.org/")
5930 (synopsis "XFS file system tools")
5931 (description "This package provides commands to create and check XFS
5932file systems.")
5933 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5934 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5935 (license (list license:gpl2 license:lgpl2.1))))
c63d7b79
DM
5936
5937(define-public genext2fs
5938 (package
5939 (name "genext2fs")
083639a5 5940 (version "1.4.1-4")
c63d7b79
DM
5941 (source (origin
5942 (method git-fetch)
5943 (uri (git-reference
5944 (url "https://github.com/jeremie-koenig/genext2fs.git")
083639a5
TGR
5945 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5946 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
c63d7b79
DM
5947 (file-name (git-file-name name version))
5948 (sha256
083639a5 5949 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
c63d7b79 5950 (build-system gnu-build-system)
083639a5
TGR
5951 (arguments
5952 `(#:phases
5953 (modify-phases %standard-phases
5954 (add-after 'unpack 'apply-debian-patches
5955 ;; Debian changes (the revision after ‘-’ in VERSION) are
5956 ;; maintained as separate patches. Apply those relevant to us.
5957 (lambda _
5958 (for-each
5959 (lambda (file-name)
5960 (invoke "patch" "-p1" "-i"
5961 (string-append "debian/patches/" file-name)))
5962 (list "blocksize+creator.diff" ; add -B/-o options
5963 "byteswap_fix.diff"))
5964 #t)))))
5965 (native-inputs
5966 `(("autoconf" ,autoconf)
5967 ("automake" ,automake)))
c63d7b79 5968 (home-page "https://github.com/jeremie-koenig/genext2fs")
52beae7b
TGR
5969 (synopsis "Generate ext2 file system as a normal user")
5970 (description "This package provides a program to generate an ext2
5971file system as a normal (non-root) user. It does not require you to mount
c63d7b79
DM
5972the image file to copy files on it, nor does it require that you become
5973the superuser to make device nodes.")
5974 (license license:gpl2)))
d1dfcc7c
DM
5975
5976(define-public fakeroot
5977 (package
5978 (name "fakeroot")
ae1bab3e 5979 (version "1.24")
d1dfcc7c
DM
5980 (source (origin
5981 (method url-fetch)
ae1bab3e
TGR
5982 (uri (string-append "https://deb.debian.org/debian/pool/main/f/"
5983 "fakeroot/fakeroot_" version ".orig.tar.gz"))
d1dfcc7c
DM
5984 (file-name (string-append name "-" version ".tar.gz"))
5985 (sha256
5986 (base32
ae1bab3e 5987 "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f"))))
d1dfcc7c
DM
5988 (build-system gnu-build-system)
5989 (arguments
5990 `(#:phases
5991 (modify-phases %standard-phases
5992 (add-after 'configure 'patch-Makefile
5993 (lambda _
5994 ;; Note: The root of the problem is already in "Makefile.am".
5995 (substitute* "Makefile"
5996 (("/bin/sh") (which "sh")))
5997 #t))
5998 (add-after 'unpack 'patch-getopt
5999 (lambda* (#:key inputs #:allow-other-keys)
6000 (substitute* "scripts/fakeroot.in"
6001 (("getopt")
6002 (string-append (assoc-ref inputs "util-linux")
6003 "/bin/getopt")))
6004 #t))
0d5c5b1b
DM
6005 (add-before 'configure 'setenv
6006 (lambda _
6007 (setenv "LIBS" "-lacl")
6008 #t))
d1dfcc7c
DM
6009 (add-before 'check 'prepare-check
6010 (lambda _
6011 (setenv "SHELL" (which "bash"))
6012 (setenv "VERBOSE" "1")
6013 (substitute* "test/t.touchinstall"
6014 ;; We don't have the name of the root user, so use ID=0.
6015 (("grep root") "grep \"\\<0\\>\""))
6016 (substitute* "test/tartest"
6017 ;; We don't have the name of the root group, so use ID=0.
6018 (("ROOTGROUP=root") "ROOTGROUP=0")
6019 ;; We don't have the name of the daemon user, so use IDs.
6020 (("daemon:sys") "1:3")
6021 (("daemon:") "1:"))
6022 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
6023 (substitute* "test/compare-tar"
6024 (("tar -tvf") "tar --numeric-owner -tvf"))
6025 #t)))))
6026 (native-inputs
0d5c5b1b
DM
6027 `(("acl" ,acl)
6028 ("sharutils" ,sharutils) ; for the tests
d1dfcc7c
DM
6029 ("xz" ,xz))) ; for the tests
6030 (inputs
6031 `(("libcap" ,libcap)
6032 ("util-linux" ,util-linux)))
6033 (synopsis "Provides a fake root environment")
6034 (description "@command{fakeroot} runs a command in an environment where
6035it appears to have root privileges for file manipulation. This is useful
6036for allowing users to create archives (tar, ar, .deb etc.) with files in
6037them with root permissions/ownership. Without fakeroot one would have to
6038have root privileges to create the constituent files of the archives with
6039the correct permissions and ownership, and then pack them up, or one would
6040have to construct the archives directly, without using the archiver.")
6041 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
6042 (license license:gpl3+)))
bf2a9969
TG
6043
6044(define-public inputattach
6045 (package
6046 (name "inputattach")
6047 (version "0.42.0")
6048 (source (origin
6049 (method git-fetch)
6050 (uri (git-reference
6051 (url "https://github.com/linuxwacom/input-wacom.git")
6052 (commit (string-append "input-wacom-" version))))
6053 (file-name (git-file-name name version))
6054 (sha256
6055 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
6056 (build-system gnu-build-system)
6057 (arguments
6058 `(#:phases
6059 (modify-phases %standard-phases
6060 (delete 'bootstrap)
6061 (delete 'configure)
6062 (replace 'build
6063 (lambda* (#:key inputs #:allow-other-keys)
6064 (with-directory-excursion "inputattach"
6065 (invoke (string-append (assoc-ref inputs "gcc")
6066 "/bin/gcc")
5ddf98da 6067 "-O2" "-o" "inputattach" "inputattach.c"))
bf2a9969
TG
6068 #t))
6069 (delete 'check)
6070 (replace 'install
6071 (lambda* (#:key outputs #:allow-other-keys)
6072 (let ((target-dir (string-append
6073 (assoc-ref outputs "out")
6074 "/bin/")))
6075 (mkdir-p target-dir)
6076 (copy-file "inputattach/inputattach"
6077 (string-append target-dir
6078 "inputattach"))
6079 #t))))))
6080 (home-page "https://linuxwacom.github.io/")
6081 (synopsis "Dispatch input peripherals events to a device file")
6082 (description "inputattach dispatches input events from several device
6083types and interfaces and translates so that the X server can use them.")
6084 (license license:gpl2+)))
de3896fb
BW
6085
6086(define-public ell
6087 (package
6088 (name "ell")
6089 (version "0.23")
6090 (source (origin
6091 (method git-fetch)
6092 (uri (git-reference
6093 (url "https://git.kernel.org/pub/scm/libs/ell/ell.git")
6094 (commit version)))
6095 (file-name (git-file-name name version))
6096 (sha256
6097 (base32
6098 "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10"))))
6099 (build-system gnu-build-system)
6100 (arguments
6101 `(#:phases
6102 (modify-phases %standard-phases
6103 (add-after 'unpack 'fix-dbus-tests
6104 (lambda _
6105 (substitute* '("unit/test-dbus-message-fds.c"
6106 "unit/test-dbus-properties.c"
6107 "unit/test-dbus.c")
6108 (("/usr/bin/dbus-daemon") (which "dbus-daemon")))
6109 #t)))))
6110 (inputs
6111 `(("dbus" ,dbus)
6112 ("libtool" ,libtool)))
6113 (native-inputs
6114 `(("autoconf" ,autoconf)
6115 ("pkgconfig" ,pkg-config)
6116 ("automake" ,automake)))
6117 (home-page "https://01.org/ell")
6118 (synopsis "Embedded Linux Library")
6119 (description "The Embedded Linux* Library (ELL) provides core, low-level
6120functionality for system daemons. It typically has no dependencies other than
6121the Linux kernel, C standard library, and libdl (for dynamic linking). While
6122ELL is designed to be efficient and compact enough for use on embedded Linux
6123platforms, it is not limited to resource-constrained systems.")
6124 (license license:lgpl2.1+)))