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