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