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