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