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