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