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