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