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