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