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