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