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