gnu: linux-libre@4.14: Update to 4.14.83.
[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.2")
410 (define %linux-libre-hash "1yh4ll9qh4wmf9r62ksyic57g1iy1b84qbv855l545ilk12znbmj")
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.83")
433 (define %linux-libre-4.14-hash "0x6r09bqdrcqigyjx922vji3pdv36l24pl0j33xs8b7xawkvii9g")
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.140"
443 "12amh7m0khjx5q3bcv8sq59xkanaxa5xnw4m1iql7503nk4pgg9a"
444 %intel-compatible-systems
445 #:configuration-file kernel-config))
446
447 (define-public linux-libre-4.4
448 (make-linux-libre "4.4.164"
449 "04w4x97bkd2javjws9pzv1shfcrhyn4nf9w8b6qk6zdaj45fzasb"
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 git-fetch)
1971 (uri (git-reference
1972 (url "https://github.com/rvoicilas/inotify-tools.git")
1973 (commit version)))
1974 (file-name (git-file-name name version))
1975 (sha256
1976 (base32
1977 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
1978 (build-system gnu-build-system)
1979 (native-inputs
1980 `(("autoconf" ,autoconf)
1981 ("automake" ,automake)
1982 ("libtool" ,libtool)))
1983 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
1984 (synopsis "Monitor file accesses")
1985 (description
1986 "The inotify-tools packages provides a C library and command-line tools
1987 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1988 (license license:gpl2+)))
1989
1990 (define-public kmod
1991 (package
1992 (name "kmod")
1993 (version "25")
1994 (source (origin
1995 (method url-fetch)
1996 (uri
1997 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1998 "kmod-" version ".tar.xz"))
1999 (sha256
2000 (base32
2001 "1kgixs4m3jvwk7fb3d18n6j77qhgi9qfv4csj35rs5ancr4ycrbi"))
2002 (patches (search-patches "kmod-module-directory.patch"))))
2003 (build-system gnu-build-system)
2004 (native-inputs
2005 `(("pkg-config" ,pkg-config)))
2006 (inputs
2007 `(("xz" ,xz)
2008 ("zlib" ,zlib)))
2009 (arguments
2010 `(#:tests? #f ; FIXME: Investigate test failures
2011 #:configure-flags '("--with-xz" "--with-zlib")
2012 #:phases
2013 (modify-phases %standard-phases
2014 (add-after 'install 'install-modprobe&co
2015 (lambda* (#:key outputs #:allow-other-keys)
2016 (let* ((out (assoc-ref outputs "out"))
2017 (bin (string-append out "/bin")))
2018 (for-each (lambda (tool)
2019 (symlink "kmod"
2020 (string-append bin "/" tool)))
2021 '("insmod" "rmmod" "lsmod" "modprobe"
2022 "modinfo" "depmod"))
2023 #t))))))
2024 (home-page "https://www.kernel.org/")
2025 (synopsis "Kernel module tools")
2026 (description "Kmod is a set of tools to handle common tasks with Linux
2027 kernel modules like insert, remove, list, check properties, resolve
2028 dependencies and aliases.
2029
2030 These tools are designed on top of libkmod, a library that is shipped with
2031 kmod. The aim is to be compatible with tools, configurations and indices
2032 from the module-init-tools project.")
2033 (license license:gpl2+))) ; library under lgpl2.1+
2034
2035 (define-public eudev
2036 ;; The post-systemd fork, maintained by Gentoo.
2037 (package
2038 (name "eudev")
2039 (version "3.2.5")
2040 (source (origin
2041 (method url-fetch)
2042 (uri (string-append "https://github.com/gentoo/eudev/archive/v"
2043 version ".tar.gz"))
2044 (file-name (string-append name "-" version ".tar.gz"))
2045 (sha256
2046 (base32
2047 "0dlkcgy7j4fdcksqrpc373zfybiif1bal3n6lpy1kfc5280j02c7"))
2048 (patches (search-patches "eudev-rules-directory.patch"))))
2049 (build-system gnu-build-system)
2050 (arguments
2051 '(#:phases
2052 (modify-phases %standard-phases
2053 (add-before 'bootstrap 'patch-file-names
2054 (lambda* (#:key inputs #:allow-other-keys)
2055 (substitute* "man/make.sh"
2056 (("/usr/bin/xsltproc")
2057 (string-append (assoc-ref inputs "xsltproc")
2058 "/bin/xsltproc")))
2059 #t))
2060 (add-after 'install 'build-hwdb
2061 (lambda* (#:key outputs #:allow-other-keys)
2062 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2063 ;; similar tools to display product names.
2064 (let ((out (assoc-ref outputs "out")))
2065 (invoke (string-append out "/bin/udevadm")
2066 "hwdb" "--update")))))
2067 #:configure-flags (list "--enable-manpages")))
2068 (native-inputs
2069 `(("autoconf" ,autoconf)
2070 ("automake" ,automake)
2071 ("gperf" ,gperf)
2072 ("libtool" ,libtool)
2073 ("pkg-config" ,pkg-config)
2074 ;; For tests.
2075 ("perl" ,perl)
2076 ("python" ,python-wrapper)
2077 ;; For documentation.
2078 ("docbook-xml" ,docbook-xml-4.2)
2079 ("docbook-xsl" ,docbook-xsl)
2080 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2081 ("xsltproc" ,libxslt)))
2082 (inputs
2083 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2084 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2085 ;; which contains the rules to do that.
2086 `(("util-linux" ,util-linux) ;for blkid
2087 ("kmod" ,kmod)))
2088 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2089 (synopsis "Userspace device management")
2090 (description "Udev is a daemon which dynamically creates and removes
2091 device nodes from /dev/, handles hotplug events and loads drivers at boot
2092 time.")
2093 (license license:gpl2+)))
2094
2095 (define-public eudev-with-hwdb
2096 (deprecated-package "eudev-with-hwdb" eudev))
2097
2098 (define-public lvm2
2099 (package
2100 (name "lvm2")
2101 (version "2.02.177")
2102 (source (origin
2103 (method url-fetch)
2104 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2105 version ".tgz"))
2106 (sha256
2107 (base32
2108 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2109 (modules '((guix build utils)))
2110 (snippet
2111 '(begin
2112 (use-modules (guix build utils))
2113
2114 ;; Honor sysconfdir.
2115 (substitute* "make.tmpl.in"
2116 (("confdir = .*$")
2117 "confdir = @sysconfdir@\n")
2118 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2119 "DEFAULT_SYS_DIR = @sysconfdir@"))
2120 #t))
2121 (patches (search-patches "lvm2-static-link.patch"))))
2122 (build-system gnu-build-system)
2123 (native-inputs
2124 `(("pkg-config" ,pkg-config)
2125 ("procps" ,procps))) ;tests use 'pgrep'
2126 (inputs
2127 `(("udev" ,eudev)))
2128 (arguments
2129 '(#:phases
2130 (modify-phases %standard-phases
2131 (add-after 'configure 'set-makefile-shell
2132 (lambda _
2133 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2134 ;; expected.
2135 (setenv "SHELL" (which "sh"))
2136
2137 ;; Replace /bin/sh with the right file name.
2138 (patch-makefile-SHELL "make.tmpl")
2139 #t)))
2140
2141 #:configure-flags (list (string-append "--sysconfdir="
2142 (assoc-ref %outputs "out")
2143 "/etc/lvm")
2144 "--enable-udev_sync"
2145 "--enable-udev_rules"
2146 "--enable-pkgconfig"
2147 "--enable-cmdlib"
2148 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2149
2150 ;; Make sure programs such as 'dmsetup' can
2151 ;; find libdevmapper.so.
2152 (string-append "LDFLAGS=-Wl,-rpath="
2153 (assoc-ref %outputs "out")
2154 "/lib,-rpath="
2155 (assoc-ref %outputs "out")
2156 "/lib/device-mapper")
2157 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2158 ;; into account so that we don't need to also
2159 ;; set CLDFLAGS.
2160 (string-append "CLDFLAGS=-Wl,-rpath="
2161 (assoc-ref %outputs "out")
2162 "/lib,-rpath="
2163 (assoc-ref %outputs "out")
2164 "/lib/device-mapper"))
2165
2166 ;; The tests use 'mknod', which requires root access.
2167 #:tests? #f))
2168 (home-page "https://sourceware.org/lvm2/")
2169 (synopsis "Logical volume management for Linux")
2170 (description
2171 "LVM2 is the logical volume management tool set for Linux-based systems.
2172 This package includes the user-space libraries and tools, including the device
2173 mapper. Kernel components are part of Linux-libre.")
2174
2175 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2176 ;; Command-line tools are GPLv2.
2177 (license (list license:gpl2 license:lgpl2.1))))
2178
2179 (define-public lvm2-static
2180 (package
2181 (inherit lvm2)
2182 (name "lvm2-static")
2183
2184 ;; Propagate udev because libdevmapper.a depends on libudev.
2185 (inputs (alist-delete "udev" (package-inputs lvm2)))
2186 (propagated-inputs `(("udev" ,eudev)))
2187
2188 (arguments
2189 (substitute-keyword-arguments (package-arguments lvm2)
2190 ((#:configure-flags flags '())
2191 ;; LVM2 doesn't use Libtool, hence the custom option.
2192 `(cons "--enable-static_link" ,flags))))
2193 (synopsis "Logical volume management for Linux (statically linked)")))
2194
2195 (define-public wireless-tools
2196 (package
2197 (name "wireless-tools")
2198 (version "30.pre9")
2199 (source (origin
2200 (method url-fetch)
2201 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2202 version ".tar.gz"))
2203 (sha256
2204 (base32
2205 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2206 (snippet
2207 '(begin
2208 ;; Remove the older header files that are not free software.
2209 (for-each (lambda (n)
2210 (delete-file (format #f "wireless.~a.h" n)))
2211 '(10 11 12 13 14 15 16 17 18 19 20))
2212 #t))))
2213 (build-system gnu-build-system)
2214 (arguments
2215 `(#:make-flags
2216 (list (string-append "PREFIX=" %output)
2217 (string-append "INSTALL_MAN=" %output "/share/man")
2218 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2219 "BUILD_STATIC=")
2220 #:phases (modify-phases %standard-phases
2221 (delete 'configure))
2222 #:tests? #f))
2223 (synopsis "Tools for manipulating Linux Wireless Extensions")
2224 (description "Wireless Tools are used to manipulate the now-deprecated
2225 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2226 Extension was an interface allowing you to set Wireless LAN specific
2227 parameters and get the specific stats. It is deprecated in favor the nl80211
2228 interface.")
2229 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2230 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2231 ;; other files are distributed under gpl2.
2232 (license (list license:gpl2 license:lgpl2.1+))))
2233
2234 (define-public crda
2235 (package
2236 (name "crda")
2237 (version "3.18")
2238 (source (origin
2239 (method url-fetch)
2240 (uri (string-append "mirror://kernel.org/software/network/crda/"
2241 "crda-" version ".tar.xz"))
2242 (sha256
2243 (base32
2244 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2245 (patches (search-patches "crda-optional-gcrypt.patch"))))
2246 (build-system gnu-build-system)
2247 (arguments
2248 '(#:phases (modify-phases %standard-phases
2249 (delete 'configure)
2250 (add-after 'unpack 'gzip-determinism
2251 (lambda _
2252 (substitute* "Makefile"
2253 (("gzip") "gzip --no-name"))
2254 #t))
2255 (add-before
2256 'build 'no-werror-no-ldconfig
2257 (lambda _
2258 (substitute* "Makefile"
2259 (("-Werror") "")
2260 (("ldconfig") "true"))
2261 #t))
2262 (add-before
2263 'build 'set-regulator-db-file-name
2264 (lambda* (#:key inputs #:allow-other-keys)
2265 ;; Tell CRDA where to find our database.
2266 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2267 (substitute* "crda.c"
2268 (("\"/lib/crda/regulatory.bin\"")
2269 (string-append "\"" regdb
2270 "/lib/crda/regulatory.bin\"")))
2271 #t))))
2272 #:test-target "verify"
2273 #:make-flags (let ((out (assoc-ref %outputs "out"))
2274 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2275 (list "CC=gcc" "V=1"
2276
2277 ;; Disable signature-checking on 'regulatory.bin'.
2278 ;; The reason is that this simplifies maintenance
2279 ;; on our side (no need to manage a distro key
2280 ;; pair), and we can guarantee integrity of
2281 ;; 'regulatory.bin' by other means anyway, such as
2282 ;; 'guix gc --verify'. See
2283 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2284 ;; for a discssion.
2285 "USE_OPENSSL=0"
2286
2287 (string-append "PREFIX=" out)
2288 (string-append "SBINDIR=" out "/sbin/")
2289 (string-append "UDEV_RULE_DIR="
2290 out "/lib/udev/rules.d")
2291 (string-append "LDFLAGS=-Wl,-rpath="
2292 out "/lib -L.")
2293 (string-append "REG_BIN=" regdb
2294 "/lib/crda/regulatory.bin")))))
2295 (native-inputs `(("pkg-config" ,pkg-config)
2296 ("python" ,python-2)
2297 ("wireless-regdb" ,wireless-regdb)))
2298 (inputs `(("libnl" ,libnl)))
2299 (home-page
2300 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2301 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2302 (description
2303 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2304 communication between the kernel Linux and user space for regulatory
2305 compliance.")
2306 (license license:copyleft-next)))
2307
2308 (define-public wireless-regdb
2309 (package
2310 (name "wireless-regdb")
2311 (version "2017.03.07")
2312 (source (origin
2313 (method url-fetch)
2314 (uri (string-append
2315 "mirror://kernel.org/software/network/wireless-regdb/"
2316 "wireless-regdb-" version ".tar.xz"))
2317 (sha256
2318 (base32
2319 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2320
2321 ;; We're building 'regulatory.bin' by ourselves.
2322 (snippet '(begin
2323 (delete-file "regulatory.bin")
2324 #t))))
2325 (build-system gnu-build-system)
2326 (arguments
2327 '(#:phases (modify-phases %standard-phases
2328 (add-after 'unpack 'gzip-determinism
2329 (lambda _
2330 (substitute* "Makefile"
2331 (("gzip") "gzip --no-name"))
2332 #t))
2333 (delete 'configure))
2334
2335 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2336 ;; is computed and can be equal to 'maintainer-clean'; when that
2337 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2338 ;; just built. Thus, build things sequentially.
2339 #:parallel-build? #f
2340
2341 #:tests? #f ;no tests
2342 #:make-flags (let ((out (assoc-ref %outputs "out")))
2343 (list (string-append "PREFIX=" out)
2344 (string-append "LSB_ID=GuixSD")
2345 (string-append "DISTRO_PUBKEY=/dev/null")
2346 (string-append "DISTRO_PRIVKEY=/dev/null")
2347 (string-append "REGDB_PUBKEY=/dev/null")
2348
2349 ;; Leave that empty so that db2bin.py doesn't try
2350 ;; to sign 'regulatory.bin'. This allows us to
2351 ;; avoid managing a key pair for the whole distro.
2352 (string-append "REGDB_PRIVKEY=")))))
2353 (native-inputs `(("python" ,python-2)))
2354 (home-page
2355 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2356 (synopsis "Wireless regulatory database")
2357 (description
2358 "This package contains the wireless regulatory database Central
2359 Regulatory Database Agent (CRDA) daemon. The database contains information on
2360 country-specific regulations for the wireless spectrum.")
2361 (license license:isc)))
2362
2363 (define-public lm-sensors
2364 (package
2365 (name "lm-sensors")
2366 (version "3.4.0")
2367 (source (origin
2368 (method url-fetch)
2369 (uri (list (string-append
2370 "https://github.com/groeck/lm-sensors/archive/V"
2371 (string-join (string-split version #\.) "-")
2372 ".tar.gz")))
2373 (file-name (string-append name "-" version ".tar.gz"))
2374 (sha256
2375 (base32
2376 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2377 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2378 (build-system gnu-build-system)
2379 (inputs `(("rrdtool" ,rrdtool)
2380 ("perl" ,perl)
2381 ("kmod" ,kmod)
2382 ("gnuplot" ,gnuplot)))
2383 (native-inputs `(("pkg-config" ,pkg-config)
2384 ("flex" ,flex)
2385 ("bison" ,bison)
2386 ("which" ,which)))
2387 (outputs '("lib" ;avoid perl in closure
2388 "out"))
2389 (arguments
2390 `(#:tests? #f ; no 'check' target
2391 #:make-flags (list (string-append "PREFIX=" %output)
2392 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2393 (string-append "INCLUDEDIR="
2394 (assoc-ref %outputs "lib") "/include")
2395 (string-append "MANDIR=" %output "/share/man")
2396 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2397 #:phases
2398 (modify-phases %standard-phases
2399 (delete 'configure)
2400 (add-before 'build 'patch-exec-paths
2401 (lambda* (#:key inputs outputs #:allow-other-keys)
2402 (substitute* "prog/detect/sensors-detect"
2403 (("`uname")
2404 (string-append "`" (assoc-ref inputs "coreutils")
2405 "/bin/uname"))
2406 (("(`|\")modprobe" all open-quote)
2407 (string-append open-quote
2408 (assoc-ref inputs "kmod")
2409 "/bin/modprobe")))
2410 (substitute* '("prog/pwm/pwmconfig"
2411 "prog/pwm/fancontrol")
2412 (("gnuplot")
2413 (string-append (assoc-ref inputs "gnuplot")
2414 "/bin/gnuplot"))
2415 (("cat ")
2416 (string-append (assoc-ref inputs "coreutils")
2417 "/bin/cat "))
2418 (("egrep ")
2419 (string-append (assoc-ref inputs "grep")
2420 "/bin/egrep "))
2421 (("sed -e")
2422 (string-append (assoc-ref inputs "sed")
2423 "/bin/sed -e"))
2424 (("cut -d")
2425 (string-append (assoc-ref inputs "coreutils")
2426 "/bin/cut -d"))
2427 (("sleep ")
2428 (string-append (assoc-ref inputs "coreutils")
2429 "/bin/sleep "))
2430 (("readlink -f")
2431 (string-append (assoc-ref inputs "coreutils")
2432 "/bin/readlink -f")))
2433 #t)))))
2434 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2435 (synopsis "Utilities to read temperature/voltage/fan sensors")
2436 (description
2437 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2438 you to access information from temperature, voltage, and fan speed sensors.
2439 It works with most newer systems.")
2440 (license license:gpl2+)))
2441
2442 (define-public iucode-tool
2443 (package
2444 (name "iucode-tool")
2445 (version "2.2")
2446 (source (origin
2447 (method url-fetch)
2448 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2449 "/raw/latest/iucode-tool_" version ".tar.xz"))
2450 (sha256
2451 (base32
2452 "0w99k1aq1xw148ffk1xykqf60rdbphb1jknw98jcmadq4pwxl44q"))))
2453 (build-system gnu-build-system)
2454 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2455 (synopsis "Manipulate Intel microcode bundles")
2456 (description
2457 "@command{iucode_tool} is a utility to work with microcode packages for
2458 Intel processors. It can convert between formats, extract specific versions,
2459 create a firmware image suitable for the Linux kernel, and more.")
2460 ;; cpuid.h is available for i686, x86_64, and ia64.
2461 (supported-systems '("i686-linux" "x86_64-linux"))
2462 (license license:gpl2+)))
2463
2464 (define-public i2c-tools
2465 (package
2466 (name "i2c-tools")
2467 (version "3.1.1")
2468 (source (origin
2469 (method url-fetch)
2470 (uri (string-append
2471 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2472 version ".tar.bz2"))
2473 (sha256
2474 (base32
2475 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2476 (build-system gnu-build-system)
2477 (arguments
2478 `(#:tests? #f ; no 'check' target
2479 #:make-flags (list (string-append "prefix=" %output)
2480 "CC=gcc")
2481 ;; no configure script
2482 #:phases (modify-phases %standard-phases (delete 'configure))))
2483 (inputs
2484 `(("perl" ,perl)))
2485 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2486 (synopsis "I2C tools for Linux")
2487 (description
2488 "The i2c-tools package contains a heterogeneous set of I2C tools for
2489 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2490 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2491 SMBus access.")
2492 (license license:gpl2+)))
2493
2494 (define-public xsensors
2495 (package
2496 (name "xsensors")
2497 (version "0.70")
2498 (source (origin
2499 (method url-fetch)
2500 (uri (string-append
2501 "http://www.linuxhardware.org/xsensors/xsensors-"
2502 version ".tar.gz"))
2503 (sha256
2504 (base32
2505 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2506 (build-system gnu-build-system)
2507 (inputs `(("lm-sensors" ,lm-sensors "lib")
2508 ("gtk" ,gtk+-2)))
2509 (native-inputs `(("pkg-config" ,pkg-config)))
2510 (arguments
2511 `(#:phases
2512 (modify-phases %standard-phases
2513 (add-before 'configure 'enable-deprecated
2514 (lambda _
2515 (substitute* "src/Makefile.in"
2516 (("-DGDK_DISABLE_DEPRECATED") "")
2517 (("-DGTK_DISABLE_DEPRECATED") ""))
2518 #t))
2519 (add-before 'configure 'remove-Werror
2520 (lambda _
2521 (substitute* '("configure" "src/Makefile.in")
2522 (("-Werror") ""))
2523 #t)))))
2524 (home-page "http://www.linuxhardware.org/xsensors/")
2525 (synopsis "Hardware health information viewer")
2526 (description
2527 "Xsensors reads data from the libsensors library regarding hardware
2528 health such as temperature, voltage and fan speed and displays the information
2529 in a digital read-out.")
2530 (license license:gpl2+)))
2531
2532 (define-public perf
2533 (package
2534 (name "perf")
2535 (version (package-version linux-libre))
2536 (source (origin
2537 (inherit (package-source linux-libre))
2538 (patches (search-patches "perf-gcc-ice.patch"))))
2539 (build-system gnu-build-system)
2540 (arguments
2541 '(#:phases
2542 (modify-phases %standard-phases
2543 (replace 'configure
2544 (lambda* (#:key inputs #:allow-other-keys)
2545 (setenv "SHELL_PATH" (which "bash"))
2546 (chdir "tools/perf")
2547 #t)))
2548 #:make-flags (list (string-append "prefix="
2549 (assoc-ref %outputs "out"))
2550 "WERROR=0"
2551
2552 ;; By default, 'config/Makefile' uses lib64 on
2553 ;; x86_64. Work around that.
2554 "lib=lib")
2555 #:tests? #f)) ;no tests
2556 (native-inputs
2557 `(("pkg-config" ,pkg-config)
2558 ("bison" ,bison)
2559 ("flex" ,flex)
2560
2561 ;; There are build scripts written in these languages.
2562 ("perl" ,perl)
2563 ("python" ,python-2)))
2564 (inputs
2565 `(("slang" ,slang) ;for the interactive TUI
2566 ;; ("newt" ,newt)
2567 ("python" ,python-2) ;'perf' links against libpython
2568 ("elfutils" ,elfutils)
2569 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2570 ("libunwind" ,libunwind) ;better stack walking
2571 ("numactl" ,numactl) ;for 'perf bench numa mem'
2572
2573 ;; Documentation.
2574 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2575 ("docbook-xsl" ,docbook-xsl)
2576 ("xmlto" ,xmlto)
2577 ("asciidoc" ,asciidoc)))
2578 (home-page "https://perf.wiki.kernel.org/")
2579 (synopsis "Linux profiling with performance counters")
2580 (description
2581 "perf is a tool suite for profiling using hardware performance counters,
2582 with support in the Linux kernel. perf can instrument CPU performance
2583 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2584 of lightweight profiling. This package contains the user-land tools and in
2585 particular the 'perf' command.")
2586 (license (package-license linux-libre))))
2587
2588 (define-public pflask
2589 (package
2590 (name "pflask")
2591 (version "0.2")
2592 (source (origin
2593 (method url-fetch)
2594 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2595 version ".tar.gz"))
2596 (file-name (string-append name "-" version ".tar.gz"))
2597 (sha256
2598 (base32
2599 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2600 (build-system cmake-build-system)
2601 (arguments
2602 '(#:tests? #f)) ; no tests
2603 (home-page "https://ghedo.github.io/pflask/")
2604 (synopsis "Simple tool for creating Linux namespace containers")
2605 (description "pflask is a simple tool for creating Linux namespace
2606 containers. It can be used for running a command or even booting an OS inside
2607 an isolated container, created with the help of Linux namespaces. It is
2608 similar in functionality to chroot, although pflask provides better isolation
2609 thanks to the use of namespaces.")
2610 (license license:bsd-2)))
2611
2612 (define-public singularity
2613 (package
2614 (name "singularity")
2615 (version "2.5.1")
2616 (source (origin
2617 (method url-fetch)
2618 (uri (string-append "https://github.com/singularityware/singularity/"
2619 "releases/download/" version
2620 "/singularity-" version ".tar.gz"))
2621 (sha256
2622 (base32
2623 "0f28dgf2qcy8ljjfix7p9q36q12j7rxyicfzzi4n0fl8zr8ab88g"))))
2624 (build-system gnu-build-system)
2625 (arguments
2626 `(#:configure-flags
2627 (list "--disable-suid"
2628 "--localstatedir=/var")
2629 #:phases
2630 (modify-phases %standard-phases
2631 ;; Do not create directories in /var.
2632 (add-after 'unpack 'disable-install-hook
2633 (lambda _
2634 (substitute* "Makefile.in"
2635 (("\\$\\(MAKE\\) .*install-data-hook") ""))
2636 #t))
2637 (add-after 'unpack 'patch-reference-to-squashfs-tools
2638 (lambda _
2639 (substitute* "libexec/cli/build.exec"
2640 (("if ! singularity_which mksquashfs") "if 0")
2641 (("if ! mksquashfs")
2642 (string-append "if ! " (which "mksquashfs"))))
2643 #t)))))
2644 (inputs
2645 `(("libarchive" ,libarchive)
2646 ("python" ,python-wrapper)
2647 ("nettle" ,nettle)
2648 ("zlib" ,zlib)
2649 ("squashfs-tools" ,squashfs-tools)))
2650 (home-page "https://singularity.lbl.gov/")
2651 (synopsis "Container platform")
2652 (description "Singularity is a container platform supporting a number of
2653 container image formats. It can build SquashFS container images or import
2654 existing Docker images. Singularity requires kernel support for container
2655 isolation or root privileges.")
2656 (license license:bsd-3)))
2657
2658 (define-public hdparm
2659 (package
2660 (name "hdparm")
2661 (version "9.56")
2662 (source (origin
2663 (method url-fetch)
2664 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2665 name "-" version ".tar.gz"))
2666 (sha256
2667 (base32
2668 "1np42qyhb503khvacnjcl3hb1dqly68gj0a1xip3j5qhbxlyvybg"))))
2669 (build-system gnu-build-system)
2670 (arguments
2671 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2672 (list (string-append "binprefix=" out)
2673 (string-append "manprefix=" out)
2674 "CC=gcc"))
2675 #:phases
2676 (modify-phases %standard-phases
2677 (delete 'configure)) ; no configure script
2678 #:tests? #f)) ; no test suite
2679 (home-page "https://sourceforge.net/projects/hdparm/")
2680 (synopsis "View and tune ATA disk drive parameters")
2681 (description
2682 "@command{hdparm} is a command-line utility to control ATA controllers and
2683 disk drives. It can increase performance and/or reliability by careful tuning
2684 of hardware settings like power and acoustic management, DMA modes, and caching.
2685 It can also display detailed device information, or be used as a simple
2686 performance benchmarking tool.
2687
2688 @command{hdparm} provides a command line interface to various Linux kernel
2689 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2690 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2691 Translation (@dfn{SAT}) are also supported.")
2692 (license (license:non-copyleft "file://LICENSE.TXT"))))
2693
2694 (define-public rfkill
2695 (package
2696 (name "rfkill")
2697 (version "0.5")
2698 (source (origin
2699 (method url-fetch)
2700 (uri (string-append "mirror://kernel.org/software/network/"
2701 name "/" name "-" version ".tar.xz"))
2702 (sha256
2703 (base32
2704 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2705 (build-system gnu-build-system)
2706 (arguments
2707 `(#:make-flags (list "CC=gcc"
2708 (string-append "PREFIX=" %output))
2709 #:phases (modify-phases %standard-phases
2710 (delete 'configure))
2711 #:tests? #f))
2712 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2713 (synopsis "Tool for enabling and disabling wireless devices")
2714 (description
2715 "rfkill is a simple tool for accessing the rfkill device interface,
2716 which is used to enable and disable wireless networking devices, typically
2717 WLAN, Bluetooth and mobile broadband.")
2718 (license (license:non-copyleft "file://COPYING"
2719 "See COPYING in the distribution."))
2720 ;; rfkill is part of util-linux as of 2.31.
2721 (properties `((superseded . ,util-linux)))))
2722
2723 (define-public acpi
2724 (package
2725 (name "acpi")
2726 (version "1.7")
2727 (source (origin
2728 (method url-fetch)
2729 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2730 version "/" name "-" version ".tar.gz"))
2731 (sha256
2732 (base32
2733 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2734 (build-system gnu-build-system)
2735 (home-page "http://acpiclient.sourceforge.net")
2736 (synopsis "Display information on ACPI devices")
2737 (description "@code{acpi} attempts to replicate the functionality of the
2738 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2739 information. It does not support ACPI suspending, only displays information
2740 about ACPI devices.")
2741 (license license:gpl2+)))
2742
2743 (define-public acpid
2744 (package
2745 (name "acpid")
2746 (version "2.0.30")
2747 (source (origin
2748 (method url-fetch)
2749 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2750 version ".tar.xz"))
2751 (sha256
2752 (base32
2753 "1jzl7hiaspr5xkmsrbl69bib8cs3dp6bq5ix58fbskpnsdi7pdr8"))))
2754 (build-system gnu-build-system)
2755 (home-page "https://sourceforge.net/projects/acpid2/")
2756 (synopsis "Daemon for delivering ACPI events to user-space programs")
2757 (description
2758 "acpid is designed to notify user-space programs of Advanced
2759 Configuration and Power Interface (ACPI) events. acpid should be started
2760 during the system boot, and will run as a background process. When an ACPI
2761 event is received from the kernel, acpid will examine the list of rules
2762 specified in /etc/acpi/events and execute the rules that match the event.")
2763 (license license:gpl2+)))
2764
2765 (define-public sysfsutils
2766 (package
2767 (name "sysfsutils")
2768 (version "2.1.0")
2769 (source
2770 (origin
2771 (method url-fetch)
2772 (uri
2773 (string-append
2774 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2775 version ".tar.gz"))
2776 (sha256
2777 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2778 (build-system gnu-build-system)
2779 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2780 (synopsis "System utilities based on Linux sysfs")
2781 (description
2782 "These are a set of utilities built upon sysfs, a virtual file system in
2783 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2784 also contains the libsysfs library.")
2785 ;; The library is under lgpl2.1+ (all files say "or any later version").
2786 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2787 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2788
2789 (define-public sysfsutils-1
2790 (package
2791 (inherit sysfsutils)
2792 (version "1.3.0")
2793 (source
2794 (origin
2795 (method url-fetch)
2796 (uri
2797 (string-append
2798 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2799 "/sysfsutils-" version ".tar.gz"))
2800 (sha256
2801 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2802 (modules '((guix build utils)))
2803 (snippet
2804 '(begin
2805 (substitute* "Makefile.in"
2806 (("includedir = /usr/include/sysfs")
2807 "includedir = @includedir@"))
2808 (substitute* "configure"
2809 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2810 (string-append "includedir='" orig "/sysfs'")))
2811 #t))))
2812 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2813
2814 (define-public cpufrequtils
2815 (package
2816 (name "cpufrequtils")
2817 (version "0.3")
2818 (source
2819 (origin
2820 (method url-fetch)
2821 (uri
2822 (string-append
2823 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2824 version ".tar.gz"))
2825 (sha256
2826 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2827 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2828 (build-system gnu-build-system)
2829 (native-inputs
2830 `(("sysfsutils" ,sysfsutils-1)))
2831 (arguments
2832 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2833 (assoc-ref %outputs "out") "/lib"))))
2834 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2835 (synopsis "Utilities to get and set CPU frequency on Linux")
2836 (description
2837 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2838 information, and set the CPU frequency if supported, using the cpufreq
2839 capabilities of the Linux kernel.")
2840 (license license:gpl2)))
2841
2842 (define-public libraw1394
2843 (package
2844 (name "libraw1394")
2845 (version "2.1.2")
2846 (source (origin
2847 (method url-fetch)
2848 (uri (string-append
2849 "mirror://kernel.org/linux/libs/ieee1394/"
2850 name "-" version ".tar.xz"))
2851 (sha256
2852 (base32
2853 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2854 (build-system gnu-build-system)
2855 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2856 (synopsis "Interface library for the Linux IEEE1394 drivers")
2857 (description
2858 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2859 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2860 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2861 send to and receive from other nodes without requiring a kernel driver for the
2862 protocol in question.")
2863 (license license:lgpl2.1+)))
2864
2865 (define-public libavc1394
2866 (package
2867 (name "libavc1394")
2868 (version "0.5.4")
2869 (source (origin
2870 (method url-fetch)
2871 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2872 name "-" version ".tar.gz"))
2873 (sha256
2874 (base32
2875 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2876 (build-system gnu-build-system)
2877 (native-inputs
2878 `(("pkg-config" ,pkg-config)))
2879 (propagated-inputs
2880 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2881 (home-page "https://sourceforge.net/projects/libavc1394/")
2882 (synopsis "AV/C protocol library for IEEE 1394")
2883 (description
2884 "Libavc1394 is a programming interface to the AV/C specification from
2885 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2886 (license license:lgpl2.1+)))
2887
2888 (define-public libiec61883
2889 (package
2890 (name "libiec61883")
2891 (version "1.2.0")
2892 (source (origin
2893 (method url-fetch)
2894 (uri (string-append
2895 "mirror://kernel.org/linux/libs/ieee1394/"
2896 name "-" version ".tar.xz"))
2897 (sha256
2898 (base32
2899 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2900 (build-system gnu-build-system)
2901 (native-inputs
2902 `(("pkg-config" ,pkg-config)))
2903 (propagated-inputs
2904 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2905 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2906 (synopsis "Isochronous streaming media library for IEEE 1394")
2907 (description
2908 "The libiec61883 library provides a higher level API for streaming DV,
2909 MPEG-2 and audio over Linux IEEE 1394.")
2910 (license license:lgpl2.1+)))
2911
2912 (define-public mdadm
2913 (package
2914 (name "mdadm")
2915 (version "4.1")
2916 (source (origin
2917 (method url-fetch)
2918 (uri (string-append
2919 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2920 version ".tar.xz"))
2921 (sha256
2922 (base32
2923 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
2924 (build-system gnu-build-system)
2925 (inputs
2926 `(("udev" ,eudev)))
2927 (arguments
2928 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2929 (list "CC=gcc"
2930 "INSTALL=install"
2931 "CHECK_RUN_DIR=0"
2932 ;; TODO: tell it where to find 'sendmail'
2933 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2934 (string-append "BINDIR=" out "/sbin")
2935 (string-append "MANDIR=" out "/share/man")
2936 (string-append "UDEVDIR=" out "/lib/udev")))
2937 #:phases
2938 (modify-phases %standard-phases
2939 (add-before 'build 'patch-program-paths
2940 (lambda* (#:key inputs #:allow-other-keys)
2941 (let ((coreutils (assoc-ref inputs "coreutils")))
2942 (substitute* "udev-md-raid-arrays.rules"
2943 (("/usr/bin/(readlink|basename)" all program)
2944 (string-append coreutils "/bin/" program))))
2945 #t))
2946 (add-before 'build 'remove-W-error
2947 (lambda _
2948 ;; We cannot build with -Werror on i686 due to a
2949 ;; 'sign-compare' warning in util.c.
2950 (substitute* "Makefile"
2951 (("-Werror") ""))
2952 #t))
2953 (delete 'configure))
2954 ;;tests must be done as root
2955 #:tests? #f))
2956 (home-page "http://neil.brown.name/blog/mdadm")
2957 (synopsis "Tool for managing Linux Software RAID arrays")
2958 (description
2959 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2960 assemble, report on, and monitor arrays. It can also move spares between raid
2961 arrays when needed.")
2962 (license license:gpl2+)))
2963
2964 (define-public mdadm-static
2965 (package
2966 (inherit mdadm)
2967 (name "mdadm-static")
2968 (arguments
2969 (substitute-keyword-arguments (package-arguments mdadm)
2970 ((#:make-flags flags)
2971 `(cons "LDFLAGS = -static" ,flags))
2972 ((#:phases phases)
2973 `(modify-phases ,phases
2974 (add-after 'install 'remove-cruft
2975 (lambda* (#:key outputs #:allow-other-keys)
2976 (let* ((out (assoc-ref outputs "out"))
2977 (precious? (lambda (file)
2978 (member file '("." ".." "sbin"))))
2979 (directories (scandir out (negate precious?))))
2980 (with-directory-excursion out
2981 (for-each delete-file-recursively directories)
2982 (remove-store-references "sbin/mdadm")
2983 (delete-file "sbin/mdmon")
2984 #t))))))
2985 ((#:modules modules %gnu-build-system-modules)
2986 `((ice-9 ftw) ,@modules))
2987 ((#:strip-flags _ '())
2988 ''("--strip-all")) ;strip a few extra KiB
2989 ((#:allowed-references _ '("out"))
2990 '("out")))) ;refer only self
2991 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2992
2993 (define-public multipath-tools
2994 (package
2995 (name "multipath-tools")
2996 (version "0.7.7")
2997 (source (origin
2998 (method url-fetch)
2999 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3000 ".git;a=snapshot;h=" version ";sf=tgz"))
3001 (file-name (string-append name "-" version ".tar.gz"))
3002 (sha256
3003 (base32
3004 "1lirhjjv37jnf42r1ylrhi8kbzx9j9xnyfzvxpp6bzcp0fawigig"))
3005 (modules '((guix build utils)))
3006 (snippet
3007 '(begin
3008 ;; Drop bundled valgrind headers.
3009 (delete-file-recursively "third-party")
3010 (substitute* '("multipathd/main.c"
3011 "libmultipath/debug.c")
3012 (("#include \"../third-party/")
3013 "#include \""))
3014 #t))))
3015 (build-system gnu-build-system)
3016 (arguments
3017 '(#:tests? #f ; no tests
3018 #:make-flags (list "CC=gcc"
3019 (string-append "DESTDIR="
3020 (assoc-ref %outputs "out"))
3021 "SYSTEMDPATH=lib"
3022 (string-append "LDFLAGS=-Wl,-rpath="
3023 (assoc-ref %outputs "out")
3024 "/lib"))
3025 #:phases
3026 (modify-phases %standard-phases
3027 (add-after 'unpack 'patch-source
3028 (lambda* (#:key inputs #:allow-other-keys)
3029 (let ((lvm2 (assoc-ref inputs "lvm2"))
3030 (udev (assoc-ref inputs "udev")))
3031 (substitute* "Makefile.inc"
3032 (("\\$\\(prefix\\)/usr") "$(prefix)")
3033 ;; Do not save timestamp to avoid gzip "timestamp
3034 ;; out-of-range" warnings.
3035 (("gzip -9") "gzip -9n"))
3036 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3037 (("/usr/include/libdevmapper.h")
3038 (string-append lvm2 "/include/libdevmapper.h"))
3039 (("/usr/include/libudev.h")
3040 (string-append udev "/include/libudev.h")))
3041 #t)))
3042 (delete 'configure))))
3043 (native-inputs
3044 `(("perl" ,perl)
3045 ("pkg-config" ,pkg-config)
3046 ("valgrind" ,valgrind)))
3047 (inputs
3048 `(("ceph:lib" ,ceph "lib")
3049 ("json-c" ,json-c)
3050 ("libaio" ,libaio)
3051 ("liburcu" ,liburcu)
3052 ("lvm2" ,lvm2)
3053 ("readline" ,readline)
3054 ("udev" ,eudev)))
3055 (home-page "http://christophe.varoqui.free.fr/")
3056 (synopsis "Access block devices through multiple paths")
3057 (description
3058 "This package provides the following binaries to drive the
3059 Linux Device Mapper multipathing driver:
3060 @enumerate
3061 @item @command{multipath} - Device mapper target autoconfig.
3062 @item @command{multipathd} - Multipath daemon.
3063 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3064 @code{dm} multipath devices.
3065 @item @command{kpartx} - Create device maps from partition tables.
3066 @end enumerate")
3067 (license (list license:gpl2+ ; Main distribution.
3068 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3069
3070 (define-public libaio
3071 (package
3072 (name "libaio")
3073 (version "0.3.111")
3074 (source (origin
3075 (method url-fetch)
3076 (uri (list
3077 (string-append "https://releases.pagure.org/libaio/"
3078 name "-" version ".tar.gz")))
3079 (sha256
3080 (base32
3081 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3082 (build-system gnu-build-system)
3083 (arguments
3084 '(#:make-flags
3085 (list "CC=gcc" (string-append "prefix=" %output))
3086 #:test-target "partcheck" ; need root for a full 'check'
3087 #:phases
3088 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3089 (home-page "https://pagure.io/libaio")
3090 (synopsis "Linux-native asynchronous I/O access library")
3091 (description
3092 "This library enables userspace to use Linux kernel asynchronous I/O
3093 system calls, important for the performance of databases and other advanced
3094 applications.")
3095 (license license:lgpl2.1+)))
3096
3097 (define-public sbc
3098 (package
3099 (name "sbc")
3100 (version "1.3")
3101 (source (origin
3102 (method url-fetch)
3103 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
3104 name "-" version ".tar.xz"))
3105 (sha256
3106 (base32
3107 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
3108 (build-system gnu-build-system)
3109 (inputs
3110 `(("libsndfile" ,libsndfile)))
3111 (native-inputs
3112 `(("pkg-config" ,pkg-config)))
3113 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3114 (synopsis "Bluetooth subband audio codec")
3115 (description
3116 "The SBC is a digital audio encoder and decoder used to transfer data to
3117 Bluetooth audio output devices like headphones or loudspeakers.")
3118 (license license:gpl2+)))
3119
3120 (define-public bluez
3121 (package
3122 (name "bluez")
3123 (version "5.50")
3124 (source (origin
3125 (method url-fetch)
3126 (uri (string-append
3127 "mirror://kernel.org/linux/bluetooth/bluez-"
3128 version ".tar.xz"))
3129 (sha256
3130 (base32
3131 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
3132 (build-system gnu-build-system)
3133 (arguments
3134 `(#:configure-flags
3135 (let ((out (assoc-ref %outputs "out")))
3136 (list "--sysconfdir=/etc"
3137 "--localstatedir=/var"
3138 "--enable-library"
3139 "--disable-systemd"
3140 ;; Install dbus/udev files to the correct location.
3141 (string-append "--with-dbusconfdir=" out "/etc")
3142 (string-append "--with-udevdir=" out "/lib/udev")))
3143 #:phases
3144 (modify-phases %standard-phases
3145 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3146 ;; issue (discussion on upstream mailing list:
3147 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3148 (add-before 'check 'skip-wonky-test
3149 (lambda _
3150 (substitute* "unit/test-gatt.c"
3151 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3152 #t))
3153 (add-after 'install 'post-install
3154 (lambda* (#:key inputs outputs #:allow-other-keys)
3155 (let* ((out (assoc-ref outputs "out"))
3156 (servicedir (string-append out "/share/dbus-1/services"))
3157 (service "obexd/src/org.bluez.obex.service")
3158 (rule (string-append
3159 out "/lib/udev/rules.d/97-hid2hci.rules")))
3160 ;; Install the obex dbus service file.
3161 (substitute* service
3162 (("/bin/false")
3163 (string-append out "/libexec/bluetooth/obexd")))
3164 (install-file service servicedir)
3165 ;; Fix paths in the udev rule.
3166 (substitute* rule
3167 (("hid2hci --method")
3168 (string-append out "/lib/udev/hid2hci --method"))
3169 (("/sbin/udevadm")
3170 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3171 #t))))))
3172 (native-inputs
3173 `(("pkg-config" ,pkg-config)
3174 ("gettext" ,gettext-minimal)))
3175 (inputs
3176 `(("glib" ,glib)
3177 ("dbus" ,dbus)
3178 ("eudev" ,eudev)
3179 ("libical" ,libical)
3180 ("readline" ,readline)))
3181 (home-page "http://www.bluez.org/")
3182 (synopsis "Linux Bluetooth protocol stack")
3183 (description
3184 "BlueZ provides support for the core Bluetooth layers and protocols. It
3185 is flexible, efficient and uses a modular implementation.")
3186 (license license:gpl2+)))
3187
3188 (define-public fuse-exfat
3189 (package
3190 (name "fuse-exfat")
3191 (version "1.3.0")
3192 (source (origin
3193 (method url-fetch)
3194 (uri (string-append
3195 "https://github.com/relan/exfat/releases/download/v"
3196 version "/" name "-" version ".tar.gz"))
3197 (sha256
3198 (base32
3199 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3200 (build-system gnu-build-system)
3201 (native-inputs
3202 `(("pkg-config" ,pkg-config)))
3203 (inputs
3204 `(("fuse" ,fuse)))
3205 (home-page "https://github.com/relan/exfat")
3206 (synopsis "Mount exFAT file systems")
3207 (description
3208 "This package provides a FUSE-based file system that provides read and
3209 write access to exFAT devices.")
3210 (license license:gpl2+)))
3211
3212 (define-public gpm
3213 (package
3214 (name "gpm")
3215 (version "1.20.7")
3216 (source (origin
3217 (method url-fetch)
3218 (uri (string-append
3219 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3220 version ".tar.bz2"))
3221 (patches (search-patches "gpm-glibc-2.26.patch"))
3222 (sha256
3223 (base32
3224 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3225 (build-system gnu-build-system)
3226 (arguments
3227 '(#:phases (modify-phases %standard-phases
3228 (replace 'bootstrap
3229 (lambda _
3230 ;; The tarball was not generated with 'make dist' so we
3231 ;; need to bootstrap things ourselves.
3232 (substitute* "autogen.sh"
3233 (("/bin/sh") (which "sh")))
3234 (invoke "./autogen.sh")
3235 (patch-makefile-SHELL "Makefile.include.in")
3236 #t)))
3237
3238 ;; Make sure programs find libgpm.so.
3239 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3240 (assoc-ref %outputs "out")
3241 "/lib"))))
3242 (native-inputs
3243 `(("texinfo" ,texinfo)
3244 ("bison" ,bison)
3245 ("flex" ,flex)
3246 ("autoconf" ,autoconf)
3247 ("automake" ,automake)
3248 ("libtool" ,libtool)))
3249 (home-page "http://www.nico.schottelius.org/software/gpm/")
3250 (synopsis "Mouse support for the Linux console")
3251 (description
3252 "The GPM (general-purpose mouse) daemon is a mouse server for
3253 applications running on the Linux console. It allows users to select items
3254 and copy/paste text in the console and in xterm.")
3255 (license license:gpl2+)))
3256
3257 (define-public btrfs-progs
3258 (package
3259 (name "btrfs-progs")
3260 (version "4.17.1")
3261 (source (origin
3262 (method url-fetch)
3263 (uri (string-append "mirror://kernel.org/linux/kernel/"
3264 "people/kdave/btrfs-progs/"
3265 "btrfs-progs-v" version ".tar.xz"))
3266 (sha256
3267 (base32
3268 "0x6d53fbrcmzvhv461575fzsv3373427p4srz646w2wcagqk82xz"))))
3269 (build-system gnu-build-system)
3270 (outputs '("out"
3271 "static")) ; static versions of the binaries in "out"
3272 (arguments
3273 '(#:phases (modify-phases %standard-phases
3274 (add-after 'build 'build-static
3275 (lambda _ (invoke "make" "static")))
3276 (add-after 'install 'install-bash-completion
3277 (lambda* (#:key outputs #:allow-other-keys)
3278 (let* ((out (assoc-ref outputs "out"))
3279 (bashcomp (string-append out "/etc/bash_completion.d")))
3280 (mkdir-p bashcomp)
3281 (copy-file "btrfs-completion"
3282 (string-append bashcomp "/btrfs"))
3283 #t)))
3284 (add-after 'install 'install-static
3285 (let ((staticbin (string-append (assoc-ref %outputs "static")
3286 "/bin")))
3287 (lambda _
3288 (invoke "make"
3289 (string-append "bindir=" staticbin)
3290 "install-static")))))
3291 #:tests? #f ; XXX: require the 'btrfs' kernel module.
3292 #:test-target "test"
3293 #:parallel-tests? #f)) ; tests fail when run in parallel
3294 (inputs `(("e2fsprogs" ,e2fsprogs)
3295 ("libblkid" ,util-linux)
3296 ("libblkid:static" ,util-linux "static")
3297 ("libuuid" ,util-linux)
3298 ("libuuid:static" ,util-linux "static")
3299 ("lzo" ,lzo)
3300 ("zlib" ,zlib)
3301 ("zstd" ,zstd)))
3302 (native-inputs `(("pkg-config" ,pkg-config)
3303 ("asciidoc" ,asciidoc)
3304 ("python" ,python)
3305 ("xmlto" ,xmlto)
3306 ;; For building documentation.
3307 ("libxml2" ,libxml2)
3308 ("docbook-xsl" ,docbook-xsl)
3309 ;; For tests.
3310 ("acl" ,acl)
3311 ("which" ,which)
3312 ;; The tests need 'grep' with perl regexp support.
3313 ("grep" ,grep)))
3314 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
3315 (synopsis "Create and manage btrfs copy-on-write file systems")
3316 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3317 aimed at implementing advanced features while focusing on fault tolerance,
3318 repair and easy administration.")
3319 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3320 ;; GPL2: Everything else.
3321 (license (list license:gpl2 license:gpl2+))))
3322
3323 (define-public btrfs-progs/static
3324 (package
3325 (name "btrfs-progs-static")
3326 (version (package-version btrfs-progs))
3327 (source #f)
3328 (build-system trivial-build-system)
3329 (inputs
3330 `(("btrfs-progs:static" ,btrfs-progs "static")))
3331 (arguments
3332 `(#:modules ((guix build utils))
3333 #:builder
3334 (begin
3335 (use-modules (guix build utils)
3336 (ice-9 ftw)
3337 (srfi srfi-26))
3338
3339 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3340 (out (assoc-ref %outputs "out"))
3341 (source (string-append btrfs "/bin/btrfs.static"))
3342 (target (string-append out "/bin/btrfs")))
3343 (mkdir-p (dirname target))
3344 (copy-file source target)
3345 (remove-store-references target)
3346 (chmod target #o555)
3347 #t))))
3348 (home-page (package-home-page btrfs-progs))
3349 (synopsis "Statically-linked btrfs command from btrfs-progs")
3350 (description "This package provides the statically-linked @command{btrfs}
3351 from the btrfs-progs package. It is meant to be used in initrds.")
3352 (license (package-license btrfs-progs))))
3353
3354 (define-public f2fs-tools-1.7
3355 (package
3356 (name "f2fs-tools")
3357 (version "1.7.0")
3358 (source (origin
3359 (method url-fetch)
3360 (uri (string-append
3361 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3362 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3363 (sha256
3364 (base32
3365 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
3366
3367 (build-system gnu-build-system)
3368 (arguments
3369 `(#:phases
3370 (modify-phases %standard-phases
3371 (add-after 'install 'install-headers
3372 (lambda* (#:key outputs #:allow-other-keys)
3373 (let* ((out (assoc-ref outputs "out"))
3374 (out-include (string-append out "/include")))
3375 (install-file "include/f2fs_fs.h" out-include)
3376 (install-file "mkfs/f2fs_format_utils.h" out-include)
3377 #t))))))
3378 (native-inputs
3379 `(("autoconf" ,autoconf)
3380 ("automake" ,automake)
3381 ("libtool" ,libtool)
3382 ("pkg-config" ,pkg-config)))
3383 (inputs
3384 `(("libuuid" ,util-linux)
3385 ("libselinux" ,libselinux)))
3386 (home-page "https://f2fs.wiki.kernel.org/")
3387 (synopsis "Userland tools for f2fs")
3388 (description
3389 "F2FS, the Flash-Friendly File System, is a modern file system
3390 designed to be fast and durable on flash devices such as solid-state
3391 disks and SD cards. This package provides the userland utilities.")
3392 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3393 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3394 (license (list license:gpl2 license:lgpl2.1))))
3395
3396 (define-public f2fs-tools
3397 (package
3398 (inherit f2fs-tools-1.7)
3399 (name "f2fs-tools")
3400 (version "1.11.0")
3401 (source (origin
3402 (method url-fetch)
3403 (uri (string-append
3404 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3405 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3406 (sha256
3407 (base32
3408 "1qvr3hcic1vzfmyl7c0gnjxfsw8zjaadm66y337h49chv9yaq5mr"))))
3409 (inputs
3410 `(("libuuid" ,util-linux)))))
3411
3412 (define-public freefall
3413 (package
3414 (name "freefall")
3415 (version (package-version linux-libre))
3416 (source (package-source linux-libre))
3417 (build-system gnu-build-system)
3418 (arguments
3419 '(#:phases (modify-phases %standard-phases
3420 (add-after 'unpack 'enter-subdirectory
3421 (lambda _
3422 (chdir "tools/laptop/freefall")
3423 #t))
3424 (delete 'configure)
3425 (add-before 'build 'increase-timeout
3426 (lambda _
3427 ;; The default of 2 seconds is too low: it assumes an
3428 ;; open lid and AC power without actually checking.
3429 (substitute* "freefall.c"
3430 (("alarm\\(2\\)") "alarm(5)"))
3431 #t)))
3432 #:make-flags (list (string-append "PREFIX="
3433 (assoc-ref %outputs "out"))
3434 "CC=gcc")
3435 #:tests? #f)) ;no tests
3436 (home-page (package-home-page linux-libre))
3437 (synopsis "Free-fall protection for spinning laptop hard drives")
3438 (description
3439 "Prevents shock damage to the internal spinning hard drive(s) of some
3440 HP and Dell laptops. When sudden movement is detected, all input/output
3441 operations on the drive are suspended and its heads are parked on the ramp,
3442 where they are less likely to cause damage to the spinning disc. Requires a
3443 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3444 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3445 (license license:gpl2)))
3446
3447 (define-public thinkfan
3448 (package
3449 (name "thinkfan")
3450 (version "0.9.3")
3451 (source (origin
3452 (method url-fetch)
3453 (uri (string-append "mirror://sourceforge/thinkfan/"
3454 "/thinkfan-" version ".tar.gz"))
3455 (sha256
3456 (base32
3457 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3458 (modules '((guix build utils)))
3459 ;; Fix erroneous man page location in Makefile leading to
3460 ;; a compilation failure.
3461 (snippet '(begin
3462 (substitute* "CMakeLists.txt"
3463 (("thinkfan\\.1") "src/thinkfan.1"))
3464 #t))))
3465 (build-system cmake-build-system)
3466 (arguments
3467 `(#:modules ((guix build cmake-build-system)
3468 (guix build utils)
3469 (srfi srfi-26))
3470 #:tests? #f ;no test target
3471 #:configure-flags
3472 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3473 `("-DUSE_ATASMART:BOOL=ON")
3474 #:phases
3475 (modify-phases %standard-phases
3476 ;; Install scripts for various foreign init systems. Also fix
3477 ;; hard-coded path for daemon.
3478 (add-after 'install 'install-rc-scripts
3479 (lambda* (#:key outputs #:allow-other-keys)
3480 (let ((out (assoc-ref outputs "out"))
3481 (files (find-files
3482 (string-append "../thinkfan-" ,version "/rcscripts")
3483 ".*")))
3484 (substitute* files
3485 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3486 (string-append out "/sbin/" name)))
3487 (for-each (cute install-file <>
3488 (string-append out "/share/thinkfan"))
3489 files))
3490 #t)))))
3491 (inputs
3492 `(("libatasmart" ,libatasmart)))
3493 (home-page "http://thinkfan.sourceforge.net/")
3494 (synopsis "Simple fan control program")
3495 (description
3496 "Thinkfan is a simple fan control program. It reads temperatures,
3497 checks them against configured limits and switches to appropriate (also
3498 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3499 other @code{hwmon} driver that enables temperature reading and fan control
3500 from userspace.")
3501 (license license:gpl3+)))
3502
3503 (define-public ntfs-3g
3504 (package
3505 (name "ntfs-3g")
3506 (version "2017.3.23")
3507 (source (origin
3508 (method url-fetch)
3509 (uri (string-append "https://tuxera.com/opensource/"
3510 "ntfs-3g_ntfsprogs-" version ".tgz"))
3511 (sha256
3512 (base32
3513 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
3514 (modules '((guix build utils)))
3515 (snippet '(begin
3516 ;; Install under $prefix.
3517 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3518 (("/sbin")
3519 "@sbindir@"))
3520 #t))))
3521 (build-system gnu-build-system)
3522 (inputs `(("util-linux" ,util-linux)
3523 ("fuse" ,fuse))) ;libuuid
3524 (native-inputs `(("pkg-config" ,pkg-config)))
3525 (arguments
3526 '(#:configure-flags (list "--exec-prefix=${prefix}"
3527 "--with-fuse=external" ;use our own FUSE
3528 "--enable-mount-helper"
3529 "--enable-posix-acls"
3530 "--enable-xattr-mappings")
3531 #:phases
3532 (modify-phases %standard-phases
3533 ;; If users install ntfs-3g, they probably want to make it the
3534 ;; default driver as well, so we opt for sensible defaults and link
3535 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
3536 ;; mount NTFS filesystems.)
3537 (add-after 'install 'install-link
3538 (lambda* (#:key outputs #:allow-other-keys)
3539 (let* ((out (assoc-ref outputs "out"))
3540 (sbin (string-append out "/sbin")))
3541 (symlink "mount.ntfs-3g"
3542 (string-append sbin "/mount.ntfs"))))))))
3543 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
3544 (synopsis "Read-write access to NTFS file systems")
3545 (description
3546 "NTFS-3G provides read-write access to NTFS file systems, which are
3547 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3548 The package provides additional NTFS tools.")
3549 (license license:gpl2+)))
3550
3551 (define-public rdma-core
3552 (package
3553 (name "rdma-core")
3554 (version "14")
3555 (source (origin
3556 (method url-fetch)
3557 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3558 "/releases/download/v" version "/rdma-core-"
3559 version ".tar.gz"))
3560 (sha256
3561 (base32
3562 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3563 (build-system cmake-build-system)
3564 (arguments
3565 '(#:tests? #f ; no tests
3566 ;; Upstream uses the "ninja" build system and encourage distros
3567 ;; to do the same for consistency. They also recommend using the
3568 ;; "Release" build type.
3569 #:build-type "Release"
3570 #:configure-flags (list "-GNinja")
3571 #:phases
3572 (modify-phases %standard-phases
3573 (replace 'build
3574 (lambda _
3575 (invoke "ninja"
3576 "-j" (number->string (parallel-job-count)))))
3577 (replace 'install
3578 (lambda _
3579 (invoke "ninja" "install"))))))
3580 (native-inputs
3581 `(("ninja" ,ninja)
3582 ("pkg-config" ,pkg-config)
3583 ("python" ,python-wrapper)))
3584 (inputs
3585 `(("libnl" ,libnl)
3586 ("udev" ,eudev)))
3587 (home-page "https://github.com/linux-rdma/rdma-core")
3588 (synopsis "Utilities and libraries for working with RDMA devices")
3589 (description
3590 "This package provides userspace components for the InfiniBand
3591 subsystem of the Linux kernel. Specifically it contains userspace
3592 libraries for the following device nodes:
3593
3594 @enumerate
3595 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3596 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3597 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3598 @end enumerate
3599
3600 The following service daemons are also provided:
3601 @enumerate
3602 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3603 @item @code{iwpmd} (for iWARP kernel providers)
3604 @item @code{ibacm} (for InfiniBand communication management assistant)
3605 @end enumerate")
3606 ;; All library code is dual licensed under GPL2 and a custom MIT
3607 ;; variant. The package also includes some components covered by
3608 ;; other licenses. Consult COPYING.md for full details.
3609 (license
3610 (list license:gpl2
3611 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3612 license:bsd-2 ; Files referring to COPYING.BSD_FB
3613 license:cc0 ; most files in ccan/
3614 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3615
3616 (define-public perftest
3617 (package
3618 (name "perftest")
3619 (version "4.4-0.4")
3620 (source
3621 (origin
3622 (method url-fetch)
3623 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
3624 version "/perftest-" version ".g0927198.tar.gz"))
3625 (sha256
3626 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
3627 (build-system gnu-build-system)
3628 (arguments
3629 `(#:phases
3630 (modify-phases %standard-phases
3631 (add-after 'unpack 'patch-header-paths
3632 (lambda _
3633 (substitute* '("src/raw_ethernet_fs_rate.c"
3634 "src/raw_ethernet_resources.c"
3635 "src/raw_ethernet_resources.h"
3636 "src/raw_ethernet_send_burst_lat.c"
3637 "src/raw_ethernet_send_bw.c"
3638 "src/raw_ethernet_send_lat.c")
3639 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
3640 #t)))))
3641 (inputs `(("rdma-core" ,rdma-core)))
3642 (home-page "https://github.com/linux-rdma/perftest/")
3643 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
3644 (description "This is a collection of tests written over uverbs intended for
3645 use as a performance micro-benchmark. The tests may be used for hardware or
3646 software tuning as well as for functional testing.
3647
3648 The collection contains a set of bandwidth and latency benchmark such as:
3649 @enumerate
3650 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
3651 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
3652 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
3653 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
3654 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
3655 @end enumerate")
3656 (license license:gpl2)))
3657
3658 (define-public rng-tools
3659 (package
3660 (name "rng-tools")
3661 (home-page "https://github.com/nhorman/rng-tools")
3662 (version "6.6")
3663 (source (origin
3664 (method git-fetch)
3665 (uri (git-reference (url home-page)
3666 (commit (string-append "v" version))))
3667 (file-name (git-file-name name version))
3668 (sha256
3669 (base32
3670 "0c32sxfvngdjzfmxn5ngc5yxwi8ij3yl216nhzyz9r31qi3m14v7"))))
3671 (build-system gnu-build-system)
3672 (arguments
3673 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
3674 #:configure-flags '("--without-nistbeacon")))
3675 (native-inputs
3676 `(("autoconf" ,autoconf)
3677 ("automake" ,automake)
3678 ("pkg-config" ,pkg-config)))
3679 (inputs
3680 `(("libsysfs" ,sysfsutils)))
3681 (synopsis "Random number generator daemon")
3682 (description
3683 "Monitor a hardware random number generator, and supply entropy
3684 from that to the system kernel's @file{/dev/random} machinery.")
3685 ;; The source package is offered under the GPL2+, but the files
3686 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3687 (license (list license:gpl2 license:gpl2+))))
3688
3689 (define-public cpupower
3690 (package
3691 (name "cpupower")
3692 (version (package-version linux-libre))
3693 (source (package-source linux-libre))
3694 (build-system gnu-build-system)
3695 (arguments
3696 '(#:phases (modify-phases %standard-phases
3697 (add-after 'unpack 'enter-subdirectory
3698 (lambda _
3699 (chdir "tools/power/cpupower")))
3700 (delete 'configure)
3701 (add-before 'build 'fix-makefiles
3702 (lambda _
3703 (substitute* "Makefile"
3704 (("/usr/") "/")
3705 (("/bin/(install|pwd)" _ command) command))
3706 (substitute* "bench/Makefile"
3707 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3708 #:make-flags (let ((out (assoc-ref %outputs "out")))
3709 (list (string-append "DESTDIR=" out)
3710 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3711 "docdir=/share/doc/cpupower"
3712 "confdir=$(docdir)/examples"
3713 ;; The Makefile recommends the following changes
3714 "DEBUG=false"
3715 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3716 #:tests? #f)) ;no tests
3717 (native-inputs `(("gettext" ,gettext-minimal)))
3718 (inputs `(("pciutils" ,pciutils)))
3719 (home-page (package-home-page linux-libre))
3720 (synopsis "CPU frequency and voltage scaling tools for Linux")
3721 (description
3722 "cpupower is a set of user-space tools that use the cpufreq feature of the
3723 Linux kernel to retrieve and control processor features related to power saving,
3724 such as frequency and voltage scaling.")
3725 (license license:gpl2)))
3726
3727 (define-public haveged
3728 (package
3729 (name "haveged")
3730 (version "1.9.4")
3731 (source
3732 (origin
3733 (method git-fetch)
3734 (uri (git-reference
3735 (url "https://github.com/jirka-h/haveged.git")
3736 (commit version)))
3737 (file-name (git-file-name name version))
3738 (sha256
3739 (base32 "1hrwzjd4byq4fdrg8svww3d8x449k80jxxrjy9v6jvzhfv19rvxr"))))
3740 (build-system gnu-build-system)
3741 (home-page "http://www.issihosts.com/haveged")
3742 (synopsis "Entropy source for the Linux random number generator")
3743 (description
3744 "haveged generates an unpredictable stream of random numbers for use by
3745 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3746 standard mechanisms for filling the entropy pool may not be sufficient for
3747 systems with high needs or limited user interaction, such as headless servers.
3748
3749 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3750 indirect effects of hardware events on hidden processor state using the HArdware
3751 Volatile Entropy Gathering and Expansion (@dfn{HAVEGE}) algorithm. It tunes
3752 itself to its environment and provides the same built-in test suite for the
3753 output stream as used on certified hardware security devices.
3754
3755 The quality of the randomness produced by this algorithm has not been proven.
3756 It is recommended to run it together with another entropy source like rngd, and
3757 not as a replacement for it.")
3758 (license (list (license:non-copyleft "file://nist/mconf.h")
3759 (license:non-copyleft "file://nist/packtest.c")
3760 license:public-domain ; nist/dfft.c
3761 license:gpl3+)))) ; everything else
3762
3763 (define-public ecryptfs-utils
3764 (package
3765 (name "ecryptfs-utils")
3766 (version "111")
3767 (source
3768 (origin
3769 (method url-fetch)
3770 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3771 version "/+download/ecryptfs-utils_"
3772 version ".orig.tar.gz"))
3773 (sha256
3774 (base32
3775 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3776 (build-system gnu-build-system)
3777 (arguments
3778 `(#:configure-flags (list "--disable-pywrap")
3779 #:phases
3780 (modify-phases %standard-phases
3781 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
3782 (lambda* (#:key inputs outputs #:allow-other-keys)
3783 (let ((out (assoc-ref outputs "out"))
3784 (utils-linux (assoc-ref inputs "utils-linux"))
3785 (cryptsetup (assoc-ref inputs "cryptsetup"))
3786 (linux-pam (assoc-ref inputs "linux-pam"))
3787 (lvm2 (assoc-ref inputs "lvm2")))
3788 (substitute* '("src/utils/ecryptfs-mount-private"
3789 "src/utils/ecryptfs-umount-private"
3790 "src/utils/ecryptfs-setup-private"
3791 "src/utils/ecryptfs-setup-swap"
3792 "src/utils/mount.ecryptfs.c"
3793 "src/utils/umount.ecryptfs.c"
3794 "src/pam_ecryptfs/pam_ecryptfs.c"
3795 "src/desktop/ecryptfs-mount-private.desktop.in"
3796 "src/desktop/ecryptfs-setup-private.desktop.in")
3797 (("/bin/mount")
3798 (string-append utils-linux "/bin/mount"))
3799 (("/bin/umount")
3800 (string-append utils-linux "/bin/umount"))
3801 (("/sbin/mount.ecryptfs_private")
3802 (string-append out "/sbin/mount.ecryptfs_private"))
3803 (("/sbin/umount.ecryptfs_private")
3804 (string-append out "/sbin/umount.ecryptfs_private"))
3805 (("/usr/bin/ecryptfs-mount-private")
3806 (string-append out "/bin/ecryptfs-mount-private"))
3807 (("/usr/bin/ecryptfs-rewrite-file")
3808 (string-append out "/bin/ecryptfs-rewrite-file"))
3809 (("/usr/bin/ecryptfs-setup-private")
3810 (string-append out "/bin/ecryptfs-setup-private"))
3811 (("/sbin/cryptsetup")
3812 (string-append cryptsetup "/sbin/cryptsetup"))
3813 (("/sbin/unix_chkpwd")
3814 (string-append linux-pam "/sbin/unix_chkpwd"))
3815 (("/sbin/dmsetup")
3816 (string-append lvm2 "/sbin/dmsetup")))))))))
3817 (native-inputs
3818 `(("intltool" ,intltool)
3819 ("perl" ,perl) ; for pod2man
3820 ("pkg-config" ,pkg-config)))
3821 (inputs
3822 `(("keyutils" ,keyutils)
3823 ("linux-pam" ,linux-pam)
3824 ("utils-linux" ,util-linux)
3825 ("cryptsetup" ,cryptsetup)
3826 ("lvm2" ,lvm2)
3827 ("nss" ,nss)))
3828 (home-page "http://ecryptfs.org/")
3829 (synopsis "eCryptfs cryptographic file system utilities")
3830 (description
3831 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3832 Each file's cryptographic meta-data is stored inside the file itself, along
3833 with the encrypted contents. This allows individual encrypted files to be
3834 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3835 native Linux file system, and has been part of the Linux kernel since version
3836 2.6.19. This package contains the userland utilities to manage it.")
3837 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3838 ;; grant additional permission to link with OpenSSL.
3839 (license license:gpl2+)))
3840
3841 (define-public libnfsidmap
3842 (package
3843 (name "libnfsidmap")
3844 (version "0.27")
3845 (source
3846 (origin
3847 (method url-fetch)
3848 (uri (string-append "https://fedorapeople.org/~steved/"
3849 name "/" version "/" name "-" version ".tar.bz2"))
3850 (sha256
3851 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
3852 (build-system gnu-build-system)
3853 (arguments
3854 `(#:configure-flags (list
3855 (string-append "--with-pluginpath="
3856 (assoc-ref %outputs "out")
3857 "/lib/libnfsidmap"))))
3858 (native-inputs
3859 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
3860 (home-page
3861 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3862 (synopsis "NFSv4 support library for name/ID mapping")
3863 (description "Libnfsidmap is a library holding mulitiple methods of
3864 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3865 extensible array of mapping functions, currently consisting of two choices:
3866 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3867 (license (license:non-copyleft "file://COPYING"
3868 "See COPYING in the distribution."))))
3869
3870 (define-public module-init-tools
3871 (package
3872 (name "module-init-tools")
3873 (version "3.16")
3874 (source (origin
3875 (method url-fetch)
3876 (uri (string-append
3877 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3878 "module-init-tools-" version ".tar.bz2"))
3879 (sha256
3880 (base32
3881 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3882 (patches (search-patches "module-init-tools-moduledir.patch"))))
3883 (build-system gnu-build-system)
3884 (arguments
3885 ;; FIXME: The upstream tarball lacks man pages, and building them would
3886 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3887 ;; but they vanished. In the meantime, fake it.
3888 '(#:phases
3889 (modify-phases %standard-phases
3890 (add-before 'configure 'fake-docbook
3891 (lambda _
3892 (substitute* "Makefile.in"
3893 (("^DOCBOOKTOMAN.*$")
3894 "DOCBOOKTOMAN = true\n"))
3895 #t)))))
3896 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3897 (synopsis "Tools for loading and managing Linux kernel modules")
3898 (description
3899 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3900 `insmod', `lsmod', and more.")
3901 (license license:gpl2+)))
3902
3903 (define-public mcelog
3904 (package
3905 (name "mcelog")
3906 (version "154")
3907 (source (origin
3908 (method url-fetch)
3909 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3910 "mcelog.git/snapshot/v" version ".tar.gz"))
3911 (sha256
3912 (base32
3913 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
3914 (file-name (string-append name "-" version ".tar.gz"))
3915 (modules '((guix build utils)))
3916 (snippet
3917 `(begin
3918 ;; The snapshots lack a .git directory,
3919 ;; breaking ‘git describe’.
3920 (substitute* "Makefile"
3921 (("\"unknown\"") (string-append "\"v" ,version "\"")))
3922 #t))))
3923 (build-system gnu-build-system)
3924 (arguments
3925 `(#:phases (modify-phases %standard-phases
3926 (delete 'configure)) ; no configure script
3927 #:make-flags (let ((out (assoc-ref %outputs "out")))
3928 (list "CC=gcc"
3929 (string-append "prefix=" out)
3930 (string-append "DOCDIR=" out "/share/doc/mcelog")
3931 "etcprefix=$(DOCDIR)/examples"))
3932 ;; The tests will only run as root on certain supported CPU models.
3933 #:tests? #f))
3934 (supported-systems (list "i686-linux" "x86_64-linux"))
3935 (home-page "https://mcelog.org/")
3936 (synopsis "Machine check monitor for x86 Linux systems")
3937 (description
3938 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3939 and other hardware errors on x86 systems. It can also perform user-defined
3940 tasks, such as bringing bad pages off-line, when configurable error thresholds
3941 are exceeded.")
3942 (license license:gpl2)))
3943
3944 (define-public mtd-utils
3945 (package
3946 (name "mtd-utils")
3947 (version "2.0.2")
3948 (source (origin
3949 (method url-fetch)
3950 (uri (string-append
3951 "ftp://ftp.infradead.org/pub/mtd-utils/"
3952 "mtd-utils-" version ".tar.bz2"))
3953 (sha256
3954 (base32
3955 "1f30jszknc5v6ykmil8ajxgksmcg54q3rsp84jsancp9x0dycggv"))))
3956 (arguments
3957 '(#:configure-flags '("--enable-unit-tests")))
3958 (native-inputs
3959 `(("cmocka" ,cmocka)
3960 ("pkg-config" ,pkg-config)))
3961 (inputs
3962 `(("acl" ,acl) ; for XATTR
3963 ("libuuid" ,util-linux)
3964 ("lzo" ,lzo)
3965 ("zlib" ,zlib)))
3966 (build-system gnu-build-system)
3967 (synopsis "MTD Flash Storage Utilities")
3968 (description "This package provides utilities for testing, partitioning, etc
3969 of flash storage.")
3970 (home-page "http://www.linux-mtd.infradead.org/")
3971 (license
3972 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3973 license:mpl1.1 ; All ftl* files
3974 license:expat)))) ; libiniparser
3975
3976 (define-public libseccomp
3977 (package
3978 (name "libseccomp")
3979 (version "2.3.3")
3980 (source (origin
3981 (method url-fetch)
3982 (uri (string-append "https://github.com/seccomp/libseccomp/"
3983 "releases/download/v" version
3984 "/libseccomp-" version ".tar.gz"))
3985 (sha256
3986 (base32
3987 "0mdiyfljrkfl50q1m3ws8yfcyfjwf1zgkvcva8ffcwncji18zhkz"))))
3988 (build-system gnu-build-system)
3989 (native-inputs
3990 `(("which" ,which)))
3991 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3992 (description "The libseccomp library provides an easy to use, platform
3993 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3994 libseccomp API is designed to abstract away the underlying BPF based syscall
3995 filter language and present a more conventional function-call based filtering
3996 interface that should be familiar to, and easily adopted by, application
3997 developers.")
3998 (home-page "https://github.com/seccomp/libseccomp")
3999 (license license:lgpl2.1)))
4000
4001 (define-public radeontop
4002 (package
4003 (name "radeontop")
4004 (version "1.1")
4005 (home-page "https://github.com/clbr/radeontop/")
4006 (source (origin
4007 (method url-fetch)
4008 (uri (string-append home-page "archive/v" version ".tar.gz"))
4009 (file-name (string-append name "-" version ".tar.gz"))
4010 (sha256
4011 (base32
4012 "1fv06j5c99imvzkac3j40lgjhr5b2i77fnyffhlvj92bli1fm1c6"))))
4013 (build-system gnu-build-system)
4014 (arguments
4015 `(#:phases (modify-phases %standard-phases
4016 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4017 ;; dependency, and doesn't even work on release(!) tarballs.
4018 (add-after 'unpack 'report-correct-version
4019 (lambda _ (substitute* "getver.sh"
4020 (("ver=unknown")
4021 (string-append "ver=" ,version)))))
4022 (delete 'configure)) ; no configure script
4023 #:make-flags (list "CC=gcc"
4024 (string-append "PREFIX=" %output))
4025 #:tests? #f)) ; no tests
4026 (native-inputs
4027 `(("gettext" ,gettext-minimal)
4028 ("pkg-config" ,pkg-config)))
4029 (inputs
4030 `(("libdrm" ,libdrm)
4031 ("libpciaccess" ,libpciaccess)
4032 ("libxcb" ,libxcb)
4033 ("ncurses" ,ncurses)))
4034 (synopsis "Usage monitor for AMD Radeon graphics")
4035 (description "RadeonTop monitors resource consumption on supported AMD
4036 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4037 a terminal or saved to a file for further processing. It measures both the
4038 activity of the GPU as a whole, which is also accurate during OpenCL
4039 computations, as well as separate component statistics that are only meaningful
4040 under OpenGL graphics workloads.")
4041 (license license:gpl3)))
4042
4043 (define-public efivar
4044 (package
4045 (name "efivar")
4046 (version "35")
4047 (source (origin
4048 (method url-fetch)
4049 (uri (string-append "https://github.com/rhboot/" name
4050 "/releases/download/" version "/" name
4051 "-" version ".tar.bz2"))
4052 (sha256
4053 (base32
4054 "153k2ifyl4giz5fkryxhz8z621diqjy7v25hfga4z94rs32ks0qy"))))
4055 (build-system gnu-build-system)
4056 (arguments
4057 `(;; Tests require a UEFI system and is not detected in the chroot.
4058 #:tests? #f
4059 #:make-flags (list (string-append "prefix=" %output)
4060 (string-append "libdir=" %output "/lib")
4061 "CC_FOR_BUILD=gcc"
4062 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4063 #:phases
4064 (modify-phases %standard-phases
4065 (delete 'configure))))
4066 (native-inputs
4067 `(("pkg-config" ,pkg-config)))
4068 (inputs
4069 `(("popt" ,popt)))
4070 (home-page "https://github.com/rhboot/efivar")
4071 (synopsis "Tool and library to manipulate EFI variables")
4072 (description "This package provides a library and a command line
4073 interface to the variable facility of UEFI boot firmware.")
4074 (license license:lgpl2.1+)))
4075
4076 (define-public efibootmgr
4077 (package
4078 (name "efibootmgr")
4079 (version "16")
4080 (source (origin
4081 (method url-fetch)
4082 (uri (string-append "https://github.com/rhinstaller/" name
4083 "/releases/download/" version "/" name
4084 "-" version ".tar.bz2"))
4085 (sha256
4086 (base32
4087 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
4088 (build-system gnu-build-system)
4089 (arguments
4090 `(#:tests? #f ; No tests.
4091 #:make-flags (list (string-append "prefix=" %output)
4092 (string-append "libdir=" %output "/lib")
4093 ;; EFIDIR denotes a subdirectory relative to the
4094 ;; EFI System Partition where the loader will be
4095 ;; installed (known as OS_VENDOR in the code).
4096 ;; GRUB overrides this, as such it's only used if
4097 ;; nothing else is specified on the command line.
4098 "EFIDIR=gnu"
4099 ;; Override CFLAGS to add efivar include directory.
4100 (string-append "CFLAGS=-O2 -g -flto -I"
4101 (assoc-ref %build-inputs "efivar")
4102 "/include/efivar"))
4103 #:phases (modify-phases %standard-phases (delete 'configure))))
4104 (native-inputs
4105 `(("pkg-config" ,pkg-config)))
4106 (inputs
4107 `(("efivar" ,efivar)
4108 ("popt" ,popt)))
4109 (home-page "https://github.com/rhinstaller/efibootmgr")
4110 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4111 (description
4112 "@code{efibootmgr} is a user-space application to modify the Intel
4113 Extensible Firmware Interface (EFI) Boot Manager. This application can
4114 create and destroy boot entries, change the boot order, change the next
4115 running boot option, and more.")
4116 (license license:gpl2+)))
4117
4118 (define-public sysstat
4119 (package
4120 (name "sysstat")
4121 (version "11.4.3")
4122 (source (origin
4123 (method url-fetch)
4124 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
4125 "sysstat-" version ".tar.xz"))
4126 (sha256
4127 (base32
4128 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
4129 (build-system gnu-build-system)
4130 (arguments
4131 `(#:tests? #f ; No test suite.
4132 ;; Without this flag, it tries to install the man pages with group 'root'
4133 ;; and fails because /etc/passwd lacks an entry for the root user.
4134 #:configure-flags
4135 (list "--disable-file-attr"
4136 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4137 #:phases
4138 (modify-phases %standard-phases
4139 ;; The build process tries to create '/var/lib/sa', so we skip that
4140 ;; instruction.
4141 (add-after 'build 'skip-touching-var
4142 (lambda _
4143 (substitute* "Makefile"
4144 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4145 ""))
4146 #t)))))
4147 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4148 (synopsis "Performance monitoring tools for Linux")
4149 (description "The sysstat utilities are a collection of performance
4150 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4151 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4152 @code{sadf} and @code{sa}.")
4153 (license license:gpl2+)))
4154
4155 (define-public light
4156 (package
4157 (name "light")
4158 (version "1.2")
4159 (source (origin
4160 (method url-fetch)
4161 (uri (string-append
4162 "https://github.com/haikarainen/light/archive/v"
4163 version ".tar.gz"))
4164 (sha256
4165 (base32
4166 "1gfvsw7gh5pis733l7j54vzp272pvjyzbg8a0pvapfmg0s7mip97"))
4167 (file-name (string-append name "-" version ".tar.gz"))))
4168 (build-system gnu-build-system)
4169 (native-inputs
4170 `(("autoconf" ,autoconf)
4171 ("automake" ,automake)))
4172 (home-page "https://haikarainen.github.io/light/")
4173 (synopsis "GNU/Linux application to control backlights")
4174 (description
4175 "Light is a program to send commands to screen backlight controllers
4176 under GNU/Linux. Features include:
4177
4178 @itemize
4179 @item It does not rely on X.
4180 @item Light can automatically figure out the best controller to use, making
4181 full use of underlying hardware.
4182 @item It is possible to set a minimum brightness value, as some controllers
4183 set the screen to be pitch black at a vaĺue of 0 (or higher).
4184 @end itemize
4185
4186 Light is the successor of lightscript.")
4187 (license license:gpl3+)))
4188
4189 (define-public tlp
4190 (package
4191 (name "tlp")
4192 (version "1.1")
4193 (source (origin
4194 (method url-fetch)
4195 (uri (string-append
4196 "https://github.com/linrunner/"
4197 (string-upcase name)
4198 "/archive/" version ".tar.gz"))
4199 (file-name (string-append name "-" version ".tar.gz"))
4200 (sha256
4201 (base32
4202 "068hzmh90x600saynbl7iwg1pm0ywldn4jazyxx5y1fixs8s1qbn"))))
4203 (inputs `(("bash" ,bash)
4204 ("dbus" ,dbus)
4205 ("ethtool" ,ethtool)
4206 ("eudev" ,eudev)
4207 ("grep" ,grep)
4208 ("hdparm" ,hdparm)
4209 ("inetutils" ,inetutils)
4210 ("iw" ,iw)
4211 ("kmod" ,kmod)
4212 ("pciutils" ,pciutils)
4213 ("perl" ,perl)
4214 ("rfkill" ,rfkill)
4215 ("sed" ,sed)
4216 ("usbutils" ,usbutils)
4217 ("util-linux" ,util-linux)
4218 ("wireless-tools" ,wireless-tools)))
4219 (build-system gnu-build-system)
4220 (arguments
4221 `(#:phases
4222 (modify-phases %standard-phases
4223 (delete 'configure) ; no configure script
4224 (add-before 'build 'setenv
4225 (lambda* (#:key outputs #:allow-other-keys)
4226 (let ((out (assoc-ref outputs "out")))
4227 (setenv "TLP_WITH_SYSTEMD" "0")
4228 (setenv "TLP_NO_INIT" "1")
4229 (setenv "TLP_NO_PMUTILS" "1")
4230 (setenv "TLP_SBIN" (string-append out "/bin"))
4231 (setenv "TLP_BIN" (string-append out "/bin"))
4232 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
4233 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
4234 (setenv "TLP_CONF" "/etc/tlp")
4235 (setenv "TLP_SHCPL"
4236 (string-append out "/share/bash-completion/completions"))
4237 (setenv "TLP_MAN" (string-append out "/share/man"))
4238 (setenv "TLP_META" (string-append out "/share/metainfo"))
4239 #t)))
4240 (delete 'check) ; no tests
4241 (add-before 'install 'fix-installation
4242 (lambda _
4243 ;; Stop the Makefile from trying to create system directories.
4244 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))
4245 #t))
4246 (replace 'install
4247 (lambda _
4248 (invoke "make" "install-tlp" "install-man")
4249 #t))
4250 (add-after 'install 'wrap
4251 (lambda* (#:key inputs outputs #:allow-other-keys)
4252 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4253 (bin-files (find-files bin ".*")))
4254 (define (bin-directory input-name)
4255 (string-append (assoc-ref inputs input-name) "/bin"))
4256 (define (sbin-directory input-name)
4257 (string-append (assoc-ref inputs input-name) "/sbin"))
4258 (for-each (lambda (program)
4259 (wrap-program program
4260 `("PATH" ":" prefix
4261 ,(append
4262 (map bin-directory '("bash"
4263 "coreutils"
4264 "dbus"
4265 "eudev"
4266 "grep"
4267 "inetutils"
4268 "kmod"
4269 "perl"
4270 "sed"
4271 "usbutils"
4272 "util-linux"))
4273 (map sbin-directory '("ethtool"
4274 "hdparm"
4275 "iw"
4276 "pciutils"
4277 "rfkill"
4278 "wireless-tools"))))))
4279 bin-files)
4280 #t))))))
4281 (home-page "http://linrunner.de/en/tlp/tlp.html")
4282 (synopsis "Power management tool for Linux")
4283 (description "TLP is a power management tool for Linux. It comes with
4284 a default configuration already optimized for battery life. Nevertheless,
4285 TLP is customizable to fulfil system requirements. TLP settings are applied
4286 every time the power supply source is changed.")
4287
4288 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4289 ;; rest is GPLv2+.
4290 (license (list license:gpl2+ license:gpl3+))))
4291
4292 (define-public lshw
4293 (package
4294 (name "lshw")
4295 (version "B.02.18")
4296 (source (origin
4297 (method url-fetch)
4298 (uri (string-append "https://www.ezix.org/software/"
4299 "files/lshw-" version
4300 ".tar.gz"))
4301 (sha256
4302 (base32
4303 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4304 (build-system gnu-build-system)
4305 (arguments
4306 `(#:phases (modify-phases %standard-phases (delete 'configure))
4307 #:tests? #f ; no tests
4308 #:make-flags
4309 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4310 (synopsis "List hardware information")
4311 (description
4312 "@command{lshw} (Hardware Lister) is a small tool to provide
4313 detailed information on the hardware configuration of the machine.
4314 It can report exact memory configuration, firmware version, mainboard
4315 configuration, CPU version and speed, cache configuration, bus speed,
4316 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4317 machines (PowerMac G4 is known to work).")
4318 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4319 (license license:gpl2+)))
4320
4321 (define-public libmnl
4322 (package
4323 (name "libmnl")
4324 (version "1.0.4")
4325 (source
4326 (origin
4327 (method url-fetch)
4328 (uri (string-append "mirror://netfilter.org/libmnl/"
4329 "libmnl-" version ".tar.bz2"))
4330 (sha256
4331 (base32
4332 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4333 (build-system gnu-build-system)
4334 (home-page "https://www.netfilter.org/projects/libmnl/")
4335 (synopsis "Netlink utility library")
4336 (description "Libmnl is a minimalistic user-space library oriented to
4337 Netlink developers. There are a lot of common tasks in parsing, validating,
4338 constructing of both the Netlink header and TLVs that are repetitive and easy to
4339 get wrong. This library aims to provide simple helpers that allows you to
4340 re-use code and to avoid re-inventing the wheel.")
4341 (license license:lgpl2.1+)))
4342
4343 (define-public libnftnl
4344 (package
4345 (name "libnftnl")
4346 (version "1.1.1")
4347 (source
4348 (origin
4349 (method url-fetch)
4350 (uri (string-append "mirror://netfilter.org/libnftnl/"
4351 "libnftnl-" version ".tar.bz2"))
4352 (sha256
4353 (base32
4354 "1wmgjfcb35mscb2srzia5931srygywrs1aznxmg67v177x0nasjx"))))
4355 (build-system gnu-build-system)
4356 (native-inputs
4357 `(("pkg-config" ,pkg-config)))
4358 (inputs
4359 `(("libmnl" ,libmnl)))
4360 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4361 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4362 (description "Libnftnl is a userspace library providing a low-level netlink
4363 programming interface to the in-kernel nf_tables subsystem. The library
4364 libnftnl has been previously known as libnftables. This library is currently
4365 used by nftables.")
4366 (license license:gpl2+)))
4367
4368 (define-public nftables
4369 (package
4370 (name "nftables")
4371 (version "0.8.1")
4372 (source
4373 (origin
4374 (method url-fetch)
4375 (uri (string-append "http://www.nftables.org/projects/nftables"
4376 "/files/nftables-" version ".tar.bz2"))
4377 (sha256
4378 (base32
4379 "1i1gfy8l7qyhc5vlrpp63s0n5kybmc9pi4dywiq8rmkhrrnddsla"))))
4380 (build-system gnu-build-system)
4381 (inputs `(("bison" ,bison)
4382 ("flex" ,flex)
4383 ("gmp" ,gmp)
4384 ("libmnl" ,libmnl)
4385 ("libnftnl" ,libnftnl)
4386 ("readline" ,readline)))
4387 (native-inputs `(("pkg-config" ,pkg-config)))
4388 (home-page "http://www.nftables.org")
4389 (synopsis "Userspace utility for Linux packet filtering")
4390 (description "nftables is the project that aims to replace the existing
4391 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4392 filtering framework, a new userspace utility and also a compatibility layer for
4393 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4394 infrastructure such as the existing hooks, the connection tracking system, the
4395 userspace queueing component and the logging subsystem.")
4396 (license license:gpl2)))
4397
4398 (define-public proot
4399 (package
4400 (name "proot")
4401 (version "5.1.0")
4402 (home-page "https://github.com/proot-me/PRoot")
4403 (source (origin
4404 (method url-fetch)
4405 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4406 (file-name (string-append name "-" version ".tar.gz"))
4407 (sha256
4408 (base32
4409 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4410 (patches (search-patches "proot-test-fhs.patch"))))
4411 (build-system gnu-build-system)
4412 (arguments
4413 '(#:make-flags '("-C" "src")
4414
4415 #:phases (modify-phases %standard-phases
4416 (delete 'configure)
4417 (add-before 'build 'set-shell-file-name
4418 (lambda* (#:key inputs #:allow-other-keys)
4419 (substitute* (find-files "src" "\\.[ch]$")
4420 (("\"/bin/sh\"")
4421 (string-append "\""
4422 (assoc-ref inputs "bash")
4423 "/bin/sh\"")))
4424 #t))
4425 (add-before 'check 'fix-fhs-assumptions-in-tests
4426 (lambda _
4427 (substitute* "tests/test-c6b77b77.mk"
4428 (("/bin/bash") (which "bash"))
4429 (("/usr/bin/test") (which "test")))
4430 (substitute* '("tests/test-16573e73.c")
4431 (("/bin/([a-z-]+)" _ program)
4432 (which program)))
4433
4434 (substitute* (find-files "tests" "\\.sh$")
4435 ;; Some of the tests try to "bind-mount" /bin/true.
4436 (("-b /bin/true:")
4437 (string-append "-b " (which "true") ":"))
4438 ;; Likewise for /bin.
4439 (("-b /bin:") "-b /gnu:")
4440 ;; Others try to run /bin/sh.
4441 (("/bin/sh") (which "sh"))
4442 ;; Others assume /etc/fstab exists.
4443 (("/etc/fstab") "/etc/passwd"))
4444
4445 (substitute* "tests/GNUmakefile"
4446 (("-b /bin:") "-b /gnu:"))
4447
4448 ;; XXX: This test fails in an obscure corner case, just
4449 ;; skip it.
4450 (delete-file "tests/test-kkkkkkkk.c")
4451
4452 #t))
4453 (replace 'check
4454 (lambda _
4455 (let ((n (parallel-job-count)))
4456 ;; For some reason we get lots of segfaults with
4457 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4458 (setenv "PROOT_NO_SECCOMP" "1")
4459
4460 ;; Most of the tests expect "/bin" to be in $PATH so
4461 ;; they can run things that live in $ROOTFS/bin.
4462 (setenv "PATH"
4463 (string-append (getenv "PATH") ":/bin"))
4464
4465 (invoke "make" "check" "-C" "tests"
4466 ;;"V=1"
4467 "-j" (number->string n)))))
4468 (replace 'install
4469 (lambda* (#:key outputs #:allow-other-keys)
4470 ;; The 'install' rule does nearly nothing.
4471 (let* ((out (assoc-ref outputs "out"))
4472 (man1 (string-append out "/share/man/man1")))
4473 ;; TODO: 'make install-care' (does not even
4474 ;; build currently.)
4475 (invoke "make" "-C" "src" "install"
4476 (string-append "PREFIX=" out))
4477
4478 (mkdir-p man1)
4479 (copy-file "doc/proot/man.1"
4480 (string-append man1 "/proot.1"))
4481 #t))))))
4482 (native-inputs `(("which" ,which)
4483
4484 ;; For 'mcookie', used by some of the tests.
4485 ("util-linux" ,util-linux)))
4486 (inputs `(("talloc" ,talloc)))
4487 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4488 (description
4489 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4490 and @code{binfmt_misc}. This means that users don't need any privileges or
4491 setup to do things like using an arbitrary directory as the new root
4492 file system, making files accessible somewhere else in the file system
4493 hierarchy, or executing programs built for another CPU architecture
4494 transparently through QEMU user-mode. Also, developers can use PRoot as a
4495 generic process instrumentation engine thanks to its extension mechanism.
4496 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4497 available in the kernel Linux.")
4498 (license license:gpl2+)))
4499
4500 (define-public proot-static
4501 (package
4502 (inherit proot)
4503 (name "proot-static")
4504 (synopsis
4505 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4506 (inputs `(("talloc" ,talloc/static)))
4507 (arguments
4508 (substitute-keyword-arguments (package-arguments proot)
4509 ((#:make-flags flags)
4510 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4511 ((#:phases phases)
4512 `(modify-phases ,phases
4513 (add-after 'strip 'remove-store-references
4514 (lambda* (#:key outputs #:allow-other-keys)
4515 (let* ((out (assoc-ref outputs "out")))
4516 (with-directory-excursion out
4517 (remove-store-references "bin/proot")
4518 #t))))))
4519 ((#:allowed-references _ '("out"))
4520 '("out"))))))
4521
4522 (define-public cpuid
4523 (package
4524 (name "cpuid")
4525 (version "20180519")
4526 (source (origin
4527 (method url-fetch)
4528 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4529 version ".src.tar.gz"))
4530 (sha256
4531 (base32
4532 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
4533 (build-system gnu-build-system)
4534 (arguments
4535 '(#:make-flags '("CC=gcc")
4536 #:tests? #f ; no tests
4537 #:phases (modify-phases %standard-phases
4538 (delete 'configure) ; no configure script
4539 (add-before 'install 'fix-makefile
4540 (lambda* (#:key outputs #:allow-other-keys)
4541 (substitute* "Makefile"
4542 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4543 ;; Make the compressed manpages writable so that the
4544 ;; reset-gzip-timestamps phase does not error out.
4545 (substitute* "Makefile"
4546 (("-m 444") "-m 644"))
4547 #t)))))
4548 (inputs `(("perl" ,perl)))
4549 (supported-systems '("i686-linux" "x86_64-linux"))
4550 (home-page "http://www.etallen.com/cpuid.html")
4551 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4552 (description "cpuid dumps detailed information about the CPU(s) gathered
4553 from the CPUID instruction, and also determines the exact model of CPU(s). It
4554 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4555 NexGen, Rise, and SiS CPUs.")
4556 (license license:gpl2+)))
4557
4558 (define-public jmtpfs
4559 (package
4560 (name "jmtpfs")
4561 (version "0.5")
4562 (source
4563 (origin
4564 (method url-fetch)
4565 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4566 version ".tar.gz"))
4567 (file-name (string-append name "-" version ".tar.gz"))
4568 (sha256
4569 (base32
4570 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4571 (build-system gnu-build-system)
4572 (inputs
4573 `(("file" ,file)
4574 ("fuse" ,fuse)
4575 ("libmtp" ,libmtp)))
4576 (native-inputs
4577 `(("pkg-config" ,pkg-config)))
4578 (home-page "https://github.com/JasonFerrara/jmtpfs")
4579 (synopsis "Use a FUSE file system to access data over MTP")
4580 (description "jmtpfs uses FUSE (file system in userspace) to provide access
4581 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4582 the MTP device as a file system.")
4583 (license license:gpl3)))
4584
4585 (define-public procenv
4586 (package
4587 (name "procenv")
4588 (version "0.50")
4589 (source
4590 (origin
4591 (method url-fetch)
4592 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4593 version ".tar.gz"))
4594 (file-name (string-append name "-" version ".tar.gz"))
4595 (sha256
4596 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
4597 (build-system gnu-build-system)
4598 (arguments `(#:configure-flags '("--disable-silent-rules")))
4599 (native-inputs `(("pkg-config" ,pkg-config)))
4600 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4601 ("groff" ,groff) ; for tests
4602 ("libselinux" ,libselinux)))
4603 (synopsis "Utility to show process environment")
4604 (description "Procenv is a command-line tool that displays as much detail about
4605 itself and its environment as possible. It can be used as a test
4606 tool, to understand the type of environment a process runs in, and for
4607 comparing system environments.")
4608 (home-page "http://github.com/jamesodhunt/procenv/")
4609 (license license:gpl3+)))
4610
4611 (define-public libfabric
4612 (package
4613 (name "libfabric")
4614 (version "1.4.1")
4615 (source
4616 (origin
4617 (method url-fetch)
4618 (uri
4619 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4620 version "/libfabric-" version ".tar.bz2"))
4621 (sha256
4622 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4623 (build-system gnu-build-system)
4624 (inputs `(("rdma-core" ,rdma-core)
4625 ,@(match (%current-system)
4626 ((member (package-supported-systems psm))
4627 `(("psm" ,psm)))
4628 (_ `()))
4629 ("libnl" ,libnl)))
4630 (home-page "https://ofiwg.github.io/libfabric/")
4631 (synopsis "Open Fabric Interfaces")
4632 (description
4633 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4634 communication services to applications. OFI is best described as a collection
4635 of libraries and applications used to export fabric services. The key
4636 components of OFI are: application interfaces, provider libraries, kernel
4637 services, daemons, and test applications.
4638
4639 Libfabric is a core component of OFI. It is the library that defines and
4640 exports the user-space API of OFI, and is typically the only software that
4641 applications deal with directly. It works in conjunction with provider
4642 libraries, which are often integrated directly into libfabric.")
4643 (license (list license:bsd-2 license:gpl2)))) ;dual
4644
4645 (define-public psm
4646 (package
4647 (name "psm")
4648 (version "3.3.20170428")
4649 (home-page "https://github.com/intel/psm")
4650 (source
4651 (origin
4652 (method git-fetch)
4653 (uri (git-reference (url home-page)
4654 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
4655 (file-name (string-append "psm-" version ".tar.gz"))
4656 (sha256
4657 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
4658 (patches (search-patches
4659 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
4660 "psm-ldflags.patch" ; build shared lib with LDFLAGS
4661 "psm-repro.patch")))) ; reproducibility
4662 (build-system gnu-build-system)
4663 (inputs `(("libuuid" ,util-linux)))
4664 (arguments
4665 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
4666 ,(string-append "INSTALL_PREFIX=" %output)
4667 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4668 #:tests? #f
4669 #:phases (modify-phases %standard-phases
4670 (delete 'configure)
4671 (add-after 'unpack 'patch-/usr/include
4672 (lambda _
4673 (substitute* "Makefile"
4674 (("\\$\\{DESTDIR}/usr/include")
4675 (string-append %output "/include")))
4676 (substitute* "Makefile"
4677 (("/lib64") "/lib"))
4678 #t)))))
4679 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
4680 (description
4681 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
4682 communications interface for the True Scale family of products. PSM users are
4683 enabled with mechanisms necessary to implement higher level communications
4684 interfaces in parallel environments.")
4685 ;; Only Intel-compatable processors are supported.
4686 (supported-systems '("i686-linux" "x86_64-linux"))
4687 (license (list license:bsd-2 license:gpl2)))) ;dual
4688
4689 (define-public snapscreenshot
4690 (package
4691 (name "snapscreenshot")
4692 (version "1.0.14.3")
4693 (source
4694 (origin
4695 (method url-fetch)
4696 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
4697 name "-" version ".tar.bz2"))
4698 (sha256
4699 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
4700 (build-system gnu-build-system)
4701 (arguments
4702 `(#:make-flags
4703 (let ((out (assoc-ref %outputs "out")))
4704 (list (string-append "BINDIR=" out "/bin")
4705 (string-append "MANDIR=" out "/share/man")))
4706 #:tests? #f ; no test suite
4707 #:phases
4708 (modify-phases %standard-phases
4709 (delete 'configure) ; ./configure is a snarky no-op
4710 (add-before 'install 'fix-ownership
4711 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
4712 (lambda _
4713 (substitute* "depfun.mak"
4714 ((" -o bin -g bin ") " "))
4715 #t))
4716 (add-before 'install 'create-output-directories
4717 (lambda* (#:key outputs #:allow-other-keys)
4718 (let ((out (assoc-ref outputs "out")))
4719 (mkdir-p (string-append out "/share/man/man1"))
4720 #t))))))
4721 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
4722 (synopsis "Take screenshots of one or more Linux text consoles")
4723 (description
4724 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
4725 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
4726 relevant @file{/dev/vcs*} file(s).")
4727 (license license:gpl2)))
4728
4729 (define-public fbcat
4730 (package
4731 (name "fbcat")
4732 (version "0.5.1")
4733 (source
4734 (origin
4735 (method url-fetch)
4736 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
4737 version "/" name "-" version ".tar.gz"))
4738 (sha256
4739 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
4740 (build-system gnu-build-system)
4741 (inputs
4742 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
4743 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
4744 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
4745 `(("pnmtopng" ,netpbm)))
4746 (outputs (list "out" "fbgrab"))
4747 (arguments
4748 `(#:make-flags
4749 (list "CC=gcc"
4750 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4751 #:tests? #f ; no tests
4752 #:phases
4753 (modify-phases %standard-phases
4754 (delete 'configure) ; no configure script
4755 (add-after 'build 'qualify-references
4756 (lambda* (#:key inputs outputs #:allow-other-keys)
4757 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
4758 (out (assoc-ref outputs "out")))
4759 (substitute* "fbgrab"
4760 (("fbcat" all)
4761 (string-append out "/bin/" all))
4762 (("pnmtopng" all)
4763 (string-append pnmtopng "/bin/" all)))
4764 #t)))
4765 (add-after 'install 'split-fbgrab-output
4766 (lambda* (#:key outputs #:allow-other-keys)
4767 (let* ((out (assoc-ref outputs "out"))
4768 (out:fbgrab (assoc-ref outputs "fbgrab")))
4769 (for-each (lambda (file)
4770 (let ((old (string-append out "/" file))
4771 (new (string-append out:fbgrab "/" file)))
4772 (mkdir-p (dirname new))
4773 (rename-file old new)))
4774 (list "bin/fbgrab"
4775 "share/man/man1/fbgrab.1"))
4776 #t))))))
4777 (home-page "https://jwilk.net/software/fbcat")
4778 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
4779 (description
4780 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
4781 a dump therof. It supports a wide range of drivers and pixel formats.
4782 @command{fbcat} can take screenshots of virtually any application that can be
4783 made to write its output to the framebuffer, including (but not limited to)
4784 text-mode or graphical applications that don't use a display server.
4785
4786 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
4787 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
4788 (license license:gpl2)))
4789
4790 (define-public libcgroup
4791 (package
4792 (name "libcgroup")
4793 (version "0.41")
4794 (source
4795 (origin
4796 (method url-fetch)
4797 (uri (string-append
4798 "mirror://sourceforge/libcg/" name "/"
4799 version "/" name "-" version ".tar.bz2"))
4800 (sha256
4801 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
4802 (build-system gnu-build-system)
4803 (arguments
4804 `(#:tests? #f))
4805 (native-inputs
4806 `(("bison" ,bison)
4807 ("flex" ,flex)))
4808 (inputs
4809 `(("linux-pam" ,linux-pam)))
4810 (home-page "https://sourceforge.net/projects/libcg/")
4811 (synopsis "Control groups management tools")
4812 (description "Control groups is Linux kernel method for process resource
4813 restriction, permission handling and more. This package provides userspace
4814 interface to this kernel feature.")
4815 (license license:lgpl2.1)))
4816
4817 (define-public mbpfan
4818 (package
4819 (name "mbpfan")
4820 (version "2.1.0")
4821 (source
4822 (origin
4823 (method git-fetch)
4824 (uri (git-reference
4825 (url "https://github.com/dgraziotin/mbpfan.git")
4826 (commit (string-append "v" version))))
4827 (file-name (git-file-name name version))
4828 (sha256
4829 (base32
4830 "1gysq778rkl6dvvj9a1swxcl15wvz0bng5bn4nwq118cl8p8pask"))))
4831 (build-system gnu-build-system)
4832 (arguments
4833 '(#:tests? #f ; tests ask to be run as root
4834 #:make-flags (let ((out (assoc-ref %outputs "out")))
4835 (list (string-append "DESTDIR=" out)
4836 "CC=gcc"))
4837 #:phases
4838 (modify-phases %standard-phases
4839 (add-after 'unpack 'patch-paths
4840 (lambda _
4841 (substitute* "Makefile"
4842 (("/usr") ""))
4843 #t))
4844 (delete 'configure)))) ; there's no configure phase
4845 (home-page "https://github.com/dgraziotin/mbpfan")
4846 (synopsis "Control fan speed on Macbooks")
4847 (description
4848 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
4849 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
4850 module. It can be executed as a daemon or in the foreground with root
4851 privileges.")
4852 (license license:gpl3+)))
4853
4854 (define-public psm2
4855 (package
4856 (name "psm2")
4857 (version "10.3-46")
4858 (source (origin
4859 (method git-fetch)
4860 (uri (git-reference
4861 (url "https://github.com/intel/opa-psm2.git")
4862 (commit (string-append "PSM2_" version))))
4863 (file-name (git-file-name name version))
4864 (sha256
4865 (base32
4866 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
4867 (build-system gnu-build-system)
4868 (arguments
4869 '(#:make-flags
4870 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4871 #:tests? #f
4872 #:phases (modify-phases %standard-phases
4873 (delete 'configure)
4874 (add-after 'unpack 'patch-Makefiles
4875 (lambda _
4876 (substitute* "Makefile"
4877 (("/lib64") "/lib")
4878 (("/usr") ""))
4879 (substitute* "compat/Makefile"
4880 (("/lib64") "/lib")
4881 (("/usr") ""))
4882 #t))
4883 (replace 'install
4884 (lambda _
4885 (setenv "DESTDIR" %output)
4886 (invoke "make" "install")
4887 #t)))))
4888 (inputs
4889 `(("rdma-core" ,rdma-core)
4890 ("numactl" ,numactl)))
4891 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
4892 (description
4893 "This package is low-level user-level Intel's communications interface.
4894 The PSM2 API is a high-performance vendor-specific protocol that provides a
4895 low-level communications interface for the Intel Omni-Path family of
4896 high-speed networking devices.")
4897 (home-page "https://github.com/intel/opa-psm2")
4898 ;; Only the x86_64 architecure is supported.
4899 (supported-systems '("x86_64-linux"))
4900 (license (list license:bsd-3 license:gpl2)))) ; dual
4901
4902 (define-public libpfm4
4903 (package
4904 (name "libpfm4")
4905 (version "4.9.0")
4906 (source (origin
4907 (method url-fetch)
4908 (uri (string-append "mirror://sourceforge/perfmon2/"
4909 name "/libpfm-" version ".tar.gz"))
4910 (sha256
4911 (base32
4912 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
4913 (build-system gnu-build-system)
4914 (arguments
4915 '(#:modules ((guix build utils)
4916 (guix build gnu-build-system))
4917 #:phases (modify-phases %standard-phases
4918 (delete 'configure)
4919 (delete 'check)
4920 (replace 'build
4921 (lambda* (#:key inputs outputs #:allow-other-keys)
4922 (let* ((out (assoc-ref outputs "out")))
4923 (setenv "CC" "gcc")
4924 (invoke "make")
4925 #t)))
4926 (replace 'install
4927 (lambda* (#:key outputs #:allow-other-keys)
4928 (let* ((out (assoc-ref outputs "out")))
4929 (invoke "make"
4930 (string-append "PREFIX=" out)
4931 "install")
4932 #t))))))
4933 (synopsis "Performance event monitoring library")
4934 (description
4935 "This package provides a library called libpfm4, which is used to develop
4936 monitoring tools exploiting the performance monitoring events such as those
4937 provided by the Performance Monitoring Unit (PMU) of modern processors.
4938
4939 Libpfm4 helps convert from an event name, expressed as a string, to the event
4940 encoding that is either the raw event as documented by the hardware vendor or
4941 the OS-specific encoding. In the latter case, the library is able to prepare
4942 the OS-specific data structures needed by the kernel to setup the event.
4943
4944 libpfm4 provides support for the @code{perf_events} interface, which was
4945 introduced in Linux 2.6.31.")
4946 (home-page "http://perfmon2.sourceforge.net/")
4947 (license license:expat)))
4948
4949 (define-public libnfnetlink
4950 (package
4951 (name "libnfnetlink")
4952 (version "1.0.1")
4953 (source (origin
4954 (method url-fetch)
4955 (uri (string-append
4956 "https://www.netfilter.org/projects/libnfnetlink/files/"
4957 "libnfnetlink-" version ".tar.bz2"))
4958 (sha256
4959 (base32
4960 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
4961 (build-system gnu-build-system)
4962 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
4963 (synopsis "Low-level netfilter netlink communication library")
4964 (description
4965 "@code{libnfnetlink} is the low-level library for netfilter related
4966 kernel/userspace communication. It provides a generic messaging
4967 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
4968 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
4969 management tools in userspace.")
4970 (license license:gpl2)))