gnu: gdb: Upgrade to 7.7.1.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
6869e5c9 2;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
233e7676 3;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
0d55c356 4;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
fd76c904 5;;;
233e7676 6;;; This file is part of GNU Guix.
fd76c904 7;;;
233e7676 8;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
233e7676 13;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
233e7676 19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 20
1ffa7090 21(define-module (gnu packages linux)
023fef7d
LC
22 #:use-module ((guix licenses)
23 #:hide (zlib))
59a43334 24 #:use-module (gnu packages)
1ffa7090 25 #:use-module ((gnu packages compression)
4a44e743 26 #:renamer (symbol-prefix-proc 'guix:))
1ffa7090 27 #:use-module (gnu packages flex)
90a0048f 28 #:use-module (gnu packages bison)
1ffa7090
LC
29 #:use-module (gnu packages libusb)
30 #:use-module (gnu packages ncurses)
90a0048f 31 #:use-module (gnu packages bdb)
1ffa7090
LC
32 #:use-module (gnu packages perl)
33 #:use-module (gnu packages pkg-config)
7c0dbe78 34 #:use-module (gnu packages python)
e7b38500 35 #:use-module (gnu packages algebra)
1dba6407 36 #:use-module (gnu packages gettext)
17b293a0 37 #:use-module (gnu packages pulseaudio)
c762e82e 38 #:use-module (gnu packages attr)
17b293a0 39 #:use-module (gnu packages xml)
215b6431 40 #:use-module (gnu packages autotools)
02b80c3f
NK
41 #:use-module (guix packages)
42 #:use-module (guix download)
7c0dbe78 43 #:use-module (guix build-system gnu)
220193ad 44 #:use-module (guix build-system cmake)
e102f940
LC
45 #:use-module (guix build-system python)
46 #:use-module (guix build-system trivial))
fd76c904 47
aaf4cb20
LC
48(define-public (system->linux-architecture arch)
49 "Return the Linux architecture name for ARCH, a Guix system name such as
50\"x86_64-linux\"."
618cea69
NK
51 (let ((arch (car (string-split arch #\-))))
52 (cond ((string=? arch "i686") "i386")
53 ((string-prefix? "mips" arch) "mips")
aaf4cb20 54 ((string-prefix? "arm" arch) "arm")
618cea69
NK
55 (else arch))))
56
6023cc74
LC
57(define (linux-libre-urls version)
58 "Return a list of URLs for Linux-Libre VERSION."
59 (list (string-append
60 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
61 version "-gnu/linux-libre-" version "-gnu.tar.xz")
62
63 ;; XXX: Work around <http://bugs.gnu.org/14851>.
64 (string-append
65 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
66 version "-gnu.tar.xz")
67
68 ;; Maybe this URL will become valid eventually.
69 (string-append
70 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
71 version "-gnu.tar.xz")))
72
80fe5c60 73(define-public linux-libre-headers
dfb52abb 74 (let* ((version "3.3.8")
80fe5c60 75 (build-phase
618cea69
NK
76 (lambda (arch)
77 `(lambda _
78 (setenv "ARCH" ,(system->linux-architecture arch))
79 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 80
618cea69
NK
81 (and (zero? (system* "make" "defconfig"))
82 (zero? (system* "make" "mrproper" "headers_check"))))))
80fe5c60
LC
83 (install-phase
84 `(lambda* (#:key outputs #:allow-other-keys)
85 (let ((out (assoc-ref outputs "out")))
86 (and (zero? (system* "make"
87 (string-append "INSTALL_HDR_PATH=" out)
88 "headers_install"))
89 (mkdir (string-append out "/include/config"))
90 (call-with-output-file
91 (string-append out
92 "/include/config/kernel.release")
93 (lambda (p)
dfb52abb 94 (format p "~a-default~%" ,version))))))))
80fe5c60
LC
95 (package
96 (name "linux-libre-headers")
dfb52abb 97 (version version)
80fe5c60
LC
98 (source (origin
99 (method url-fetch)
6023cc74 100 (uri (linux-libre-urls version))
80fe5c60
LC
101 (sha256
102 (base32
103 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
104 (build-system gnu-build-system)
105 (native-inputs `(("perl" ,perl)))
106 (arguments
107 `(#:modules ((guix build gnu-build-system)
108 (guix build utils)
56c092ce 109 (srfi srfi-1))
80fe5c60 110 #:phases (alist-replace
fb6c2fa8
LC
111 'build ,(build-phase (or (%current-target-system)
112 (%current-system)))
80fe5c60
LC
113 (alist-replace
114 'install ,install-phase
56c092ce 115 (alist-delete 'configure %standard-phases)))
80fe5c60
LC
116 #:tests? #f))
117 (synopsis "GNU Linux-Libre kernel headers")
118 (description "Headers of the Linux-Libre kernel.")
38bbd61d 119 (license gpl2)
80fe5c60
LC
120 (home-page "http://www.gnu.org/software/linux-libre/"))))
121
b4fcb735
LC
122(define-public module-init-tools
123 (package
124 (name "module-init-tools")
125 (version "3.16")
126 (source (origin
127 (method url-fetch)
128 (uri (string-append
129 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
130 version ".tar.bz2"))
131 (sha256
132 (base32
133 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))))
134 (build-system gnu-build-system)
b4fcb735 135 (arguments
5c413a9c
LC
136 ;; FIXME: The upstream tarball lacks man pages, and building them would
137 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
138 ;; but they vanished. In the meantime, fake it.
b4fcb735 139 '(#:phases (alist-cons-before
5c413a9c
LC
140 'configure 'fake-docbook
141 (lambda _
142 (substitute* "Makefile.in"
143 (("^DOCBOOKTOMAN.*$")
144 "DOCBOOKTOMAN = true\n")))
b4fcb735
LC
145 %standard-phases)))
146 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
147 (synopsis "Tools for loading and managing Linux kernel modules")
148 (description
149 "Tools for loading and managing Linux kernel modules, such as `modprobe',
150`insmod', `lsmod', and more.")
151 (license gpl2+)))
152
beacfcab 153(define-public linux-libre
d013fe50 154 (let* ((version "3.13.7")
beacfcab
LC
155 (build-phase
156 '(lambda* (#:key system #:allow-other-keys #:rest args)
157 (let ((arch (car (string-split system #\-))))
158 (setenv "ARCH"
159 (cond ((string=? arch "i686") "i386")
160 (else arch)))
161 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
162
163 (let ((build (assoc-ref %standard-phases 'build)))
2e48455d
LC
164 (and (zero? (system* "make" "defconfig"))
165 (begin
c0888b3f
AE
166 ;; Appending works even when the option wasn't in the
167 ;; file. The last one prevails if duplicated.
882f034f 168 (let ((port (open-file ".config" "a")))
c0888b3f
AE
169 (display (string-append "CONFIG_NET_9P=m\n"
170 "CONFIG_NET_9P_VIRTIO=m\n"
882f034f 171 "CONFIG_VIRTIO_BLK=m\n"
be0d8af8 172 "CONFIG_SATA_SIS=y\n"
c0888b3f 173 "CONFIG_VIRTIO_NET=m\n"
be0d8af8
AE
174 "CONFIG_SIS190=y\n"
175 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
176 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
c0888b3f
AE
177 "CONFIG_VIRTIO_PCI=m\n"
178 "CONFIG_VIRTIO_BALLOON=m\n"
179 "CONFIG_VIRTIO_MMIO=m\n"
180 "CONFIG_FUSE_FS=m\n"
181 "CONFIG_CIFS=m\n"
182 "CONFIG_9P_FS=m\n")
882f034f
LC
183 port)
184 (close-port port))
185
2e48455d 186 (zero? (system* "make" "oldconfig")))
beacfcab
LC
187
188 ;; Call the default `build' phase so `-j' is correctly
189 ;; passed.
190 (apply build #:make-flags "all" args)))))
191 (install-phase
192 `(lambda* (#:key inputs outputs #:allow-other-keys)
193 (let* ((out (assoc-ref outputs "out"))
194 (moddir (string-append out "/lib/modules"))
195 (mit (assoc-ref inputs "module-init-tools")))
196 (mkdir-p moddir)
197 (for-each (lambda (file)
198 (copy-file file
199 (string-append out "/" (basename file))))
200 (find-files "." "^(bzImage|System\\.map)$"))
201 (copy-file ".config" (string-append out "/config"))
202 (zero? (system* "make"
203 (string-append "DEPMOD=" mit "/sbin/depmod")
204 (string-append "MODULE_DIR=" moddir)
205 (string-append "INSTALL_PATH=" out)
206 (string-append "INSTALL_MOD_PATH=" out)
207 "modules_install"))))))
208 (package
209 (name "linux-libre")
dfb52abb 210 (version version)
beacfcab
LC
211 (source (origin
212 (method url-fetch)
6023cc74 213 (uri (linux-libre-urls version))
beacfcab
LC
214 (sha256
215 (base32
d013fe50 216 "0j28dg0zq4vlbk4ady4fq021i8dxx2h8h90n26mzigr9hky86n8d"))))
beacfcab
LC
217 (build-system gnu-build-system)
218 (native-inputs `(("perl" ,perl)
e7b38500 219 ("bc" ,bc)
beacfcab
LC
220 ("module-init-tools" ,module-init-tools)))
221 (arguments
222 `(#:modules ((guix build gnu-build-system)
223 (guix build utils)
224 (srfi srfi-1)
225 (ice-9 match))
226 #:phases (alist-replace
227 'build ,build-phase
228 (alist-replace
229 'install ,install-phase
230 (alist-delete 'configure %standard-phases)))
231 #:tests? #f))
f50d2669 232 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 233 (description
79c311b8
LC
234 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
235It has been modified to remove all non-free binary blobs.")
beacfcab
LC
236 (license gpl2)
237 (home-page "http://www.gnu.org/software/linux-libre/"))))
238
c84d0eca
LC
239\f
240;;;
241;;; Pluggable authentication modules (PAM).
242;;;
243
fd76c904
LC
244(define-public linux-pam
245 (package
246 (name "linux-pam")
247 (version "1.1.6")
248 (source
249 (origin
250 (method url-fetch)
251 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
252 version ".tar.bz2")
253 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
254 version ".tar.bz2")))
255 (sha256
256 (base32
257 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
258 (build-system gnu-build-system)
c4c4cc05 259 (native-inputs
fd76c904
LC
260 `(("flex" ,flex)
261
262 ;; TODO: optional dependencies
263 ;; ("libxcrypt" ,libxcrypt)
264 ;; ("cracklib" ,cracklib)
265 ))
266 (arguments
c134056a
LC
267 '(;; Most users, such as `shadow', expect the headers to be under
268 ;; `security'.
269 #:configure-flags (list (string-append "--includedir="
270 (assoc-ref %outputs "out")
271 "/include/security"))
272
273 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
274 ;; isn't available.
275 #:tests? #f))
fd76c904
LC
276 (home-page "http://www.linux-pam.org/")
277 (synopsis "Pluggable authentication modules for Linux")
278 (description
279 "A *Free* project to implement OSF's RFC 86.0.
280Pluggable authentication modules are small shared object files that can
281be used through the PAM API to perform tasks, like authenticating a user
282at login. Local and dynamic reconfiguration are its key features")
4a44e743 283 (license bsd-3)))
686f14e8 284
c84d0eca
LC
285\f
286;;;
287;;; Miscellaneous.
288;;;
289
686f14e8
LC
290(define-public psmisc
291 (package
292 (name "psmisc")
293 (version "22.20")
294 (source
295 (origin
296 (method url-fetch)
297 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
298 version ".tar.gz"))
299 (sha256
300 (base32
301 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
302 (build-system gnu-build-system)
303 (inputs `(("ncurses" ,ncurses)))
304 (home-page "http://psmisc.sourceforge.net/")
305 (synopsis
306 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
307 (description
308 "This PSmisc package is a set of some small useful utilities that
309use the proc filesystem. We're not about changing the world, but
310providing the system administrator with some help in common tasks.")
4a44e743 311 (license gpl2+)))
02b80c3f
NK
312
313(define-public util-linux
314 (package
315 (name "util-linux")
316 (version "2.21")
317 (source
318 (origin
319 (method url-fetch)
320 (uri (string-append "mirror://kernel.org/linux/utils/"
321 name "/v" version "/"
322 name "-" version ".2" ".tar.xz"))
323 (sha256
324 (base32
325 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
326 (build-system gnu-build-system)
327 (arguments
8b8476b8
AE
328 `(#:configure-flags '("--disable-use-tty-group"
329 "--enable-ddate")
02b80c3f
NK
330 #:phases (alist-cons-after
331 'install 'patch-chkdupexe
332 (lambda* (#:key outputs #:allow-other-keys)
333 (let ((out (assoc-ref outputs "out")))
334 (substitute* (string-append out "/bin/chkdupexe")
335 ;; Allow 'patch-shebang' to do its work.
336 (("@PERL@") "/bin/perl"))))
337 %standard-phases)))
4a44e743 338 (inputs `(("zlib" ,guix:zlib)
c4c4cc05
JD
339 ("ncurses" ,ncurses)))
340 (native-inputs
341 `(("perl" ,perl)))
02b80c3f 342 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 343 (synopsis "Collection of utilities for the Linux kernel")
02b80c3f
NK
344 (description
345 "util-linux is a random collection of utilities for the Linux kernel.")
fe8ccfcc 346
02b80c3f 347 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 348 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 349 ;; explicitly defined license.
fe8ccfcc
LC
350 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
351 bsd-4 public-domain))))
5d5c4278 352
e47e3eff
LC
353(define-public procps
354 (package
355 (name "procps")
356 (version "3.2.8")
357 (source (origin
358 (method url-fetch)
359 (uri (string-append "http://procps.sourceforge.net/procps-"
360 version ".tar.gz"))
361 (sha256
362 (base32
01eafd38
LC
363 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
364 (patches (list (search-patch "procps-make-3.82.patch")))))
e47e3eff 365 (build-system gnu-build-system)
01eafd38 366 (inputs `(("ncurses" ,ncurses)))
e47e3eff 367 (arguments
01eafd38 368 '(#:phases (alist-replace
e47e3eff
LC
369 'configure
370 (lambda* (#:key outputs #:allow-other-keys)
371 ;; No `configure', just a single Makefile.
372 (let ((out (assoc-ref outputs "out")))
373 (substitute* "Makefile"
374 (("/usr/") "/")
375 (("--(owner|group) 0") "")
376 (("ldconfig") "true")
377 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
378 ;; Add libproc to the RPATH.
379 (string-append "LDFLAGS := -Wl,-rpath="
380 out "/lib" value))))
381 (setenv "CC" "gcc"))
382 (alist-replace
383 'install
384 (lambda* (#:key outputs #:allow-other-keys)
385 (let ((out (assoc-ref outputs "out")))
386 (and (zero?
387 (system* "make" "install"
388 (string-append "DESTDIR=" out)))
389
390 ;; Sanity check.
391 (zero?
392 (system* (string-append out "/bin/ps")
393 "--version")))))
394 %standard-phases))
395
396 ;; What did you expect? Tests?
397 #:tests? #f))
398 (home-page "http://procps.sourceforge.net/")
35ec07c7 399 (synopsis "Utilities that give information about processes")
e47e3eff
LC
400 (description
401 "procps is the package that has a bunch of small useful utilities
402that give information about processes using the Linux /proc file system.
403The package includes the programs ps, top, vmstat, w, kill, free,
404slabtop, and skill.")
405 (license gpl2)))
406
5d5c4278
NK
407(define-public usbutils
408 (package
409 (name "usbutils")
410 (version "006")
411 (source
412 (origin
413 (method url-fetch)
414 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
415 "usbutils-" version ".tar.xz"))
416 (sha256
417 (base32
418 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
419 (build-system gnu-build-system)
420 (inputs
c4c4cc05
JD
421 `(("libusb" ,libusb)))
422 (native-inputs
423 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
424 (home-page "http://www.linux-usb.org/")
425 (synopsis
426 "Tools for working with USB devices, such as lsusb")
427 (description
428 "Tools for working with USB devices, such as lsusb.")
4050e5d6 429 (license gpl2+)))
0750452a
LC
430
431(define-public e2fsprogs
432 (package
433 (name "e2fsprogs")
434 (version "1.42.7")
435 (source (origin
436 (method url-fetch)
437 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
438 version ".tar.gz"))
439 (sha256
440 (base32
441 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
442 (build-system gnu-build-system)
c4c4cc05
JD
443 (inputs `(("util-linux" ,util-linux)))
444 (native-inputs `(("pkg-config" ,pkg-config)))
0750452a
LC
445 (arguments
446 '(#:phases (alist-cons-before
447 'configure 'patch-shells
448 (lambda _
449 (substitute* "configure"
450 (("/bin/sh (.*)parse-types.sh" _ dir)
451 (string-append (which "sh") " " dir
452 "parse-types.sh")))
453 (substitute* (find-files "." "^Makefile.in$")
454 (("#!/bin/sh")
455 (string-append "#!" (which "sh")))))
456 %standard-phases)
457
458 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
459 ;; they fail because we get an extra line that says "Can't check if
460 ;; filesystem is mounted due to missing mtab file".
461 #:tests? #f))
462 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 463 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
464 (description
465 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
466 (license (list gpl2 ; programs
467 lgpl2.0 ; libext2fs
468 x11)))) ; libuuid
d8482ad0 469
e102f940
LC
470(define-public e2fsprogs/static
471 (package (inherit e2fsprogs)
472 (name "e2fsprogs-static")
473 (arguments
474 `(#:configure-flags '("LDFLAGS=-static")
475 ,@(package-arguments e2fsprogs)))
476 (synopsis
477 "Statically-linked version of the ext2/ext3/ext4 file system tools")))
478
479(define-public e2fsck/static
480 (package
481 (name "e2fsck-static")
482 (version (package-version e2fsprogs/static))
483 (build-system trivial-build-system)
484 (source #f)
485 (arguments
486 `(#:modules ((guix build utils))
487 #:builder
488 (begin
489 (use-modules (guix build utils)
490 (ice-9 ftw)
491 (srfi srfi-26))
492
493 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
494 "/sbin"))
495 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
496 (mkdir-p bin)
497 (with-directory-excursion bin
498 (for-each (lambda (file)
499 (copy-file (string-append source "/" file)
500 file)
501 (remove-store-references file)
502 (chmod file #o555))
503 (scandir source (cut string-prefix? "fsck." <>))))))))
504 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
505 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
506 (description
507 "This package provides statically-linked command of fsck.ext[234] taken
508from the e2fsprogs package. It is meant to be used in initrds.")
509 (home-page (package-home-page e2fsprogs/static))
510 (license (package-license e2fsprogs/static))))
511
d8482ad0
LC
512(define-public strace
513 (package
514 (name "strace")
515 (version "4.7")
516 (source (origin
517 (method url-fetch)
518 (uri (string-append "mirror://sourceforge/strace/strace-"
519 version ".tar.xz"))
520 (sha256
521 (base32
522 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
523 (build-system gnu-build-system)
c4c4cc05 524 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
525 (home-page "http://strace.sourceforge.net/")
526 (synopsis "System call tracer for Linux")
527 (description
528 "strace is a system call tracer, i.e. a debugging tool which prints out a
529trace of all the system calls made by a another process/program.")
530 (license bsd-3)))
ba04571a
LC
531
532(define-public alsa-lib
533 (package
534 (name "alsa-lib")
535 (version "1.0.27.1")
536 (source (origin
537 (method url-fetch)
538 (uri (string-append
539 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
540 version ".tar.bz2"))
541 (sha256
542 (base32
bcd94e19
MW
543 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
544 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
ba04571a
LC
545 (build-system gnu-build-system)
546 (home-page "http://www.alsa-project.org/")
547 (synopsis "The Advanced Linux Sound Architecture libraries")
548 (description
549 "The Advanced Linux Sound Architecture (ALSA) provides audio and
550MIDI functionality to the Linux-based operating system.")
551 (license lgpl2.1+)))
10afdf50 552
17b293a0
LC
553(define-public alsa-utils
554 (package
555 (name "alsa-utils")
556 (version "1.0.27.2")
557 (source (origin
558 (method url-fetch)
559 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
560 version ".tar.bz2"))
561 (sha256
562 (base32
563 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
564 (build-system gnu-build-system)
565 (arguments
566 ;; XXX: Disable man page creation until we have DocBook.
567 '(#:configure-flags (list "--disable-xmlto"
568 (string-append "--with-udev-rules-dir="
569 (assoc-ref %outputs "out")
570 "/lib/udev/rules.d"))
571 #:phases (alist-cons-before
572 'install 'pre-install
573 (lambda _
574 ;; Don't try to mkdir /var/lib/alsa.
575 (substitute* "Makefile"
576 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
577 "true\n")))
578 %standard-phases)))
579 (inputs
580 `(("libsamplerate" ,libsamplerate)
581 ("ncurses" ,ncurses)
582 ("alsa-lib" ,alsa-lib)
583 ("xmlto" ,xmlto)
1dba6407 584 ("gettext" ,gnu-gettext)))
17b293a0
LC
585 (home-page "http://www.alsa-project.org/")
586 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
587 (description
588 "The Advanced Linux Sound Architecture (ALSA) provides audio and
589MIDI functionality to the Linux-based operating system.")
590
591 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
592 ;; GPLv2-only.
593 (license gpl2)))
594
10afdf50
LC
595(define-public iptables
596 (package
597 (name "iptables")
598 (version "1.4.16.2")
599 (source (origin
600 (method url-fetch)
601 (uri (string-append
602 "http://www.netfilter.org/projects/iptables/files/iptables-"
603 version ".tar.bz2"))
604 (sha256
605 (base32
606 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
607 (build-system gnu-build-system)
608 (arguments '(#:tests? #f)) ; no test suite
609 (home-page "http://www.netfilter.org/projects/iptables/index.html")
610 (synopsis "Program to configure the Linux IP packet filtering rules")
611 (description
612 "iptables is the userspace command line program used to configure the
613Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
614system administrators. Since Network Address Translation is also configured
615from the packet filter ruleset, iptables is used for this, too. The iptables
616package also includes ip6tables. ip6tables is used for configuring the IPv6
617packet filter.")
618 (license gpl2+)))
90a0048f
LC
619
620(define-public iproute
621 (package
622 (name "iproute2")
5fd7f3e0 623 (version "3.12.0")
90a0048f
LC
624 (source (origin
625 (method url-fetch)
626 (uri (string-append
627 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
628 version ".tar.xz"))
629 (sha256
630 (base32
5fd7f3e0 631 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
90a0048f
LC
632 (build-system gnu-build-system)
633 (arguments
634 `(#:tests? #f ; no test suite
635 #:make-flags (let ((out (assoc-ref %outputs "out")))
636 (list "DESTDIR="
637 (string-append "LIBDIR=" out "/lib")
638 (string-append "SBINDIR=" out "/sbin")
639 (string-append "CONFDIR=" out "/etc")
640 (string-append "DOCDIR=" out "/share/doc/"
641 ,name "-" ,version)
642 (string-append "MANDIR=" out "/share/man")))
643 #:phases (alist-cons-before
644 'install 'pre-install
645 (lambda _
646 ;; Don't attempt to create /var/lib/arpd.
647 (substitute* "Makefile"
648 (("^.*ARPDDIR.*$") "")))
649 %standard-phases)))
650 (inputs
651 `(("iptables" ,iptables)
c4c4cc05
JD
652 ("db4" ,bdb)))
653 (native-inputs
654 `(("pkg-config" ,pkg-config)
90a0048f
LC
655 ("flex" ,flex)
656 ("bison" ,bison)))
657 (home-page
658 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
659 (synopsis
660 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
661 (description
662 "Iproute2 is a collection of utilities for controlling TCP/IP
663networking and traffic with the Linux kernel.
664
665Most network configuration manuals still refer to ifconfig and route as the
666primary network configuration tools, but ifconfig is known to behave
667inadequately in modern network environments. They should be deprecated, but
668most distros still include them. Most network configuration systems make use
669of ifconfig and thus provide a limited feature set. The /etc/net project aims
670to support most modern network technologies, as it doesn't use ifconfig and
671allows a system administrator to make use of all iproute2 features, including
672traffic control.
673
674iproute2 is usually shipped in a package called iproute or iproute2 and
675consists of several tools, of which the most important are ip and tc. ip
676controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
677tools print detailed usage messages and are accompanied by a set of
678manpages.")
679 (license gpl2+)))
85e0dc6a
LC
680
681(define-public net-tools
682 ;; XXX: This package is basically unmaintained, but it provides a few
683 ;; commands not yet provided by Inetutils, such as 'route', so we have to
684 ;; live with it.
685 (package
686 (name "net-tools")
687 (version "1.60")
688 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
689 (source (origin
690 (method url-fetch)
691 (uri (string-append home-page "/" name "-"
692 version ".tar.bz2"))
693 (sha256
694 (base32
695 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
696 (build-system gnu-build-system)
697 (arguments
cd143df0
LC
698 '(#:phases (alist-cons-after
699 'unpack 'patch
85e0dc6a
LC
700 (lambda* (#:key inputs #:allow-other-keys)
701 (define (apply-patch file)
702 (zero? (system* "patch" "-p1" "--batch"
703 "--input" file)))
704
705 (let ((patch.gz (assoc-ref inputs "patch")))
706 (format #t "applying Debian patch set '~a'...~%"
707 patch.gz)
708 (system (string-append "gunzip < " patch.gz " > the-patch"))
709 (pk 'here)
710 (and (apply-patch "the-patch")
711 (for-each apply-patch
712 (find-files "debian/patches"
713 "\\.patch")))))
714 (alist-replace
715 'configure
716 (lambda* (#:key outputs #:allow-other-keys)
717 (let ((out (assoc-ref outputs "out")))
718 (mkdir-p (string-append out "/bin"))
719 (mkdir-p (string-append out "/sbin"))
720
721 ;; Pretend we have everything...
722 (system "yes | make config")
723
724 ;; ... except we don't have libdnet, so remove that
725 ;; definition.
726 (substitute* '("config.make" "config.h")
727 (("^.*HAVE_AFDECnet.*$") ""))))
728 %standard-phases))
729
730 ;; Binaries that depend on libnet-tools.a don't declare that
731 ;; dependency, making it parallel-unsafe.
732 #:parallel-build? #f
733
734 #:tests? #f ; no test suite
0d55c356
MW
735 #:make-flags (let ((out (assoc-ref %outputs "out")))
736 (list "CC=gcc"
737 (string-append "BASEDIR=" out)
738 (string-append "INSTALLNLSDIR=" out "/share/locale")
739 (string-append "mandir=/share/man")))))
85e0dc6a
LC
740
741 ;; Use the big Debian patch set (the thing does not even compile out of
742 ;; the box.)
743 (inputs `(("patch" ,(origin
744 (method url-fetch)
745 (uri
746 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
747 (sha256
748 (base32
749 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1dba6407 750 (native-inputs `(("gettext" ,gnu-gettext)))
85e0dc6a
LC
751
752 (synopsis "Tools for controlling the network subsystem in Linux")
753 (description
754 "This package includes the important tools for controlling the network
755subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
756netstat, rarp and route. Additionally, this package contains utilities
757relating to particular network hardware types (plipconfig, slattach) and
758advanced aspects of IP configuration (iptunnel, ipmaddr).")
759 (license gpl2+)))
c762e82e
LC
760
761(define-public libcap
762 (package
763 (name "libcap")
764 (version "2.22")
765 (source (origin
766 (method url-fetch)
767
768 ;; Tarballs used to be available from
769 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
770 ;; but they never came back after kernel.org was compromised.
771 (uri (string-append
772 "mirror://debian/pool/main/libc/libcap2/libcap2_"
773 version ".orig.tar.gz"))
774 (sha256
775 (base32
776 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
777 (build-system gnu-build-system)
778 (arguments '(#:phases (alist-delete 'configure %standard-phases)
779 #:tests? #f ; no 'check' target
780 #:make-flags (list "lib=lib"
781 (string-append "prefix="
782 (assoc-ref %outputs "out"))
783 "RAISE_SETFCAP=no")))
784 (native-inputs `(("perl" ,perl)))
785 (inputs `(("attr" ,attr)))
786 (home-page "https://sites.google.com/site/fullycapable/")
787 (synopsis "Library for working with POSIX capabilities")
788 (description
789 "libcap2 provides a programming interface to POSIX capabilities on
790Linux-based operating systems.")
791
792 ;; License is BSD-3 or GPLv2, at the user's choice.
793 (license gpl2)))
215b6431
LC
794
795(define-public bridge-utils
796 (package
797 (name "bridge-utils")
798 (version "1.5")
799 (source (origin
800 (method url-fetch)
801 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
802 version ".tar.gz"))
803 (sha256
804 (base32
805 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
806 (build-system gnu-build-system)
807
808 ;; The tarball lacks all the generated files.
809 (native-inputs `(("autoconf" ,autoconf)
810 ("automake" ,automake)))
811 (arguments
812 '(#:phases (alist-cons-before
813 'configure 'bootstrap
814 (lambda _
815 (zero? (system* "autoreconf" "-vf")))
816 %standard-phases)
817 #:tests? #f)) ; no 'check' target
818
819 (home-page
820 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
821 (synopsis "Manipulate Ethernet bridges")
822 (description
823 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
824to connect two Ethernet segments together in a protocol independent way.
825Packets are forwarded based on Ethernet address, rather than IP address (like
826a router). Since forwarding is done at Layer 2, all protocols can go
827transparently through a bridge.")
828 (license gpl2+)))
3cc20675
LC
829
830(define-public libnl
831 (package
832 (name "libnl")
833 (version "3.2.13")
834 (source (origin
835 (method url-fetch)
836 (uri (string-append
837 "http://www.infradead.org/~tgr/libnl/files/libnl-"
838 version ".tar.gz"))
839 (sha256
840 (base32
841 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
842 (build-system gnu-build-system)
843 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
844 (home-page "http://www.infradead.org/~tgr/libnl/")
845 (synopsis "NetLink protocol library suite")
846 (description
847 "The libnl suite is a collection of libraries providing APIs to netlink
848protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
849between the kernel and user space processes. It was designed to be a more
850flexible successor to ioctl to provide mainly networking related kernel
851configuration and monitoring interfaces.")
852
853 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
854 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
855 (license gpl2)))
023fef7d
LC
856
857(define-public powertop
858 (package
859 (name "powertop")
860 (version "2.5")
861 (source
862 (origin
863 (method url-fetch)
864 (uri (string-append
865 "https://01.org/powertop/sites/default/files/downloads/powertop-"
866 version ".tar.gz"))
867 (sha256
868 (base32
869 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
870 (build-system gnu-build-system)
871 (inputs
872 ;; TODO: Add pciutils.
873 `(("zlib" ,guix:zlib)
023fef7d
LC
874 ;; ("pciutils" ,pciutils)
875 ("ncurses" ,ncurses)
876 ("libnl" ,libnl)))
c4c4cc05
JD
877 (native-inputs
878 `(("pkg-config" ,pkg-config)))
023fef7d
LC
879 (home-page "https://01.org/powertop/")
880 (synopsis "Analyze power consumption on Intel-based laptops")
881 (description
882 "PowerTOP is a Linux tool to diagnose issues with power consumption and
883power management. In addition to being a diagnostic tool, PowerTOP also has
884an interactive mode where the user can experiment various power management
885settings for cases where the operating system has not enabled these
886settings.")
887 (license gpl2)))
6869e5c9
LC
888
889(define-public aumix
890 (package
891 (name "aumix")
892 (version "2.9.1")
893 (source (origin
894 (method url-fetch)
895 (uri (string-append
896 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
897 version ".tar.bz2"))
898 (sha256
899 (base32
900 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
901 (build-system gnu-build-system)
902 (inputs `(("ncurses" ,ncurses)))
903 (home-page "http://www.jpj.net/~trevor/aumix.html")
904 (synopsis "Audio mixer for X and the console")
905 (description
906 "Aumix adjusts an audio mixer from X, the console, a terminal,
907the command line or a script.")
908 (license gpl2+)))
7c0dbe78
SHT
909
910(define-public iotop
911 (package
912 (name "iotop")
913 (version "0.6")
914 (source
915 (origin
916 (method url-fetch)
917 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
918 version ".tar.gz"))
919 (sha256 (base32
920 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
921 (build-system python-build-system)
922 (arguments
35cebf01 923 ;; The setup.py script expects python-2.
7c0dbe78 924 `(#:python ,python-2
35cebf01 925 ;; There are currently no checks in the package.
7c0dbe78
SHT
926 #:tests? #f))
927 (native-inputs `(("python" ,python-2)))
928 (home-page "http://guichaz.free.fr/iotop/")
929 (synopsis
930 "Displays the IO activity of running processes")
931 (description
932 "Iotop is a Python program with a top like user interface to show the
933processes currently causing I/O.")
35cebf01 934 (license gpl2+)))
e30835e2
LC
935
936(define-public fuse
937 (package
938 (name "fuse")
939 (version "2.9.3")
940 (source (origin
941 (method url-fetch)
942 (uri (string-append "mirror://sourceforge/fuse/fuse-"
943 version ".tar.gz"))
944 (sha256
945 (base32
946 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
947 (build-system gnu-build-system)
b148bd71 948 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
949 (arguments
950 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
951 (assoc-ref %outputs "out")
952 "/sbin")
953 (string-append "INIT_D_PATH="
954 (assoc-ref %outputs "out")
955 "/etc/init.d")
956 (string-append "UDEV_RULES_PATH="
957 (assoc-ref %outputs "out")
b148bd71
LC
958 "/etc/udev"))
959 #:phases (alist-cons-before
960 'build 'set-file-names
961 (lambda* (#:key inputs #:allow-other-keys)
962 ;; libfuse calls out to mount(8) and umount(8). Make sure
963 ;; it refers to the right ones.
964 (substitute* '("lib/mount_util.c" "util/mount_util.c")
965 (("/bin/(u?)mount" _ maybe-u)
966 (string-append (assoc-ref inputs "util-linux")
967 "/bin/" maybe-u "mount")))
968 (substitute* '("util/mount.fuse.c")
969 (("/bin/sh")
970 (which "sh"))))
971 %standard-phases)))
e30835e2
LC
972 (home-page "http://fuse.sourceforge.net/")
973 (synopsis "Support file systems implemented in user space")
974 (description
975 "As a consequence of its monolithic design, file system code for Linux
976normally goes into the kernel itself---which is not only a robustness issue,
977but also an impediment to system extensibility. FUSE, for \"file systems in
978user space\", is a kernel module and user-space library that tries to address
979part of this problem by allowing users to run file system implementations as
980user-space processes.")
981 (license (list lgpl2.1 ; library
982 gpl2+)))) ; command-line utilities
220193ad
LC
983
984(define-public unionfs-fuse
985 (package
986 (name "unionfs-fuse")
987 (version "0.26")
988 (source (origin
989 (method url-fetch)
990 (uri (string-append
991 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
992 version ".tar.xz"))
993 (sha256
994 (base32
995 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
996 (build-system cmake-build-system)
997 (inputs `(("fuse" ,fuse)))
998 (arguments '(#:tests? #f)) ; no tests
999 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1000 (synopsis "User-space union file system")
1001 (description
1002 "UnionFS-FUSE is a flexible union file system implementation in user
1003space, using the FUSE library. Mounting a union file system allows you to
1004\"aggregate\" the contents of several directories into a single mount point.
1005UnionFS-FUSE additionally supports copy-on-write.")
1006 (license bsd-3)))
ed748588 1007
0b7a0c20
LC
1008(define fuse-static
1009 (package (inherit fuse)
1010 (name "fuse-static")
1011 (source (origin (inherit (package-source fuse))
1012 (modules '((guix build utils)))
1013 (snippet
1014 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1015 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1016 ;; it doesn't do that, allowing us to remove the dependency on
1017 ;; util-linux (something that is useful in initrds.)
1018 '(substitute* '("lib/mount_util.c"
1019 "util/mount_util.c")
1020 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1021 "0")
1022 (("/bin/")
1023 "")))))))
1024
ed748588
LC
1025(define-public unionfs-fuse/static
1026 (package (inherit unionfs-fuse)
1027 (synopsis "User-space union file system (statically linked)")
1028 (name (string-append (package-name unionfs-fuse) "-static"))
1029 (source (origin (inherit (package-source unionfs-fuse))
1030 (modules '((guix build utils)))
1031 (snippet
1032 ;; Add -ldl to the libraries, because libfuse.a needs that.
1033 '(substitute* "src/CMakeLists.txt"
1034 (("target_link_libraries(.*)\\)" _ libs)
1035 (string-append "target_link_libraries"
1036 libs " dl)"))))))
1037 (arguments
1038 '(#:tests? #f
0b7a0c20
LC
1039 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")))
1040 (inputs `(("fuse" ,fuse-static)))))