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