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