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