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