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