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