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