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