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