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