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