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