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