gnu: wireless-tools: Describe it as deprecated.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages linux)
23 #:use-module ((guix licenses)
24 #:hide (zlib))
25 #:use-module (gnu packages)
26 #:use-module ((gnu packages compression) #:prefix guix:)
27 #:use-module (gnu packages gcc)
28 #:use-module (gnu packages flex)
29 #:use-module (gnu packages bison)
30 #:use-module (gnu packages gperf)
31 #:use-module (gnu packages libusb)
32 #:use-module (gnu packages ncurses)
33 #:use-module (gnu packages pciutils)
34 #:use-module (gnu packages databases)
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
37 #:use-module (gnu packages python)
38 #:use-module (gnu packages algebra)
39 #:use-module (gnu packages gettext)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages pulseaudio)
42 #:use-module (gnu packages attr)
43 #:use-module (gnu packages xml)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages texinfo)
46 #:use-module (gnu packages check)
47 #:use-module (gnu packages maths)
48 #:use-module (gnu packages which)
49 #:use-module (gnu packages rrdtool)
50 #:use-module (gnu packages elf)
51 #:use-module (gnu packages gtk)
52 #:use-module (guix packages)
53 #:use-module (guix download)
54 #:use-module (guix utils)
55 #:use-module (guix build-system gnu)
56 #:use-module (guix build-system cmake)
57 #:use-module (guix build-system python)
58 #:use-module (guix build-system trivial)
59 #:use-module (srfi srfi-26)
60 #:use-module (ice-9 match))
61
62 (define-public (system->linux-architecture arch)
63 "Return the Linux architecture name for ARCH, a Guix system name such as
64 \"x86_64-linux\"."
65 (let ((arch (car (string-split arch #\-))))
66 (cond ((string=? arch "i686") "i386")
67 ((string-prefix? "mips" arch) "mips")
68 ((string-prefix? "arm" arch) "arm")
69 (else arch))))
70
71 (define (linux-libre-urls version)
72 "Return a list of URLs for Linux-Libre VERSION."
73 (list (string-append
74 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
75 version "-gnu/linux-libre-" version "-gnu.tar.xz")
76
77 ;; XXX: Work around <http://bugs.gnu.org/14851>.
78 (string-append
79 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
80 version "-gnu.tar.xz")
81
82 ;; Maybe this URL will become valid eventually.
83 (string-append
84 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
85 version "-gnu.tar.xz")))
86
87 (define-public linux-libre-headers
88 (let* ((version "3.3.8")
89 (build-phase
90 (lambda (arch)
91 `(lambda _
92 (setenv "ARCH" ,(system->linux-architecture arch))
93 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
94
95 (and (zero? (system* "make" "defconfig"))
96 (zero? (system* "make" "mrproper" "headers_check"))))))
97 (install-phase
98 `(lambda* (#:key outputs #:allow-other-keys)
99 (let ((out (assoc-ref outputs "out")))
100 (and (zero? (system* "make"
101 (string-append "INSTALL_HDR_PATH=" out)
102 "headers_install"))
103 (mkdir (string-append out "/include/config"))
104 (call-with-output-file
105 (string-append out
106 "/include/config/kernel.release")
107 (lambda (p)
108 (format p "~a-default~%" ,version))))))))
109 (package
110 (name "linux-libre-headers")
111 (version version)
112 (source (origin
113 (method url-fetch)
114 (uri (linux-libre-urls version))
115 (sha256
116 (base32
117 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
118 (build-system gnu-build-system)
119 (native-inputs `(("perl" ,perl)))
120 (arguments
121 `(#:modules ((guix build gnu-build-system)
122 (guix build utils)
123 (srfi srfi-1))
124 #:phases (alist-replace
125 'build ,(build-phase (or (%current-target-system)
126 (%current-system)))
127 (alist-replace
128 'install ,install-phase
129 (alist-delete 'configure %standard-phases)))
130 #:tests? #f))
131 (synopsis "GNU Linux-Libre kernel headers")
132 (description "Headers of the Linux-Libre kernel.")
133 (license gpl2)
134 (home-page "http://www.gnu.org/software/linux-libre/"))))
135
136 (define-public module-init-tools
137 (package
138 (name "module-init-tools")
139 (version "3.16")
140 (source (origin
141 (method url-fetch)
142 (uri (string-append
143 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
144 version ".tar.bz2"))
145 (sha256
146 (base32
147 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
148 (patches
149 (list (search-patch "module-init-tools-moduledir.patch")))))
150 (build-system gnu-build-system)
151 (arguments
152 ;; FIXME: The upstream tarball lacks man pages, and building them would
153 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
154 ;; but they vanished. In the meantime, fake it.
155 '(#:phases (alist-cons-before
156 'configure 'fake-docbook
157 (lambda _
158 (substitute* "Makefile.in"
159 (("^DOCBOOKTOMAN.*$")
160 "DOCBOOKTOMAN = true\n")))
161 %standard-phases)))
162 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
163 (synopsis "Tools for loading and managing Linux kernel modules")
164 (description
165 "Tools for loading and managing Linux kernel modules, such as `modprobe',
166 `insmod', `lsmod', and more.")
167 (license gpl2+)))
168
169 (define %boot-logo-patch
170 ;; Linux-Libre boot logo featuring Freedo and a gnu.
171 (origin
172 (method url-fetch)
173 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
174 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
175 (sha256
176 (base32
177 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
178
179 (define (kernel-config system)
180 "Return the absolute file name of the Linux-Libre build configuration file
181 for SYSTEM, or #f if there is no configuration for SYSTEM."
182 (define (lookup file)
183 (let ((file (string-append "gnu/packages/" file)))
184 (search-path %load-path file)))
185
186 (match system
187 ("i686-linux"
188 (lookup "linux-libre-i686.conf"))
189 ("x86_64-linux"
190 (lookup "linux-libre-x86_64.conf"))
191 (_
192 #f)))
193
194 (define-public linux-libre
195 (let* ((version "3.18.2")
196 (build-phase
197 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
198 ;; Apply the neat patch.
199 (system* "patch" "-p1" "--batch"
200 "-i" (assoc-ref inputs "patch/freedo+gnu"))
201
202 (let ((arch (car (string-split system #\-))))
203 (setenv "ARCH"
204 (cond ((string=? arch "i686") "i386")
205 (else arch)))
206 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
207
208 (let ((build (assoc-ref %standard-phases 'build))
209 (config (assoc-ref inputs "kconfig")))
210
211 ;; Use the architecture-specific config if available, and
212 ;; 'defconfig' otherwise.
213 (if config
214 (begin
215 (copy-file config ".config")
216 (chmod ".config" #o666))
217 (system* "make" "defconfig"))
218
219 ;; Appending works even when the option wasn't in the
220 ;; file. The last one prevails if duplicated.
221 (let ((port (open-file ".config" "a")))
222 (display (string-append "CONFIG_NET_9P=m\n"
223 "CONFIG_NET_9P_VIRTIO=m\n"
224 "CONFIG_VIRTIO_BLK=m\n"
225 "CONFIG_VIRTIO_NET=m\n"
226 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
227 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
228 "CONFIG_VIRTIO_PCI=m\n"
229 "CONFIG_VIRTIO_BALLOON=m\n"
230 "CONFIG_VIRTIO_MMIO=m\n"
231 "CONFIG_FUSE_FS=m\n"
232 "CONFIG_CIFS=m\n"
233 "CONFIG_9P_FS=m\n")
234 port)
235 (close-port port))
236
237 (zero? (system* "make" "oldconfig"))
238
239 ;; Call the default `build' phase so `-j' is correctly
240 ;; passed.
241 (apply build #:make-flags "all" args))))
242 (install-phase
243 `(lambda* (#:key inputs outputs #:allow-other-keys)
244 (let* ((out (assoc-ref outputs "out"))
245 (moddir (string-append out "/lib/modules"))
246 (mit (assoc-ref inputs "module-init-tools")))
247 (mkdir-p moddir)
248 (for-each (lambda (file)
249 (copy-file file
250 (string-append out "/" (basename file))))
251 (find-files "." "^(bzImage|System\\.map)$"))
252 (copy-file ".config" (string-append out "/config"))
253 (zero? (system* "make"
254 (string-append "DEPMOD=" mit "/sbin/depmod")
255 (string-append "MODULE_DIR=" moddir)
256 (string-append "INSTALL_PATH=" out)
257 (string-append "INSTALL_MOD_PATH=" out)
258 "INSTALL_MOD_STRIP=1"
259 "modules_install"))))))
260 (package
261 (name "linux-libre")
262 (version version)
263 (source (origin
264 (method url-fetch)
265 (uri (linux-libre-urls version))
266 (sha256
267 (base32
268 "0wji58x0zci13a499v6kbz3pyhs2gk6wsbv3fia8valxgbcppyhp"))))
269 (build-system gnu-build-system)
270 (native-inputs `(("perl" ,perl)
271 ("bc" ,bc)
272 ("module-init-tools" ,module-init-tools)
273 ("patch/freedo+gnu" ,%boot-logo-patch)
274
275 ,@(let ((conf (kernel-config (or (%current-target-system)
276 (%current-system)))))
277 (if conf
278 `(("kconfig" ,conf))
279 '()))))
280
281 ;; XXX: Work around an ICE with our patched GCC 4.8.3 while compiling
282 ;; 'drivers/staging/vt6656/michael.o': <http://hydra.gnu.org/build/96389/>.
283 (inputs `(("gcc" ,gcc-4.9)))
284
285 (arguments
286 `(#:modules ((guix build gnu-build-system)
287 (guix build utils)
288 (srfi srfi-1)
289 (ice-9 match))
290 #:phases (alist-replace
291 'build ,build-phase
292 (alist-replace
293 'install ,install-phase
294 (alist-delete 'configure %standard-phases)))
295 #:tests? #f))
296 (synopsis "100% free redistribution of a cleaned Linux kernel")
297 (description
298 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
299 It has been modified to remove all non-free binary blobs.")
300 (license gpl2)
301 (home-page "http://www.gnu.org/software/linux-libre/"))))
302
303 \f
304 ;;;
305 ;;; Pluggable authentication modules (PAM).
306 ;;;
307
308 (define-public linux-pam
309 (package
310 (name "linux-pam")
311 (version "1.1.6")
312 (source
313 (origin
314 (method url-fetch)
315 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
316 version ".tar.bz2")
317 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
318 version ".tar.bz2")))
319 (sha256
320 (base32
321 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
322 (build-system gnu-build-system)
323 (native-inputs
324 `(("flex" ,flex)
325
326 ;; TODO: optional dependencies
327 ;; ("libxcrypt" ,libxcrypt)
328 ;; ("cracklib" ,cracklib)
329 ))
330 (arguments
331 '(;; Most users, such as `shadow', expect the headers to be under
332 ;; `security'.
333 #:configure-flags (list (string-append "--includedir="
334 (assoc-ref %outputs "out")
335 "/include/security"))
336
337 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
338 ;; isn't available.
339 #:tests? #f))
340 (home-page "http://www.linux-pam.org/")
341 (synopsis "Pluggable authentication modules for Linux")
342 (description
343 "A *Free* project to implement OSF's RFC 86.0.
344 Pluggable authentication modules are small shared object files that can
345 be used through the PAM API to perform tasks, like authenticating a user
346 at login. Local and dynamic reconfiguration are its key features")
347 (license bsd-3)))
348
349 \f
350 ;;;
351 ;;; Miscellaneous.
352 ;;;
353
354 (define-public psmisc
355 (package
356 (name "psmisc")
357 (version "22.20")
358 (source
359 (origin
360 (method url-fetch)
361 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
362 version ".tar.gz"))
363 (sha256
364 (base32
365 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
366 (build-system gnu-build-system)
367 (inputs `(("ncurses" ,ncurses)))
368 (home-page "http://psmisc.sourceforge.net/")
369 (synopsis
370 "Small utilities that use the proc filesystem")
371 (description
372 "This PSmisc package is a set of some small useful utilities that
373 use the proc filesystem. We're not about changing the world, but
374 providing the system administrator with some help in common tasks.")
375 (license gpl2+)))
376
377 (define-public util-linux
378 (package
379 (name "util-linux")
380 (version "2.21")
381 (source (origin
382 (method url-fetch)
383 (uri (string-append "mirror://kernel.org/linux/utils/"
384 name "/v" version "/"
385 name "-" version ".2" ".tar.xz"))
386 (sha256
387 (base32
388 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
389 (patches (list (search-patch "util-linux-perl.patch")))
390 (modules '((guix build utils)))
391 (snippet
392 ;; We take the 'logger' program from GNU Inetutils, so remove
393 ;; it from here.
394 '(substitute* "misc-utils/Makefile.in"
395 (("PROGRAMS =(.*) logger(.*)" _ before after)
396 (string-append "PROGRAMS =" before " " after))
397 (("MANS =(.*) logger\\.1(.*)" _ before after)
398 (string-append "MANS =" before " " after))))))
399 (build-system gnu-build-system)
400 (arguments
401 `(#:configure-flags '("--disable-use-tty-group"
402 "--enable-ddate")
403 #:phases (alist-cons-after
404 'install 'patch-chkdupexe
405 (lambda* (#:key outputs #:allow-other-keys)
406 (let ((out (assoc-ref outputs "out")))
407 (substitute* (string-append out "/bin/chkdupexe")
408 ;; Allow 'patch-shebang' to do its work.
409 (("@PERL@") "/bin/perl"))))
410 %standard-phases)))
411 (inputs `(("zlib" ,guix:zlib)
412 ("ncurses" ,ncurses)))
413 (native-inputs
414 `(("perl" ,perl)))
415 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
416 (synopsis "Collection of utilities for the Linux kernel")
417 (description
418 "Util-linux is a random collection of utilities for the Linux kernel.")
419
420 ;; Note that util-linux doesn't use the same license for all the
421 ;; code. GPLv2+ is the default license for a code without an
422 ;; explicitly defined license.
423 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
424 bsd-4 public-domain))))
425
426 (define-public procps
427 (package
428 (name "procps")
429 (version "3.2.8")
430 (source (origin
431 (method url-fetch)
432 (uri (string-append "http://procps.sourceforge.net/procps-"
433 version ".tar.gz"))
434 (sha256
435 (base32
436 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
437 (patches (list (search-patch "procps-make-3.82.patch")))))
438 (build-system gnu-build-system)
439 (inputs `(("ncurses" ,ncurses)))
440 (arguments
441 '(#:phases (alist-replace
442 'configure
443 (lambda* (#:key outputs #:allow-other-keys)
444 ;; No `configure', just a single Makefile.
445 (let ((out (assoc-ref outputs "out")))
446 (substitute* "Makefile"
447 (("/usr/") "/")
448 (("--(owner|group) 0") "")
449 (("ldconfig") "true")
450 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
451 ;; Add libproc to the RPATH.
452 (string-append "LDFLAGS := -Wl,-rpath="
453 out "/lib" value))))
454 (setenv "CC" "gcc"))
455 (alist-replace
456 'install
457 (lambda* (#:key outputs #:allow-other-keys)
458 (let ((out (assoc-ref outputs "out")))
459 (and (zero?
460 (system* "make" "install"
461 (string-append "DESTDIR=" out)))
462
463 ;; Sanity check.
464 (zero?
465 (system* (string-append out "/bin/ps")
466 "--version")))))
467 %standard-phases))
468
469 ;; What did you expect? Tests?
470 #:tests? #f))
471 (home-page "http://procps.sourceforge.net/")
472 (synopsis "Utilities that give information about processes")
473 (description
474 "Procps is the package that has a bunch of small useful utilities
475 that give information about processes using the Linux /proc file system.
476 The package includes the programs ps, top, vmstat, w, kill, free,
477 slabtop, and skill.")
478 (license gpl2)))
479
480 (define-public usbutils
481 (package
482 (name "usbutils")
483 (version "006")
484 (source
485 (origin
486 (method url-fetch)
487 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
488 "usbutils-" version ".tar.xz"))
489 (sha256
490 (base32
491 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
492 (build-system gnu-build-system)
493 (inputs
494 `(("libusb" ,libusb)))
495 (native-inputs
496 `(("pkg-config" ,pkg-config)))
497 (home-page "http://www.linux-usb.org/")
498 (synopsis
499 "Tools for working with USB devices, such as lsusb")
500 (description
501 "Tools for working with USB devices, such as lsusb.")
502 (license gpl2+)))
503
504 (define-public e2fsprogs
505 (package
506 (name "e2fsprogs")
507 (version "1.42.7")
508 (source (origin
509 (method url-fetch)
510 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
511 version ".tar.gz"))
512 (sha256
513 (base32
514 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
515 (build-system gnu-build-system)
516 (inputs `(("util-linux" ,util-linux)))
517 (native-inputs `(("pkg-config" ,pkg-config)
518 ("texinfo" ,texinfo))) ; for the libext2fs Info manual
519 (arguments
520 '(;; The 'blkid' command and library are already provided by util-linux,
521 ;; which is the preferred source for them (see, e.g.,
522 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b336339909c90559b7db40b455f172>.)
523 #:configure-flags '("--disable-blkid")
524
525 #:phases (alist-cons-before
526 'configure 'patch-shells
527 (lambda _
528 (substitute* "configure"
529 (("/bin/sh (.*)parse-types.sh" _ dir)
530 (string-append (which "sh") " " dir
531 "parse-types.sh")))
532 (substitute* (find-files "." "^Makefile.in$")
533 (("#!/bin/sh")
534 (string-append "#!" (which "sh")))))
535 %standard-phases)
536
537 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
538 ;; they fail because we get an extra line that says "Can't check if
539 ;; filesystem is mounted due to missing mtab file".
540 #:tests? #f))
541 (home-page "http://e2fsprogs.sourceforge.net/")
542 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
543 (description
544 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
545 (license (list gpl2 ; programs
546 lgpl2.0 ; libext2fs
547 x11)))) ; libuuid
548
549 (define-public e2fsck/static
550 (package
551 (name "e2fsck-static")
552 (version (package-version e2fsprogs))
553 (build-system trivial-build-system)
554 (source #f)
555 (arguments
556 `(#:modules ((guix build utils))
557 #:builder
558 (begin
559 (use-modules (guix build utils)
560 (ice-9 ftw)
561 (srfi srfi-26))
562
563 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
564 "/sbin"))
565 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
566 (mkdir-p bin)
567 (with-directory-excursion bin
568 (for-each (lambda (file)
569 (copy-file (string-append source "/" file)
570 file)
571 (remove-store-references file)
572 (chmod file #o555))
573 (scandir source (cut string-prefix? "fsck." <>))))))))
574 (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
575 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
576 (description
577 "This package provides statically-linked command of fsck.ext[234] taken
578 from the e2fsprogs package. It is meant to be used in initrds.")
579 (home-page (package-home-page e2fsprogs))
580 (license (package-license e2fsprogs))))
581
582 (define-public strace
583 (package
584 (name "strace")
585 (version "4.7")
586 (source (origin
587 (method url-fetch)
588 (uri (string-append "mirror://sourceforge/strace/strace-"
589 version ".tar.xz"))
590 (sha256
591 (base32
592 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
593 (build-system gnu-build-system)
594 (native-inputs `(("perl" ,perl)))
595 (home-page "http://strace.sourceforge.net/")
596 (synopsis "System call tracer for Linux")
597 (description
598 "strace is a system call tracer, i.e. a debugging tool which prints out a
599 trace of all the system calls made by a another process/program.")
600 (license bsd-3)))
601
602 (define-public alsa-lib
603 (package
604 (name "alsa-lib")
605 (version "1.0.27.1")
606 (source (origin
607 (method url-fetch)
608 (uri (string-append
609 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
610 version ".tar.bz2"))
611 (sha256
612 (base32
613 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
614 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
615 (build-system gnu-build-system)
616 (home-page "http://www.alsa-project.org/")
617 (synopsis "The Advanced Linux Sound Architecture libraries")
618 (description
619 "The Advanced Linux Sound Architecture (ALSA) provides audio and
620 MIDI functionality to the Linux-based operating system.")
621 (license lgpl2.1+)))
622
623 (define-public alsa-utils
624 (package
625 (name "alsa-utils")
626 (version "1.0.27.2")
627 (source (origin
628 (method url-fetch)
629 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
630 version ".tar.bz2"))
631 (sha256
632 (base32
633 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
634 (build-system gnu-build-system)
635 (arguments
636 ;; XXX: Disable man page creation until we have DocBook.
637 '(#:configure-flags (list "--disable-xmlto"
638
639 ;; The udev rule is responsible for restoring
640 ;; the volume.
641 (string-append "--with-udev-rules-dir="
642 (assoc-ref %outputs "out")
643 "/lib/udev/rules.d"))
644 #:phases (alist-cons-before
645 'install 'pre-install
646 (lambda _
647 ;; Don't try to mkdir /var/lib/alsa.
648 (substitute* "Makefile"
649 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
650 "true\n")))
651 %standard-phases)))
652 (inputs
653 `(("libsamplerate" ,libsamplerate)
654 ("ncurses" ,ncurses)
655 ("alsa-lib" ,alsa-lib)
656 ("xmlto" ,xmlto)
657 ("gettext" ,gnu-gettext)))
658 (home-page "http://www.alsa-project.org/")
659 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
660 (description
661 "The Advanced Linux Sound Architecture (ALSA) provides audio and
662 MIDI functionality to the Linux-based operating system.")
663
664 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
665 ;; GPLv2-only.
666 (license gpl2)))
667
668 (define-public iptables
669 (package
670 (name "iptables")
671 (version "1.4.16.2")
672 (source (origin
673 (method url-fetch)
674 (uri (string-append
675 "http://www.netfilter.org/projects/iptables/files/iptables-"
676 version ".tar.bz2"))
677 (sha256
678 (base32
679 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
680 (build-system gnu-build-system)
681 (arguments '(#:tests? #f)) ; no test suite
682 (home-page "http://www.netfilter.org/projects/iptables/index.html")
683 (synopsis "Program to configure the Linux IP packet filtering rules")
684 (description
685 "iptables is the userspace command line program used to configure the
686 Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
687 system administrators. Since Network Address Translation is also configured
688 from the packet filter ruleset, iptables is used for this, too. The iptables
689 package also includes ip6tables. ip6tables is used for configuring the IPv6
690 packet filter.")
691 (license gpl2+)))
692
693 (define-public iproute
694 (package
695 (name "iproute2")
696 (version "3.12.0")
697 (source (origin
698 (method url-fetch)
699 (uri (string-append
700 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
701 version ".tar.xz"))
702 (sha256
703 (base32
704 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
705 (build-system gnu-build-system)
706 (arguments
707 `(#:tests? #f ; no test suite
708 #:make-flags (let ((out (assoc-ref %outputs "out")))
709 (list "DESTDIR="
710 (string-append "LIBDIR=" out "/lib")
711 (string-append "SBINDIR=" out "/sbin")
712 (string-append "CONFDIR=" out "/etc")
713 (string-append "DOCDIR=" out "/share/doc/"
714 ,name "-" ,version)
715 (string-append "MANDIR=" out "/share/man")))
716 #:phases (alist-cons-before
717 'install 'pre-install
718 (lambda _
719 ;; Don't attempt to create /var/lib/arpd.
720 (substitute* "Makefile"
721 (("^.*ARPDDIR.*$") "")))
722 %standard-phases)))
723 (inputs
724 `(("iptables" ,iptables)
725 ("db4" ,bdb)))
726 (native-inputs
727 `(("pkg-config" ,pkg-config)
728 ("flex" ,flex)
729 ("bison" ,bison)))
730 (home-page
731 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
732 (synopsis
733 "Utilities for controlling TCP/IP networking and traffic in Linux")
734 (description
735 "Iproute2 is a collection of utilities for controlling TCP/IP
736 networking and traffic with the Linux kernel.
737
738 Most network configuration manuals still refer to ifconfig and route as the
739 primary network configuration tools, but ifconfig is known to behave
740 inadequately in modern network environments. They should be deprecated, but
741 most distros still include them. Most network configuration systems make use
742 of ifconfig and thus provide a limited feature set. The /etc/net project aims
743 to support most modern network technologies, as it doesn't use ifconfig and
744 allows a system administrator to make use of all iproute2 features, including
745 traffic control.
746
747 iproute2 is usually shipped in a package called iproute or iproute2 and
748 consists of several tools, of which the most important are ip and tc. ip
749 controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
750 tools print detailed usage messages and are accompanied by a set of
751 manpages.")
752 (license gpl2+)))
753
754 (define-public net-tools
755 ;; XXX: This package is basically unmaintained, but it provides a few
756 ;; commands not yet provided by Inetutils, such as 'route', so we have to
757 ;; live with it.
758 (package
759 (name "net-tools")
760 (version "1.60")
761 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
762 (source (origin
763 (method url-fetch)
764 (uri (string-append home-page "/" name "-"
765 version ".tar.bz2"))
766 (sha256
767 (base32
768 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
769 (patches
770 (list (search-patch "net-tools-bitrot.patch")))))
771 (build-system gnu-build-system)
772 (arguments
773 '(#:phases (alist-cons-after
774 'unpack 'patch
775 (lambda* (#:key inputs #:allow-other-keys)
776 (define (apply-patch file)
777 (zero? (system* "patch" "-p1" "--batch"
778 "--input" file)))
779
780 (let ((patch.gz (assoc-ref inputs "patch")))
781 (format #t "applying Debian patch set '~a'...~%"
782 patch.gz)
783 (system (string-append "gunzip < " patch.gz " > the-patch"))
784 (pk 'here)
785 (and (apply-patch "the-patch")
786 (for-each apply-patch
787 (find-files "debian/patches"
788 "\\.patch")))))
789 (alist-replace
790 'configure
791 (lambda* (#:key outputs #:allow-other-keys)
792 (let ((out (assoc-ref outputs "out")))
793 (mkdir-p (string-append out "/bin"))
794 (mkdir-p (string-append out "/sbin"))
795
796 ;; Pretend we have everything...
797 (system "yes | make config")
798
799 ;; ... except we don't have libdnet, so remove that
800 ;; definition.
801 (substitute* '("config.make" "config.h")
802 (("^.*HAVE_AFDECnet.*$") ""))))
803 %standard-phases))
804
805 ;; Binaries that depend on libnet-tools.a don't declare that
806 ;; dependency, making it parallel-unsafe.
807 #:parallel-build? #f
808
809 #:tests? #f ; no test suite
810 #:make-flags (let ((out (assoc-ref %outputs "out")))
811 (list "CC=gcc"
812 (string-append "BASEDIR=" out)
813 (string-append "INSTALLNLSDIR=" out "/share/locale")
814 (string-append "mandir=/share/man")))))
815
816 ;; Use the big Debian patch set (the thing does not even compile out of
817 ;; the box.)
818 (inputs `(("patch" ,(origin
819 (method url-fetch)
820 (uri
821 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
822 (sha256
823 (base32
824 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
825 (native-inputs `(("gettext" ,gnu-gettext)))
826
827 (synopsis "Tools for controlling the network subsystem in Linux")
828 (description
829 "This package includes the important tools for controlling the network
830 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
831 netstat, rarp and route. Additionally, this package contains utilities
832 relating to particular network hardware types (plipconfig, slattach) and
833 advanced aspects of IP configuration (iptunnel, ipmaddr).")
834 (license gpl2+)))
835
836 (define-public libcap
837 (package
838 (name "libcap")
839 (version "2.22")
840 (source (origin
841 (method url-fetch)
842
843 ;; Tarballs used to be available from
844 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
845 ;; but they never came back after kernel.org was compromised.
846 (uri (string-append
847 "mirror://debian/pool/main/libc/libcap2/libcap2_"
848 version ".orig.tar.gz"))
849 (sha256
850 (base32
851 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
852 (build-system gnu-build-system)
853 (arguments '(#:phases (alist-delete 'configure %standard-phases)
854 #:tests? #f ; no 'check' target
855 #:make-flags (list "lib=lib"
856 (string-append "prefix="
857 (assoc-ref %outputs "out"))
858 "RAISE_SETFCAP=no")))
859 (native-inputs `(("perl" ,perl)))
860 (inputs `(("attr" ,attr)))
861 (home-page "https://sites.google.com/site/fullycapable/")
862 (synopsis "Library for working with POSIX capabilities")
863 (description
864 "Libcap2 provides a programming interface to POSIX capabilities on
865 Linux-based operating systems.")
866
867 ;; License is BSD-3 or GPLv2, at the user's choice.
868 (license gpl2)))
869
870 (define-public bridge-utils
871 (package
872 (name "bridge-utils")
873 (version "1.5")
874 (source (origin
875 (method url-fetch)
876 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
877 version ".tar.gz"))
878 (sha256
879 (base32
880 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
881 (build-system gnu-build-system)
882
883 ;; The tarball lacks all the generated files.
884 (native-inputs `(("autoconf" ,autoconf)
885 ("automake" ,automake)))
886 (arguments
887 '(#:phases (alist-cons-before
888 'configure 'bootstrap
889 (lambda _
890 (zero? (system* "autoreconf" "-vf")))
891 %standard-phases)
892 #:tests? #f)) ; no 'check' target
893
894 (home-page
895 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
896 (synopsis "Manipulate Ethernet bridges")
897 (description
898 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
899 to connect two Ethernet segments together in a protocol independent way.
900 Packets are forwarded based on Ethernet address, rather than IP address (like
901 a router). Since forwarding is done at Layer 2, all protocols can go
902 transparently through a bridge.")
903 (license gpl2+)))
904
905 (define-public libnl
906 (package
907 (name "libnl")
908 (version "3.2.25")
909 (source (origin
910 (method url-fetch)
911 (uri (string-append
912 "http://www.infradead.org/~tgr/libnl/files/libnl-"
913 version ".tar.gz"))
914 (sha256
915 (base32
916 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
917 (build-system gnu-build-system)
918 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
919 (home-page "http://www.infradead.org/~tgr/libnl/")
920 (synopsis "NetLink protocol library suite")
921 (description
922 "The libnl suite is a collection of libraries providing APIs to netlink
923 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
924 between the kernel and user space processes. It was designed to be a more
925 flexible successor to ioctl to provide mainly networking related kernel
926 configuration and monitoring interfaces.")
927
928 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
929 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
930 (license gpl2)))
931
932 (define-public iw
933 (package
934 (name "iw")
935 (version "3.17")
936 (source (origin
937 (method url-fetch)
938 (uri (string-append
939 "https://www.kernel.org/pub/software/network/iw/iw-"
940 version ".tar.xz"))
941 (sha256
942 (base32
943 "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8"))))
944 (build-system gnu-build-system)
945 (native-inputs `(("pkg-config" ,pkg-config)))
946 (inputs `(("libnl" ,libnl)))
947 (arguments
948 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
949 "CC=gcc")
950 #:phases (alist-delete 'configure %standard-phases)))
951 (home-page "http://wireless.kernel.org/en/users/Documentation/iw")
952 (synopsis "Tool for configuring wireless devices")
953 (description
954 "iw is a new nl80211 based CLI configuration utility for wireless
955 devices. It replaces 'iwconfig', which is deprecated.")
956 (license isc)))
957
958 (define-public powertop
959 (package
960 (name "powertop")
961 (version "2.5")
962 (source
963 (origin
964 (method url-fetch)
965 (uri (string-append
966 "https://01.org/powertop/sites/default/files/downloads/powertop-"
967 version ".tar.gz"))
968 (sha256
969 (base32
970 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
971 (build-system gnu-build-system)
972 (inputs
973 ;; TODO: Add pciutils.
974 `(("zlib" ,guix:zlib)
975 ;; ("pciutils" ,pciutils)
976 ("ncurses" ,ncurses)
977 ("libnl" ,libnl)))
978 (native-inputs
979 `(("pkg-config" ,pkg-config)))
980 (home-page "https://01.org/powertop/")
981 (synopsis "Analyze power consumption on Intel-based laptops")
982 (description
983 "PowerTOP is a Linux tool to diagnose issues with power consumption and
984 power management. In addition to being a diagnostic tool, PowerTOP also has
985 an interactive mode where the user can experiment various power management
986 settings for cases where the operating system has not enabled these
987 settings.")
988 (license gpl2)))
989
990 (define-public aumix
991 (package
992 (name "aumix")
993 (version "2.9.1")
994 (source (origin
995 (method url-fetch)
996 (uri (string-append
997 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
998 version ".tar.bz2"))
999 (sha256
1000 (base32
1001 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1002 (build-system gnu-build-system)
1003 (inputs `(("ncurses" ,ncurses)))
1004 (home-page "http://www.jpj.net/~trevor/aumix.html")
1005 (synopsis "Audio mixer for X and the console")
1006 (description
1007 "Aumix adjusts an audio mixer from X, the console, a terminal,
1008 the command line or a script.")
1009 (license gpl2+)))
1010
1011 (define-public iotop
1012 (package
1013 (name "iotop")
1014 (version "0.6")
1015 (source
1016 (origin
1017 (method url-fetch)
1018 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1019 version ".tar.gz"))
1020 (sha256 (base32
1021 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1022 (build-system python-build-system)
1023 (arguments
1024 ;; The setup.py script expects python-2.
1025 `(#:python ,python-2
1026 ;; There are currently no checks in the package.
1027 #:tests? #f))
1028 (native-inputs `(("python" ,python-2)))
1029 (home-page "http://guichaz.free.fr/iotop/")
1030 (synopsis
1031 "Displays the IO activity of running processes")
1032 (description
1033 "Iotop is a Python program with a top like user interface to show the
1034 processes currently causing I/O.")
1035 (license gpl2+)))
1036
1037 (define-public fuse
1038 (package
1039 (name "fuse")
1040 (version "2.9.3")
1041 (source (origin
1042 (method url-fetch)
1043 (uri (string-append "mirror://sourceforge/fuse/fuse-"
1044 version ".tar.gz"))
1045 (sha256
1046 (base32
1047 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
1048 (build-system gnu-build-system)
1049 (inputs `(("util-linux" ,util-linux)))
1050 (arguments
1051 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1052 (assoc-ref %outputs "out")
1053 "/sbin")
1054 (string-append "INIT_D_PATH="
1055 (assoc-ref %outputs "out")
1056 "/etc/init.d")
1057
1058 ;; The rule makes /dev/fuse 666.
1059 (string-append "UDEV_RULES_PATH="
1060 (assoc-ref %outputs "out")
1061 "/lib/udev/rules.d"))
1062 #:phases (alist-cons-before
1063 'build 'set-file-names
1064 (lambda* (#:key inputs #:allow-other-keys)
1065 ;; libfuse calls out to mount(8) and umount(8). Make sure
1066 ;; it refers to the right ones.
1067 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1068 (("/bin/(u?)mount" _ maybe-u)
1069 (string-append (assoc-ref inputs "util-linux")
1070 "/bin/" maybe-u "mount")))
1071 (substitute* '("util/mount.fuse.c")
1072 (("/bin/sh")
1073 (which "sh")))
1074
1075 ;; This hack leads libfuse to search for 'fusermount' in
1076 ;; $PATH, where it may find a setuid-root binary, instead of
1077 ;; trying solely $out/sbin/fusermount and failing because
1078 ;; it's not setuid.
1079 (substitute* "lib/Makefile"
1080 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1081 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1082 %standard-phases)))
1083 (home-page "http://fuse.sourceforge.net/")
1084 (synopsis "Support file systems implemented in user space")
1085 (description
1086 "As a consequence of its monolithic design, file system code for Linux
1087 normally goes into the kernel itself---which is not only a robustness issue,
1088 but also an impediment to system extensibility. FUSE, for \"file systems in
1089 user space\", is a kernel module and user-space library that tries to address
1090 part of this problem by allowing users to run file system implementations as
1091 user-space processes.")
1092 (license (list lgpl2.1 ; library
1093 gpl2+)))) ; command-line utilities
1094
1095 (define-public unionfs-fuse
1096 (package
1097 (name "unionfs-fuse")
1098 (version "0.26")
1099 (source (origin
1100 (method url-fetch)
1101 (uri (string-append
1102 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1103 version ".tar.xz"))
1104 (sha256
1105 (base32
1106 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1107 (build-system cmake-build-system)
1108 (inputs `(("fuse" ,fuse)))
1109 (arguments '(#:tests? #f)) ; no tests
1110 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1111 (synopsis "User-space union file system")
1112 (description
1113 "UnionFS-FUSE is a flexible union file system implementation in user
1114 space, using the FUSE library. Mounting a union file system allows you to
1115 \"aggregate\" the contents of several directories into a single mount point.
1116 UnionFS-FUSE additionally supports copy-on-write.")
1117 (license bsd-3)))
1118
1119 (define fuse-static
1120 (package (inherit fuse)
1121 (name "fuse-static")
1122 (source (origin (inherit (package-source fuse))
1123 (modules '((guix build utils)))
1124 (snippet
1125 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1126 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1127 ;; it doesn't do that, allowing us to remove the dependency on
1128 ;; util-linux (something that is useful in initrds.)
1129 '(substitute* '("lib/mount_util.c"
1130 "util/mount_util.c")
1131 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1132 "0")
1133 (("/bin/")
1134 "")))))))
1135
1136 (define-public unionfs-fuse/static
1137 (package (inherit unionfs-fuse)
1138 (synopsis "User-space union file system (statically linked)")
1139 (name (string-append (package-name unionfs-fuse) "-static"))
1140 (source (origin (inherit (package-source unionfs-fuse))
1141 (modules '((guix build utils)))
1142 (snippet
1143 ;; Add -ldl to the libraries, because libfuse.a needs that.
1144 '(substitute* "src/CMakeLists.txt"
1145 (("target_link_libraries(.*)\\)" _ libs)
1146 (string-append "target_link_libraries"
1147 libs " dl)"))))))
1148 (arguments
1149 '(#:tests? #f
1150 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1151 #:phases (alist-cons-after
1152 'install 'post-install
1153 (lambda* (#:key outputs #:allow-other-keys)
1154 (let* ((out (assoc-ref outputs "out"))
1155 (exe (string-append out "/bin/unionfs")))
1156 ;; By default, 'unionfs' keeps references to
1157 ;; $glibc/share/locale and similar stuff. Remove them.
1158 (remove-store-references exe)))
1159 %standard-phases)))
1160 (inputs `(("fuse" ,fuse-static)))))
1161
1162 (define-public sshfs-fuse
1163 (package
1164 (name "sshfs-fuse")
1165 (version "2.5")
1166 (source (origin
1167 (method url-fetch)
1168 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1169 version ".tar.gz"))
1170 (sha256
1171 (base32
1172 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1173 (build-system gnu-build-system)
1174 (inputs
1175 `(("fuse" ,fuse)
1176 ("glib" ,glib)))
1177 (native-inputs
1178 `(("pkg-config" ,pkg-config)))
1179 (home-page "http://fuse.sourceforge.net/sshfs.html")
1180 (synopsis "Mount remote file systems over SSH")
1181 (description
1182 "This is a file system client based on the SSH File Transfer Protocol.
1183 Since most SSH servers already support this protocol it is very easy to set
1184 up: on the server side there's nothing to do; on the client side mounting the
1185 file system is as easy as logging into the server with an SSH client.")
1186 (license gpl2+)))
1187
1188 (define-public numactl
1189 (package
1190 (name "numactl")
1191 (version "2.0.9")
1192 (source (origin
1193 (method url-fetch)
1194 (uri (string-append
1195 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1196 version
1197 ".tar.gz"))
1198 (sha256
1199 (base32
1200 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1201 (build-system gnu-build-system)
1202 (arguments
1203 '(#:phases (alist-replace
1204 'configure
1205 (lambda* (#:key outputs #:allow-other-keys)
1206 ;; There's no 'configure' script, just a raw makefile.
1207 (substitute* "Makefile"
1208 (("^prefix := .*$")
1209 (string-append "prefix := " (assoc-ref outputs "out")
1210 "\n"))
1211 (("^libdir := .*$")
1212 ;; By default the thing tries to install under
1213 ;; $prefix/lib64 when on a 64-bit platform.
1214 (string-append "libdir := $(prefix)/lib\n"))))
1215 %standard-phases)
1216
1217 #:make-flags (list
1218 ;; By default the thing tries to use 'cc'.
1219 "CC=gcc"
1220
1221 ;; Make sure programs have an RPATH so they can find
1222 ;; libnuma.so.
1223 (string-append "LDLIBS=-Wl,-rpath="
1224 (assoc-ref %outputs "out") "/lib"))
1225
1226 ;; There's a 'test' target, but it requires NUMA support in the kernel
1227 ;; to run, which we can't assume to have.
1228 #:tests? #f))
1229 (home-page "http://oss.sgi.com/projects/libnuma/")
1230 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1231 (description
1232 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1233 memory is not all in one place. The numactl program allows you to run your
1234 application program on specific CPU's and memory nodes. It does this by
1235 supplying a NUMA memory policy to the operating system before running your
1236 program.
1237
1238 The package contains other commands, such as numademo, numastat and memhog.
1239 The numademo command provides a quick overview of NUMA performance on your
1240 system.")
1241 (license (list gpl2 ; programs
1242 lgpl2.1)))) ; library
1243
1244 (define-public kbd
1245 (package
1246 (name "kbd")
1247 (version "2.0.1")
1248 (source (origin
1249 (method url-fetch)
1250 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1251 version ".tar.gz"))
1252 (sha256
1253 (base32
1254 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1255 (modules '((guix build utils)))
1256 (snippet
1257 '(begin
1258 (substitute* "tests/Makefile.in"
1259 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1260 (("@VERSION@")
1261 "[@]VERSION[@]"))
1262 (substitute* '("src/unicode_start" "src/unicode_stop")
1263 ;; Assume the Coreutils are in $PATH.
1264 (("/usr/bin/tty")
1265 "tty"))))))
1266 (build-system gnu-build-system)
1267 (arguments
1268 '(#:phases (alist-cons-before
1269 'build 'pre-build
1270 (lambda* (#:key inputs #:allow-other-keys)
1271 (let ((gzip (assoc-ref %build-inputs "gzip"))
1272 (bzip2 (assoc-ref %build-inputs "bzip2")))
1273 (substitute* "src/libkeymap/findfile.c"
1274 (("gzip")
1275 (string-append gzip "/bin/gzip"))
1276 (("bzip2")
1277 (string-append bzip2 "/bin/bzip2")))))
1278 (alist-cons-after
1279 'install 'post-install
1280 (lambda* (#:key outputs #:allow-other-keys)
1281 ;; Make sure these programs find their comrades.
1282 (let* ((out (assoc-ref outputs "out"))
1283 (bin (string-append out "/bin")))
1284 (for-each (lambda (prog)
1285 (wrap-program (string-append bin "/" prog)
1286 `("PATH" ":" prefix (,bin))))
1287 '("unicode_start" "unicode_stop"))))
1288 %standard-phases))))
1289 (inputs `(("check" ,check)
1290 ("gzip" ,guix:gzip)
1291 ("bzip2" ,guix:bzip2)
1292 ("pam" ,linux-pam)))
1293 (native-inputs `(("pkg-config" ,pkg-config)))
1294 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1295 (synopsis "Linux keyboard utilities and keyboard maps")
1296 (description
1297 "This package contains keytable files and keyboard utilities compatible
1298 for systems using the Linux kernel. This includes commands such as
1299 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1300 (license gpl2+)))
1301
1302 (define-public inotify-tools
1303 (package
1304 (name "inotify-tools")
1305 (version "3.13")
1306 (source (origin
1307 (method url-fetch)
1308 (uri (string-append
1309 "mirror://sourceforge/inotify-tools/inotify-tools/"
1310 version "/inotify-tools-" version ".tar.gz"))
1311 (sha256
1312 (base32
1313 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1314 (build-system gnu-build-system)
1315 (home-page "http://inotify-tools.sourceforge.net/")
1316 (synopsis "Monitor file accesses")
1317 (description
1318 "The inotify-tools packages provides a C library and command-line tools
1319 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1320 (license gpl2+)))
1321
1322 (define-public kmod
1323 (package
1324 (name "kmod")
1325 (version "17")
1326 (source (origin
1327 (method url-fetch)
1328 (uri
1329 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1330 "kmod-" version ".tar.xz"))
1331 (sha256
1332 (base32
1333 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1334 (patches (list (search-patch "kmod-module-directory.patch")))))
1335 (build-system gnu-build-system)
1336 (native-inputs
1337 `(("pkg-config" ,pkg-config)))
1338 (inputs
1339 `(("xz" ,guix:xz)
1340 ("zlib" ,guix:zlib)))
1341 (arguments
1342 `(#:tests? #f ; FIXME: Investigate test failures
1343 #:configure-flags '("--with-xz" "--with-zlib")
1344 #:phases (alist-cons-after
1345 'install 'install-modprobe&co
1346 (lambda* (#:key outputs #:allow-other-keys)
1347 (let* ((out (assoc-ref outputs "out"))
1348 (bin (string-append out "/bin")))
1349 (for-each (lambda (tool)
1350 (symlink "kmod"
1351 (string-append bin "/" tool)))
1352 '("insmod" "rmmod" "lsmod" "modprobe"
1353 "modinfo" "depmod"))))
1354 %standard-phases)))
1355 (home-page "https://www.kernel.org/")
1356 (synopsis "Kernel module tools")
1357 (description "Kmod is a set of tools to handle common tasks with Linux
1358 kernel modules like insert, remove, list, check properties, resolve
1359 dependencies and aliases.
1360
1361 These tools are designed on top of libkmod, a library that is shipped with
1362 kmod. The aim is to be compatible with tools, configurations and indices
1363 from the module-init-tools project.")
1364 (license gpl2+))) ; library under lgpl2.1+
1365
1366 (define-public udev
1367 ;; The last pre-systemd version.
1368 (package
1369 (name "udev")
1370 (version "182")
1371 (source (origin
1372 (method url-fetch)
1373 (uri (string-append
1374 "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
1375 version ".tar.xz"))
1376 (sha256
1377 (base32
1378 "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
1379 (patches (list (search-patch "udev-gir-libtool.patch")))))
1380 (build-system gnu-build-system)
1381 (arguments
1382 `(#:configure-flags (list (string-append
1383 "--with-pci-ids-path="
1384 (assoc-ref %build-inputs "pciutils")
1385 "/share/pci.ids.gz")
1386
1387 "--with-firmware-path=/no/firmware"
1388
1389 ;; Work around undefined reference to
1390 ;; 'mq_getattr' in sc-daemon.c.
1391 "LDFLAGS=-lrt")))
1392 (native-inputs
1393 `(("pkg-config" ,pkg-config)
1394 ("gperf" ,gperf)
1395 ("glib" ,glib "bin") ; glib-genmarshal, etc.
1396 ("perl" ,perl) ; for the tests
1397 ("python" ,python-2))) ; ditto
1398 (inputs
1399 `(("kmod" ,kmod)
1400 ("pciutils" ,pciutils)
1401 ("usbutils" ,usbutils)
1402 ("util-linux" ,util-linux)
1403 ("glib" ,glib)
1404 ("gobject-introspection" ,gobject-introspection)))
1405 (home-page "http://www.freedesktop.org/software/systemd/libudev/")
1406 (synopsis "Userspace device management")
1407 (description "Udev is a daemon which dynamically creates and removes
1408 device nodes from /dev/, handles hotplug events and loads drivers at boot
1409 time.")
1410 (license gpl2+))) ; libudev is under lgpl2.1+
1411
1412 (define-public eudev
1413 ;; The post-systemd fork, maintained by Gentoo.
1414 (package (inherit udev)
1415 (name "eudev")
1416 (version "1.10")
1417 (source (origin
1418 (method url-fetch)
1419 (uri (string-append
1420 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1421 version ".tar.gz"))
1422 (sha256
1423 (base32
1424 "1l907bvz6dcykvaq8d4iklvfpb9fyrnh1a29g3c28gkx2hlyn7j0"))
1425 (patches (list (search-patch "eudev-rules-directory.patch")))
1426 (modules '((guix build utils)))
1427 (snippet
1428 ;; 'configure' checks uses <linux/btrfs.h> as an indication of
1429 ;; whether Linux headers are available, but it doesn't actually
1430 ;; use it, and our 'linux-libre-headers' package doesn't
1431 ;; provide it. So just remove that.
1432 '(substitute* "configure"
1433 (("linux/btrfs\\.h")
1434 "")))))
1435 (arguments
1436 (substitute-keyword-arguments (package-arguments udev)
1437 ((#:configure-flags flags)
1438 `(cons "--enable-libkmod" ,flags))))
1439 (home-page "http://www.gentoo.org/proj/en/eudev/")))
1440
1441 (define-public lvm2
1442 (package
1443 (name "lvm2")
1444 (version "2.02.109")
1445 (source (origin
1446 (method url-fetch)
1447 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1448 version ".tgz"))
1449 (sha256
1450 (base32
1451 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1452 (modules '((guix build utils)))
1453 (snippet
1454 '(begin
1455 (use-modules (guix build utils))
1456
1457 ;; Honor sysconfdir.
1458 (substitute* "make.tmpl.in"
1459 (("confdir = .*$")
1460 "confdir = @sysconfdir@\n")
1461 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1462 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1463 (build-system gnu-build-system)
1464 (native-inputs
1465 `(("pkg-config" ,pkg-config)
1466 ("procps" ,procps))) ;tests use 'pgrep'
1467 (inputs
1468 `(("udev" ,udev)))
1469 (arguments
1470 '(#:phases (alist-cons-after
1471 'configure 'set-makefile-shell
1472 (lambda _
1473 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1474 ;; expected.
1475 (setenv "SHELL" (which "sh"))
1476
1477 ;; Replace /bin/sh with the right file name.
1478 (patch-makefile-SHELL "make.tmpl"))
1479 %standard-phases)
1480
1481 #:configure-flags (list (string-append "--sysconfdir="
1482 (assoc-ref %outputs "out")
1483 "/etc/lvm")
1484 "--enable-udev_sync"
1485 "--enable-udev_rules"
1486
1487 ;; Make sure programs such as 'dmsetup' can
1488 ;; find libdevmapper.so.
1489 (string-append "LDFLAGS=-Wl,-rpath="
1490 (assoc-ref %outputs "out")
1491 "/lib"))
1492
1493 ;; The tests use 'mknod', which requires root access.
1494 #:tests? #f))
1495 (home-page "http://sourceware.org/lvm2/")
1496 (synopsis "Logical volume management for Linux")
1497 (description
1498 "LVM2 is the logical volume management tool set for Linux-based systems.
1499 This package includes the user-space libraries and tools, including the device
1500 mapper. Kernel components are part of Linux-libre.")
1501
1502 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1503 ;; Command-line tools are GPLv2.
1504 (license (list gpl2 lgpl2.1))))
1505
1506 (define-public wireless-tools
1507 (package
1508 (name "wireless-tools")
1509 (version "30.pre9")
1510 (source (origin
1511 (method url-fetch)
1512 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1513 version ".tar.gz"))
1514 (sha256
1515 (base32
1516 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
1517 (modules '((guix build utils)))
1518 (snippet
1519 ;; Install the manual pages in the right place.
1520 '(substitute* "Makefile"
1521 (("INSTALL_MAN= .*")
1522 "INSTALL_MAN= $(PREFIX)/share/man")))))
1523 (build-system gnu-build-system)
1524 (arguments
1525 `(#:phases (alist-replace
1526 'configure
1527 (lambda* (#:key outputs #:allow-other-keys)
1528 (setenv "PREFIX" (assoc-ref outputs "out")))
1529 %standard-phases)
1530 #:tests? #f))
1531 (synopsis "Tools for manipulating Linux Wireless Extensions")
1532 (description "Wireless Tools are used to manipulate the now-deprecated
1533 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1534 Extension was an interface allowing you to set Wireless LAN specific
1535 parameters and get the specific stats. It is deprecated in favor the nl80211
1536 interface.")
1537 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1538 (license gpl2+)))
1539
1540 (define-public lm-sensors
1541 (package
1542 (name "lm-sensors")
1543 (version "3.3.5")
1544 (source (origin
1545 (method url-fetch)
1546 (uri (string-append
1547 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1548 version ".tar.bz2"))
1549 (sha256
1550 (base32
1551 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1552 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1553 (build-system gnu-build-system)
1554 (inputs `(("rrdtool" ,rrdtool)
1555 ("perl" ,perl)
1556 ("kmod" ,kmod)
1557 ("gnuplot" ,gnuplot)))
1558 (native-inputs `(("pkg-config" ,pkg-config)
1559 ("flex" ,flex)
1560 ("bison" ,bison)
1561 ("which" ,which)))
1562 (arguments
1563 `(#:tests? #f ; no 'check' target
1564 #:make-flags (list (string-append "PREFIX=" %output)
1565 (string-append "ETCDIR=" %output "/etc")
1566 (string-append "MANDIR=" %output "/share/man"))
1567 #:phases
1568 (alist-delete
1569 'configure
1570 (alist-cons-before
1571 'build 'patch-exec-paths
1572 (lambda* (#:key inputs outputs #:allow-other-keys)
1573 (substitute* "prog/detect/sensors-detect"
1574 (("`uname")
1575 (string-append "`" (assoc-ref inputs "coreutils")
1576 "/bin/uname"))
1577 (("(`|\")modprobe" all open-quote)
1578 (string-append open-quote
1579 (assoc-ref inputs "kmod")
1580 "/bin/modprobe")))
1581 (substitute* '("prog/pwm/pwmconfig"
1582 "prog/pwm/fancontrol")
1583 (("gnuplot")
1584 (string-append (assoc-ref inputs "gnuplot")
1585 "/bin/gnuplot"))
1586 (("cat ")
1587 (string-append (assoc-ref inputs "coreutils")
1588 "/bin/cat "))
1589 (("egrep ")
1590 (string-append (assoc-ref inputs "grep")
1591 "/bin/egrep "))
1592 (("sed -e")
1593 (string-append (assoc-ref inputs "sed")
1594 "/bin/sed -e"))
1595 (("cut -d")
1596 (string-append (assoc-ref inputs "coreutils")
1597 "/bin/cut -d"))
1598 (("sleep ")
1599 (string-append (assoc-ref inputs "coreutils")
1600 "/bin/sleep "))
1601 (("readlink -f")
1602 (string-append (assoc-ref inputs "coreutils")
1603 "/bin/readlink -f"))))
1604 %standard-phases))))
1605 (home-page "http://www.lm-sensors.org/")
1606 (synopsis "Utilities to read temperature/voltage/fan sensors")
1607 (description
1608 "Lm-sensors is a hardware health monitoring package for Linux. It allows
1609 you to access information from temperature, voltage, and fan speed sensors.
1610 It works with most newer systems.")
1611 (license gpl2+)))
1612
1613 (define-public xsensors
1614 (package
1615 (name "xsensors")
1616 (version "0.70")
1617 (source (origin
1618 (method url-fetch)
1619 (uri (string-append
1620 "http://www.linuxhardware.org/xsensors/xsensors-"
1621 version ".tar.gz"))
1622 (sha256
1623 (base32
1624 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1625 (build-system gnu-build-system)
1626 (inputs `(("lm-sensors" ,lm-sensors)
1627 ("gtk" ,gtk+-2)))
1628 (native-inputs `(("pkg-config" ,pkg-config)))
1629 (arguments
1630 `(#:phases (alist-cons-before
1631 'configure 'enable-deprecated
1632 (lambda _
1633 (substitute* "src/Makefile.in"
1634 (("-DGDK_DISABLE_DEPRECATED") "")
1635 (("-DGTK_DISABLE_DEPRECATED") "")))
1636 (alist-cons-before
1637 'configure 'remove-Werror
1638 (lambda _
1639 (substitute* '("configure" "src/Makefile.in")
1640 (("-Werror") "")))
1641 %standard-phases))))
1642 (home-page "http://www.linuxhardware.org/xsensors/")
1643 (synopsis "Hardware health information viewer")
1644 (description
1645 "Xsensors reads data from the libsensors library regarding hardware
1646 health such as temperature, voltage and fan speed and displays the information
1647 in a digital read-out.")
1648 (license gpl2+)))
1649
1650 (define-public perf
1651 (package
1652 (name "perf")
1653 (version (package-version linux-libre))
1654 (source (package-source linux-libre))
1655 (build-system gnu-build-system)
1656 (arguments
1657 '(#:phases (alist-replace
1658 'configure
1659 (lambda* (#:key inputs #:allow-other-keys)
1660 (setenv "SHELL_PATH" (which "bash"))
1661 (chdir "tools/perf"))
1662 %standard-phases)
1663 #:make-flags (list (string-append "DESTDIR="
1664 (assoc-ref %outputs "out"))
1665 "WERROR=0")
1666 #:tests? #f)) ;no tests
1667 (native-inputs
1668 `(("pkg-config" ,pkg-config)
1669 ("bison" ,bison)
1670 ("flex" ,flex)
1671
1672 ;; There are build scripts written in these languages.
1673 ("perl" ,perl)
1674 ("python" ,python-2)))
1675 (inputs
1676 `(;; ("slang" ,slang)
1677 ;; ("newt" ,newt)
1678 ("elfutils" ,elfutils)
1679
1680 ;; FIXME: Documentation.
1681 ;; ("libxslt" ,libxslt)
1682 ;; ("docbook-xml" ,docbook-xml)
1683 ;; ("docbook-xsl" ,docbook-xsl)
1684 ;; ("xmlto" ,xmlto)
1685 ;; ("asciidoc" ,asciidoc)
1686 ))
1687 (home-page "https://perf.wiki.kernel.org/")
1688 (synopsis "Linux profiling with performance counters")
1689 (description
1690 "perf is a tool suite for profiling using hardware performance counters,
1691 with support in the Linux kernel. perf can instrument CPU performance
1692 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
1693 of lightweight profiling. This package contains the user-land tools and in
1694 particular the 'perf' command.")
1695 (license (package-license linux-libre))))
1696
1697 (define-public pflask
1698 (package
1699 (name "pflask")
1700 (version "0.2")
1701 (source (origin
1702 (method url-fetch)
1703 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
1704 version ".tar.gz"))
1705 (sha256
1706 (base32
1707 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
1708 (build-system cmake-build-system)
1709 (arguments
1710 '(#:tests? #f)) ; no tests
1711 (home-page "http://ghedo.github.io/pflask/")
1712 (synopsis "Simple tool for creating Linux namespace containers")
1713 (description "pflask is a simple tool for creating Linux namespace
1714 containers. It can be used for running a command or even booting an OS inside
1715 an isolated container, created with the help of Linux namespaces. It is
1716 similar in functionality to chroot, although pflask provides better isolation
1717 thanks to the use of namespaces.")
1718 (license bsd-2)))