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