gnu: linux-libre@4.4: Update to 4.4.60.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017 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 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017 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 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 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016 ng0 <ng0@libertad.pw>
22 ;;; Copyright © 2017 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 ;;;
27 ;;; This file is part of GNU Guix.
28 ;;;
29 ;;; GNU Guix is free software; you can redistribute it and/or modify it
30 ;;; under the terms of the GNU General Public License as published by
31 ;;; the Free Software Foundation; either version 3 of the License, or (at
32 ;;; your option) any later version.
33 ;;;
34 ;;; GNU Guix is distributed in the hope that it will be useful, but
35 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37 ;;; GNU General Public License for more details.
38 ;;;
39 ;;; You should have received a copy of the GNU General Public License
40 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41
42 (define-module (gnu packages linux)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages acl)
45 #:use-module (gnu packages admin)
46 #:use-module (gnu packages algebra)
47 #:use-module (gnu packages attr)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages base)
50 #:use-module (gnu packages bash)
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages calendar)
53 #:use-module (gnu packages check)
54 #:use-module (gnu packages crypto)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages databases)
57 #:use-module (gnu packages datastructures)
58 #:use-module (gnu packages docbook)
59 #:use-module (gnu packages documentation)
60 #:use-module (gnu packages elf)
61 #:use-module (gnu packages flex)
62 #:use-module (gnu packages freedesktop)
63 #:use-module (gnu packages gcc)
64 #:use-module (gnu packages gettext)
65 #:use-module (gnu packages glib)
66 #:use-module (gnu packages gnuzilla)
67 #:use-module (gnu packages gperf)
68 #:use-module (gnu packages gtk)
69 #:use-module (gnu packages libusb)
70 #:use-module (gnu packages man)
71 #:use-module (gnu packages maths)
72 #:use-module (gnu packages ncurses)
73 #:use-module (gnu packages networking)
74 #:use-module (gnu packages ninja)
75 #:use-module (gnu packages perl)
76 #:use-module (gnu packages pciutils)
77 #:use-module (gnu packages pkg-config)
78 #:use-module (gnu packages popt)
79 #:use-module (gnu packages pulseaudio)
80 #:use-module (gnu packages python)
81 #:use-module (gnu packages readline)
82 #:use-module (gnu packages rrdtool)
83 #:use-module (gnu packages slang)
84 #:use-module (gnu packages storage)
85 #:use-module (gnu packages texinfo)
86 #:use-module (gnu packages tls)
87 #:use-module (gnu packages valgrind)
88 #:use-module (gnu packages video)
89 #:use-module (gnu packages xiph)
90 #:use-module (gnu packages xml)
91 #:use-module (gnu packages xdisorg)
92 #:use-module (gnu packages xorg)
93 #:use-module (guix build-system cmake)
94 #:use-module (guix build-system gnu)
95 #:use-module (guix build-system python)
96 #:use-module (guix build-system trivial)
97 #:use-module (guix download)
98 #:use-module ((guix licenses) #:prefix license:)
99 #:use-module (guix packages)
100 #:use-module (guix utils)
101 #:use-module (srfi srfi-1)
102 #:use-module (srfi srfi-2)
103 #:use-module (srfi srfi-26)
104 #:use-module (ice-9 match))
105
106 (define-public (system->linux-architecture arch)
107 "Return the Linux architecture name for ARCH, a Guix system name such as
108 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
109 (let ((arch (car (string-split arch #\-))))
110 (cond ((string=? arch "i686") "i386")
111 ((string-prefix? "mips" arch) "mips")
112 ((string-prefix? "arm" arch) "arm")
113 ((string-prefix? "aarch64" arch) "arm64")
114 ((string-prefix? "alpha" arch) "alpha")
115 (else arch))))
116
117 (define-public (system->defconfig system)
118 "Some systems (notably powerpc-linux) require a special target for kernel
119 defconfig. Return the appropiate make target if applicable, otherwise return
120 \"defconfig\"."
121 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
122 (else "defconfig")))
123
124 (define (linux-libre-urls version)
125 "Return a list of URLs for Linux-Libre VERSION."
126 (list (string-append
127 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
128 version "-gnu/linux-libre-" version "-gnu.tar.xz")
129
130 ;; XXX: Work around <http://bugs.gnu.org/14851>.
131 (string-append
132 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
133 version "-gnu.tar.xz")
134
135 ;; Maybe this URL will become valid eventually.
136 (string-append
137 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
138 version "-gnu.tar.xz")))
139
140 (define-public linux-libre-headers
141 (package
142 (name "linux-libre-headers")
143 (version "4.4.47")
144 (source (origin
145 (method url-fetch)
146 (uri (linux-libre-urls version))
147 (sha256
148 (base32
149 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
150 (build-system gnu-build-system)
151 (native-inputs `(("perl" ,perl)))
152 (arguments
153 `(#:modules ((guix build gnu-build-system)
154 (guix build utils)
155 (srfi srfi-1))
156 #:phases
157 (modify-phases %standard-phases
158 (delete 'configure)
159 (replace 'build
160 (lambda _
161 (let ((arch ,(system->linux-architecture
162 (or (%current-target-system)
163 (%current-system))))
164 (defconfig ,(system->defconfig
165 (or (%current-target-system)
166 (%current-system)))))
167 (setenv "ARCH" arch)
168 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
169 (and (zero? (system* "make" defconfig))
170 (zero? (system* "make" "mrproper" "headers_check"))))))
171 (replace 'install
172 (lambda* (#:key outputs #:allow-other-keys)
173 (let ((out (assoc-ref outputs "out")))
174 (and (zero? (system* "make"
175 (string-append "INSTALL_HDR_PATH=" out)
176 "headers_install"))
177 (begin
178 (mkdir (string-append out "/include/config"))
179 (call-with-output-file
180 (string-append out
181 "/include/config/kernel.release")
182 (lambda (p)
183 (format p "~a-default~%" ,version)))
184
185 ;; Remove the '.install' and '..install.cmd' files; the
186 ;; latter contains store paths, which pulls in bootstrap
187 ;; binaries in the build environment, and prevents bit
188 ;; reproducibility for the bootstrap binaries.
189 (for-each delete-file (find-files out "\\.install"))
190
191 #t))))))
192 #:allowed-references ()
193 #:tests? #f))
194 (home-page "https://www.gnu.org/software/linux-libre/")
195 (synopsis "GNU Linux-Libre kernel headers")
196 (description "Headers of the Linux-Libre kernel.")
197 (license license:gpl2)))
198
199 (define %boot-logo-patch
200 ;; Linux-Libre boot logo featuring Freedo and a gnu.
201 (origin
202 (method url-fetch)
203 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
204 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
205 (sha256
206 (base32
207 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
208
209 (define* (kernel-config arch #:key variant)
210 "Return the absolute file name of the Linux-Libre build configuration file
211 for ARCH and optionally VARIANT, or #f if there is no such configuration."
212 (let* ((name (string-append (if variant (string-append variant "-") "")
213 (if (string=? "i386" arch) "i686" arch) ".conf"))
214 (file (string-append "linux-libre/" name)))
215 (search-auxiliary-file file)))
216
217 (define %default-extra-linux-options
218 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
219 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
220 ;; Modules required for initrd:
221 ("CONFIG_NET_9P" . m)
222 ("CONFIG_NET_9P_VIRTIO" . m)
223 ("CONFIG_VIRTIO_BLK" . m)
224 ("CONFIG_VIRTIO_NET" . m)
225 ("CONFIG_VIRTIO_PCI" . m)
226 ("CONFIG_VIRTIO_BALLOON" . m)
227 ("CONFIG_VIRTIO_MMIO" . m)
228 ("CONFIG_FUSE_FS" . m)
229 ("CONFIG_CIFS" . m)
230 ("CONFIG_9P_FS" . m)))
231
232 (define (config->string options)
233 (string-join (map (match-lambda
234 ((option . 'm)
235 (string-append option "=m"))
236 ((option . #t)
237 (string-append option "=y"))
238 ((option . #f)
239 (string-append option "=n")))
240 options)
241 "\n"))
242
243 (define* (make-linux-libre version hash supported-systems
244 #:key
245 ;; A function that takes an arch and a variant.
246 ;; See kernel-config for an example.
247 (extra-version #f)
248 (configuration-file #f)
249 (defconfig "defconfig")
250 (extra-options %default-extra-linux-options)
251 (patches (list %boot-logo-patch)))
252 (package
253 (name (if extra-version
254 (string-append "linux-libre-" extra-version)
255 "linux-libre"))
256 (version version)
257 (source (origin
258 (method url-fetch)
259 (uri (linux-libre-urls version))
260 (sha256 (base32 hash))
261 (patches patches)))
262 (supported-systems supported-systems)
263 (build-system gnu-build-system)
264 (native-inputs
265 `(("perl" ,perl)
266 ("bc" ,bc)
267 ("openssl" ,openssl)
268 ("kmod" ,kmod)
269 ,@(match (and configuration-file
270 (configuration-file
271 (system->linux-architecture
272 (or (%current-target-system) (%current-system)))
273 #:variant (version-major+minor version)))
274 (#f ;no config for this platform
275 '())
276 ((? string? config)
277 `(("kconfig" ,config))))))
278 (arguments
279 `(#:modules ((guix build gnu-build-system)
280 (guix build utils)
281 (srfi srfi-1)
282 (ice-9 match))
283 #:phases
284 (modify-phases %standard-phases
285 (replace 'configure
286 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
287 ;; Avoid introducing timestamps
288 (setenv "KCONFIG_NOTIMESTAMP" "1")
289 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
290
291 ;; Set ARCH and CROSS_COMPILE
292 (let ((arch ,(system->linux-architecture
293 (or (%current-target-system)
294 (%current-system)))))
295 (setenv "ARCH" arch)
296 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
297
298 (when target
299 (setenv "CROSS_COMPILE" (string-append target "-"))
300 (format #t "`CROSS_COMPILE' set to `~a'~%"
301 (getenv "CROSS_COMPILE"))))
302
303 (setenv "EXTRA_VERSION" ,extra-version)
304
305 (let ((build (assoc-ref %standard-phases 'build))
306 (config (assoc-ref inputs "kconfig")))
307
308 ;; Use a custom kernel configuration file or a default
309 ;; configuration file.
310 (if config
311 (begin
312 (copy-file config ".config")
313 (chmod ".config" #o666))
314 (system* "make" ,defconfig))
315
316 ;; Appending works even when the option wasn't in the
317 ;; file. The last one prevails if duplicated.
318 (let ((port (open-file ".config" "a"))
319 (extra-configuration ,(config->string extra-options)))
320 (display extra-configuration port)
321 (close-port port))
322
323 (zero? (system* "make" "oldconfig")))))
324 (replace 'install
325 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
326 (let* ((out (assoc-ref outputs "out"))
327 (moddir (string-append out "/lib/modules"))
328 (dtbdir (string-append out "/lib/dtbs"))
329 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
330 ;; Install kernel image, kernel configuration and link map.
331 (for-each (lambda (file) (install-file file out))
332 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
333 ;; Install device tree files
334 (for-each (lambda (file) (install-file file dtbdir))
335 (find-files "." "\\.dtb$"))
336 ;; Install kernel modules
337 (mkdir-p moddir)
338 (zero? (system* "make"
339 (string-append "DEPMOD=" kmod "/bin/depmod")
340 (string-append "MODULE_DIR=" moddir)
341 (string-append "INSTALL_PATH=" out)
342 (string-append "INSTALL_MOD_PATH=" out)
343 "INSTALL_MOD_STRIP=1"
344 "modules_install"))))))
345 #:tests? #f))
346 (home-page "https://www.gnu.org/software/linux-libre//")
347 (synopsis "100% free redistribution of a cleaned Linux kernel")
348 (description
349 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
350 It has been modified to remove all non-free binary blobs.")
351 (license license:gpl2)))
352
353 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
354
355 (define %linux-libre-version "4.10.8")
356 (define %linux-libre-hash "0936i2h9l4gn67gby9kx70w6zqv1nbzbgwssry6k11wrjwa2p8n4")
357
358 (define-public linux-libre
359 (make-linux-libre %linux-libre-version
360 %linux-libre-hash
361 %intel-compatible-systems
362 #:configuration-file kernel-config))
363
364 (define-public linux-libre-4.9
365 (make-linux-libre "4.9.20"
366 "0hnxylfnyz3xf7k3qcq2wri2wpbi2islngxjmqp445v1pzr4k9xp"
367 %intel-compatible-systems
368 #:configuration-file kernel-config))
369
370 (define-public linux-libre-4.4
371 (make-linux-libre "4.4.60"
372 "0rahii7nxfhn3zh289x4xpx4fk3nbij0jnrbvfpa59p15iamwyi2"
373 %intel-compatible-systems
374 #:configuration-file kernel-config))
375
376 (define-public linux-libre-4.1
377 (make-linux-libre "4.1.39"
378 "06pb3zpkfkc7pb7yh537vvzn8i9nhqyx58kqxv0wq23b4hhpza7d"
379 %intel-compatible-systems
380 #:configuration-file kernel-config
381 #:patches
382 (list %boot-logo-patch
383 (origin
384 (method url-fetch)
385 (uri "\
386 https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=5edabca9d4cff7f1f2b68f0bac55ef99d9798ba4")
387 (file-name "linux-libre-CVE-2017-6074.patch")
388 (sha256
389 (base32
390 "1x40slfz1qxgiaznyy13bwlh34450pkyyrkljpyjlx6c4mrzb1jj"))))))
391
392 (define-public linux-libre-arm-generic
393 (make-linux-libre %linux-libre-version
394 %linux-libre-hash
395 '("armhf-linux")
396 #:defconfig "multi_v7_defconfig"
397 #:extra-version "arm-generic"))
398
399 \f
400 ;;;
401 ;;; Pluggable authentication modules (PAM).
402 ;;;
403
404 (define-public linux-pam
405 (package
406 (name "linux-pam")
407 (version "1.3.0")
408 (source
409 (origin
410 (method url-fetch)
411 (uri (string-append
412 "http://www.linux-pam.org/library/"
413 "Linux-PAM-" version ".tar.bz2"))
414 (sha256
415 (base32
416 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
417 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
418
419 (build-system gnu-build-system)
420 (native-inputs
421 `(("flex" ,flex)
422
423 ;; TODO: optional dependencies
424 ;; ("libxcrypt" ,libxcrypt)
425 ;; ("cracklib" ,cracklib)
426 ))
427 (arguments
428 '(;; Most users, such as `shadow', expect the headers to be under
429 ;; `security'.
430 #:configure-flags (list (string-append "--includedir="
431 (assoc-ref %outputs "out")
432 "/include/security"))
433
434 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
435 ;; isn't available.
436 #:tests? #f))
437 (home-page "http://www.linux-pam.org/")
438 (synopsis "Pluggable authentication modules for Linux")
439 (description
440 "A *Free* project to implement OSF's RFC 86.0.
441 Pluggable authentication modules are small shared object files that can
442 be used through the PAM API to perform tasks, like authenticating a user
443 at login. Local and dynamic reconfiguration are its key features.")
444 (license license:bsd-3)))
445
446 (define-public linux-pam-1.2
447 (package
448 (inherit linux-pam)
449 (version "1.2.1")
450 (source
451 (origin
452 (method url-fetch)
453 (uri (string-append
454 "http://www.linux-pam.org/library/"
455 "Linux-PAM-" version ".tar.bz2"))
456 (sha256
457 (base32
458 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
459 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
460
461
462 ;;;
463 ;;; Miscellaneous.
464 ;;;
465
466 (define-public psmisc
467 (package
468 (name "psmisc")
469 (version "22.20")
470 (source
471 (origin
472 (method url-fetch)
473 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
474 version ".tar.gz"))
475 (sha256
476 (base32
477 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
478 (build-system gnu-build-system)
479 (inputs `(("ncurses" ,ncurses)))
480 (home-page "http://psmisc.sourceforge.net/")
481 (synopsis
482 "Small utilities that use the proc file system")
483 (description
484 "This PSmisc package is a set of some small useful utilities that
485 use the proc file system. We're not about changing the world, but
486 providing the system administrator with some help in common tasks.")
487 (license license:gpl2+)))
488
489 (define-public util-linux
490 (package
491 (name "util-linux")
492 (version "2.29.2")
493 (source (origin
494 (method url-fetch)
495 (uri (string-append "mirror://kernel.org/linux/utils/"
496 name "/v" (version-major+minor version) "/"
497 name "-" version ".tar.xz"))
498 (sha256
499 (base32
500 "1qz81w8vzrmy8xn9yx7ls4amkbgwx6vr62pl6kv9g7r0g3ba9kmc"))
501 (patches (search-patches "util-linux-tests.patch"))
502 (modules '((guix build utils)))
503 (snippet
504 ;; We take the 'logger' program from GNU Inetutils and 'kill'
505 ;; from GNU Coreutils.
506 '(begin
507 (substitute* "configure"
508 (("build_logger=yes") "build_logger=no")
509 (("build_kill=yes") "build_kill=no"))
510 #t))))
511 (build-system gnu-build-system)
512 (outputs '("out"
513 "static")) ; >2 MiB of static .a libraries
514 (arguments
515 `(#:configure-flags (list "--disable-use-tty-group"
516 "--enable-fs-paths-default=/run/current-system/profile/sbin"
517 ;; Install completions where our
518 ;; bash-completion package expects them.
519 (string-append "--with-bashcompletiondir="
520 (assoc-ref %outputs "out")
521 "/etc/bash_completion.d"))
522 #:phases (modify-phases %standard-phases
523 (add-before
524 'build 'set-umount-file-name
525 (lambda* (#:key outputs #:allow-other-keys)
526 ;; Tell 'eject' the right file name of 'umount'.
527 (let ((out (assoc-ref outputs "out")))
528 (substitute* "sys-utils/eject.c"
529 (("\"/bin/umount\"")
530 (string-append "\"" out "/bin/umount\"")))
531 #t)))
532 (add-before
533 'check 'pre-check
534 (lambda* (#:key inputs outputs #:allow-other-keys)
535 (let ((out (assoc-ref outputs "out"))
536 (net (assoc-ref inputs "net-base")))
537 ;; Change the test to refer to the right file.
538 (substitute* "tests/ts/misc/mcookie"
539 (("/etc/services")
540 (string-append net "/etc/services")))
541 #t)))
542 (add-after
543 'install 'move-static-libraries
544 (lambda* (#:key outputs #:allow-other-keys)
545 (let ((out (assoc-ref outputs "out"))
546 (static (assoc-ref outputs "static")))
547 (mkdir-p (string-append static "/lib"))
548 (with-directory-excursion out
549 (for-each (lambda (file)
550 (rename-file file
551 (string-append static "/"
552 file)))
553 (find-files "lib" "\\.a$")))
554 #t))))))
555 (inputs `(("zlib" ,zlib)
556 ("ncurses" ,ncurses)))
557 (native-inputs
558 `(("perl" ,perl)
559 ("net-base" ,net-base))) ;for tests
560 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
561 (synopsis "Collection of utilities for the Linux kernel")
562 (description "Util-linux is a diverse collection of Linux kernel
563 utilities. It provides dmesg and includes tools for working with file systems,
564 block devices, UUIDs, TTYs, and many other tools.")
565
566 ;; Note that util-linux doesn't use the same license for all the
567 ;; code. GPLv2+ is the default license for a code without an
568 ;; explicitly defined license.
569 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
570 license:bsd-4 license:public-domain))))
571
572 (define-public procps
573 (package
574 (name "procps")
575 (version "3.3.12")
576 (source (origin
577 (method url-fetch)
578 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
579 "procps-ng-" version ".tar.xz"))
580 (sha256
581 (base32
582 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
583 (build-system gnu-build-system)
584 (arguments
585 '(#:modules ((guix build utils)
586 (guix build gnu-build-system)
587 (srfi srfi-1)
588 (srfi srfi-26))
589 #:phases
590 (modify-phases %standard-phases
591 (add-before 'check 'disable-strtod-test
592 (lambda _
593 ;; Disable the 'strtod' test, which fails on 32-bit systems.
594 ;; This is what upstream does:
595 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
596 (substitute* "Makefile"
597 (("^(TESTS|check_PROGRAMS) = .*$" all)
598 (string-append "# " all "\n")))
599 #t))
600 (add-after
601 'install 'post-install
602 ;; Remove commands and man pages redudant with
603 ;; Coreutils.
604 (lambda* (#:key outputs #:allow-other-keys)
605 (let* ((out (assoc-ref outputs "out"))
606 (dup (append-map (cut find-files out <>)
607 '("^kill" "^uptime"))))
608 (for-each delete-file dup)
609 #t))))))
610 (inputs `(("ncurses" ,ncurses)))
611 (home-page "https://gitlab.com/procps-ng/procps/")
612 (synopsis "Utilities that give information about processes")
613 (description
614 "Procps is the package that has a bunch of small useful utilities
615 that give information about processes using the Linux /proc file system.
616 The package includes the programs ps, top, vmstat, w, kill, free,
617 slabtop, and skill.")
618 (license license:gpl2)))
619
620 (define-public usbutils
621 (package
622 (name "usbutils")
623 (version "008")
624 (source
625 (origin
626 (method url-fetch)
627 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
628 "usbutils-" version ".tar.xz"))
629 (sha256
630 (base32
631 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
632 (build-system gnu-build-system)
633 (inputs
634 `(("libusb" ,libusb)
635 ("eudev" ,eudev-with-hwdb)))
636 (native-inputs
637 `(("pkg-config" ,pkg-config)))
638 (home-page "http://www.linux-usb.org/")
639 (synopsis
640 "Tools for working with USB devices, such as lsusb")
641 (description
642 "Tools for working with USB devices, such as lsusb.")
643 (license license:gpl2+)))
644
645 (define-public e2fsprogs
646 (package
647 (name "e2fsprogs")
648 (version "1.42.13")
649 (source (origin
650 (method url-fetch)
651 (uri (string-append
652 "mirror://kernel.org/linux/kernel/people/tytso/"
653 name "/v" version "/"
654 name "-" version ".tar.xz"))
655 (sha256
656 (base32
657 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
658 (modules '((guix build utils)))
659 (snippet
660 '(begin
661 (substitute* "MCONFIG.in"
662 (("INSTALL_SYMLINK = /bin/sh")
663 "INSTALL_SYMLINK = sh"))
664
665 ;; Do not include a timestamp in libext2fs.info.gz.
666 (substitute* "doc/Makefile.in"
667 (("gzip -9")
668 "gzip -9n"))))))
669 (build-system gnu-build-system)
670 (inputs `(("util-linux" ,util-linux)))
671 (native-inputs `(("pkg-config" ,pkg-config)
672 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
673 (arguments
674 '(;; Parallel building reliably yields a failure like this:
675 ;; "make[2]: *** No rule to make target '../lib/libss.so', needed by
676 ;; 'debugfs'. Stop."
677 #:parallel-build? #f
678 ;; util-linux is the preferred source for some of the libraries and
679 ;; commands, so disable them (see, e.g.,
680 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
681 #:configure-flags '("--disable-libblkid"
682 "--disable-libuuid" "--disable-uuidd"
683 "--disable-fsck"
684
685 ;; Use symlinks instead of hard links for
686 ;; 'fsck.extN' etc. This makes the resulting nar
687 ;; smaller and is preserved across copies.
688 "--enable-symlink-install"
689
690 ;; Install libext2fs et al.
691 "--enable-elf-shlibs")
692
693 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
694 (assoc-ref %outputs "out")
695 "/lib"))
696
697 #:phases (alist-cons-before
698 'configure 'patch-shells
699 (lambda _
700 (substitute* "configure"
701 (("/bin/sh (.*)parse-types.sh" _ dir)
702 (string-append (which "sh") " " dir
703 "parse-types.sh")))
704 (substitute* (find-files "." "^Makefile.in$")
705 (("#!/bin/sh")
706 (string-append "#!" (which "sh")))))
707 (alist-cons-after
708 'install 'install-libs
709 (lambda* (#:key outputs #:allow-other-keys)
710 (let* ((out (assoc-ref outputs "out"))
711 (lib (string-append out "/lib")))
712 (and (zero? (system* "make" "install-libs"))
713
714 ;; Make the .a writable so that 'strip' works.
715 ;; Failing to do that, due to debug symbols, we
716 ;; retain a reference to the final
717 ;; linux-libre-headers, which refer to the
718 ;; bootstrap binaries.
719 (let ((archives (find-files lib "\\.a$")))
720 (for-each (lambda (file)
721 (chmod file #o666))
722 archives)
723 #t))))
724 %standard-phases))
725
726 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
727 ;; they fail because we get an extra line that says "Can't check if
728 ;; file system is mounted due to missing mtab file".
729 #:tests? #f))
730 (home-page "http://e2fsprogs.sourceforge.net/")
731 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
732 (description
733 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
734 (license (list license:gpl2 ;programs
735 license:lgpl2.0 ;libext2fs
736 license:x11)))) ;libuuid
737
738 (define e2fsprogs/static
739 (static-package
740 (package (inherit e2fsprogs)
741 (arguments
742 ;; Do not build shared libraries.
743 (substitute-keyword-arguments (package-arguments e2fsprogs)
744 ((#:configure-flags _)
745 '(list "--disable-blkid"))
746 ((#:make-flags _)
747 '(list)))))))
748
749 (define-public e2fsck/static
750 (package
751 (name "e2fsck-static")
752 (version (package-version e2fsprogs))
753 (build-system trivial-build-system)
754 (source #f)
755 (inputs
756 `(("e2fsprogs" ,e2fsprogs/static)))
757 (arguments
758 `(#:modules ((guix build utils))
759 #:builder
760 (begin
761 (use-modules (guix build utils)
762 (ice-9 ftw)
763 (srfi srfi-26))
764
765 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
766 "/sbin/e2fsck"))
767 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
768 (mkdir-p bin)
769 (with-directory-excursion bin
770 (copy-file e2fsck "e2fsck")
771 (remove-store-references "e2fsck")
772 (chmod "e2fsck" #o555))))))
773 (home-page (package-home-page e2fsprogs))
774 (synopsis "Statically-linked e2fsck command from e2fsprogs")
775 (description "This package provides statically-linked e2fsck command taken
776 from the e2fsprogs package. It is meant to be used in initrds.")
777 (license (package-license e2fsprogs))))
778
779 (define-public extundelete
780 (package
781 (name "extundelete")
782 (version "0.2.4")
783 (source (origin
784 (method url-fetch)
785 (uri (string-append "mirror://sourceforge/extundelete/"
786 "extundelete/" version "/extundelete-"
787 version ".tar.bz2"))
788 (sha256
789 (base32
790 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
791 (build-system gnu-build-system)
792 (inputs `(("e2fsprogs" ,e2fsprogs)))
793 (home-page "http://extundelete.sourceforge.net/")
794 (synopsis "Recover deleted files from ext2/3/4 partitions")
795 (description
796 "Extundelete is a set of tools that can recover deleted files from an
797 ext3 or ext4 partition.")
798 (license license:gpl2)))
799
800 (define-public zerofree
801 (package
802 (name "zerofree")
803 (version "1.0.3")
804 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
805 (source (origin
806 (method url-fetch)
807 (uri (string-append home-page name "-" version
808 ".tgz"))
809 (sha256
810 (base32
811 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
812 (build-system gnu-build-system)
813 (arguments
814 '(#:phases (alist-replace
815 'install
816 (lambda* (#:key outputs #:allow-other-keys)
817 (let* ((out (assoc-ref outputs "out"))
818 (bin (string-append out "/bin")))
819 (mkdir-p bin)
820 (copy-file "zerofree"
821 (string-append bin "/zerofree"))
822 (chmod (string-append bin "/zerofree")
823 #o555)
824 #t))
825 (alist-delete 'configure %standard-phases))
826 #:tests? #f)) ;no tests
827 (inputs `(("libext2fs" ,e2fsprogs)))
828 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
829 (description
830 "The zerofree command scans the free blocks in an ext2 file system and
831 fills any non-zero blocks with zeroes. This is a useful way to make disk
832 images more compressible.")
833 (license license:gpl2)))
834
835 (define-public strace
836 (package
837 (name "strace")
838 (version "4.16")
839 (source (origin
840 (method url-fetch)
841 (uri (string-append "mirror://sourceforge/strace/strace/" version
842 "/strace-" version ".tar.xz"))
843 (sha256
844 (base32
845 "1vzhmpcy989i4k12q4cc438yal2ghhm6x7ychscjbhcf2yspqj4q"))))
846 (build-system gnu-build-system)
847 (arguments
848 '(#:phases
849 (modify-phases %standard-phases
850 (add-after 'unpack 'patch-/bin/sh
851 (lambda _
852 (substitute* "strace.c"
853 (("/bin/sh") (which "sh")))
854 #t)))))
855 (native-inputs `(("perl" ,perl)))
856 (home-page "https://strace.io/")
857 (synopsis "System call tracer for Linux")
858 (description
859 "strace is a system call tracer, i.e. a debugging tool which prints out a
860 trace of all the system calls made by a another process/program.")
861 (license license:bsd-3)))
862
863 (define-public ltrace
864 (package
865 (name "ltrace")
866 (version "0.7.3")
867 (source (origin
868 (method url-fetch)
869 (uri (string-append "http://www.ltrace.org/ltrace_" version
870 ".orig.tar.bz2"))
871 (sha256
872 (base32
873 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
874 (build-system gnu-build-system)
875 (inputs `(("libelf" ,libelf)))
876 (arguments
877 ;; Compilation uses -Werror by default, but it fails.
878 '(#:configure-flags '("--disable-werror")))
879 (home-page "http://www.ltrace.org/")
880 (synopsis "Library call tracer for Linux")
881 (description
882 "ltrace intercepts and records dynamic library calls which are called by
883 an executed process and the signals received by that process. It can also
884 intercept and print the system calls executed by the program.")
885 (license license:gpl2+)))
886
887 (define-public alsa-lib
888 (package
889 (name "alsa-lib")
890 (version "1.1.3")
891 (source (origin
892 (method url-fetch)
893 (uri (string-append
894 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
895 version ".tar.bz2"))
896 (sha256
897 (base32
898 "174n2psp0328xcy2f1ayls67598bxli6q9cf00d2qnac3012aa3i"))))
899 (build-system gnu-build-system)
900 (home-page "https://www.alsa-project.org/")
901 (synopsis "The Advanced Linux Sound Architecture libraries")
902 (description
903 "The Advanced Linux Sound Architecture (ALSA) provides audio and
904 MIDI functionality to the Linux-based operating system.")
905 (license license:lgpl2.1+)))
906
907 (define-public alsa-utils
908 (package
909 (name "alsa-utils")
910 (version "1.1.3")
911 (source (origin
912 (method url-fetch)
913 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
914 name "-" version ".tar.bz2"))
915 (sha256
916 (base32
917 "0z0nnqp1707bm02dys2d16m88lsg5nd26bqaf14rl3za9sjifwhj"))))
918 (build-system gnu-build-system)
919 (arguments
920 ;; XXX: Disable man page creation until we have DocBook.
921 '(#:configure-flags (list "--disable-xmlto"
922
923 ;; The udev rule is responsible for restoring
924 ;; the volume.
925 (string-append "--with-udev-rules-dir="
926 (assoc-ref %outputs "out")
927 "/lib/udev/rules.d"))
928 #:phases
929 (modify-phases %standard-phases
930 (add-before
931 'install 'pre-install
932 (lambda _
933 ;; Don't try to mkdir /var/lib/alsa.
934 (substitute* "Makefile"
935 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
936 "true\n"))
937 #t)))))
938 (inputs
939 `(("libsamplerate" ,libsamplerate)
940 ("ncurses" ,ncurses)
941 ("alsa-lib" ,alsa-lib)
942 ("xmlto" ,xmlto)
943 ("gettext" ,gettext-minimal)))
944 (home-page "http://www.alsa-project.org/")
945 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
946 (description
947 "The Advanced Linux Sound Architecture (ALSA) provides audio and
948 MIDI functionality to the Linux-based operating system.")
949
950 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
951 ;; GPLv2-only.
952 (license license:gpl2)))
953
954 (define-public alsa-plugins
955 (package
956 (name "alsa-plugins")
957 (version "1.1.1")
958 (source (origin
959 (method url-fetch)
960 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
961 name "-" version ".tar.bz2"))
962 (sha256
963 (base32
964 "1w81z5jlwqhd1l2m7qrq69lc4k9dnrg1wn52jsl2hrf3hbhd394f"))))
965 (build-system gnu-build-system)
966 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
967 ;; be split, there are references to both in files.
968 ;; TODO: Remove OSS related plugins, they add support to run native
969 ;; ALSA applications on OSS however we do not offer OSS and OSS is
970 ;; obsolete.
971 (outputs '("out" "pulseaudio"))
972 (arguments
973 `(#:phases
974 (modify-phases %standard-phases
975 (add-after 'install 'split
976 (lambda* (#:key inputs outputs #:allow-other-keys)
977 ;; Distribute the binaries to the various outputs.
978 (let* ((out (assoc-ref outputs "out"))
979 (pua (assoc-ref outputs "pulseaudio"))
980 (pualib (string-append pua "/lib/alsa-lib"))
981 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
982 (mkdir-p puaconf)
983 (mkdir-p pualib)
984 (chdir (string-append out "/share"))
985 (for-each (lambda (file)
986 (rename-file file (string-append puaconf "/" (basename file))))
987 (find-files out "\\.(conf|example)"))
988 (for-each (lambda (file)
989 (rename-file file (string-append pualib "/" (basename file))))
990 (find-files out ".*pulse\\.(la|so)"))
991 (chdir "..")
992 ;; We have moved the files to output pulsaudio, the
993 ;; directory is now empty.
994 (delete-file-recursively (string-append out "/share"))
995 #t))))))
996 (inputs
997 `(("alsa-lib" ,alsa-lib)
998 ("speex" ,speex) ; libspeexdsp resampling plugin
999 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1000 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1001 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1002 (native-inputs
1003 `(("pkg-config" ,pkg-config)))
1004 (home-page "http://www.alsa-project.org/")
1005 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1006 (description
1007 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1008 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1009 by providing additional plugins which include: upmixing, downmixing, jackd and
1010 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1011 external rate conversion.")
1012 (license (list license:gpl2+
1013 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1014 license:lgpl2.1+))))
1015
1016 (define-public iptables
1017 (package
1018 (name "iptables")
1019 (version "1.4.21")
1020 (source (origin
1021 (method url-fetch)
1022 (uri (string-append
1023 "http://www.netfilter.org/projects/iptables/files/iptables-"
1024 version ".tar.bz2"))
1025 (sha256
1026 (base32
1027 "1q6kg7sf0pgpq0qhab6sywl23cngxxfzc9zdzscsba8x09l4q02j"))))
1028 (build-system gnu-build-system)
1029 (arguments
1030 '(#:tests? #f ; no test suite
1031 #:configure-flags ; add $libdir to the RUNPATH of executables
1032 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1033 (home-page "http://www.netfilter.org/projects/iptables/index.html")
1034 (synopsis "Program to configure the Linux IP packet filtering rules")
1035 (description
1036 "iptables is the userspace command line program used to configure the
1037 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1038 system administrators. Since Network Address Translation is also configured
1039 from the packet filter ruleset, iptables is used for this, too. The iptables
1040 package also includes ip6tables. ip6tables is used for configuring the IPv6
1041 packet filter.")
1042 (license license:gpl2+)))
1043
1044 (define-public iproute
1045 (package
1046 (name "iproute2")
1047 (version "4.10.0")
1048 (source (origin
1049 (method url-fetch)
1050 (uri (string-append
1051 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1052 version ".tar.xz"))
1053 (sha256
1054 (base32
1055 "1a59y1zkddvr7z0lh2y9iasbh9wpfc1n39p56xcd6jkhzk0y3c92"))))
1056 (build-system gnu-build-system)
1057 (arguments
1058 `(#:tests? #f ; no test suite
1059 #:make-flags (let ((out (assoc-ref %outputs "out")))
1060 (list "DESTDIR="
1061 (string-append "BASH_COMPDIR=" out
1062 "/etc/bash_completion.d")
1063 (string-append "LIBDIR=" out "/lib")
1064 (string-append "HDRDIR=" out "/include")
1065 (string-append "SBINDIR=" out "/sbin")
1066 (string-append "CONFDIR=" out "/etc")
1067 (string-append "DOCDIR=" out "/share/doc/"
1068 ,name "-" ,version)
1069 (string-append "MANDIR=" out "/share/man")))
1070 #:phases (modify-phases %standard-phases
1071 (add-before 'install 'pre-install
1072 (lambda _
1073 ;; Don't attempt to create /var/lib/arpd.
1074 (substitute* "Makefile"
1075 (("^.*ARPDDIR.*$") "")))))))
1076 (inputs
1077 `(("iptables" ,iptables)
1078 ("db4" ,bdb)))
1079 (native-inputs
1080 `(("pkg-config" ,pkg-config)
1081 ("flex" ,flex)
1082 ("bison" ,bison)))
1083 (home-page
1084 "https://wiki.linuxfoundation.org/networking/iproute2")
1085 (synopsis
1086 "Utilities for controlling TCP/IP networking and traffic in Linux")
1087 (description
1088 "Iproute2 is a collection of utilities for controlling TCP/IP
1089 networking and traffic with the Linux kernel.
1090
1091 Most network configuration manuals still refer to ifconfig and route as the
1092 primary network configuration tools, but ifconfig is known to behave
1093 inadequately in modern network environments. They should be deprecated, but
1094 most distros still include them. Most network configuration systems make use
1095 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1096 to support most modern network technologies, as it doesn't use ifconfig and
1097 allows a system administrator to make use of all iproute2 features, including
1098 traffic control.
1099
1100 iproute2 is usually shipped in a package called iproute or iproute2 and
1101 consists of several tools, of which the most important are @command{ip} and
1102 @command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1103 @command{tc} stands for traffic control. Both tools print detailed usage
1104 messages and are accompanied by a set of manpages.")
1105 (license license:gpl2+)))
1106
1107 (define-public net-tools
1108 ;; XXX: This package is basically unmaintained, but it provides a few
1109 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1110 ;; live with it.
1111 (package
1112 (name "net-tools")
1113 (version "1.60")
1114 (home-page "http://net-tools.sourceforge.net/")
1115 (source (origin
1116 (method url-fetch)
1117 (uri (list (string-append
1118 "mirror://sourceforge/net-tools/net-tools-"
1119 version ".tar.bz2")
1120 (string-append
1121 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1122 "/base/net-tools/net-tools-1.60.tar.bz2")))
1123 (sha256
1124 (base32
1125 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1126 (patches (search-patches "net-tools-bitrot.patch"))))
1127 (build-system gnu-build-system)
1128 (arguments
1129 '(#:modules ((guix build gnu-build-system)
1130 (guix build utils)
1131 (srfi srfi-1)
1132 (srfi srfi-26))
1133 #:phases (alist-cons-after
1134 'unpack 'patch
1135 (lambda* (#:key inputs #:allow-other-keys)
1136 (define (apply-patch file)
1137 (zero? (system* "patch" "-p1" "--force"
1138 "--input" file)))
1139
1140 (let ((patch.gz (assoc-ref inputs "patch")))
1141 (format #t "applying Debian patch set '~a'...~%"
1142 patch.gz)
1143 (system (string-append "gunzip < " patch.gz " > the-patch"))
1144 (and (apply-patch "the-patch")
1145 (for-each apply-patch
1146 (find-files "debian/patches"
1147 "\\.patch")))))
1148 (alist-replace
1149 'configure
1150 (lambda* (#:key outputs #:allow-other-keys)
1151 (let ((out (assoc-ref outputs "out")))
1152 (mkdir-p (string-append out "/bin"))
1153 (mkdir-p (string-append out "/sbin"))
1154
1155 ;; Pretend we have everything...
1156 (system "yes | make config")
1157
1158 ;; ... except for the things we don't have.
1159 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1160 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1161 ;; that have been removed.
1162 (substitute* '("config.make" "config.h")
1163 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1164 (alist-cons-after
1165 'install 'remove-redundant-commands
1166 (lambda* (#:key outputs #:allow-other-keys)
1167 ;; Remove commands and man pages redundant with
1168 ;; Inetutils.
1169 (let* ((out (assoc-ref outputs "out"))
1170 (dup (append-map (cut find-files out <>)
1171 '("^hostname"
1172 "^(yp|nis|dns)?domainname"))))
1173 (for-each delete-file dup)
1174 #t))
1175 %standard-phases)))
1176
1177 ;; Binaries that depend on libnet-tools.a don't declare that
1178 ;; dependency, making it parallel-unsafe.
1179 #:parallel-build? #f
1180
1181 #:tests? #f ; no test suite
1182 #:make-flags (let ((out (assoc-ref %outputs "out")))
1183 (list "CC=gcc"
1184 (string-append "BASEDIR=" out)
1185 (string-append "INSTALLNLSDIR=" out "/share/locale")
1186 (string-append "mandir=/share/man")))))
1187
1188 ;; Use the big Debian patch set (the thing does not even compile out of
1189 ;; the box.)
1190 (inputs `(("patch" ,(origin
1191 (method url-fetch)
1192 (uri
1193 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1194 (sha256
1195 (base32
1196 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1197 (native-inputs `(("gettext" ,gettext-minimal)))
1198
1199 (synopsis "Tools for controlling the network subsystem in Linux")
1200 (description
1201 "This package includes the important tools for controlling the network
1202 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1203 netstat, rarp and route. Additionally, this package contains utilities
1204 relating to particular network hardware types (plipconfig, slattach) and
1205 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1206 (license license:gpl2+)))
1207
1208 (define-public libcap
1209 (package
1210 (name "libcap")
1211 (version "2.25")
1212 (source (origin
1213 (method url-fetch)
1214 (uri (string-append
1215 "mirror://kernel.org/linux/libs/security/linux-privs/"
1216 "libcap2/libcap-" version ".tar.xz"))
1217 (sha256
1218 (base32
1219 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1220 (build-system gnu-build-system)
1221 (arguments '(#:phases
1222 (modify-phases %standard-phases
1223 (replace 'configure
1224 ;; Add $libdir to the RUNPATH of executables.
1225 (lambda _
1226 (substitute* "Make.Rules"
1227 (("LDFLAGS := #-g")
1228 (string-append "LDFLAGS := -Wl,-rpath="
1229 %output "/lib"))))))
1230 #:tests? #f ; no 'check' target
1231 #:make-flags (list "lib=lib"
1232 (string-append "prefix="
1233 (assoc-ref %outputs "out"))
1234 "RAISE_SETFCAP=no")))
1235 (native-inputs `(("perl" ,perl)))
1236 (inputs `(("attr" ,attr)))
1237 (home-page "https://sites.google.com/site/fullycapable/")
1238 (synopsis "Library for working with POSIX capabilities")
1239 (description
1240 "Libcap2 provides a programming interface to POSIX capabilities on
1241 Linux-based operating systems.")
1242
1243 ;; License is BSD-3 or GPLv2, at the user's choice.
1244 (license license:gpl2)))
1245
1246 (define-public bridge-utils
1247 (package
1248 (name "bridge-utils")
1249 (version "1.5")
1250 (source (origin
1251 (method url-fetch)
1252 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1253 "bridge-utils-" version ".tar.gz"))
1254 (sha256
1255 (base32
1256 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1257 (build-system gnu-build-system)
1258
1259 ;; The tarball lacks all the generated files.
1260 (native-inputs `(("autoconf" ,autoconf)
1261 ("automake" ,automake)))
1262 (arguments
1263 '(#:phases (alist-cons-after
1264 'unpack 'bootstrap
1265 (lambda _
1266 ;; Fix "field ‘ip6’ has incomplete type" errors.
1267 (substitute* "libbridge/libbridge.h"
1268 (("#include <linux/if_bridge.h>")
1269 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1270
1271 ;; Ensure that the entire build fails if one of the
1272 ;; sub-Makefiles fails.
1273 (substitute* "Makefile.in"
1274 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1275 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1276
1277 (zero? (system* "autoreconf" "-vf")))
1278 %standard-phases)
1279 #:tests? #f)) ; no 'check' target
1280
1281 (home-page
1282 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1283 (synopsis "Manipulate Ethernet bridges")
1284 (description
1285 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1286 to connect two Ethernet segments together in a protocol independent way.
1287 Packets are forwarded based on Ethernet address, rather than IP address (like
1288 a router). Since forwarding is done at Layer 2, all protocols can go
1289 transparently through a bridge.")
1290 (license license:gpl2+)))
1291
1292 (define-public libnl
1293 (package
1294 (name "libnl")
1295 (version "3.2.25")
1296 (source (origin
1297 (method url-fetch)
1298 (uri (string-append
1299 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1300 version ".tar.gz"))
1301 (sha256
1302 (base32
1303 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
1304 (build-system gnu-build-system)
1305 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1306 (home-page "http://www.infradead.org/~tgr/libnl/")
1307 (synopsis "NetLink protocol library suite")
1308 (description
1309 "The libnl suite is a collection of libraries providing APIs to netlink
1310 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1311 between the kernel and user space processes. It was designed to be a more
1312 flexible successor to ioctl to provide mainly networking related kernel
1313 configuration and monitoring interfaces.")
1314
1315 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1316 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1317 (license license:gpl2)))
1318
1319 (define-public iw
1320 (package
1321 (name "iw")
1322 (version "4.9")
1323 (source (origin
1324 (method url-fetch)
1325 (uri (string-append
1326 "mirror://kernel.org/software/network/iw/iw-"
1327 version ".tar.xz"))
1328 (sha256
1329 (base32
1330 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1331 (build-system gnu-build-system)
1332 (native-inputs `(("pkg-config" ,pkg-config)))
1333 (inputs `(("libnl" ,libnl)))
1334 (arguments
1335 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1336 "CC=gcc")
1337 #:phases (alist-delete 'configure %standard-phases)))
1338 (home-page "https://wireless.wiki.kernel.org/")
1339 (synopsis "Tool for configuring wireless devices")
1340 (description
1341 "iw is a new nl80211 based CLI configuration utility for wireless
1342 devices. It replaces @code{iwconfig}, which is deprecated.")
1343 (license license:isc)))
1344
1345 (define-public powertop
1346 (package
1347 (name "powertop")
1348 (version "2.8")
1349 (source
1350 (origin
1351 (method url-fetch)
1352 (uri (string-append
1353 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1354 version ".tar.gz"))
1355 (sha256
1356 (base32
1357 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1358 (build-system gnu-build-system)
1359 (arguments
1360 '(#:phases
1361 (modify-phases %standard-phases
1362 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1363 ;; allow calibrating the network interface in GuixSD.
1364 (add-after 'unpack 'patch-absolute-file-names
1365 (lambda* (#:key inputs #:allow-other-keys)
1366 (let ((kmod (assoc-ref inputs "kmod")))
1367 (substitute* (find-files "src" "\\.cpp$")
1368 ;; Give the right 'modprobe' file name so that essential
1369 ;; modules such as msr.ko can be loaded.
1370 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1371 ;; These programs are only needed to calibrate, so using
1372 ;; relative file names avoids adding extra inputs. When they
1373 ;; are missing powertop gracefully handles it.
1374 (("/usr/bin/hcitool") "hcitool")
1375 (("/usr/bin/xset") "xset")
1376 (("/usr/sbin/hciconfig") "hciconfig"))
1377 #t))))))
1378 (inputs
1379 `(("kmod" ,kmod)
1380 ("libnl" ,libnl)
1381 ("ncurses" ,ncurses)
1382 ("pciutils" ,pciutils)
1383 ("zlib" ,zlib)))
1384 (native-inputs
1385 `(("pkg-config" ,pkg-config)))
1386 (home-page "https://01.org/powertop/")
1387 (synopsis "Analyze power consumption on Intel-based laptops")
1388 (description
1389 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1390 power management. In addition to being a diagnostic tool, PowerTOP also has
1391 an interactive mode where the user can experiment various power management
1392 settings for cases where the operating system has not enabled these
1393 settings.")
1394 (license license:gpl2)))
1395
1396 (define-public aumix
1397 (package
1398 (name "aumix")
1399 (version "2.9.1")
1400 (source (origin
1401 (method url-fetch)
1402 (uri (string-append
1403 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1404 version ".tar.bz2"))
1405 (sha256
1406 (base32
1407 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1408 (build-system gnu-build-system)
1409 (inputs `(("ncurses" ,ncurses)))
1410 (home-page "http://www.jpj.net/~trevor/aumix.html")
1411 (synopsis "Audio mixer for X and the console")
1412 (description
1413 "Aumix adjusts an audio mixer from X, the console, a terminal,
1414 the command line or a script.")
1415 (license license:gpl2+)))
1416
1417 (define-public iotop
1418 (package
1419 (name "iotop")
1420 (version "0.6")
1421 (source
1422 (origin
1423 (method url-fetch)
1424 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1425 version ".tar.gz"))
1426 (sha256 (base32
1427 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1428 (build-system python-build-system)
1429 (arguments
1430 ;; The setup.py script expects python-2.
1431 `(#:python ,python-2
1432 ;; There are currently no checks in the package.
1433 #:tests? #f))
1434 (native-inputs `(("python" ,python-2)))
1435 (home-page "http://guichaz.free.fr/iotop/")
1436 (synopsis
1437 "Displays the IO activity of running processes")
1438 (description
1439 "Iotop is a Python program with a top like user interface to show the
1440 processes currently causing I/O.")
1441 (license license:gpl2+)))
1442
1443 (define-public fuse
1444 (package
1445 (name "fuse")
1446 (version "2.9.6")
1447 (source (origin
1448 (method url-fetch)
1449 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1450 "download/fuse-" version
1451 "/fuse-" version ".tar.gz"))
1452 (sha256
1453 (base32
1454 "0szi2vlsjxg03y4ji51jks34p269jqj5ify6l0ajsqq6f6y8pd0c"))))
1455 (build-system gnu-build-system)
1456 (inputs `(("util-linux" ,util-linux)))
1457 (arguments
1458 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1459 (assoc-ref %outputs "out")
1460 "/sbin")
1461 (string-append "INIT_D_PATH="
1462 (assoc-ref %outputs "out")
1463 "/etc/init.d")
1464
1465 ;; The rule makes /dev/fuse 666.
1466 (string-append "UDEV_RULES_PATH="
1467 (assoc-ref %outputs "out")
1468 "/lib/udev/rules.d"))
1469 #:phases (alist-cons-before
1470 'build 'set-file-names
1471 (lambda* (#:key inputs #:allow-other-keys)
1472 ;; libfuse calls out to mount(8) and umount(8). Make sure
1473 ;; it refers to the right ones.
1474 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1475 (("/bin/(u?)mount" _ maybe-u)
1476 (string-append (assoc-ref inputs "util-linux")
1477 "/bin/" maybe-u "mount")))
1478 (substitute* '("util/mount.fuse.c")
1479 (("/bin/sh")
1480 (which "sh")))
1481
1482 ;; This hack leads libfuse to search for 'fusermount' in
1483 ;; $PATH, where it may find a setuid-root binary, instead of
1484 ;; trying solely $out/sbin/fusermount and failing because
1485 ;; it's not setuid.
1486 (substitute* "lib/Makefile"
1487 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1488 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1489 %standard-phases)))
1490 (home-page "https://github.com/libfuse/libfuse")
1491 (synopsis "Support file systems implemented in user space")
1492 (description
1493 "As a consequence of its monolithic design, file system code for Linux
1494 normally goes into the kernel itself---which is not only a robustness issue,
1495 but also an impediment to system extensibility. FUSE, for \"file systems in
1496 user space\", is a kernel module and user-space library that tries to address
1497 part of this problem by allowing users to run file system implementations as
1498 user-space processes.")
1499 (license (list license:lgpl2.1 ;library
1500 license:gpl2+)))) ;command-line utilities
1501
1502 (define-public unionfs-fuse
1503 (package
1504 (name "unionfs-fuse")
1505 (version "0.26")
1506 (source (origin
1507 (method url-fetch)
1508 (uri (string-append
1509 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1510 version ".tar.xz"))
1511 (sha256
1512 (base32
1513 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1514 (build-system cmake-build-system)
1515 (inputs `(("fuse" ,fuse)))
1516 (arguments '(#:tests? #f)) ; no tests
1517 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1518 (synopsis "User-space union file system")
1519 (description
1520 "UnionFS-FUSE is a flexible union file system implementation in user
1521 space, using the FUSE library. Mounting a union file system allows you to
1522 \"aggregate\" the contents of several directories into a single mount point.
1523 UnionFS-FUSE additionally supports copy-on-write.")
1524 (license license:bsd-3)))
1525
1526 (define fuse-static
1527 (package (inherit fuse)
1528 (name "fuse-static")
1529 (source (origin (inherit (package-source fuse))
1530 (modules '((guix build utils)))
1531 (snippet
1532 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1533 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1534 ;; it doesn't do that, allowing us to remove the dependency on
1535 ;; util-linux (something that is useful in initrds.)
1536 '(substitute* '("lib/mount_util.c"
1537 "util/mount_util.c")
1538 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1539 "0")
1540 (("/bin/")
1541 "")))))))
1542
1543 (define-public unionfs-fuse/static
1544 (package (inherit unionfs-fuse)
1545 (synopsis "User-space union file system (statically linked)")
1546 (name (string-append (package-name unionfs-fuse) "-static"))
1547 (source (origin (inherit (package-source unionfs-fuse))
1548 (modules '((guix build utils)))
1549 (snippet
1550 ;; Add -ldl to the libraries, because libfuse.a needs that.
1551 '(substitute* "src/CMakeLists.txt"
1552 (("target_link_libraries(.*)\\)" _ libs)
1553 (string-append "target_link_libraries"
1554 libs " dl)"))))))
1555 (arguments
1556 '(#:tests? #f
1557 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1558 #:phases (alist-cons-after
1559 'install 'post-install
1560 (lambda* (#:key outputs #:allow-other-keys)
1561 (let* ((out (assoc-ref outputs "out"))
1562 (exe (string-append out "/bin/unionfs")))
1563 ;; By default, 'unionfs' keeps references to
1564 ;; $glibc/share/locale and similar stuff. Remove them.
1565 (remove-store-references exe)))
1566 %standard-phases)))
1567 (inputs `(("fuse" ,fuse-static)))))
1568
1569 (define-public sshfs-fuse
1570 (package
1571 (name "sshfs-fuse")
1572 (version "2.8")
1573 (source (origin
1574 (method url-fetch)
1575 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1576 "download/sshfs_" version
1577 "/sshfs-" version ".tar.gz"))
1578 (sha256
1579 (base32
1580 "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
1581 (build-system gnu-build-system)
1582 (inputs
1583 `(("fuse" ,fuse)
1584 ("glib" ,glib)))
1585 (native-inputs
1586 `(("pkg-config" ,pkg-config)))
1587 (home-page "http://fuse.sourceforge.net/sshfs.html")
1588 (synopsis "Mount remote file systems over SSH")
1589 (description
1590 "This is a file system client based on the SSH File Transfer Protocol.
1591 Since most SSH servers already support this protocol it is very easy to set
1592 up: on the server side there's nothing to do; on the client side mounting the
1593 file system is as easy as logging into the server with an SSH client.")
1594 (license license:gpl2+)))
1595
1596 (define-public numactl
1597 (package
1598 (name "numactl")
1599 (version "2.0.11")
1600 (source (origin
1601 (method url-fetch)
1602 (uri (string-append
1603 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1604 version
1605 ".tar.gz"))
1606 (sha256
1607 (base32
1608 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1609 (build-system gnu-build-system)
1610 (arguments
1611 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1612 ;; to run, which we can't assume to have.
1613 #:tests? #f))
1614
1615 ;; NUMA is apparently not supported on armhf, see
1616 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1617 (supported-systems (delete "armhf-linux" %supported-systems))
1618 (home-page "http://oss.sgi.com/projects/libnuma/")
1619 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1620 (description
1621 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1622 memory is not all in one place. The numactl program allows you to run your
1623 application program on specific CPU's and memory nodes. It does this by
1624 supplying a NUMA memory policy to the operating system before running your
1625 program.
1626
1627 The package contains other commands, such as numademo, numastat and memhog.
1628 The numademo command provides a quick overview of NUMA performance on your
1629 system.")
1630 (license (list license:gpl2 ;programs
1631 license:lgpl2.1)))) ;library
1632
1633 (define-public kbd
1634 (package
1635 (name "kbd")
1636 (version "2.0.4")
1637 (source (origin
1638 (method url-fetch)
1639 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1640 version ".tar.xz"))
1641 (sha256
1642 (base32
1643 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1644 (modules '((guix build utils)))
1645 (snippet
1646 '(begin
1647 (substitute* "tests/Makefile.in"
1648 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1649 (("@VERSION@")
1650 "[@]VERSION[@]"))
1651 (substitute* '("src/unicode_start" "src/unicode_stop")
1652 ;; Assume the Coreutils are in $PATH.
1653 (("/usr/bin/tty")
1654 "tty"))))))
1655 (build-system gnu-build-system)
1656 (arguments
1657 '(#:phases
1658 (modify-phases %standard-phases
1659 (add-before 'build 'pre-build
1660 (lambda* (#:key inputs #:allow-other-keys)
1661 (let ((gzip (assoc-ref %build-inputs "gzip"))
1662 (bzip2 (assoc-ref %build-inputs "bzip2")))
1663 (substitute* "src/libkeymap/findfile.c"
1664 (("gzip")
1665 (string-append gzip "/bin/gzip"))
1666 (("bzip2")
1667 (string-append bzip2 "/bin/bzip2"))))))
1668 (add-after 'install 'post-install
1669 (lambda* (#:key outputs #:allow-other-keys)
1670 ;; Make sure these programs find their comrades.
1671 (let* ((out (assoc-ref outputs "out"))
1672 (bin (string-append out "/bin")))
1673 (for-each (lambda (prog)
1674 (wrap-program (string-append bin "/" prog)
1675 `("PATH" ":" prefix (,bin))))
1676 '("unicode_start" "unicode_stop"))))))))
1677 (inputs `(("check" ,check)
1678 ("gzip" ,gzip)
1679 ("bzip2" ,bzip2)
1680 ("pam" ,linux-pam)))
1681 (native-inputs `(("pkg-config" ,pkg-config)))
1682 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1683 (synopsis "Linux keyboard utilities and keyboard maps")
1684 (description
1685 "This package contains keytable files and keyboard utilities compatible
1686 for systems using the Linux kernel. This includes commands such as
1687 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1688 (license license:gpl2+)))
1689
1690 (define-public inotify-tools
1691 (package
1692 (name "inotify-tools")
1693 (version "3.13")
1694 (source (origin
1695 (method url-fetch)
1696 (uri (string-append
1697 "mirror://sourceforge/inotify-tools/inotify-tools/"
1698 version "/inotify-tools-" version ".tar.gz"))
1699 (sha256
1700 (base32
1701 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1702 (build-system gnu-build-system)
1703 (home-page "http://inotify-tools.sourceforge.net/")
1704 (synopsis "Monitor file accesses")
1705 (description
1706 "The inotify-tools packages provides a C library and command-line tools
1707 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1708 (license license:gpl2+)))
1709
1710 (define-public kmod
1711 (package
1712 (name "kmod")
1713 (version "24")
1714 (source (origin
1715 (method url-fetch)
1716 (uri
1717 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1718 "kmod-" version ".tar.xz"))
1719 (sha256
1720 (base32
1721 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
1722 (patches (search-patches "kmod-module-directory.patch"))))
1723 (build-system gnu-build-system)
1724 (native-inputs
1725 `(("pkg-config" ,pkg-config)))
1726 (inputs
1727 `(("xz" ,xz)
1728 ("zlib" ,zlib)))
1729 (arguments
1730 `(#:tests? #f ; FIXME: Investigate test failures
1731 #:configure-flags '("--with-xz" "--with-zlib")
1732 #:phases (alist-cons-after
1733 'install 'install-modprobe&co
1734 (lambda* (#:key outputs #:allow-other-keys)
1735 (let* ((out (assoc-ref outputs "out"))
1736 (bin (string-append out "/bin")))
1737 (for-each (lambda (tool)
1738 (symlink "kmod"
1739 (string-append bin "/" tool)))
1740 '("insmod" "rmmod" "lsmod" "modprobe"
1741 "modinfo" "depmod"))))
1742 %standard-phases)))
1743 (home-page "https://www.kernel.org/")
1744 (synopsis "Kernel module tools")
1745 (description "Kmod is a set of tools to handle common tasks with Linux
1746 kernel modules like insert, remove, list, check properties, resolve
1747 dependencies and aliases.
1748
1749 These tools are designed on top of libkmod, a library that is shipped with
1750 kmod. The aim is to be compatible with tools, configurations and indices
1751 from the module-init-tools project.")
1752 (license license:gpl2+))) ; library under lgpl2.1+
1753
1754 (define-public eudev
1755 ;; The post-systemd fork, maintained by Gentoo.
1756 (package
1757 (name "eudev")
1758 (version "3.2.1")
1759 (source (origin
1760 (method url-fetch)
1761 (uri (string-append
1762 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1763 version ".tar.gz"))
1764 (sha256
1765 (base32
1766 "06gyyl90n85x8i7lfhns514y1kg1ians13l467admyzy3kjxkqsp"))
1767 (patches (search-patches "eudev-rules-directory.patch"
1768 "eudev-conflicting-declaration.patch"))))
1769 (build-system gnu-build-system)
1770 (native-inputs
1771 `(("pkg-config" ,pkg-config)
1772 ("perl" ,perl)
1773 ("gperf" ,gperf)))
1774 (inputs
1775 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1776 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1777 ;; which contains the rules to do that.
1778 `(("util-linux" ,util-linux) ;for blkid
1779 ("kmod" ,kmod)))
1780 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1781 (synopsis "Userspace device management")
1782 (description "Udev is a daemon which dynamically creates and removes
1783 device nodes from /dev/, handles hotplug events and loads drivers at boot
1784 time.")
1785 (license license:gpl2+)))
1786
1787 (define-public eudev-with-hwdb
1788 ;; TODO: Merge with 'eudev'.
1789 (package
1790 (inherit eudev)
1791 (name "eudev-with-hwdb")
1792 (arguments
1793 '(#:phases (modify-phases %standard-phases
1794 (add-after 'install 'build-hwdb
1795 (lambda* (#:key outputs #:allow-other-keys)
1796 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1797 ;; similar tools to display product names.
1798 (let ((out (assoc-ref outputs "out")))
1799 (zero? (system* (string-append out "/bin/udevadm")
1800 "hwdb" "--update"))))))))))
1801
1802 (define-public lvm2
1803 (package
1804 (name "lvm2")
1805 (version "2.02.168")
1806 (source (origin
1807 (method url-fetch)
1808 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1809 version ".tgz"))
1810 (sha256
1811 (base32
1812 "03b62hcsj9z37ckd8c21wwpm07s9zblq7grfh58yzcs1vp6x38r3"))
1813 (modules '((guix build utils)))
1814 (snippet
1815 '(begin
1816 (use-modules (guix build utils))
1817
1818 ;; Honor sysconfdir.
1819 (substitute* "make.tmpl.in"
1820 (("confdir = .*$")
1821 "confdir = @sysconfdir@\n")
1822 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1823 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1824 (patches (search-patches "lvm2-static-link.patch"))))
1825 (build-system gnu-build-system)
1826 (native-inputs
1827 `(("pkg-config" ,pkg-config)
1828 ("procps" ,procps))) ;tests use 'pgrep'
1829 (inputs
1830 `(("udev" ,eudev)))
1831 (arguments
1832 '(#:phases
1833 (modify-phases %standard-phases
1834 (add-after 'configure 'set-makefile-shell
1835 (lambda _
1836 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1837 ;; expected.
1838 (setenv "SHELL" (which "sh"))
1839
1840 ;; Replace /bin/sh with the right file name.
1841 (patch-makefile-SHELL "make.tmpl")
1842 #t))
1843 (add-before 'strip 'make-objects-writable
1844 (lambda* (#:key outputs #:allow-other-keys)
1845 ;; Make compiled objects writable so they can be stripped.
1846 (let ((out (assoc-ref outputs "out")))
1847 (for-each (lambda (file)
1848 (chmod file #o755))
1849 (append
1850 (find-files (string-append out "/lib"))
1851 (find-files (string-append out "/sbin"))))
1852 #t))))
1853
1854 #:configure-flags (list (string-append "--sysconfdir="
1855 (assoc-ref %outputs "out")
1856 "/etc/lvm")
1857 "--enable-udev_sync"
1858 "--enable-udev_rules"
1859
1860 ;; Make sure programs such as 'dmsetup' can
1861 ;; find libdevmapper.so.
1862 (string-append "LDFLAGS=-Wl,-rpath="
1863 (assoc-ref %outputs "out")
1864 "/lib"))
1865
1866 ;; The tests use 'mknod', which requires root access.
1867 #:tests? #f))
1868 (home-page "http://sourceware.org/lvm2/")
1869 (synopsis "Logical volume management for Linux")
1870 (description
1871 "LVM2 is the logical volume management tool set for Linux-based systems.
1872 This package includes the user-space libraries and tools, including the device
1873 mapper. Kernel components are part of Linux-libre.")
1874
1875 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1876 ;; Command-line tools are GPLv2.
1877 (license (list license:gpl2 license:lgpl2.1))))
1878
1879 (define-public lvm2-static
1880 (package
1881 (inherit lvm2)
1882 (name "lvm2-static")
1883
1884 ;; Propagate udev because libdevmapper.a depends on libudev.
1885 (inputs (alist-delete "udev" (package-inputs lvm2)))
1886 (propagated-inputs `(("udev" ,eudev)))
1887
1888 (arguments
1889 (substitute-keyword-arguments (package-arguments lvm2)
1890 ((#:configure-flags flags '())
1891 ;; LVM2 doesn't use Libtool, hence the custom option.
1892 `(cons "--enable-static_link" ,flags))))
1893 (synopsis "Logical volume management for Linux (statically linked)")))
1894
1895 (define-public wireless-tools
1896 (package
1897 (name "wireless-tools")
1898 (version "30.pre9")
1899 (source (origin
1900 (method url-fetch)
1901 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1902 version ".tar.gz"))
1903 (sha256
1904 (base32
1905 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1906 (snippet
1907 '(begin
1908 ;; Remove the older header files that are not free software.
1909 (for-each (lambda (n)
1910 (delete-file (format #f "wireless.~a.h" n)))
1911 '(10 11 12 13 14 15 16 17 18 19 20))
1912 #t))))
1913 (build-system gnu-build-system)
1914 (arguments
1915 `(#:make-flags
1916 (list (string-append "PREFIX=" %output)
1917 (string-append "INSTALL_MAN=" %output "/share/man")
1918 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1919 "BUILD_STATIC=")
1920 #:phases (modify-phases %standard-phases
1921 (delete 'configure))
1922 #:tests? #f))
1923 (synopsis "Tools for manipulating Linux Wireless Extensions")
1924 (description "Wireless Tools are used to manipulate the now-deprecated
1925 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1926 Extension was an interface allowing you to set Wireless LAN specific
1927 parameters and get the specific stats. It is deprecated in favor the nl80211
1928 interface.")
1929 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1930 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1931 ;; other files are distributed under gpl2.
1932 (license (list license:gpl2 license:lgpl2.1+))))
1933
1934 (define-public crda
1935 (package
1936 (name "crda")
1937 (version "3.18")
1938 (source (origin
1939 (method url-fetch)
1940 (uri (string-append "mirror://kernel.org/software/network/crda/"
1941 "crda-" version ".tar.xz"))
1942 (sha256
1943 (base32
1944 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
1945 (patches (search-patches "crda-optional-gcrypt.patch"))))
1946 (build-system gnu-build-system)
1947 (arguments
1948 '(#:phases (modify-phases %standard-phases
1949 (delete 'configure)
1950 (add-before
1951 'build 'no-werror-no-ldconfig
1952 (lambda _
1953 (substitute* "Makefile"
1954 (("-Werror") "")
1955 (("ldconfig") "true"))
1956 #t))
1957 (add-before
1958 'build 'set-regulator-db-file-name
1959 (lambda* (#:key inputs #:allow-other-keys)
1960 ;; Tell CRDA where to find our database.
1961 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1962 (substitute* "crda.c"
1963 (("\"/lib/crda/regulatory.bin\"")
1964 (string-append "\"" regdb
1965 "/lib/crda/regulatory.bin\"")))
1966 #t))))
1967 #:test-target "verify"
1968 #:make-flags (let ((out (assoc-ref %outputs "out"))
1969 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1970 (list "CC=gcc" "V=1"
1971
1972 ;; Disable signature-checking on 'regulatory.bin'.
1973 ;; The reason is that this simplifies maintenance
1974 ;; on our side (no need to manage a distro key
1975 ;; pair), and we can guarantee integrity of
1976 ;; 'regulatory.bin' by other means anyway, such as
1977 ;; 'guix gc --verify'. See
1978 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1979 ;; for a discssion.
1980 "USE_OPENSSL=0"
1981
1982 (string-append "PREFIX=" out)
1983 (string-append "SBINDIR=" out "/sbin/")
1984 (string-append "UDEV_RULE_DIR="
1985 out "/lib/udev/rules.d")
1986 (string-append "LDFLAGS=-Wl,-rpath="
1987 out "/lib -L.")
1988 (string-append "REG_BIN=" regdb
1989 "/lib/crda/regulatory.bin")))))
1990 (native-inputs `(("pkg-config" ,pkg-config)
1991 ("python" ,python-2)
1992 ("wireless-regdb" ,wireless-regdb)))
1993 (inputs `(("libnl" ,libnl)))
1994 (home-page
1995 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1996 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1997 (description
1998 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1999 communication between the kernel Linux and user space for regulatory
2000 compliance.")
2001 (license license:copyleft-next)))
2002
2003 (define-public wireless-regdb
2004 (package
2005 (name "wireless-regdb")
2006 (version "2017.03.07")
2007 (source (origin
2008 (method url-fetch)
2009 (uri (string-append
2010 "mirror://kernel.org/software/network/wireless-regdb/"
2011 "wireless-regdb-" version ".tar.xz"))
2012 (sha256
2013 (base32
2014 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2015
2016 ;; We're building 'regulatory.bin' by ourselves.
2017 (snippet '(delete-file "regulatory.bin"))))
2018 (build-system gnu-build-system)
2019 (arguments
2020 '(#:phases (modify-phases %standard-phases
2021 (delete 'configure))
2022
2023 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2024 ;; is computed and can be equal to 'maintainer-clean'; when that
2025 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2026 ;; just built. Thus, build things sequentially.
2027 #:parallel-build? #f
2028
2029 #:tests? #f ;no tests
2030 #:make-flags (let ((out (assoc-ref %outputs "out")))
2031 (list (string-append "PREFIX=" out)
2032 (string-append "LSB_ID=GuixSD")
2033 (string-append "DISTRO_PUBKEY=/dev/null")
2034 (string-append "DISTRO_PRIVKEY=/dev/null")
2035 (string-append "REGDB_PUBKEY=/dev/null")
2036
2037 ;; Leave that empty so that db2bin.py doesn't try
2038 ;; to sign 'regulatory.bin'. This allows us to
2039 ;; avoid managing a key pair for the whole distro.
2040 (string-append "REGDB_PRIVKEY=")))))
2041 (native-inputs `(("python" ,python-2)))
2042 (home-page
2043 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2044 (synopsis "Wireless regulatory database")
2045 (description
2046 "This package contains the wireless regulatory database Central
2047 Regulatory Database Agent (CRDA) daemon. The database contains information on
2048 country-specific regulations for the wireless spectrum.")
2049 (license license:isc)))
2050
2051 (define-public lm-sensors
2052 (package
2053 (name "lm-sensors")
2054 (version "3.4.0")
2055 (source (origin
2056 (method url-fetch)
2057 (uri (list (string-append
2058 "https://github.com/groeck/lm-sensors/archive/V"
2059 (string-join (string-split version #\.) "-")
2060 ".tar.gz")))
2061 (file-name (string-append name "-" version ".tar.gz"))
2062 (sha256
2063 (base32
2064 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2065 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2066 (build-system gnu-build-system)
2067 (inputs `(("rrdtool" ,rrdtool)
2068 ("perl" ,perl)
2069 ("kmod" ,kmod)
2070 ("gnuplot" ,gnuplot)))
2071 (native-inputs `(("pkg-config" ,pkg-config)
2072 ("flex" ,flex)
2073 ("bison" ,bison)
2074 ("which" ,which)))
2075 (arguments
2076 `(#:tests? #f ; no 'check' target
2077 #:make-flags (list (string-append "PREFIX=" %output)
2078 (string-append "ETCDIR=" %output "/etc")
2079 (string-append "MANDIR=" %output "/share/man"))
2080 #:phases
2081 (alist-delete
2082 'configure
2083 (alist-cons-before
2084 'build 'patch-exec-paths
2085 (lambda* (#:key inputs outputs #:allow-other-keys)
2086 (substitute* "prog/detect/sensors-detect"
2087 (("`uname")
2088 (string-append "`" (assoc-ref inputs "coreutils")
2089 "/bin/uname"))
2090 (("(`|\")modprobe" all open-quote)
2091 (string-append open-quote
2092 (assoc-ref inputs "kmod")
2093 "/bin/modprobe")))
2094 (substitute* '("prog/pwm/pwmconfig"
2095 "prog/pwm/fancontrol")
2096 (("gnuplot")
2097 (string-append (assoc-ref inputs "gnuplot")
2098 "/bin/gnuplot"))
2099 (("cat ")
2100 (string-append (assoc-ref inputs "coreutils")
2101 "/bin/cat "))
2102 (("egrep ")
2103 (string-append (assoc-ref inputs "grep")
2104 "/bin/egrep "))
2105 (("sed -e")
2106 (string-append (assoc-ref inputs "sed")
2107 "/bin/sed -e"))
2108 (("cut -d")
2109 (string-append (assoc-ref inputs "coreutils")
2110 "/bin/cut -d"))
2111 (("sleep ")
2112 (string-append (assoc-ref inputs "coreutils")
2113 "/bin/sleep "))
2114 (("readlink -f")
2115 (string-append (assoc-ref inputs "coreutils")
2116 "/bin/readlink -f"))))
2117 %standard-phases))))
2118 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2119 (synopsis "Utilities to read temperature/voltage/fan sensors")
2120 (description
2121 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2122 you to access information from temperature, voltage, and fan speed sensors.
2123 It works with most newer systems.")
2124 (license license:gpl2+)))
2125
2126 (define-public i2c-tools
2127 (package
2128 (name "i2c-tools")
2129 (version "3.1.1")
2130 (source (origin
2131 (method url-fetch)
2132 (uri (string-append
2133 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2134 version ".tar.bz2"))
2135 (sha256
2136 (base32
2137 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2138 (build-system gnu-build-system)
2139 (arguments
2140 `(#:tests? #f ; no 'check' target
2141 #:make-flags (list (string-append "prefix=" %output)
2142 "CC=gcc")
2143 ;; no configure script
2144 #:phases (alist-delete 'configure %standard-phases)))
2145 (inputs
2146 `(("perl" ,perl)))
2147 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2148 (synopsis "I2C tools for Linux")
2149 (description
2150 "The i2c-tools package contains a heterogeneous set of I2C tools for
2151 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2152 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2153 SMBus access.")
2154 (license license:gpl2+)))
2155
2156 (define-public xsensors
2157 (package
2158 (name "xsensors")
2159 (version "0.70")
2160 (source (origin
2161 (method url-fetch)
2162 (uri (string-append
2163 "http://www.linuxhardware.org/xsensors/xsensors-"
2164 version ".tar.gz"))
2165 (sha256
2166 (base32
2167 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2168 (build-system gnu-build-system)
2169 (inputs `(("lm-sensors" ,lm-sensors)
2170 ("gtk" ,gtk+-2)))
2171 (native-inputs `(("pkg-config" ,pkg-config)))
2172 (arguments
2173 `(#:phases (alist-cons-before
2174 'configure 'enable-deprecated
2175 (lambda _
2176 (substitute* "src/Makefile.in"
2177 (("-DGDK_DISABLE_DEPRECATED") "")
2178 (("-DGTK_DISABLE_DEPRECATED") "")))
2179 (alist-cons-before
2180 'configure 'remove-Werror
2181 (lambda _
2182 (substitute* '("configure" "src/Makefile.in")
2183 (("-Werror") "")))
2184 %standard-phases))))
2185 (home-page "http://www.linuxhardware.org/xsensors/")
2186 (synopsis "Hardware health information viewer")
2187 (description
2188 "Xsensors reads data from the libsensors library regarding hardware
2189 health such as temperature, voltage and fan speed and displays the information
2190 in a digital read-out.")
2191 (license license:gpl2+)))
2192
2193 (define-public perf
2194 (package
2195 (name "perf")
2196 (version (package-version linux-libre))
2197 (source (package-source linux-libre))
2198 (build-system gnu-build-system)
2199 (arguments
2200 '(#:phases (alist-replace
2201 'configure
2202 (lambda* (#:key inputs #:allow-other-keys)
2203 (setenv "SHELL_PATH" (which "bash"))
2204 (chdir "tools/perf"))
2205 %standard-phases)
2206 #:make-flags (list (string-append "DESTDIR="
2207 (assoc-ref %outputs "out"))
2208 "WERROR=0"
2209
2210 ;; By default, 'config/Makefile' uses lib64 on
2211 ;; x86_64. Work around that.
2212 "lib=lib")
2213 #:tests? #f)) ;no tests
2214 (native-inputs
2215 `(("pkg-config" ,pkg-config)
2216 ("bison" ,bison)
2217 ("flex" ,flex)
2218
2219 ;; There are build scripts written in these languages.
2220 ("perl" ,perl)
2221 ("python" ,python-2)))
2222 (inputs
2223 `(("slang" ,slang) ;for the interactive TUI
2224 ;; ("newt" ,newt)
2225 ("python" ,python-2) ;'perf' links against libpython
2226 ("elfutils" ,elfutils)
2227 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2228
2229 ;; Documentation.
2230 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2231 ("docbook-xsl" ,docbook-xsl)
2232 ("xmlto" ,xmlto)
2233 ("asciidoc" ,asciidoc)))
2234 (home-page "https://perf.wiki.kernel.org/")
2235 (synopsis "Linux profiling with performance counters")
2236 (description
2237 "perf is a tool suite for profiling using hardware performance counters,
2238 with support in the Linux kernel. perf can instrument CPU performance
2239 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2240 of lightweight profiling. This package contains the user-land tools and in
2241 particular the 'perf' command.")
2242 (license (package-license linux-libre))))
2243
2244 (define-public pflask
2245 (package
2246 (name "pflask")
2247 (version "0.2")
2248 (source (origin
2249 (method url-fetch)
2250 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2251 version ".tar.gz"))
2252 (file-name (string-append name "-" version ".tar.gz"))
2253 (sha256
2254 (base32
2255 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2256 (build-system cmake-build-system)
2257 (arguments
2258 '(#:tests? #f)) ; no tests
2259 (home-page "http://ghedo.github.io/pflask/")
2260 (synopsis "Simple tool for creating Linux namespace containers")
2261 (description "pflask is a simple tool for creating Linux namespace
2262 containers. It can be used for running a command or even booting an OS inside
2263 an isolated container, created with the help of Linux namespaces. It is
2264 similar in functionality to chroot, although pflask provides better isolation
2265 thanks to the use of namespaces.")
2266 (license license:bsd-2)))
2267
2268 (define-public hdparm
2269 (package
2270 (name "hdparm")
2271 (version "9.51")
2272 (source (origin
2273 (method url-fetch)
2274 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2275 name "-" version ".tar.gz"))
2276 (sha256
2277 (base32
2278 "14ax5lyzhigx58ing7adbfyzisv0fqajbmzphg149rnb3s4xiyhs"))))
2279 (build-system gnu-build-system)
2280 (arguments
2281 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2282 (list (string-append "binprefix=" out)
2283 (string-append "manprefix=" out)
2284 "CC=gcc"))
2285 #:phases
2286 (modify-phases %standard-phases
2287 (delete 'configure)) ; no configure script
2288 #:tests? #f)) ; no test suite
2289 (home-page "https://sourceforge.net/projects/hdparm/")
2290 (synopsis "View and tune ATA disk drive parameters")
2291 (description
2292 "@command{hdparm} is a command-line utility to control ATA controllers and
2293 disk drives. It can increase performance and/or reliability by careful tuning
2294 of hardware settings like power and acoustic management, DMA modes, and caching.
2295 It can also display detailed device information, or be used as a simple
2296 performance benchmarking tool.
2297
2298 @command{hdparm} provides a command line interface to various Linux kernel
2299 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2300 IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2301 Command Translation} (SAT) are also supported.")
2302 (license (license:non-copyleft "file://LICENSE.TXT"))))
2303
2304 (define-public rfkill
2305 (package
2306 (name "rfkill")
2307 (version "0.5")
2308 (source (origin
2309 (method url-fetch)
2310 (uri (string-append "mirror://kernel.org/software/network/"
2311 name "/" name "-" version ".tar.xz"))
2312 (sha256
2313 (base32
2314 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2315 (build-system gnu-build-system)
2316 (arguments
2317 `(#:make-flags (list "CC=gcc"
2318 (string-append "PREFIX=" %output))
2319 #:phases (modify-phases %standard-phases
2320 (delete 'configure))
2321 #:tests? #f))
2322 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2323 (synopsis "Tool for enabling and disabling wireless devices")
2324 (description
2325 "rfkill is a simple tool for accessing the rfkill device interface,
2326 which is used to enable and disable wireless networking devices, typically
2327 WLAN, Bluetooth and mobile broadband.")
2328 (license (license:non-copyleft "file://COPYING"
2329 "See COPYING in the distribution."))))
2330
2331 (define-public acpi
2332 (package
2333 (name "acpi")
2334 (version "1.7")
2335 (source (origin
2336 (method url-fetch)
2337 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2338 version "/" name "-" version ".tar.gz"))
2339 (sha256
2340 (base32
2341 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2342 (build-system gnu-build-system)
2343 (home-page "http://acpiclient.sourceforge.net")
2344 (synopsis "Display information on ACPI devices")
2345 (description "@code{acpi} attempts to replicate the functionality of the
2346 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2347 information. It does not support ACPI suspending, only displays information
2348 about ACPI devices.")
2349 (license license:gpl2+)))
2350
2351 (define-public acpid
2352 (package
2353 (name "acpid")
2354 (version "2.0.28")
2355 (source (origin
2356 (method url-fetch)
2357 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2358 version ".tar.xz"))
2359 (sha256
2360 (base32
2361 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2362 (build-system gnu-build-system)
2363 (home-page "https://sourceforge.net/projects/acpid2/")
2364 (synopsis "Daemon for delivering ACPI events to user-space programs")
2365 (description
2366 "acpid is designed to notify user-space programs of Advanced
2367 Configuration and Power Interface (ACPI) events. acpid should be started
2368 during the system boot, and will run as a background process. When an ACPI
2369 event is received from the kernel, acpid will examine the list of rules
2370 specified in /etc/acpi/events and execute the rules that match the event.")
2371 (license license:gpl2+)))
2372
2373 (define-public sysfsutils
2374 (package
2375 (name "sysfsutils")
2376 (version "2.1.0")
2377 (source
2378 (origin
2379 (method url-fetch)
2380 (uri
2381 (string-append
2382 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2383 version ".tar.gz"))
2384 (sha256
2385 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2386 (build-system gnu-build-system)
2387 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2388 (synopsis "System utilities based on Linux sysfs")
2389 (description
2390 "These are a set of utilities built upon sysfs, a virtual file system in
2391 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2392 also contains the libsysfs library.")
2393 ;; The library is under lgpl2.1+ (all files say "or any later version").
2394 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2395 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2396
2397 (define-public sysfsutils-1
2398 (package
2399 (inherit sysfsutils)
2400 (version "1.3.0")
2401 (source
2402 (origin
2403 (method url-fetch)
2404 (uri
2405 (string-append
2406 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2407 "/sysfsutils-" version ".tar.gz"))
2408 (sha256
2409 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2410 (modules '((guix build utils)))
2411 (snippet
2412 '(begin
2413 (substitute* "Makefile.in"
2414 (("includedir = /usr/include/sysfs")
2415 "includedir = @includedir@"))
2416 (substitute* "configure"
2417 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2418 (string-append "includedir='" orig "/sysfs'")))))))
2419 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2420
2421 (define-public cpufrequtils
2422 (package
2423 (name "cpufrequtils")
2424 (version "0.3")
2425 (source
2426 (origin
2427 (method url-fetch)
2428 (uri
2429 (string-append
2430 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2431 version ".tar.gz"))
2432 (sha256
2433 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2434 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2435 (build-system gnu-build-system)
2436 (native-inputs
2437 `(("sysfsutils" ,sysfsutils-1)))
2438 (arguments
2439 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2440 (assoc-ref %outputs "out") "/lib"))))
2441 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2442 (synopsis "Utilities to get and set CPU frequency on Linux")
2443 (description
2444 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2445 information, and set the CPU frequency if supported, using the cpufreq
2446 capabilities of the Linux kernel.")
2447 (license license:gpl2)))
2448
2449 (define-public libraw1394
2450 (package
2451 (name "libraw1394")
2452 (version "2.1.2")
2453 (source (origin
2454 (method url-fetch)
2455 (uri (string-append
2456 "mirror://kernel.org/linux/libs/ieee1394/"
2457 name "-" version ".tar.xz"))
2458 (sha256
2459 (base32
2460 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2461 (build-system gnu-build-system)
2462 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2463 (synopsis "Interface library for the Linux IEEE1394 drivers")
2464 (description
2465 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2466 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2467 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2468 send to and receive from other nodes without requiring a kernel driver for the
2469 protocol in question.")
2470 (license license:lgpl2.1+)))
2471
2472 (define-public libavc1394
2473 (package
2474 (name "libavc1394")
2475 (version "0.5.4")
2476 (source (origin
2477 (method url-fetch)
2478 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2479 name "-" version ".tar.gz"))
2480 (sha256
2481 (base32
2482 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2483 (build-system gnu-build-system)
2484 (native-inputs
2485 `(("pkg-config" ,pkg-config)))
2486 (propagated-inputs
2487 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2488 (home-page "https://sourceforge.net/projects/libavc1394/")
2489 (synopsis "AV/C protocol library for IEEE 1394")
2490 (description
2491 "Libavc1394 is a programming interface to the AV/C specification from
2492 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2493 (license license:lgpl2.1+)))
2494
2495 (define-public libiec61883
2496 (package
2497 (name "libiec61883")
2498 (version "1.2.0")
2499 (source (origin
2500 (method url-fetch)
2501 (uri (string-append
2502 "mirror://kernel.org/linux/libs/ieee1394/"
2503 name "-" version ".tar.xz"))
2504 (sha256
2505 (base32
2506 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2507 (build-system gnu-build-system)
2508 (native-inputs
2509 `(("pkg-config" ,pkg-config)))
2510 (propagated-inputs
2511 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2512 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2513 (synopsis "Isochronous streaming media library for IEEE 1394")
2514 (description
2515 "The libiec61883 library provides a higher level API for streaming DV,
2516 MPEG-2 and audio over Linux IEEE 1394.")
2517 (license license:lgpl2.1+)))
2518
2519 (define-public mdadm
2520 (package
2521 (name "mdadm")
2522 (version "4.0")
2523 (source (origin
2524 (method url-fetch)
2525 (uri (string-append
2526 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2527 version ".tar.xz"))
2528 (sha256
2529 (base32
2530 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2531 (build-system gnu-build-system)
2532 (inputs
2533 `(("udev" ,eudev)))
2534 (arguments
2535 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2536 (list "CC=gcc"
2537 "INSTALL=install"
2538 "CHECK_RUN_DIR=0"
2539 ;; TODO: tell it where to find 'sendmail'
2540 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2541 (string-append "BINDIR=" out "/sbin")
2542 (string-append "MANDIR=" out "/share/man")
2543 (string-append "UDEVDIR=" out "/lib/udev")))
2544 #:phases (alist-cons-before
2545 'build 'patch-program-paths
2546 (lambda* (#:key inputs #:allow-other-keys)
2547 (let ((coreutils (assoc-ref inputs "coreutils")))
2548 (substitute* "udev-md-raid-arrays.rules"
2549 (("/usr/bin/(readlink|basename)" all program)
2550 (string-append coreutils "/bin/" program)))))
2551 (alist-cons-before
2552 'build 'remove-W-error
2553 (lambda _
2554 ;; We cannot build with -Werror on i686 due to a
2555 ;; 'sign-compare' warning in util.c.
2556 (substitute* "Makefile"
2557 (("-Werror") ""))
2558 #t)
2559 (alist-delete 'configure %standard-phases)))
2560 ;;tests must be done as root
2561 #:tests? #f))
2562 (home-page "http://neil.brown.name/blog/mdadm")
2563 (synopsis "Tool for managing Linux Software RAID arrays")
2564 (description
2565 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2566 assemble, report on, and monitor arrays. It can also move spares between raid
2567 arrays when needed.")
2568 (license license:gpl2+)))
2569
2570 (define-public mdadm-static
2571 (package
2572 (inherit mdadm)
2573 (name "mdadm-static")
2574 (arguments
2575 (substitute-keyword-arguments (package-arguments mdadm)
2576 ((#:make-flags flags)
2577 `(cons "LDFLAGS = -static" ,flags))
2578 ((#:phases phases)
2579 `(modify-phases ,phases
2580 (add-after 'install 'remove-cruft
2581 (lambda* (#:key outputs #:allow-other-keys)
2582 (let* ((out (assoc-ref outputs "out"))
2583 (precious? (lambda (file)
2584 (member file '("." ".." "sbin"))))
2585 (directories (scandir out (negate precious?))))
2586 (with-directory-excursion out
2587 (for-each delete-file-recursively directories)
2588 (remove-store-references "sbin/mdadm")
2589 (delete-file "sbin/mdmon")
2590 #t))))))
2591 ((#:modules modules %gnu-build-system-modules)
2592 `((ice-9 ftw) ,@modules))
2593 ((#:strip-flags _ '())
2594 ''("--strip-all")) ;strip a few extra KiB
2595 ((#:allowed-references _ '("out"))
2596 '("out")))) ;refer only self
2597 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2598
2599 (define-public multipath-tools
2600 (package
2601 (name "multipath-tools")
2602 (version "0.6.4")
2603 (source (origin
2604 (method url-fetch)
2605 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2606 ".git;a=snapshot;h=" version ";sf=tgz"))
2607 (file-name (string-append name "-" version ".tar.gz"))
2608 (sha256
2609 (base32
2610 "12smwmljrkl2afc06dghd2253rqnfawvzr818a2xpxr06f44f9qy"))
2611 (modules '((guix build utils)))
2612 (snippet
2613 '(begin
2614 ;; Drop bundled valgrind headers.
2615 (delete-file-recursively "third-party")
2616 (substitute* '("multipathd/main.c"
2617 "libmultipath/debug.c")
2618 (("#include \"../third-party/")
2619 "#include \""))
2620 #t))))
2621 (build-system gnu-build-system)
2622 (arguments
2623 '(#:tests? #f ; No tests.
2624 #:make-flags (list (string-append "DESTDIR="
2625 (assoc-ref %outputs "out"))
2626 (string-append "LDFLAGS=-Wl,-rpath="
2627 (assoc-ref %outputs "out")
2628 "/lib"))
2629 #:phases
2630 (modify-phases %standard-phases
2631 (delete 'configure)
2632 (add-before 'build 'set-CC
2633 (lambda _
2634 (setenv "CC" "gcc")
2635 #t)))))
2636 (native-inputs
2637 `(("valgrind" ,valgrind)))
2638 (inputs
2639 `(("ceph:lib" ,ceph "lib")
2640 ("libaio" ,libaio)
2641 ("liburcu" ,liburcu)
2642 ("lvm2" ,lvm2)
2643 ("readline" ,readline)
2644 ("udev" ,eudev)))
2645 (home-page "http://christophe.varoqui.free.fr/")
2646 (synopsis "Access block devices through multiple paths")
2647 (description
2648 "This package provides the following binaries to drive the
2649 Linux Device Mapper multipathing driver:
2650 @enumerate
2651 @item @command{multipath} - Device mapper target autoconfig.
2652 @item @command{multipathd} - Multipath daemon.
2653 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2654 @code{dm} multipath devices.
2655 @item @command{kpartx} - Create device maps from partition tables.
2656 @end enumerate")
2657 (license (list license:gpl2+ ; Main distribution.
2658 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2659
2660 (define-public libaio
2661 (package
2662 (name "libaio")
2663 (version "0.3.110")
2664 (source (origin
2665 (method url-fetch)
2666 (uri (list
2667 (string-append "mirror://debian/pool/main/liba/libaio/"
2668 name "_" version ".orig.tar.gz")
2669 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2670 name "-" version ".tar.gz")))
2671 (sha256
2672 (base32
2673 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2674 (build-system gnu-build-system)
2675 (arguments
2676 '(#:make-flags
2677 (list "CC=gcc" (string-append "prefix=" %output))
2678 #:test-target "partcheck" ; need root for a full 'check'
2679 #:phases
2680 (alist-delete 'configure %standard-phases))) ; no configure script
2681 (home-page "http://lse.sourceforge.net/io/aio.html")
2682 (synopsis "Linux-native asynchronous I/O access library")
2683 (description
2684 "This library enables userspace to use Linux kernel asynchronous I/O
2685 system calls, important for the performance of databases and other advanced
2686 applications.")
2687 (license license:lgpl2.1+)))
2688
2689 (define-public sbc
2690 (package
2691 (name "sbc")
2692 (version "1.3")
2693 (source (origin
2694 (method url-fetch)
2695 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2696 name "-" version ".tar.xz"))
2697 (sha256
2698 (base32
2699 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2700 (build-system gnu-build-system)
2701 (inputs
2702 `(("libsndfile" ,libsndfile)))
2703 (native-inputs
2704 `(("pkg-config" ,pkg-config)))
2705 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2706 (synopsis "Bluetooth subband audio codec")
2707 (description
2708 "The SBC is a digital audio encoder and decoder used to transfer data to
2709 Bluetooth audio output devices like headphones or loudspeakers.")
2710 (license license:gpl2+)))
2711
2712 (define-public bluez
2713 (package
2714 (name "bluez")
2715 (version "5.44")
2716 (source (origin
2717 (method url-fetch)
2718 (uri (string-append
2719 "mirror://kernel.org/linux/bluetooth/bluez-"
2720 version ".tar.xz"))
2721 (sha256
2722 (base32
2723 "11bc6pndivd0rkqr3c8a1xd9ar9bb60gx79piskycicb3wliwchc"))))
2724 (build-system gnu-build-system)
2725 (arguments
2726 '(#:configure-flags
2727 (let ((out (assoc-ref %outputs "out")))
2728 (list "--sysconfdir=/etc"
2729 "--localstatedir=/var"
2730 "--enable-library"
2731 "--disable-systemd"
2732 ;; Install dbus/udev files to the correct location.
2733 (string-append "--with-dbusconfdir=" out "/etc")
2734 (string-append "--with-udevdir=" out "/lib/udev")))
2735 #:phases
2736 (modify-phases %standard-phases
2737 (add-after 'install 'post-install
2738 (lambda* (#:key inputs outputs #:allow-other-keys)
2739 (let* ((out (assoc-ref outputs "out"))
2740 (servicedir (string-append out "/share/dbus-1/services"))
2741 (service "obexd/src/org.bluez.obex.service")
2742 (rule (string-append
2743 out "/lib/udev/rules.d/97-hid2hci.rules")))
2744 ;; Install the obex dbus service file.
2745 (substitute* service
2746 (("/bin/false")
2747 (string-append out "/libexec/bluetooth/obexd")))
2748 (install-file service servicedir)
2749 ;; Fix paths in the udev rule.
2750 (substitute* rule
2751 (("hid2hci --method")
2752 (string-append out "/lib/udev/hid2hci --method"))
2753 (("/sbin/udevadm")
2754 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2755 #t))))))
2756 (native-inputs
2757 `(("pkg-config" ,pkg-config)
2758 ("gettext" ,gettext-minimal)))
2759 (inputs
2760 `(("glib" ,glib)
2761 ("dbus" ,dbus)
2762 ("eudev" ,eudev)
2763 ("libical" ,libical)
2764 ("readline" ,readline)))
2765 (home-page "http://www.bluez.org/")
2766 (synopsis "Linux Bluetooth protocol stack")
2767 (description
2768 "BlueZ provides support for the core Bluetooth layers and protocols. It
2769 is flexible, efficient and uses a modular implementation.")
2770 (license license:gpl2+)))
2771
2772 (define-public fuse-exfat
2773 (package
2774 (name "fuse-exfat")
2775 (version "1.2.6")
2776 (source (origin
2777 (method url-fetch)
2778 (uri (string-append
2779 "https://github.com/relan/exfat/releases/download/v"
2780 version "/" name "-" version ".tar.gz"))
2781 (sha256
2782 (base32
2783 "1rvq4hapy2anal1vg1yidv4x8rg4iw5sxfwqixkw0q2qsxb54471"))))
2784 (build-system gnu-build-system)
2785 (native-inputs
2786 `(("pkg-config" ,pkg-config)))
2787 (inputs
2788 `(("fuse" ,fuse)))
2789 (home-page "https://github.com/relan/exfat")
2790 (synopsis "Mount exFAT file systems")
2791 (description
2792 "This package provides a FUSE-based file system that provides read and
2793 write access to exFAT devices.")
2794 (license license:gpl2+)))
2795
2796 (define-public gpm
2797 (package
2798 (name "gpm")
2799 (version "1.20.7")
2800 (source (origin
2801 (method url-fetch)
2802 (uri (string-append
2803 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2804 version ".tar.bz2"))
2805 (sha256
2806 (base32
2807 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2808 (build-system gnu-build-system)
2809 (arguments
2810 '(#:phases (modify-phases %standard-phases
2811 (add-before 'configure 'bootstrap
2812 (lambda _
2813 ;; The tarball was not generated with 'make dist' so we
2814 ;; need to bootstrap things ourselves.
2815 (and (zero? (system* "./autogen.sh"))
2816 (begin
2817 (patch-makefile-SHELL "Makefile.include.in")
2818 #t)))))
2819
2820 ;; Make sure programs find libgpm.so.
2821 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2822 (assoc-ref %outputs "out")
2823 "/lib"))))
2824 (native-inputs
2825 `(("texinfo" ,texinfo)
2826 ("bison" ,bison)
2827 ("flex" ,flex)
2828 ("autoconf" ,autoconf)
2829 ("automake" ,automake)
2830 ("libtool" ,libtool)))
2831 (home-page "http://www.nico.schottelius.org/software/gpm/")
2832 (synopsis "Mouse support for the Linux console")
2833 (description
2834 "The GPM (general-purpose mouse) daemon is a mouse server for
2835 applications running on the Linux console. It allows users to select items
2836 and copy/paste text in the console and in xterm.")
2837 (license license:gpl2+)))
2838
2839 (define-public btrfs-progs
2840 (package
2841 (name "btrfs-progs")
2842 (version "4.10.2")
2843 (source (origin
2844 (method url-fetch)
2845 (uri (string-append "mirror://kernel.org/linux/kernel/"
2846 "people/kdave/btrfs-progs/"
2847 "btrfs-progs-v" version ".tar.xz"))
2848 (sha256
2849 (base32
2850 "02p63nz78lrr156cmbb759z76cn95hv6mmz7v592lmiq0dkxy2gd"))))
2851 (build-system gnu-build-system)
2852 (outputs '("out"
2853 "static")) ; static versions of binaries in "out" (~16MiB!)
2854 (arguments
2855 '(#:phases (modify-phases %standard-phases
2856 (add-after 'build 'build-static
2857 (lambda _ (zero? (system* "make" "static"))))
2858 (add-after 'install 'install-static
2859 (let ((staticbin (string-append (assoc-ref %outputs "static")
2860 "/bin")))
2861 (lambda _
2862 (zero? (system* "make"
2863 (string-append "bindir=" staticbin)
2864 "install-static"))))))
2865 #:test-target "test"
2866 #:parallel-tests? #f)) ; tests fail when run in parallel
2867 (inputs `(("e2fsprogs" ,e2fsprogs)
2868 ("libblkid" ,util-linux)
2869 ("libblkid:static" ,util-linux "static")
2870 ("libuuid" ,util-linux)
2871 ("libuuid:static" ,util-linux "static")
2872 ("zlib" ,zlib)
2873 ("lzo" ,lzo)))
2874 (native-inputs `(("pkg-config" ,pkg-config)
2875 ("asciidoc" ,asciidoc)
2876 ("xmlto" ,xmlto)
2877 ;; For building documentation.
2878 ("libxml2" ,libxml2)
2879 ("docbook-xsl" ,docbook-xsl)
2880 ;; For tests.
2881 ("which" ,which)))
2882 (home-page "https://btrfs.wiki.kernel.org/")
2883 (synopsis "Create and manage btrfs copy-on-write file systems")
2884 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
2885 aimed at implementing advanced features while focusing on fault tolerance,
2886 repair and easy administration.")
2887 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2888 ;; GPL2: Everything else.
2889 (license (list license:gpl2 license:gpl2+))))
2890
2891 (define-public btrfs-progs/static
2892 (package
2893 (name "btrfs-progs-static")
2894 (version (package-version btrfs-progs))
2895 (source #f)
2896 (build-system trivial-build-system)
2897 (inputs
2898 `(("btrfs-progs:static" ,btrfs-progs "static")))
2899 (arguments
2900 `(#:modules ((guix build utils))
2901 #:builder
2902 (begin
2903 (use-modules (guix build utils)
2904 (ice-9 ftw)
2905 (srfi srfi-26))
2906
2907 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
2908 (out (assoc-ref %outputs "out"))
2909 (source (string-append btrfs "/bin/btrfs.static"))
2910 (target (string-append out "/bin/btrfs")))
2911 (mkdir-p (dirname target))
2912 (copy-file source target)
2913 (remove-store-references target)
2914 (chmod target #o555)))))
2915 (home-page (package-home-page btrfs-progs))
2916 (synopsis "Statically-linked btrfs command from btrfs-progs")
2917 (description "This package provides the statically-linked @command{btrfs}
2918 from the btrfs-progs package. It is meant to be used in initrds.")
2919 (license (package-license btrfs-progs))))
2920
2921 (define-public freefall
2922 (package
2923 (name "freefall")
2924 (version (package-version linux-libre))
2925 (source (package-source linux-libre))
2926 (build-system gnu-build-system)
2927 (arguments
2928 '(#:phases (modify-phases %standard-phases
2929 (add-after 'unpack 'enter-subdirectory
2930 (lambda _
2931 (chdir "tools/laptop/freefall")))
2932 (delete 'configure)
2933 (add-before 'build 'increase-timeout
2934 (lambda _
2935 ;; The default of 2 seconds is too low: it assumes an
2936 ;; open lid and AC power without actually checking.
2937 (substitute* "freefall.c"
2938 (("alarm\\(2\\)") "alarm(5)")))))
2939 #:make-flags (list (string-append "PREFIX="
2940 (assoc-ref %outputs "out")))
2941 #:tests? #f)) ;no tests
2942 (home-page (package-home-page linux-libre))
2943 (synopsis "Free-fall protection for spinning laptop hard drives")
2944 (description
2945 "Prevents shock damage to the internal spinning hard drive(s) of some
2946 HP and Dell laptops. When sudden movement is detected, all input/output
2947 operations on the drive are suspended and its heads are parked on the ramp,
2948 where they are less likely to cause damage to the spinning disc. Requires a
2949 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2950 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2951 (license license:gpl2)))
2952
2953 (define-public thinkfan
2954 (package
2955 (name "thinkfan")
2956 (version "0.9.3")
2957 (source (origin
2958 (method url-fetch)
2959 (uri (string-append "mirror://sourceforge/thinkfan/"
2960 "/thinkfan-" version ".tar.gz"))
2961 (sha256
2962 (base32
2963 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2964 (modules '((guix build utils)))
2965 ;; Fix erroneous man page location in Makefile leading to
2966 ;; a compilation failure.
2967 (snippet
2968 '(substitute* "CMakeLists.txt"
2969 (("thinkfan\\.1") "src/thinkfan.1")))))
2970 (build-system cmake-build-system)
2971 (arguments
2972 `(#:modules ((guix build cmake-build-system)
2973 (guix build utils)
2974 (srfi srfi-26))
2975 #:tests? #f ;no test target
2976 #:configure-flags
2977 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2978 `("-DUSE_ATASMART:BOOL=ON")
2979 #:phases
2980 (modify-phases %standard-phases
2981 ;; Install scripts for various foreign init systems. Also fix
2982 ;; hard-coded path for daemon.
2983 (add-after 'install 'install-rc-scripts
2984 (lambda* (#:key outputs #:allow-other-keys)
2985 (let ((out (assoc-ref outputs "out"))
2986 (files (find-files
2987 (string-append "../thinkfan-" ,version "/rcscripts")
2988 ".*")))
2989 (substitute* files
2990 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2991 (string-append out "/sbin/" name)))
2992 (for-each (cute install-file <>
2993 (string-append out "/share/thinkfan"))
2994 files))
2995 #t)))))
2996 (inputs
2997 `(("libatasmart" ,libatasmart)))
2998 (home-page "http://thinkfan.sourceforge.net/")
2999 (synopsis "Simple fan control program")
3000 (description
3001 "Thinkfan is a simple fan control program. It reads temperatures,
3002 checks them against configured limits and switches to appropriate (also
3003 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3004 other @code{hwmon} driver that enables temperature reading and fan control
3005 from userspace.")
3006 (license license:gpl3+)))
3007
3008 (define-public ntfs-3g
3009 (package
3010 (name "ntfs-3g")
3011 (version "2016.2.22")
3012 (source (origin
3013 (method url-fetch)
3014 (uri (string-append "https://tuxera.com/opensource/"
3015 "ntfs-3g_ntfsprogs-" version ".tgz"))
3016 (sha256
3017 (base32
3018 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3019 (modules '((guix build utils)))
3020 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
3021 (snippet
3022 ;; Install under $prefix.
3023 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3024 (("/sbin")
3025 "@sbindir@")))))
3026 (build-system gnu-build-system)
3027 (inputs `(("util-linux" ,util-linux)
3028 ("fuse" ,fuse))) ;libuuid
3029 (native-inputs `(("pkg-config" ,pkg-config)))
3030 (arguments
3031 '(#:configure-flags (list "--exec-prefix=${prefix}"
3032 "--with-fuse=external" ;use our own FUSE
3033 "--enable-mount-helper"
3034 "--enable-posix-acls"
3035 "--enable-xattr-mappings")))
3036 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3037 (synopsis "Read-write access to NTFS file systems")
3038 (description
3039 "NTFS-3G provides read-write access to NTFS file systems, which are
3040 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3041 The package provides additional NTFS tools.")
3042 (license license:gpl2+)))
3043
3044 (define-public rdma-core
3045 (package
3046 (name "rdma-core")
3047 (version "13")
3048 (source (origin
3049 (method url-fetch)
3050 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3051 "/releases/download/v" version "/rdma-core-"
3052 version ".tar.gz"))
3053 (sha256
3054 (base32
3055 "15qdfqkia22vab1dh41s88vgi70yifi40ar5s4x7a456rpbhy8z5"))))
3056 (build-system cmake-build-system)
3057 (arguments
3058 '(#:tests? #f ; no tests
3059 ;; Upstream uses the "ninja" build system and encourage distros
3060 ;; to do the same for consistency. They also recommend using the
3061 ;; "Release" build type.
3062 #:configure-flags (list "-GNinja"
3063 ;; Defaults to "lib64" on 64-bit archs.
3064 (string-append "-DCMAKE_INSTALL_LIBDIR="
3065 (assoc-ref %outputs "out") "/lib")
3066 "-DCMAKE_BUILD_TYPE=Release")
3067 #:phases
3068 (modify-phases %standard-phases
3069 (replace 'build
3070 (lambda _
3071 (zero? (system* "ninja"
3072 "-j" (number->string (parallel-job-count))))))
3073 (replace 'install
3074 (lambda _
3075 (zero? (system* "ninja" "install")))))))
3076 (native-inputs
3077 `(("ninja" ,ninja)
3078 ("pkg-config" ,pkg-config)
3079 ("python" ,python-wrapper)))
3080 (inputs
3081 `(("libnl" ,libnl)
3082 ("udev" ,eudev)))
3083 (home-page "https://github.com/linux-rdma/rdma-core")
3084 (synopsis "Utilities and libraries for working with RDMA devices")
3085 (description
3086 "This package provides userspace components for the InfiniBand
3087 subsystem of the Linux kernel. Specifically it contains userspace
3088 libraries for the following device nodes:
3089
3090 @enumerate
3091 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3092 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3093 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3094 @end enumerate
3095
3096 The following service daemons are also provided:
3097 @enumerate
3098 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3099 @item @code{iwpmd} (for iWARP kernel providers)
3100 @item @code{ibacm} (for InfiniBand communication management assistant)
3101 @end enumerate")
3102 ;; All library code is dual licensed under GPL2 and a custom MIT
3103 ;; variant. The package also includes some components covered by
3104 ;; other licenses. Consult COPYING.md for full details.
3105 (license
3106 (list license:gpl2
3107 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3108 license:bsd-2 ; Files referring to COPYING.BSD_FB
3109 license:cc0 ; most files in ccan/
3110 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3111
3112 (define-public rng-tools
3113 (package
3114 (name "rng-tools")
3115 (version "5")
3116 (source (origin
3117 (method url-fetch)
3118 (uri (string-append
3119 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3120 "rng-tools-" version ".tar.gz"))
3121 (sha256
3122 (base32
3123 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3124 (build-system gnu-build-system)
3125 (synopsis "Random number generator daemon")
3126 (description
3127 "Monitor a hardware random number generator, and supply entropy
3128 from that to the system kernel's @file{/dev/random} machinery.")
3129 (home-page "https://sourceforge.net/projects/gkernel")
3130 ;; The source package is offered under the GPL2+, but the files
3131 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3132 (license (list license:gpl2 license:gpl2+))))
3133
3134 (define-public cpupower
3135 (package
3136 (name "cpupower")
3137 (version (package-version linux-libre))
3138 (source (package-source linux-libre))
3139 (build-system gnu-build-system)
3140 (arguments
3141 '(#:phases (modify-phases %standard-phases
3142 (add-after 'unpack 'enter-subdirectory
3143 (lambda _
3144 (chdir "tools/power/cpupower")))
3145 (delete 'configure)
3146 (add-before 'build 'fix-makefiles
3147 (lambda _
3148 (substitute* "Makefile"
3149 (("/usr/") "/")
3150 (("/bin/(install|pwd)" _ command) command))
3151 (substitute* "bench/Makefile"
3152 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3153 #:make-flags (let ((out (assoc-ref %outputs "out")))
3154 (list (string-append "DESTDIR=" out)
3155 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3156 "docdir=/share/doc/cpupower"
3157 "confdir=$(docdir)/examples"
3158 ;; The Makefile recommends the following changes
3159 "DEBUG=false"
3160 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3161 #:tests? #f)) ;no tests
3162 (native-inputs `(("gettext" ,gettext-minimal)))
3163 (inputs `(("pciutils" ,pciutils)))
3164 (home-page (package-home-page linux-libre))
3165 (synopsis "CPU frequency and voltage scaling tools for Linux")
3166 (description
3167 "cpupower is a set of user-space tools that use the cpufreq feature of the
3168 Linux kernel to retrieve and control processor features related to power saving,
3169 such as frequency and voltage scaling.")
3170 (license license:gpl2)))
3171
3172 (define-public haveged
3173 (package
3174 (name "haveged")
3175 (version "1.9.1")
3176 (source
3177 (origin
3178 (method url-fetch)
3179 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3180 version ".tar.gz"))
3181 (sha256
3182 (base32
3183 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3184 (build-system gnu-build-system)
3185 (home-page "http://www.issihosts.com/haveged")
3186 (synopsis "Entropy source for the Linux random number generator")
3187 (description
3188 "haveged generates an unpredictable stream of random numbers for use by
3189 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3190 standard mechanisms for filling the entropy pool may not be sufficient for
3191 systems with high needs or limited user interaction, such as headless servers.
3192 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3193 indirect effects of hardware events on hidden processor state using the HArdware
3194 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3195 its environment and provides the same built-in test suite for the output stream
3196 as used on certified hardware security devices.")
3197 (license (list (license:non-copyleft "file://nist/mconf.h")
3198 (license:non-copyleft "file://nist/packtest.c")
3199 license:public-domain ; nist/dfft.c
3200 license:gpl3+)))) ; everything else
3201
3202 (define-public ecryptfs-utils
3203 (package
3204 (name "ecryptfs-utils")
3205 (version "111")
3206 (source
3207 (origin
3208 (method url-fetch)
3209 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3210 version "/+download/ecryptfs-utils_"
3211 version ".orig.tar.gz"))
3212 (sha256
3213 (base32
3214 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3215 (build-system gnu-build-system)
3216 (arguments
3217 `(#:configure-flags (list "--disable-pywrap")))
3218 (native-inputs
3219 `(("intltool" ,intltool)
3220 ("perl" ,perl) ; for pod2man
3221 ("pkg-config" ,pkg-config)))
3222 (inputs
3223 `(("keyutils" ,keyutils)
3224 ("linux-pam" ,linux-pam)
3225 ("nss" ,nss)))
3226 (home-page "http://ecryptfs.org/")
3227 (synopsis "eCryptfs cryptographic file system utilities")
3228 (description
3229 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3230 Each file's cryptographic meta-data is stored inside the file itself, along
3231 with the encrypted contents. This allows individual encrypted files to be
3232 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3233 native Linux file system, and has been part of the Linux kernel since version
3234 2.6.19. This package contains the userland utilities to manage it.")
3235 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3236 ;; grant additional permission to link with OpenSSL.
3237 (license license:gpl2+)))
3238
3239 (define-public libnfsidmap
3240 (package
3241 (name "libnfsidmap")
3242 (version "0.25")
3243 (source (origin
3244 (method url-fetch)
3245 (uri (string-append
3246 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3247 name "/" name "-" version ".tar.gz"))
3248 (sha256
3249 (base32
3250 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3251 (build-system gnu-build-system)
3252 (arguments
3253 `(#:configure-flags (list
3254 (string-append "--with-pluginpath="
3255 (assoc-ref %outputs "out")
3256 "/lib/libnfsidmap"))))
3257 (home-page
3258 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3259 (synopsis
3260 "NFSv4 support library for name/ID mapping")
3261 (description "Libnfsidmap is a library holding mulitiple methods of
3262 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3263 extensible array of mapping functions, currently consisting of two choices:
3264 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3265 (license (license:non-copyleft "file://COPYING"
3266 "See COPYING in the distribution."))))
3267
3268 (define-public module-init-tools
3269 (package
3270 (name "module-init-tools")
3271 (version "3.16")
3272 (source (origin
3273 (method url-fetch)
3274 (uri (string-append
3275 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3276 "module-init-tools-" version ".tar.bz2"))
3277 (sha256
3278 (base32
3279 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3280 (patches (search-patches "module-init-tools-moduledir.patch"))))
3281 (build-system gnu-build-system)
3282 (arguments
3283 ;; FIXME: The upstream tarball lacks man pages, and building them would
3284 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3285 ;; but they vanished. In the meantime, fake it.
3286 '(#:phases (alist-cons-before
3287 'configure 'fake-docbook
3288 (lambda _
3289 (substitute* "Makefile.in"
3290 (("^DOCBOOKTOMAN.*$")
3291 "DOCBOOKTOMAN = true\n")))
3292 %standard-phases)))
3293 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3294 (synopsis "Tools for loading and managing Linux kernel modules")
3295 (description
3296 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3297 `insmod', `lsmod', and more.")
3298 (license license:gpl2+)))
3299
3300 (define-public mcelog
3301 (package
3302 (name "mcelog")
3303 (version "149")
3304 (source (origin
3305 (method url-fetch)
3306 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3307 "mcelog.git/snapshot/v" version ".tar.gz"))
3308 (sha256
3309 (base32
3310 "08hd8bl9rgss990icb69srarrfwcg8k7py979ak753j92ybbkhdm"))
3311 (file-name (string-append name "-" version ".tar.gz"))
3312 (modules '((guix build utils)))
3313 (snippet
3314 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3315 `(substitute* "Makefile"
3316 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3317 (build-system gnu-build-system)
3318 (arguments
3319 `(#:phases (modify-phases %standard-phases
3320 (delete 'configure)) ; no configure script
3321 #:make-flags (let ((out (assoc-ref %outputs "out")))
3322 (list "CC=gcc"
3323 (string-append "prefix=" out)
3324 (string-append "DOCDIR=" out "/share/doc/mcelog")
3325 "etcprefix=$(DOCDIR)/examples"))
3326 ;; The tests will only run as root on certain supported CPU models.
3327 #:tests? #f))
3328 (supported-systems (list "i686-linux" "x86_64-linux"))
3329 (home-page "http://mcelog.org/")
3330 (synopsis "Machine check monitor for x86 Linux systems")
3331 (description
3332 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3333 and other hardware errors on x86 systems. It can also perform user-defined
3334 tasks, such as bringing bad pages off-line, when configurable error thresholds
3335 are exceeded.")
3336 (license license:gpl2)))
3337
3338 (define-public mtd-utils
3339 (package
3340 (name "mtd-utils")
3341 (version "1.5.2")
3342 (source (origin
3343 (method url-fetch)
3344 (uri (string-append
3345 "ftp://ftp.infradead.org/pub/mtd-utils/"
3346 "mtd-utils-" version ".tar.bz2"))
3347 (sha256
3348 (base32
3349 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3350 (inputs
3351 `(("acl" ,acl)
3352 ("libuuid" ,util-linux)
3353 ("lzo", lzo)
3354 ("zlib" ,zlib)))
3355 (build-system gnu-build-system)
3356 (arguments
3357 `(#:test-target "tests"
3358 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3359 #:phases (modify-phases %standard-phases
3360 (delete 'configure))))
3361 (synopsis "MTD Flash Storage Utilities")
3362 (description "This package provides utilities for testing, partitioning, etc
3363 of flash storage.")
3364 (home-page "http://www.linux-mtd.infradead.org/")
3365 (license
3366 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3367 license:mpl1.1 ; All ftl* files
3368 license:expat)))) ; libiniparser
3369
3370 (define-public libseccomp
3371 (package
3372 (name "libseccomp")
3373 (version "2.3.2")
3374 (source (origin
3375 (method url-fetch)
3376 (uri (string-append "https://github.com/seccomp/libseccomp/"
3377 "releases/download/v" version
3378 "/libseccomp-" version ".tar.gz"))
3379 (sha256
3380 (base32
3381 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3382 (build-system gnu-build-system)
3383 (native-inputs
3384 `(("which" ,which)))
3385 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3386 (description "The libseccomp library provides an easy to use, platform
3387 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3388 libseccomp API is designed to abstract away the underlying BPF based syscall
3389 filter language and present a more conventional function-call based filtering
3390 interface that should be familiar to, and easily adopted by, application
3391 developers.")
3392 (home-page "https://github.com/seccomp/libseccomp")
3393 (license license:lgpl2.1)))
3394
3395 (define-public radeontop
3396 (package
3397 (name "radeontop")
3398 (version "0.9")
3399 (home-page "https://github.com/clbr/radeontop/")
3400 (source (origin
3401 (method url-fetch)
3402 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3403 (file-name (string-append name "-" version ".tar.gz"))
3404 (sha256
3405 (base32
3406 "07fnimn6wwablmdjw0av11hk9a6xilbryh09izq4b2ic4b8md2p7"))))
3407 (build-system gnu-build-system)
3408 (arguments
3409 `(#:phases (modify-phases %standard-phases
3410 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3411 ;; dependency, and doesn't even work on release(!) tarballs.
3412 (add-after 'unpack 'report-correct-version
3413 (lambda _ (substitute* "getver.sh"
3414 (("ver=unknown")
3415 (string-append "ver=" ,version)))))
3416 (delete 'configure)) ; no configure script
3417 #:make-flags (list "CC=gcc"
3418 (string-append "PREFIX=" %output))
3419 #:tests? #f)) ; no tests
3420 (native-inputs
3421 `(("gettext" ,gettext-minimal)
3422 ("pkg-config" ,pkg-config)))
3423 (inputs
3424 `(("libdrm" ,libdrm)
3425 ("libpciaccess" ,libpciaccess)
3426 ("ncurses" ,ncurses)))
3427 (synopsis "Usage monitor for AMD Radeon graphics")
3428 (description "RadeonTop monitors resource consumption on supported AMD
3429 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3430 a terminal or saved to a file for further processing. It measures both the
3431 activity of the GPU as a whole, which is also accurate during OpenCL
3432 computations, as well as separate component statistics that are only meaningful
3433 under OpenGL graphics workloads.")
3434 (license license:gpl3)))
3435
3436 (define-public efivar
3437 (package
3438 (name "efivar")
3439 (version "30")
3440 (source (origin
3441 (method url-fetch)
3442 (uri (string-append "https://github.com/rhinstaller/" name
3443 "/releases/download/" version "/" name
3444 "-" version ".tar.bz2"))
3445 (sha256
3446 (base32
3447 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3448 (build-system gnu-build-system)
3449 (arguments
3450 `(;; Tests require a UEFI system and is not detected in the chroot.
3451 #:tests? #f
3452 #:make-flags (list (string-append "prefix=" %output)
3453 (string-append "libdir=" %output "/lib")
3454 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3455 #:phases
3456 (modify-phases %standard-phases
3457 (delete 'configure))))
3458 (native-inputs
3459 `(("pkg-config" ,pkg-config)))
3460 (inputs
3461 `(("popt" ,popt)))
3462 (home-page "https://github.com/rhinstaller/efivar")
3463 (synopsis "Tool and library to manipulate EFI variables")
3464 (description "This package provides a library and a command line
3465 interface to the variable facility of UEFI boot firmware.")
3466 (license license:lgpl2.1+)))
3467
3468 (define-public efibootmgr
3469 (package
3470 (name "efibootmgr")
3471 (version "14")
3472 (source (origin
3473 (method url-fetch)
3474 (uri (string-append "https://github.com/rhinstaller/" name
3475 "/releases/download/" version "/" name
3476 "-" version ".tar.bz2"))
3477 (sha256
3478 (base32
3479 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3480 (build-system gnu-build-system)
3481 (arguments
3482 `(#:tests? #f ; No tests.
3483 #:make-flags (list (string-append "prefix=" %output)
3484 (string-append "libdir=" %output "/lib")
3485 ;; Override CFLAGS to add efivar include directory.
3486 (string-append "CFLAGS=-O2 -g -flto -I"
3487 (assoc-ref %build-inputs "efivar")
3488 "/include/efivar"))
3489 #:phases
3490 (modify-phases %standard-phases
3491 (add-after 'unpack 'branding
3492 ;; Replace default loader path with something more familiar.
3493 (lambda _
3494 (substitute* "src/efibootmgr.c"
3495 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3496 "EFI\\\\gnu"))
3497 #t))
3498 (delete 'configure))))
3499 (native-inputs
3500 `(("pkg-config" ,pkg-config)))
3501 (inputs
3502 `(("efivar" ,efivar)
3503 ("popt" ,popt)))
3504 (home-page "https://github.com/rhinstaller/efibootmgr")
3505 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3506 (description
3507 "@code{efibootmgr} is a user-space application to modify the Intel
3508 Extensible Firmware Interface (EFI) Boot Manager. This application can
3509 create and destroy boot entries, change the boot order, change the next
3510 running boot option, and more.")
3511 (license license:gpl2+)))
3512
3513 (define-public sysstat
3514 (package
3515 (name "sysstat")
3516 (version "11.4.3")
3517 (source (origin
3518 (method url-fetch)
3519 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3520 "sysstat-" version ".tar.xz"))
3521 (sha256
3522 (base32
3523 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3524 (build-system gnu-build-system)
3525 (arguments
3526 `(#:tests? #f ; No test suite.
3527 ;; Without this flag, it tries to install the man pages with group 'root'
3528 ;; and fails because /etc/passwd lacks an entry for the root user.
3529 #:configure-flags
3530 (list "--disable-file-attr"
3531 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3532 #:phases
3533 (modify-phases %standard-phases
3534 ;; The build process tries to create '/var/lib/sa', so we skip that
3535 ;; instruction.
3536 (add-after 'build 'skip-touching-var
3537 (lambda _
3538 (substitute* "Makefile"
3539 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3540 ""))
3541 #t)))))
3542 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3543 (synopsis "Performance monitoring tools for Linux")
3544 (description "The sysstat utilities are a collection of performance
3545 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3546 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3547 @code{sadf} and @code{sa}.")
3548 (license license:gpl2+)))
3549
3550 (define-public light
3551 (package
3552 (name "light")
3553 (version "1.0")
3554 (source (origin
3555 (method url-fetch)
3556 (uri (string-append "https://github.com/haikarainen/" name
3557 "/archive/v" version ".tar.gz"))
3558 (sha256
3559 (base32
3560 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3561 (file-name (string-append name "-" version ".tar.gz"))))
3562 (build-system gnu-build-system)
3563 (arguments
3564 '(#:tests? #f ; no tests
3565 #:make-flags (list "CC=gcc"
3566 (string-append "PREFIX=" %output))
3567 #:phases
3568 (modify-phases %standard-phases
3569 (delete 'configure)
3570 (add-after 'unpack 'patch-makefile
3571 (lambda _
3572 (substitute* "Makefile" (("chown") "#")))))))
3573 (native-inputs
3574 `(("help2man" ,help2man)))
3575 (home-page "https://haikarainen.github.io/light")
3576 (synopsis "GNU/Linux application to control backlights")
3577 (description
3578 "Light is a program to send commands to screen backlight controllers
3579 under GNU/Linux. Features include:
3580
3581 @itemize
3582 @item It does not rely on X.
3583 @item Light can automatically figure out the best controller to use, making
3584 full use of underlying hardware.
3585 @item It is possible to set a minimum brightness value, as some controllers
3586 set the screen to be pitch black at a vaĺue of 0 (or higher).
3587 @end itemize
3588
3589 Light is the successor of lightscript.")
3590 (license license:gpl3+)))
3591
3592 (define-public tlp
3593 (package
3594 (name "tlp")
3595 (version "0.9")
3596 (source (origin
3597 (method url-fetch)
3598 (uri (string-append
3599 "https://github.com/linrunner/"
3600 (string-upcase name)
3601 "/archive/" version ".tar.gz"))
3602 (file-name (string-append name "-" version ".tar.gz"))
3603 (sha256
3604 (base32
3605 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3606 (inputs `(("bash" ,bash)
3607 ("dbus" ,dbus)
3608 ("ethtool" ,ethtool)
3609 ("eudev" ,eudev)
3610 ("grep" ,grep)
3611 ("hdparm" ,hdparm)
3612 ("inetutils" ,inetutils)
3613 ("iw" ,iw)
3614 ("kmod" ,kmod)
3615 ("pciutils" ,pciutils)
3616 ("perl" ,perl)
3617 ("rfkill" ,rfkill)
3618 ("sed" ,sed)
3619 ("usbutils" ,usbutils)
3620 ("util-linux" ,util-linux)
3621 ("wireless-tools" ,wireless-tools)))
3622 (build-system gnu-build-system)
3623 (arguments
3624 `(#:phases
3625 (modify-phases %standard-phases
3626 (delete 'configure)
3627 (add-before 'build 'setenv
3628 (lambda* (#:key outputs #:allow-other-keys)
3629 (let ((out (assoc-ref outputs "out")))
3630 (setenv "TLP_WITH_SYSTEMD" "0")
3631 (setenv "TLP_NO_INIT" "1")
3632 (setenv "TLP_NO_PMUTILS" "1")
3633 (setenv "TLP_SBIN" (string-append out "/bin"))
3634 (setenv "TLP_BIN" (string-append out "/bin"))
3635 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3636 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3637 (setenv "TLP_CONF" "/etc/tlp")
3638 (setenv "TLP_SHCPL"
3639 (string-append out "/share/bash-completion/completions"))
3640 (setenv "TLP_MAN" (string-append out "/share/man")))))
3641 (delete 'check)
3642 (replace 'install
3643 (lambda _
3644 (system "make install-tlp install-man")))
3645 (add-after 'install 'wrap
3646 (lambda* (#:key inputs outputs #:allow-other-keys)
3647 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3648 (bin-files (find-files bin ".*")))
3649 (define (bin-directory input-name)
3650 (string-append (assoc-ref inputs input-name) "/bin"))
3651 (define (sbin-directory input-name)
3652 (string-append (assoc-ref inputs input-name) "/sbin"))
3653 (for-each (lambda (program)
3654 (wrap-program program
3655 `("PATH" ":" prefix
3656 ,(append
3657 (map bin-directory '("bash"
3658 "coreutils"
3659 "dbus"
3660 "eudev"
3661 "grep"
3662 "inetutils"
3663 "kmod"
3664 "perl"
3665 "sed"
3666 "usbutils"
3667 "util-linux"))
3668 (map sbin-directory '("ethtool"
3669 "hdparm"
3670 "iw"
3671 "pciutils"
3672 "rfkill"
3673 "wireless-tools"))))))
3674 bin-files)))))))
3675 (home-page "http://linrunner.de/en/tlp/tlp.html")
3676 (synopsis "Power management tool for Linux")
3677 (description "TLP is a power management tool for Linux. It comes with
3678 a default configuration already optimized for battery life. Nevertheless,
3679 TLP is customizable to fulfil system requirements. TLP settings are applied
3680 every time the power supply source is changed.")
3681
3682 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3683 ;; rest is GPLv2+.
3684 (license (list license:gpl2+ license:gpl3+))))
3685
3686 (define-public lshw
3687 (package
3688 (name "lshw")
3689 (version "B.02.18")
3690 (source (origin
3691 (method url-fetch)
3692 (uri (string-append "https://www.ezix.org/software/"
3693 "files/lshw-" version
3694 ".tar.gz"))
3695 (sha256
3696 (base32
3697 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3698 (build-system gnu-build-system)
3699 (arguments
3700 `(#:phases (modify-phases %standard-phases (delete 'configure))
3701 #:tests? #f ; no tests
3702 #:make-flags
3703 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3704 (synopsis "List hardware information")
3705 (description
3706 "@command{lshw} (Hardware Lister) is a small tool to provide
3707 detailed information on the hardware configuration of the machine.
3708 It can report exact memory configuration, firmware version, mainboard
3709 configuration, CPU version and speed, cache configuration, bus speed,
3710 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3711 machines (PowerMac G4 is known to work).")
3712 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3713 (license license:gpl2+)))