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