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