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