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