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