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