gnu: Add perf.
[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>
66269d47 3;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
0d55c356 5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
fd76c904 6;;;
233e7676 7;;; This file is part of GNU Guix.
fd76c904 8;;;
233e7676 9;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
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;;;
233e7676 14;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
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
233e7676 20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 21
1ffa7090 22(define-module (gnu packages linux)
023fef7d
LC
23 #:use-module ((guix licenses)
24 #:hide (zlib))
59a43334 25 #:use-module (gnu packages)
30016044 26 #:use-module ((gnu packages compression) #:prefix guix:)
3b027388 27 #:use-module (gnu packages gcc)
1ffa7090 28 #:use-module (gnu packages flex)
90a0048f 29 #:use-module (gnu packages bison)
d7d42d6b 30 #:use-module (gnu packages gperf)
1ffa7090
LC
31 #:use-module (gnu packages libusb)
32 #:use-module (gnu packages ncurses)
d7d42d6b 33 #:use-module (gnu packages pciutils)
5f96f303 34 #:use-module (gnu packages databases)
1ffa7090
LC
35 #:use-module (gnu packages perl)
36 #:use-module (gnu packages pkg-config)
7c0dbe78 37 #:use-module (gnu packages python)
e7b38500 38 #:use-module (gnu packages algebra)
1dba6407 39 #:use-module (gnu packages gettext)
db288efa 40 #:use-module (gnu packages glib)
17b293a0 41 #:use-module (gnu packages pulseaudio)
c762e82e 42 #:use-module (gnu packages attr)
17b293a0 43 #:use-module (gnu packages xml)
215b6431 44 #:use-module (gnu packages autotools)
f57d2639 45 #:use-module (gnu packages texinfo)
b10e9ff6 46 #:use-module (gnu packages check)
30016044
MW
47 #:use-module (gnu packages maths)
48 #:use-module (gnu packages which)
49 #:use-module (gnu packages rrdtool)
b62fe07f 50 #:use-module (gnu packages elf)
b087d413 51 #:use-module (gnu packages gtk)
02b80c3f
NK
52 #:use-module (guix packages)
53 #:use-module (guix download)
dc2d59af 54 #:use-module (guix utils)
7c0dbe78 55 #:use-module (guix build-system gnu)
220193ad 56 #:use-module (guix build-system cmake)
e102f940 57 #:use-module (guix build-system python)
a94546ec
LC
58 #:use-module (guix build-system trivial)
59 #:use-module (srfi srfi-26)
60 #:use-module (ice-9 match))
fd76c904 61
aaf4cb20
LC
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\"."
618cea69
NK
65 (let ((arch (car (string-split arch #\-))))
66 (cond ((string=? arch "i686") "i386")
67 ((string-prefix? "mips" arch) "mips")
aaf4cb20 68 ((string-prefix? "arm" arch) "arm")
618cea69
NK
69 (else arch))))
70
6023cc74
LC
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
80fe5c60 87(define-public linux-libre-headers
dfb52abb 88 (let* ((version "3.3.8")
80fe5c60 89 (build-phase
618cea69
NK
90 (lambda (arch)
91 `(lambda _
92 (setenv "ARCH" ,(system->linux-architecture arch))
93 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 94
618cea69
NK
95 (and (zero? (system* "make" "defconfig"))
96 (zero? (system* "make" "mrproper" "headers_check"))))))
80fe5c60
LC
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)
dfb52abb 108 (format p "~a-default~%" ,version))))))))
80fe5c60
LC
109 (package
110 (name "linux-libre-headers")
dfb52abb 111 (version version)
80fe5c60
LC
112 (source (origin
113 (method url-fetch)
6023cc74 114 (uri (linux-libre-urls version))
80fe5c60
LC
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)
56c092ce 123 (srfi srfi-1))
80fe5c60 124 #:phases (alist-replace
fb6c2fa8
LC
125 'build ,(build-phase (or (%current-target-system)
126 (%current-system)))
80fe5c60
LC
127 (alist-replace
128 'install ,install-phase
56c092ce 129 (alist-delete 'configure %standard-phases)))
80fe5c60
LC
130 #:tests? #f))
131 (synopsis "GNU Linux-Libre kernel headers")
132 (description "Headers of the Linux-Libre kernel.")
38bbd61d 133 (license gpl2)
80fe5c60
LC
134 (home-page "http://www.gnu.org/software/linux-libre/"))))
135
b4fcb735
LC
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
d3bbe992
LC
147 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
148 (patches
149 (list (search-patch "module-init-tools-moduledir.patch")))))
b4fcb735 150 (build-system gnu-build-system)
b4fcb735 151 (arguments
5c413a9c
LC
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.
b4fcb735 155 '(#:phases (alist-cons-before
5c413a9c
LC
156 'configure 'fake-docbook
157 (lambda _
158 (substitute* "Makefile.in"
159 (("^DOCBOOKTOMAN.*$")
160 "DOCBOOKTOMAN = true\n")))
b4fcb735
LC
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
ac47a7c2
LC
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/"
74dde9e9 174 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
175 (sha256
176 (base32
177 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
178
a94546ec
LC
179(define (kernel-config system)
180 "Return the absolute file name of the Linux-Libre build configuration file
1650dd8a 181for SYSTEM, or #f if there is no configuration for SYSTEM."
a94546ec
LC
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 (_
1650dd8a 192 #f)))
a94546ec 193
beacfcab 194(define-public linux-libre
49e4bca5 195 (let* ((version "3.16.3")
beacfcab 196 (build-phase
ac47a7c2
LC
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
beacfcab
LC
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
a94546ec
LC
208 (let ((build (assoc-ref %standard-phases 'build))
209 (config (assoc-ref inputs "kconfig")))
1650dd8a
LC
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"))
a94546ec
LC
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))))
beacfcab
LC
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)
cda3d81e 258 "INSTALL_MOD_STRIP=1"
beacfcab
LC
259 "modules_install"))))))
260 (package
261 (name "linux-libre")
dfb52abb 262 (version version)
beacfcab
LC
263 (source (origin
264 (method url-fetch)
6023cc74 265 (uri (linux-libre-urls version))
beacfcab
LC
266 (sha256
267 (base32
49e4bca5 268 "1480wnk1j18rxhp8hi7dd4d706lkgplwhvskx3z2mj39vg46v1zk"))))
beacfcab
LC
269 (build-system gnu-build-system)
270 (native-inputs `(("perl" ,perl)
e7b38500 271 ("bc" ,bc)
ac47a7c2 272 ("module-init-tools" ,module-init-tools)
a94546ec 273 ("patch/freedo+gnu" ,%boot-logo-patch)
1650dd8a
LC
274
275 ,@(let ((conf (kernel-config (or (%current-target-system)
276 (%current-system)))))
277 (if conf
278 `(("kconfig" ,conf))
279 '()))))
3b027388
LC
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
beacfcab
LC
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))
f50d2669 296 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 297 (description
79c311b8
LC
298 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
299It has been modified to remove all non-free binary blobs.")
beacfcab
LC
300 (license gpl2)
301 (home-page "http://www.gnu.org/software/linux-libre/"))))
302
c84d0eca
LC
303\f
304;;;
305;;; Pluggable authentication modules (PAM).
306;;;
307
fd76c904
LC
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)
c4c4cc05 323 (native-inputs
fd76c904
LC
324 `(("flex" ,flex)
325
326 ;; TODO: optional dependencies
327 ;; ("libxcrypt" ,libxcrypt)
328 ;; ("cracklib" ,cracklib)
329 ))
330 (arguments
c134056a
LC
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))
fd76c904
LC
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.
344Pluggable authentication modules are small shared object files that can
345be used through the PAM API to perform tasks, like authenticating a user
346at login. Local and dynamic reconfiguration are its key features")
4a44e743 347 (license bsd-3)))
686f14e8 348
c84d0eca
LC
349\f
350;;;
351;;; Miscellaneous.
352;;;
353
686f14e8
LC
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 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
371 (description
372 "This PSmisc package is a set of some small useful utilities that
373use the proc filesystem. We're not about changing the world, but
374providing the system administrator with some help in common tasks.")
4a44e743 375 (license gpl2+)))
02b80c3f
NK
376
377(define-public util-linux
378 (package
379 (name "util-linux")
380 (version "2.21")
5a6a3ba4
LC
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"))
9d77da2a
LC
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))))))
02b80c3f
NK
399 (build-system gnu-build-system)
400 (arguments
8b8476b8
AE
401 `(#:configure-flags '("--disable-use-tty-group"
402 "--enable-ddate")
02b80c3f
NK
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)))
4a44e743 411 (inputs `(("zlib" ,guix:zlib)
c4c4cc05
JD
412 ("ncurses" ,ncurses)))
413 (native-inputs
414 `(("perl" ,perl)))
02b80c3f 415 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 416 (synopsis "Collection of utilities for the Linux kernel")
02b80c3f
NK
417 (description
418 "util-linux is a random collection of utilities for the Linux kernel.")
fe8ccfcc 419
02b80c3f 420 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 421 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 422 ;; explicitly defined license.
fe8ccfcc
LC
423 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
424 bsd-4 public-domain))))
5d5c4278 425
e47e3eff
LC
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
01eafd38
LC
436 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
437 (patches (list (search-patch "procps-make-3.82.patch")))))
e47e3eff 438 (build-system gnu-build-system)
01eafd38 439 (inputs `(("ncurses" ,ncurses)))
e47e3eff 440 (arguments
01eafd38 441 '(#:phases (alist-replace
e47e3eff
LC
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/")
35ec07c7 472 (synopsis "Utilities that give information about processes")
e47e3eff
LC
473 (description
474 "procps is the package that has a bunch of small useful utilities
475that give information about processes using the Linux /proc file system.
476The package includes the programs ps, top, vmstat, w, kill, free,
477slabtop, and skill.")
478 (license gpl2)))
479
5d5c4278
NK
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
c4c4cc05
JD
494 `(("libusb" ,libusb)))
495 (native-inputs
496 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
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.")
4050e5d6 502 (license gpl2+)))
0750452a
LC
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)
c4c4cc05 516 (inputs `(("util-linux" ,util-linux)))
f57d2639
LC
517 (native-inputs `(("pkg-config" ,pkg-config)
518 ("texinfo" ,texinfo))) ; for the libext2fs Info manual
0750452a 519 (arguments
ddfc2fd8
LC
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
0750452a
LC
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/")
35ec07c7 542 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
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
d8482ad0 548
e102f940
LC
549(define-public e2fsck/static
550 (package
551 (name "e2fsck-static")
0997771a 552 (version (package-version e2fsprogs))
e102f940
LC
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." <>))))))))
0997771a 574 (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
e102f940
LC
575 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
576 (description
577 "This package provides statically-linked command of fsck.ext[234] taken
578from the e2fsprogs package. It is meant to be used in initrds.")
0997771a
LC
579 (home-page (package-home-page e2fsprogs))
580 (license (package-license e2fsprogs))))
e102f940 581
d8482ad0
LC
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)
c4c4cc05 594 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
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
599trace of all the system calls made by a another process/program.")
600 (license bsd-3)))
ba04571a
LC
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
bcd94e19
MW
613 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
614 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
ba04571a
LC
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
620MIDI functionality to the Linux-based operating system.")
621 (license lgpl2.1+)))
10afdf50 622
17b293a0
LC
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"
f2817d43
LC
638
639 ;; The udev rule is responsible for restoring
640 ;; the volume.
17b293a0
LC
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)
1dba6407 657 ("gettext" ,gnu-gettext)))
17b293a0
LC
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
662MIDI 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
10afdf50
LC
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
686Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
687system administrators. Since Network Address Translation is also configured
688from the packet filter ruleset, iptables is used for this, too. The iptables
689package also includes ip6tables. ip6tables is used for configuring the IPv6
690packet filter.")
691 (license gpl2+)))
90a0048f
LC
692
693(define-public iproute
694 (package
695 (name "iproute2")
5fd7f3e0 696 (version "3.12.0")
90a0048f
LC
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
5fd7f3e0 704 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
90a0048f
LC
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)
c4c4cc05
JD
725 ("db4" ,bdb)))
726 (native-inputs
727 `(("pkg-config" ,pkg-config)
90a0048f
LC
728 ("flex" ,flex)
729 ("bison" ,bison)))
730 (home-page
731 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
732 (synopsis
9e771e3b 733 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f
LC
734 (description
735 "Iproute2 is a collection of utilities for controlling TCP/IP
736networking and traffic with the Linux kernel.
737
738Most network configuration manuals still refer to ifconfig and route as the
739primary network configuration tools, but ifconfig is known to behave
740inadequately in modern network environments. They should be deprecated, but
741most distros still include them. Most network configuration systems make use
742of ifconfig and thus provide a limited feature set. The /etc/net project aims
743to support most modern network technologies, as it doesn't use ifconfig and
744allows a system administrator to make use of all iproute2 features, including
745traffic control.
746
747iproute2 is usually shipped in a package called iproute or iproute2 and
748consists of several tools, of which the most important are ip and tc. ip
749controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
750tools print detailed usage messages and are accompanied by a set of
751manpages.")
752 (license gpl2+)))
85e0dc6a
LC
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 (build-system gnu-build-system)
770 (arguments
cd143df0
LC
771 '(#:phases (alist-cons-after
772 'unpack 'patch
85e0dc6a
LC
773 (lambda* (#:key inputs #:allow-other-keys)
774 (define (apply-patch file)
775 (zero? (system* "patch" "-p1" "--batch"
776 "--input" file)))
777
778 (let ((patch.gz (assoc-ref inputs "patch")))
779 (format #t "applying Debian patch set '~a'...~%"
780 patch.gz)
781 (system (string-append "gunzip < " patch.gz " > the-patch"))
782 (pk 'here)
783 (and (apply-patch "the-patch")
784 (for-each apply-patch
785 (find-files "debian/patches"
786 "\\.patch")))))
787 (alist-replace
788 'configure
789 (lambda* (#:key outputs #:allow-other-keys)
790 (let ((out (assoc-ref outputs "out")))
791 (mkdir-p (string-append out "/bin"))
792 (mkdir-p (string-append out "/sbin"))
793
794 ;; Pretend we have everything...
795 (system "yes | make config")
796
797 ;; ... except we don't have libdnet, so remove that
798 ;; definition.
799 (substitute* '("config.make" "config.h")
800 (("^.*HAVE_AFDECnet.*$") ""))))
801 %standard-phases))
802
803 ;; Binaries that depend on libnet-tools.a don't declare that
804 ;; dependency, making it parallel-unsafe.
805 #:parallel-build? #f
806
807 #:tests? #f ; no test suite
0d55c356
MW
808 #:make-flags (let ((out (assoc-ref %outputs "out")))
809 (list "CC=gcc"
810 (string-append "BASEDIR=" out)
811 (string-append "INSTALLNLSDIR=" out "/share/locale")
812 (string-append "mandir=/share/man")))))
85e0dc6a
LC
813
814 ;; Use the big Debian patch set (the thing does not even compile out of
815 ;; the box.)
816 (inputs `(("patch" ,(origin
817 (method url-fetch)
818 (uri
819 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
820 (sha256
821 (base32
822 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1dba6407 823 (native-inputs `(("gettext" ,gnu-gettext)))
85e0dc6a
LC
824
825 (synopsis "Tools for controlling the network subsystem in Linux")
826 (description
827 "This package includes the important tools for controlling the network
828subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
829netstat, rarp and route. Additionally, this package contains utilities
830relating to particular network hardware types (plipconfig, slattach) and
831advanced aspects of IP configuration (iptunnel, ipmaddr).")
832 (license gpl2+)))
c762e82e
LC
833
834(define-public libcap
835 (package
836 (name "libcap")
837 (version "2.22")
838 (source (origin
839 (method url-fetch)
840
841 ;; Tarballs used to be available from
842 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
843 ;; but they never came back after kernel.org was compromised.
844 (uri (string-append
845 "mirror://debian/pool/main/libc/libcap2/libcap2_"
846 version ".orig.tar.gz"))
847 (sha256
848 (base32
849 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
850 (build-system gnu-build-system)
851 (arguments '(#:phases (alist-delete 'configure %standard-phases)
852 #:tests? #f ; no 'check' target
853 #:make-flags (list "lib=lib"
854 (string-append "prefix="
855 (assoc-ref %outputs "out"))
856 "RAISE_SETFCAP=no")))
857 (native-inputs `(("perl" ,perl)))
858 (inputs `(("attr" ,attr)))
859 (home-page "https://sites.google.com/site/fullycapable/")
860 (synopsis "Library for working with POSIX capabilities")
861 (description
862 "libcap2 provides a programming interface to POSIX capabilities on
863Linux-based operating systems.")
864
865 ;; License is BSD-3 or GPLv2, at the user's choice.
866 (license gpl2)))
215b6431
LC
867
868(define-public bridge-utils
869 (package
870 (name "bridge-utils")
871 (version "1.5")
872 (source (origin
873 (method url-fetch)
874 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
875 version ".tar.gz"))
876 (sha256
877 (base32
878 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
879 (build-system gnu-build-system)
880
881 ;; The tarball lacks all the generated files.
882 (native-inputs `(("autoconf" ,autoconf)
883 ("automake" ,automake)))
884 (arguments
885 '(#:phases (alist-cons-before
886 'configure 'bootstrap
887 (lambda _
888 (zero? (system* "autoreconf" "-vf")))
889 %standard-phases)
890 #:tests? #f)) ; no 'check' target
891
892 (home-page
893 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
894 (synopsis "Manipulate Ethernet bridges")
895 (description
896 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
897to connect two Ethernet segments together in a protocol independent way.
898Packets are forwarded based on Ethernet address, rather than IP address (like
899a router). Since forwarding is done at Layer 2, all protocols can go
900transparently through a bridge.")
901 (license gpl2+)))
3cc20675
LC
902
903(define-public libnl
904 (package
905 (name "libnl")
906 (version "3.2.13")
907 (source (origin
908 (method url-fetch)
909 (uri (string-append
910 "http://www.infradead.org/~tgr/libnl/files/libnl-"
911 version ".tar.gz"))
912 (sha256
913 (base32
914 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
915 (build-system gnu-build-system)
916 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
917 (home-page "http://www.infradead.org/~tgr/libnl/")
918 (synopsis "NetLink protocol library suite")
919 (description
920 "The libnl suite is a collection of libraries providing APIs to netlink
921protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
922between the kernel and user space processes. It was designed to be a more
923flexible successor to ioctl to provide mainly networking related kernel
924configuration and monitoring interfaces.")
925
926 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
927 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
928 (license gpl2)))
023fef7d
LC
929
930(define-public powertop
931 (package
932 (name "powertop")
933 (version "2.5")
934 (source
935 (origin
936 (method url-fetch)
937 (uri (string-append
938 "https://01.org/powertop/sites/default/files/downloads/powertop-"
939 version ".tar.gz"))
940 (sha256
941 (base32
942 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
943 (build-system gnu-build-system)
944 (inputs
945 ;; TODO: Add pciutils.
946 `(("zlib" ,guix:zlib)
023fef7d
LC
947 ;; ("pciutils" ,pciutils)
948 ("ncurses" ,ncurses)
949 ("libnl" ,libnl)))
c4c4cc05
JD
950 (native-inputs
951 `(("pkg-config" ,pkg-config)))
023fef7d
LC
952 (home-page "https://01.org/powertop/")
953 (synopsis "Analyze power consumption on Intel-based laptops")
954 (description
955 "PowerTOP is a Linux tool to diagnose issues with power consumption and
956power management. In addition to being a diagnostic tool, PowerTOP also has
957an interactive mode where the user can experiment various power management
958settings for cases where the operating system has not enabled these
959settings.")
960 (license gpl2)))
6869e5c9
LC
961
962(define-public aumix
963 (package
964 (name "aumix")
965 (version "2.9.1")
966 (source (origin
967 (method url-fetch)
968 (uri (string-append
969 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
970 version ".tar.bz2"))
971 (sha256
972 (base32
973 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
974 (build-system gnu-build-system)
975 (inputs `(("ncurses" ,ncurses)))
976 (home-page "http://www.jpj.net/~trevor/aumix.html")
977 (synopsis "Audio mixer for X and the console")
978 (description
979 "Aumix adjusts an audio mixer from X, the console, a terminal,
980the command line or a script.")
981 (license gpl2+)))
7c0dbe78
SHT
982
983(define-public iotop
984 (package
985 (name "iotop")
986 (version "0.6")
987 (source
988 (origin
989 (method url-fetch)
990 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
991 version ".tar.gz"))
992 (sha256 (base32
993 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
994 (build-system python-build-system)
995 (arguments
35cebf01 996 ;; The setup.py script expects python-2.
7c0dbe78 997 `(#:python ,python-2
35cebf01 998 ;; There are currently no checks in the package.
7c0dbe78
SHT
999 #:tests? #f))
1000 (native-inputs `(("python" ,python-2)))
1001 (home-page "http://guichaz.free.fr/iotop/")
1002 (synopsis
1003 "Displays the IO activity of running processes")
1004 (description
1005 "Iotop is a Python program with a top like user interface to show the
1006processes currently causing I/O.")
35cebf01 1007 (license gpl2+)))
e30835e2
LC
1008
1009(define-public fuse
1010 (package
1011 (name "fuse")
1012 (version "2.9.3")
1013 (source (origin
1014 (method url-fetch)
1015 (uri (string-append "mirror://sourceforge/fuse/fuse-"
1016 version ".tar.gz"))
1017 (sha256
1018 (base32
1019 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
1020 (build-system gnu-build-system)
b148bd71 1021 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1022 (arguments
1023 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1024 (assoc-ref %outputs "out")
1025 "/sbin")
1026 (string-append "INIT_D_PATH="
1027 (assoc-ref %outputs "out")
1028 "/etc/init.d")
9a4efac9
LC
1029
1030 ;; The rule makes /dev/fuse 666.
e30835e2
LC
1031 (string-append "UDEV_RULES_PATH="
1032 (assoc-ref %outputs "out")
9a4efac9 1033 "/lib/udev/rules.d"))
b148bd71
LC
1034 #:phases (alist-cons-before
1035 'build 'set-file-names
1036 (lambda* (#:key inputs #:allow-other-keys)
1037 ;; libfuse calls out to mount(8) and umount(8). Make sure
1038 ;; it refers to the right ones.
1039 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1040 (("/bin/(u?)mount" _ maybe-u)
1041 (string-append (assoc-ref inputs "util-linux")
1042 "/bin/" maybe-u "mount")))
1043 (substitute* '("util/mount.fuse.c")
1044 (("/bin/sh")
bd663902
LC
1045 (which "sh")))
1046
1047 ;; This hack leads libfuse to search for 'fusermount' in
1048 ;; $PATH, where it may find a setuid-root binary, instead of
1049 ;; trying solely $out/sbin/fusermount and failing because
1050 ;; it's not setuid.
1051 (substitute* "lib/Makefile"
1052 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1053 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1054 %standard-phases)))
e30835e2
LC
1055 (home-page "http://fuse.sourceforge.net/")
1056 (synopsis "Support file systems implemented in user space")
1057 (description
1058 "As a consequence of its monolithic design, file system code for Linux
1059normally goes into the kernel itself---which is not only a robustness issue,
1060but also an impediment to system extensibility. FUSE, for \"file systems in
1061user space\", is a kernel module and user-space library that tries to address
1062part of this problem by allowing users to run file system implementations as
1063user-space processes.")
1064 (license (list lgpl2.1 ; library
1065 gpl2+)))) ; command-line utilities
220193ad
LC
1066
1067(define-public unionfs-fuse
1068 (package
1069 (name "unionfs-fuse")
1070 (version "0.26")
1071 (source (origin
1072 (method url-fetch)
1073 (uri (string-append
1074 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1075 version ".tar.xz"))
1076 (sha256
1077 (base32
1078 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1079 (build-system cmake-build-system)
1080 (inputs `(("fuse" ,fuse)))
1081 (arguments '(#:tests? #f)) ; no tests
1082 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1083 (synopsis "User-space union file system")
1084 (description
1085 "UnionFS-FUSE is a flexible union file system implementation in user
1086space, using the FUSE library. Mounting a union file system allows you to
1087\"aggregate\" the contents of several directories into a single mount point.
1088UnionFS-FUSE additionally supports copy-on-write.")
1089 (license bsd-3)))
ed748588 1090
0b7a0c20
LC
1091(define fuse-static
1092 (package (inherit fuse)
1093 (name "fuse-static")
1094 (source (origin (inherit (package-source fuse))
1095 (modules '((guix build utils)))
1096 (snippet
1097 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1098 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1099 ;; it doesn't do that, allowing us to remove the dependency on
1100 ;; util-linux (something that is useful in initrds.)
1101 '(substitute* '("lib/mount_util.c"
1102 "util/mount_util.c")
1103 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1104 "0")
1105 (("/bin/")
1106 "")))))))
1107
ed748588
LC
1108(define-public unionfs-fuse/static
1109 (package (inherit unionfs-fuse)
1110 (synopsis "User-space union file system (statically linked)")
1111 (name (string-append (package-name unionfs-fuse) "-static"))
1112 (source (origin (inherit (package-source unionfs-fuse))
1113 (modules '((guix build utils)))
1114 (snippet
1115 ;; Add -ldl to the libraries, because libfuse.a needs that.
1116 '(substitute* "src/CMakeLists.txt"
1117 (("target_link_libraries(.*)\\)" _ libs)
1118 (string-append "target_link_libraries"
1119 libs " dl)"))))))
1120 (arguments
1121 '(#:tests? #f
1456cff1
LC
1122 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1123 #:phases (alist-cons-after
1124 'install 'post-install
1125 (lambda* (#:key outputs #:allow-other-keys)
1126 (let* ((out (assoc-ref outputs "out"))
1127 (exe (string-append out "/bin/unionfs")))
1128 ;; By default, 'unionfs' keeps references to
1129 ;; $glibc/share/locale and similar stuff. Remove them.
1130 (remove-store-references exe)))
1131 %standard-phases)))
0b7a0c20 1132 (inputs `(("fuse" ,fuse-static)))))
67b66003 1133
db288efa
LC
1134(define-public sshfs-fuse
1135 (package
1136 (name "sshfs-fuse")
1137 (version "2.5")
1138 (source (origin
1139 (method url-fetch)
1140 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1141 version ".tar.gz"))
1142 (sha256
1143 (base32
1144 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1145 (build-system gnu-build-system)
1146 (inputs
1147 `(("fuse" ,fuse)
1148 ("glib" ,glib)))
1149 (native-inputs
1150 `(("pkg-config" ,pkg-config)))
1151 (home-page "http://fuse.sourceforge.net/sshfs.html")
1152 (synopsis "Mount remote file systems over SSH")
1153 (description
1154 "This is a file system client based on the SSH File Transfer Protocol.
1155Since most SSH servers already support this protocol it is very easy to set
1156up: on the server side there's nothing to do; on the client side mounting the
1157file system is as easy as logging into the server with an SSH client.")
1158 (license gpl2+)))
1159
67b66003
LC
1160(define-public numactl
1161 (package
1162 (name "numactl")
1163 (version "2.0.9")
1164 (source (origin
1165 (method url-fetch)
1166 (uri (string-append
1167 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1168 version
1169 ".tar.gz"))
1170 (sha256
1171 (base32
1172 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1173 (build-system gnu-build-system)
1174 (arguments
1175 '(#:phases (alist-replace
1176 'configure
1177 (lambda* (#:key outputs #:allow-other-keys)
1178 ;; There's no 'configure' script, just a raw makefile.
1179 (substitute* "Makefile"
1180 (("^prefix := .*$")
1181 (string-append "prefix := " (assoc-ref outputs "out")
1182 "\n"))
1183 (("^libdir := .*$")
1184 ;; By default the thing tries to install under
1185 ;; $prefix/lib64 when on a 64-bit platform.
1186 (string-append "libdir := $(prefix)/lib\n"))))
1187 %standard-phases)
1188
1189 #:make-flags (list
1190 ;; By default the thing tries to use 'cc'.
1191 "CC=gcc"
1192
1193 ;; Make sure programs have an RPATH so they can find
1194 ;; libnuma.so.
1195 (string-append "LDLIBS=-Wl,-rpath="
1196 (assoc-ref %outputs "out") "/lib"))
1197
1198 ;; There's a 'test' target, but it requires NUMA support in the kernel
1199 ;; to run, which we can't assume to have.
1200 #:tests? #f))
1201 (home-page "http://oss.sgi.com/projects/libnuma/")
1202 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1203 (description
1204 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1205memory is not all in one place. The numactl program allows you to run your
1206application program on specific CPU's and memory nodes. It does this by
1207supplying a NUMA memory policy to the operating system before running your
1208program.
1209
1210The package contains other commands, such as numademo, numastat and memhog.
1211The numademo command provides a quick overview of NUMA performance on your
1212system.")
1213 (license (list gpl2 ; programs
1214 lgpl2.1)))) ; library
b10e9ff6
LC
1215
1216(define-public kbd
1217 (package
1218 (name "kbd")
1219 (version "2.0.1")
1220 (source (origin
1221 (method url-fetch)
1222 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1223 version ".tar.gz"))
1224 (sha256
1225 (base32
c8f60748
LC
1226 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1227 (modules '((guix build utils)))
1228 (snippet
f2cdcafb
LC
1229 '(begin
1230 (substitute* "tests/Makefile.in"
1231 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1232 (("@VERSION@")
1233 "[@]VERSION[@]"))
1234 (substitute* '("src/unicode_start" "src/unicode_stop")
1235 ;; Assume the Coreutils are in $PATH.
1236 (("/usr/bin/tty")
1237 "tty"))))))
b10e9ff6
LC
1238 (build-system gnu-build-system)
1239 (arguments
1240 '(#:phases (alist-cons-before
1241 'build 'pre-build
1242 (lambda* (#:key inputs #:allow-other-keys)
1243 (let ((gzip (assoc-ref %build-inputs "gzip"))
1244 (bzip2 (assoc-ref %build-inputs "bzip2")))
1245 (substitute* "src/libkeymap/findfile.c"
1246 (("gzip")
1247 (string-append gzip "/bin/gzip"))
1248 (("bzip2")
1249 (string-append bzip2 "/bin/bzip2")))))
f2cdcafb
LC
1250 (alist-cons-after
1251 'install 'post-install
1252 (lambda* (#:key outputs #:allow-other-keys)
1253 ;; Make sure these programs find their comrades.
1254 (let* ((out (assoc-ref outputs "out"))
1255 (bin (string-append out "/bin")))
1256 (for-each (lambda (prog)
1257 (wrap-program (string-append bin "/" prog)
1258 `("PATH" ":" prefix (,bin))))
1259 '("unicode_start" "unicode_stop"))))
1260 %standard-phases))))
b10e9ff6
LC
1261 (inputs `(("check" ,check)
1262 ("gzip" ,guix:gzip)
1263 ("bzip2" ,guix:bzip2)
1264 ("pam" ,linux-pam)))
1265 (native-inputs `(("pkg-config" ,pkg-config)))
1266 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1267 (synopsis "Linux keyboard utilities and keyboard maps")
1268 (description
1269 "This package contains keytable files and keyboard utilities compatible
1270for systems using the Linux kernel. This includes commands such as
1271'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1272 (license gpl2+)))
de0b620e
LC
1273
1274(define-public inotify-tools
1275 (package
1276 (name "inotify-tools")
1277 (version "3.13")
1278 (source (origin
1279 (method url-fetch)
1280 (uri (string-append
1281 "mirror://sourceforge/inotify-tools/inotify-tools/"
1282 version "/inotify-tools-" version ".tar.gz"))
1283 (sha256
1284 (base32
1285 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1286 (build-system gnu-build-system)
1287 (home-page "http://inotify-tools.sourceforge.net/")
1288 (synopsis "Monitor file accesses")
1289 (description
1290 "The inotify-tools packages provides a C library and command-line tools
1291to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1292 (license gpl2+)))
e062d542
AE
1293
1294(define-public kmod
1295 (package
1296 (name "kmod")
1297 (version "17")
1298 (source (origin
1299 (method url-fetch)
1300 (uri
1301 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1302 "kmod-" version ".tar.xz"))
1303 (sha256
1304 (base32
528b6a3d
LC
1305 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1306 (patches (list (search-patch "kmod-module-directory.patch")))))
e062d542
AE
1307 (build-system gnu-build-system)
1308 (native-inputs
1309 `(("pkg-config" ,pkg-config)))
1310 (inputs
1311 `(("xz" ,guix:xz)
1312 ("zlib" ,guix:zlib)))
1313 (arguments
1314 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1315 #:configure-flags '("--with-xz" "--with-zlib")
1316 #:phases (alist-cons-after
1317 'install 'install-modprobe&co
1318 (lambda* (#:key outputs #:allow-other-keys)
1319 (let* ((out (assoc-ref outputs "out"))
1320 (bin (string-append out "/bin")))
1321 (for-each (lambda (tool)
1322 (symlink "kmod"
1323 (string-append bin "/" tool)))
1324 '("insmod" "rmmod" "lsmod" "modprobe"
1325 "modinfo" "depmod"))))
1326 %standard-phases)))
e062d542
AE
1327 (home-page "https://www.kernel.org/")
1328 (synopsis "Kernel module tools")
1329 (description "kmod is a set of tools to handle common tasks with Linux
1330kernel modules like insert, remove, list, check properties, resolve
1331dependencies and aliases.
1332
1333These tools are designed on top of libkmod, a library that is shipped with
1334kmod. The aim is to be compatible with tools, configurations and indices
1335from the module-init-tools project.")
1336 (license gpl2+))) ; library under lgpl2.1+
d7d42d6b
AE
1337
1338(define-public udev
7fa715e7 1339 ;; The last pre-systemd version.
d7d42d6b
AE
1340 (package
1341 (name "udev")
1342 (version "182")
1343 (source (origin
1344 (method url-fetch)
1345 (uri (string-append
1346 "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
1347 version ".tar.xz"))
1348 (sha256
1349 (base32
1350 "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
1351 (patches (list (search-patch "udev-gir-libtool.patch")))))
1352 (build-system gnu-build-system)
1353 (arguments
1354 `(#:configure-flags (list (string-append
1355 "--with-pci-ids-path="
1356 (assoc-ref %build-inputs "pciutils")
1357 "/share/pci.ids.gz")
1358
1359 "--with-firmware-path=/no/firmware"
1360
1361 ;; Work around undefined reference to
1362 ;; 'mq_getattr' in sc-daemon.c.
1363 "LDFLAGS=-lrt")))
1364 (native-inputs
1365 `(("pkg-config" ,pkg-config)
1366 ("gperf" ,gperf)
426adbe8 1367 ("glib" ,glib "bin") ; glib-genmarshal, etc.
d7d42d6b
AE
1368 ("perl" ,perl) ; for the tests
1369 ("python" ,python-2))) ; ditto
1370 (inputs
1371 `(("kmod" ,kmod)
1372 ("pciutils" ,pciutils)
1373 ("usbutils" ,usbutils)
1374 ("util-linux" ,util-linux)
1375 ("glib" ,glib)
1376 ("gobject-introspection" ,gobject-introspection)))
1377 (home-page "http://www.freedesktop.org/software/systemd/libudev/")
1378 (synopsis "Userspace device management")
1379 (description "Udev is a daemon which dynamically creates and removes
1380device nodes from /dev/, handles hotplug events and loads drivers at boot
1381time.")
1382 (license gpl2+))) ; libudev is under lgpl2.1+
000f7559 1383
7fa715e7
LC
1384(define-public eudev
1385 ;; The post-systemd fork, maintained by Gentoo.
1386 (package (inherit udev)
1387 (name "eudev")
1388 (version "1.9")
1389 (source (origin
1390 (method url-fetch)
1391 (uri (string-append
1392 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1393 version ".tar.gz"))
1394 (sha256
1395 (base32
c19ce3a7
LC
1396 "1w6f8h7fhjz3prs630f8gawv7jx74zi600z0pm997kkp24pyj5wg"))
1397 (patches (list (search-patch "eudev-rules-directory.patch")))))
dc2d59af
LC
1398 (arguments
1399 (substitute-keyword-arguments (package-arguments udev)
1400 ((#:configure-flags flags)
1401 `(cons "--enable-libkmod" ,flags))))
7fa715e7
LC
1402 (home-page "http://www.gentoo.org/proj/en/eudev/")))
1403
66269d47
LC
1404(define-public lvm2
1405 (package
1406 (name "lvm2")
1407 (version "2.02.109")
1408 (source (origin
1409 (method url-fetch)
1410 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1411 version ".tgz"))
1412 (sha256
1413 (base32
1414 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1415 (modules '((guix build utils)))
1416 (snippet
1417 '(begin
1418 (use-modules (guix build utils))
1419
1420 ;; Honor sysconfdir.
1421 (substitute* "make.tmpl.in"
1422 (("confdir = .*$")
1423 "confdir = @sysconfdir@\n")
1424 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1425 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1426 (build-system gnu-build-system)
1427 (native-inputs
1428 `(("pkg-config" ,pkg-config)
1429 ("procps" ,procps))) ;tests use 'pgrep'
1430 (inputs
1431 `(("udev" ,udev)))
1432 (arguments
1433 '(#:phases (alist-cons-after
1434 'configure 'set-makefile-shell
1435 (lambda _
1436 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1437 ;; expected.
1438 (setenv "SHELL" (which "sh"))
1439
1440 ;; Replace /bin/sh with the right file name.
1441 (patch-makefile-SHELL "make.tmpl"))
1442 %standard-phases)
1443
1444 #:configure-flags (list (string-append "--sysconfdir="
1445 (assoc-ref %outputs "out")
1446 "/etc/lvm")
1447 "--enable-udev_sync"
f2817d43
LC
1448 "--enable-udev_rules"
1449
1450 ;; Make sure programs such as 'dmsetup' can
1451 ;; find libdevmapper.so.
1452 (string-append "LDFLAGS=-Wl,-rpath="
1453 (assoc-ref %outputs "out")
1454 "/lib"))
66269d47
LC
1455
1456 ;; The tests use 'mknod', which requires root access.
1457 #:tests? #f))
1458 (home-page "http://sourceware.org/lvm2/")
1459 (synopsis "Logical volume management for Linux")
1460 (description
1461 "LVM2 is the logical volume management tool set for Linux-based systems.
1462This package includes the user-space libraries and tools, including the device
1463mapper. Kernel components are part of Linux-libre.")
1464
1465 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1466 ;; Command-line tools are GPLv2.
1467 (license (list gpl2 lgpl2.1))))
1468
000f7559
DT
1469(define-public wireless-tools
1470 (package
1471 (name "wireless-tools")
1472 (version "30.pre9")
1473 (source (origin
1474 (method url-fetch)
1475 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1476 version ".tar.gz"))
1477 (sha256
1478 (base32
1479 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))))
1480 (build-system gnu-build-system)
1481 (arguments
1482 `(#:phases (alist-replace
1483 'configure
1484 (lambda* (#:key outputs #:allow-other-keys)
1485 (setenv "PREFIX" (assoc-ref outputs "out")))
1486 %standard-phases)
1487 #:tests? #f))
1488 (synopsis "Tools for manipulating Linux Wireless Extensions")
1489 (description "Wireless Tools are used to manipulate the Linux Wireless
1490Extensions. The Wireless Extension is an interface allowing you to set
1491Wireless LAN specific parameters and get the specific stats.")
1492 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1493 (license gpl2+)))
30016044
MW
1494
1495(define-public lm-sensors
1496 (package
1497 (name "lm-sensors")
1498 (version "3.3.5")
1499 (source (origin
1500 (method url-fetch)
1501 (uri (string-append
1502 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1503 version ".tar.bz2"))
1504 (sha256
1505 (base32
1506 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1507 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1508 (build-system gnu-build-system)
1509 (inputs `(("rrdtool" ,rrdtool)
1510 ("perl" ,perl)
1511 ("kmod" ,kmod)
1512 ("gnuplot" ,gnuplot)))
1513 (native-inputs `(("pkg-config" ,pkg-config)
1514 ("flex" ,flex)
1515 ("bison" ,bison)
1516 ("which" ,which)))
1517 (arguments
1518 `(#:tests? #f ; no 'check' target
1519 #:make-flags (list (string-append "PREFIX=" %output)
1520 (string-append "ETCDIR=" %output "/etc")
1521 (string-append "MANDIR=" %output "/share/man"))
1522 #:phases
1523 (alist-delete
1524 'configure
1525 (alist-cons-before
1526 'build 'patch-exec-paths
1527 (lambda* (#:key inputs outputs #:allow-other-keys)
1528 (substitute* "prog/detect/sensors-detect"
1529 (("`uname")
1530 (string-append "`" (assoc-ref inputs "coreutils")
1531 "/bin/uname"))
1532 (("(`|\")modprobe" all open-quote)
1533 (string-append open-quote
1534 (assoc-ref inputs "kmod")
1535 "/bin/modprobe")))
1536 (substitute* '("prog/pwm/pwmconfig"
1537 "prog/pwm/fancontrol")
1538 (("gnuplot")
1539 (string-append (assoc-ref inputs "gnuplot")
1540 "/bin/gnuplot"))
1541 (("cat ")
1542 (string-append (assoc-ref inputs "coreutils")
1543 "/bin/cat "))
1544 (("egrep ")
1545 (string-append (assoc-ref inputs "grep")
1546 "/bin/egrep "))
1547 (("sed -e")
1548 (string-append (assoc-ref inputs "sed")
1549 "/bin/sed -e"))
1550 (("cut -d")
1551 (string-append (assoc-ref inputs "coreutils")
1552 "/bin/cut -d"))
1553 (("sleep ")
1554 (string-append (assoc-ref inputs "coreutils")
1555 "/bin/sleep "))
1556 (("readlink -f")
1557 (string-append (assoc-ref inputs "coreutils")
1558 "/bin/readlink -f"))))
1559 %standard-phases))))
1560 (home-page "http://www.lm-sensors.org/")
1561 (synopsis "Utilities to read temperature/voltage/fan sensors")
1562 (description
1563 "lm-sensors is a hardware health monitoring package for Linux. It allows
1564you to access information from temperature, voltage, and fan speed sensors.
1565It works with most newer systems.")
1566 (license gpl2+)))
b087d413
MW
1567
1568(define-public xsensors
1569 (package
1570 (name "xsensors")
1571 (version "0.70")
1572 (source (origin
1573 (method url-fetch)
1574 (uri (string-append
1575 "http://www.linuxhardware.org/xsensors/xsensors-"
1576 version ".tar.gz"))
1577 (sha256
1578 (base32
1579 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1580 (build-system gnu-build-system)
1581 (inputs `(("lm-sensors" ,lm-sensors)
1582 ("gtk" ,gtk+-2)))
1583 (native-inputs `(("pkg-config" ,pkg-config)))
1584 (arguments
1585 `(#:phases (alist-cons-before
1586 'configure 'enable-deprecated
1587 (lambda _
1588 (substitute* "src/Makefile.in"
1589 (("-DGDK_DISABLE_DEPRECATED") "")
1590 (("-DGTK_DISABLE_DEPRECATED") "")))
1591 (alist-cons-before
1592 'configure 'remove-Werror
1593 (lambda _
1594 (substitute* '("configure" "src/Makefile.in")
1595 (("-Werror") "")))
1596 %standard-phases))))
1597 (home-page "http://www.linuxhardware.org/xsensors/")
1598 (synopsis "Hardware health information viewer")
1599 (description
1600 "xsensors reads data from the libsensors library regarding hardware
1601health such as temperature, voltage and fan speed and displays the information
1602in a digital read-out.")
1603 (license gpl2+)))
b62fe07f
LC
1604
1605(define-public perf
1606 (package
1607 (name "perf")
1608 (version (package-version linux-libre))
1609 (source (package-source linux-libre))
1610 (build-system gnu-build-system)
1611 (arguments
1612 '(#:phases (alist-replace
1613 'configure
1614 (lambda* (#:key inputs #:allow-other-keys)
1615 (setenv "SHELL_PATH" (which "bash"))
1616 (chdir "tools/perf"))
1617 %standard-phases)
1618 #:make-flags (list (string-append "DESTDIR="
1619 (assoc-ref %outputs "out"))
1620 "WERROR=0")
1621 #:tests? #f)) ;no tests
1622 (native-inputs
1623 `(("pkg-config" ,pkg-config)
1624 ("bison" ,bison)
1625 ("flex" ,flex)
1626
1627 ;; There are build scripts written in these languages.
1628 ("perl" ,perl)
1629 ("python" ,python-2)))
1630 (inputs
1631 `(;; ("slang" ,slang)
1632 ;; ("newt" ,newt)
1633 ("elfutils" ,elfutils)
1634
1635 ;; FIXME: Documentation.
1636 ;; ("libxslt" ,libxslt)
1637 ;; ("docbook-xml" ,docbook-xml)
1638 ;; ("docbook-xsl" ,docbook-xsl)
1639 ;; ("xmlto" ,xmlto)
1640 ;; ("asciidoc" ,asciidoc)
1641 ))
1642 (home-page "https://perf.wiki.kernel.org/")
1643 (synopsis "Linux profiling with performance counters")
1644 (description
1645 "perf is a tool suite for profiling using hardware performance counters,
1646with support in the Linux kernel. perf can instrument CPU performance
1647counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
1648of lightweight profiling. This package contains the user-land tools and in
1649particular the 'perf' command.")
1650 (license (package-license linux-libre))))