gnu: apl: Update to 1.4, add sqlite support.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
6869e5c9 2;;; Copyright © 2012, 2013, 2014 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>
0d55c356 5;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
fd76c904 6;;;
233e7676 7;;; This file is part of GNU Guix.
fd76c904 8;;;
233e7676 9;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
10;;; under the terms of the GNU General Public License as published by
11;;; the Free Software Foundation; either version 3 of the License, or (at
12;;; your option) any later version.
13;;;
233e7676 14;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
15;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;;; GNU General Public License for more details.
18;;;
19;;; You should have received a copy of the GNU General Public License
233e7676 20;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 21
1ffa7090 22(define-module (gnu packages linux)
023fef7d
LC
23 #:use-module ((guix licenses)
24 #:hide (zlib))
59a43334 25 #:use-module (gnu packages)
30016044 26 #:use-module ((gnu packages compression) #:prefix guix:)
1ffa7090 27 #:use-module (gnu packages flex)
90a0048f 28 #:use-module (gnu packages bison)
d7d42d6b 29 #:use-module (gnu packages gperf)
1ffa7090
LC
30 #:use-module (gnu packages libusb)
31 #:use-module (gnu packages ncurses)
d7d42d6b 32 #:use-module (gnu packages pciutils)
90a0048f 33 #:use-module (gnu packages bdb)
1ffa7090
LC
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages pkg-config)
7c0dbe78 36 #:use-module (gnu packages python)
e7b38500 37 #:use-module (gnu packages algebra)
1dba6407 38 #:use-module (gnu packages gettext)
db288efa 39 #:use-module (gnu packages glib)
17b293a0 40 #:use-module (gnu packages pulseaudio)
c762e82e 41 #:use-module (gnu packages attr)
17b293a0 42 #:use-module (gnu packages xml)
215b6431 43 #:use-module (gnu packages autotools)
f57d2639 44 #:use-module (gnu packages texinfo)
b10e9ff6 45 #:use-module (gnu packages check)
30016044
MW
46 #:use-module (gnu packages maths)
47 #:use-module (gnu packages which)
48 #:use-module (gnu packages rrdtool)
b087d413 49 #:use-module (gnu packages gtk)
02b80c3f
NK
50 #:use-module (guix packages)
51 #:use-module (guix download)
7c0dbe78 52 #:use-module (guix build-system gnu)
220193ad 53 #:use-module (guix build-system cmake)
e102f940 54 #:use-module (guix build-system python)
a94546ec
LC
55 #:use-module (guix build-system trivial)
56 #:use-module (srfi srfi-26)
57 #:use-module (ice-9 match))
fd76c904 58
aaf4cb20
LC
59(define-public (system->linux-architecture arch)
60 "Return the Linux architecture name for ARCH, a Guix system name such as
61\"x86_64-linux\"."
618cea69
NK
62 (let ((arch (car (string-split arch #\-))))
63 (cond ((string=? arch "i686") "i386")
64 ((string-prefix? "mips" arch) "mips")
aaf4cb20 65 ((string-prefix? "arm" arch) "arm")
618cea69
NK
66 (else arch))))
67
6023cc74
LC
68(define (linux-libre-urls version)
69 "Return a list of URLs for Linux-Libre VERSION."
70 (list (string-append
71 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
72 version "-gnu/linux-libre-" version "-gnu.tar.xz")
73
74 ;; XXX: Work around <http://bugs.gnu.org/14851>.
75 (string-append
76 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
77 version "-gnu.tar.xz")
78
79 ;; Maybe this URL will become valid eventually.
80 (string-append
81 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
82 version "-gnu.tar.xz")))
83
80fe5c60 84(define-public linux-libre-headers
dfb52abb 85 (let* ((version "3.3.8")
80fe5c60 86 (build-phase
618cea69
NK
87 (lambda (arch)
88 `(lambda _
89 (setenv "ARCH" ,(system->linux-architecture arch))
90 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 91
618cea69
NK
92 (and (zero? (system* "make" "defconfig"))
93 (zero? (system* "make" "mrproper" "headers_check"))))))
80fe5c60
LC
94 (install-phase
95 `(lambda* (#:key outputs #:allow-other-keys)
96 (let ((out (assoc-ref outputs "out")))
97 (and (zero? (system* "make"
98 (string-append "INSTALL_HDR_PATH=" out)
99 "headers_install"))
100 (mkdir (string-append out "/include/config"))
101 (call-with-output-file
102 (string-append out
103 "/include/config/kernel.release")
104 (lambda (p)
dfb52abb 105 (format p "~a-default~%" ,version))))))))
80fe5c60
LC
106 (package
107 (name "linux-libre-headers")
dfb52abb 108 (version version)
80fe5c60
LC
109 (source (origin
110 (method url-fetch)
6023cc74 111 (uri (linux-libre-urls version))
80fe5c60
LC
112 (sha256
113 (base32
114 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
115 (build-system gnu-build-system)
116 (native-inputs `(("perl" ,perl)))
117 (arguments
118 `(#:modules ((guix build gnu-build-system)
119 (guix build utils)
56c092ce 120 (srfi srfi-1))
80fe5c60 121 #:phases (alist-replace
fb6c2fa8
LC
122 'build ,(build-phase (or (%current-target-system)
123 (%current-system)))
80fe5c60
LC
124 (alist-replace
125 'install ,install-phase
56c092ce 126 (alist-delete 'configure %standard-phases)))
80fe5c60
LC
127 #:tests? #f))
128 (synopsis "GNU Linux-Libre kernel headers")
129 (description "Headers of the Linux-Libre kernel.")
38bbd61d 130 (license gpl2)
80fe5c60
LC
131 (home-page "http://www.gnu.org/software/linux-libre/"))))
132
b4fcb735
LC
133(define-public module-init-tools
134 (package
135 (name "module-init-tools")
136 (version "3.16")
137 (source (origin
138 (method url-fetch)
139 (uri (string-append
140 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
141 version ".tar.bz2"))
142 (sha256
143 (base32
d3bbe992
LC
144 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
145 (patches
146 (list (search-patch "module-init-tools-moduledir.patch")))))
b4fcb735 147 (build-system gnu-build-system)
b4fcb735 148 (arguments
5c413a9c
LC
149 ;; FIXME: The upstream tarball lacks man pages, and building them would
150 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
151 ;; but they vanished. In the meantime, fake it.
b4fcb735 152 '(#:phases (alist-cons-before
5c413a9c
LC
153 'configure 'fake-docbook
154 (lambda _
155 (substitute* "Makefile.in"
156 (("^DOCBOOKTOMAN.*$")
157 "DOCBOOKTOMAN = true\n")))
b4fcb735
LC
158 %standard-phases)))
159 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
160 (synopsis "Tools for loading and managing Linux kernel modules")
161 (description
162 "Tools for loading and managing Linux kernel modules, such as `modprobe',
163`insmod', `lsmod', and more.")
164 (license gpl2+)))
165
ac47a7c2
LC
166(define %boot-logo-patch
167 ;; Linux-Libre boot logo featuring Freedo and a gnu.
168 (origin
169 (method url-fetch)
170 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
171 "lemote/gnewsense/branches/3.15/100gnu+freedo.patch"))
172 (sha256
173 (base32
174 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
175
a94546ec
LC
176(define (kernel-config system)
177 "Return the absolute file name of the Linux-Libre build configuration file
1650dd8a 178for SYSTEM, or #f if there is no configuration for SYSTEM."
a94546ec
LC
179 (define (lookup file)
180 (let ((file (string-append "gnu/packages/" file)))
181 (search-path %load-path file)))
182
183 (match system
184 ("i686-linux"
185 (lookup "linux-libre-i686.conf"))
186 ("x86_64-linux"
187 (lookup "linux-libre-x86_64.conf"))
188 (_
1650dd8a 189 #f)))
a94546ec 190
beacfcab 191(define-public linux-libre
c8c85ed7 192 (let* ((version "3.16")
beacfcab 193 (build-phase
ac47a7c2
LC
194 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
195 ;; Apply the neat patch.
196 (system* "patch" "-p1" "--batch"
197 "-i" (assoc-ref inputs "patch/freedo+gnu"))
198
beacfcab
LC
199 (let ((arch (car (string-split system #\-))))
200 (setenv "ARCH"
201 (cond ((string=? arch "i686") "i386")
202 (else arch)))
203 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
204
a94546ec
LC
205 (let ((build (assoc-ref %standard-phases 'build))
206 (config (assoc-ref inputs "kconfig")))
1650dd8a
LC
207
208 ;; Use the architecture-specific config if available, and
209 ;; 'defconfig' otherwise.
210 (if config
211 (begin
212 (copy-file config ".config")
213 (chmod ".config" #o666))
214 (system* "make" "defconfig"))
a94546ec
LC
215
216 ;; Appending works even when the option wasn't in the
217 ;; file. The last one prevails if duplicated.
218 (let ((port (open-file ".config" "a")))
219 (display (string-append "CONFIG_NET_9P=m\n"
220 "CONFIG_NET_9P_VIRTIO=m\n"
221 "CONFIG_VIRTIO_BLK=m\n"
222 "CONFIG_VIRTIO_NET=m\n"
223 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
224 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
225 "CONFIG_VIRTIO_PCI=m\n"
226 "CONFIG_VIRTIO_BALLOON=m\n"
227 "CONFIG_VIRTIO_MMIO=m\n"
228 "CONFIG_FUSE_FS=m\n"
229 "CONFIG_CIFS=m\n"
230 "CONFIG_9P_FS=m\n")
231 port)
232 (close-port port))
233
234 (zero? (system* "make" "oldconfig"))
235
236 ;; Call the default `build' phase so `-j' is correctly
237 ;; passed.
238 (apply build #:make-flags "all" args))))
beacfcab
LC
239 (install-phase
240 `(lambda* (#:key inputs outputs #:allow-other-keys)
241 (let* ((out (assoc-ref outputs "out"))
242 (moddir (string-append out "/lib/modules"))
243 (mit (assoc-ref inputs "module-init-tools")))
244 (mkdir-p moddir)
245 (for-each (lambda (file)
246 (copy-file file
247 (string-append out "/" (basename file))))
248 (find-files "." "^(bzImage|System\\.map)$"))
249 (copy-file ".config" (string-append out "/config"))
250 (zero? (system* "make"
251 (string-append "DEPMOD=" mit "/sbin/depmod")
252 (string-append "MODULE_DIR=" moddir)
253 (string-append "INSTALL_PATH=" out)
254 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 255 "INSTALL_MOD_STRIP=1"
beacfcab
LC
256 "modules_install"))))))
257 (package
258 (name "linux-libre")
dfb52abb 259 (version version)
beacfcab
LC
260 (source (origin
261 (method url-fetch)
6023cc74 262 (uri (linux-libre-urls version))
beacfcab
LC
263 (sha256
264 (base32
c8c85ed7 265 "0632y5qbr03mlfxbmzf14agzgmjjxgyjnw4g2gqf1sqzj1654alw"))))
beacfcab
LC
266 (build-system gnu-build-system)
267 (native-inputs `(("perl" ,perl)
e7b38500 268 ("bc" ,bc)
ac47a7c2 269 ("module-init-tools" ,module-init-tools)
a94546ec 270 ("patch/freedo+gnu" ,%boot-logo-patch)
1650dd8a
LC
271
272 ,@(let ((conf (kernel-config (or (%current-target-system)
273 (%current-system)))))
274 (if conf
275 `(("kconfig" ,conf))
276 '()))))
beacfcab
LC
277 (arguments
278 `(#:modules ((guix build gnu-build-system)
279 (guix build utils)
280 (srfi srfi-1)
281 (ice-9 match))
282 #:phases (alist-replace
283 'build ,build-phase
284 (alist-replace
285 'install ,install-phase
286 (alist-delete 'configure %standard-phases)))
287 #:tests? #f))
f50d2669 288 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 289 (description
79c311b8
LC
290 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
291It has been modified to remove all non-free binary blobs.")
beacfcab
LC
292 (license gpl2)
293 (home-page "http://www.gnu.org/software/linux-libre/"))))
294
c84d0eca
LC
295\f
296;;;
297;;; Pluggable authentication modules (PAM).
298;;;
299
fd76c904
LC
300(define-public linux-pam
301 (package
302 (name "linux-pam")
303 (version "1.1.6")
304 (source
305 (origin
306 (method url-fetch)
307 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
308 version ".tar.bz2")
309 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
310 version ".tar.bz2")))
311 (sha256
312 (base32
313 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
314 (build-system gnu-build-system)
c4c4cc05 315 (native-inputs
fd76c904
LC
316 `(("flex" ,flex)
317
318 ;; TODO: optional dependencies
319 ;; ("libxcrypt" ,libxcrypt)
320 ;; ("cracklib" ,cracklib)
321 ))
322 (arguments
c134056a
LC
323 '(;; Most users, such as `shadow', expect the headers to be under
324 ;; `security'.
325 #:configure-flags (list (string-append "--includedir="
326 (assoc-ref %outputs "out")
327 "/include/security"))
328
329 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
330 ;; isn't available.
331 #:tests? #f))
fd76c904
LC
332 (home-page "http://www.linux-pam.org/")
333 (synopsis "Pluggable authentication modules for Linux")
334 (description
335 "A *Free* project to implement OSF's RFC 86.0.
336Pluggable authentication modules are small shared object files that can
337be used through the PAM API to perform tasks, like authenticating a user
338at login. Local and dynamic reconfiguration are its key features")
4a44e743 339 (license bsd-3)))
686f14e8 340
c84d0eca
LC
341\f
342;;;
343;;; Miscellaneous.
344;;;
345
686f14e8
LC
346(define-public psmisc
347 (package
348 (name "psmisc")
349 (version "22.20")
350 (source
351 (origin
352 (method url-fetch)
353 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
354 version ".tar.gz"))
355 (sha256
356 (base32
357 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
358 (build-system gnu-build-system)
359 (inputs `(("ncurses" ,ncurses)))
360 (home-page "http://psmisc.sourceforge.net/")
361 (synopsis
362 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
363 (description
364 "This PSmisc package is a set of some small useful utilities that
365use the proc filesystem. We're not about changing the world, but
366providing the system administrator with some help in common tasks.")
4a44e743 367 (license gpl2+)))
02b80c3f
NK
368
369(define-public util-linux
370 (package
371 (name "util-linux")
372 (version "2.21")
5a6a3ba4
LC
373 (source (origin
374 (method url-fetch)
375 (uri (string-append "mirror://kernel.org/linux/utils/"
376 name "/v" version "/"
377 name "-" version ".2" ".tar.xz"))
378 (sha256
379 (base32
380 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))
381 (patches (list (search-patch "util-linux-perl.patch")))))
02b80c3f
NK
382 (build-system gnu-build-system)
383 (arguments
8b8476b8
AE
384 `(#:configure-flags '("--disable-use-tty-group"
385 "--enable-ddate")
02b80c3f
NK
386 #:phases (alist-cons-after
387 'install 'patch-chkdupexe
388 (lambda* (#:key outputs #:allow-other-keys)
389 (let ((out (assoc-ref outputs "out")))
390 (substitute* (string-append out "/bin/chkdupexe")
391 ;; Allow 'patch-shebang' to do its work.
392 (("@PERL@") "/bin/perl"))))
393 %standard-phases)))
4a44e743 394 (inputs `(("zlib" ,guix:zlib)
c4c4cc05
JD
395 ("ncurses" ,ncurses)))
396 (native-inputs
397 `(("perl" ,perl)))
02b80c3f 398 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 399 (synopsis "Collection of utilities for the Linux kernel")
02b80c3f
NK
400 (description
401 "util-linux is a random collection of utilities for the Linux kernel.")
fe8ccfcc 402
02b80c3f 403 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 404 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 405 ;; explicitly defined license.
fe8ccfcc
LC
406 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
407 bsd-4 public-domain))))
5d5c4278 408
e47e3eff
LC
409(define-public procps
410 (package
411 (name "procps")
412 (version "3.2.8")
413 (source (origin
414 (method url-fetch)
415 (uri (string-append "http://procps.sourceforge.net/procps-"
416 version ".tar.gz"))
417 (sha256
418 (base32
01eafd38
LC
419 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))
420 (patches (list (search-patch "procps-make-3.82.patch")))))
e47e3eff 421 (build-system gnu-build-system)
01eafd38 422 (inputs `(("ncurses" ,ncurses)))
e47e3eff 423 (arguments
01eafd38 424 '(#:phases (alist-replace
e47e3eff
LC
425 'configure
426 (lambda* (#:key outputs #:allow-other-keys)
427 ;; No `configure', just a single Makefile.
428 (let ((out (assoc-ref outputs "out")))
429 (substitute* "Makefile"
430 (("/usr/") "/")
431 (("--(owner|group) 0") "")
432 (("ldconfig") "true")
433 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
434 ;; Add libproc to the RPATH.
435 (string-append "LDFLAGS := -Wl,-rpath="
436 out "/lib" value))))
437 (setenv "CC" "gcc"))
438 (alist-replace
439 'install
440 (lambda* (#:key outputs #:allow-other-keys)
441 (let ((out (assoc-ref outputs "out")))
442 (and (zero?
443 (system* "make" "install"
444 (string-append "DESTDIR=" out)))
445
446 ;; Sanity check.
447 (zero?
448 (system* (string-append out "/bin/ps")
449 "--version")))))
450 %standard-phases))
451
452 ;; What did you expect? Tests?
453 #:tests? #f))
454 (home-page "http://procps.sourceforge.net/")
35ec07c7 455 (synopsis "Utilities that give information about processes")
e47e3eff
LC
456 (description
457 "procps is the package that has a bunch of small useful utilities
458that give information about processes using the Linux /proc file system.
459The package includes the programs ps, top, vmstat, w, kill, free,
460slabtop, and skill.")
461 (license gpl2)))
462
5d5c4278
NK
463(define-public usbutils
464 (package
465 (name "usbutils")
466 (version "006")
467 (source
468 (origin
469 (method url-fetch)
470 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
471 "usbutils-" version ".tar.xz"))
472 (sha256
473 (base32
474 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
475 (build-system gnu-build-system)
476 (inputs
c4c4cc05
JD
477 `(("libusb" ,libusb)))
478 (native-inputs
479 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
480 (home-page "http://www.linux-usb.org/")
481 (synopsis
482 "Tools for working with USB devices, such as lsusb")
483 (description
484 "Tools for working with USB devices, such as lsusb.")
4050e5d6 485 (license gpl2+)))
0750452a
LC
486
487(define-public e2fsprogs
488 (package
489 (name "e2fsprogs")
490 (version "1.42.7")
491 (source (origin
492 (method url-fetch)
493 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
494 version ".tar.gz"))
495 (sha256
496 (base32
497 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
498 (build-system gnu-build-system)
c4c4cc05 499 (inputs `(("util-linux" ,util-linux)))
f57d2639
LC
500 (native-inputs `(("pkg-config" ,pkg-config)
501 ("texinfo" ,texinfo))) ; for the libext2fs Info manual
0750452a
LC
502 (arguments
503 '(#:phases (alist-cons-before
504 'configure 'patch-shells
505 (lambda _
506 (substitute* "configure"
507 (("/bin/sh (.*)parse-types.sh" _ dir)
508 (string-append (which "sh") " " dir
509 "parse-types.sh")))
510 (substitute* (find-files "." "^Makefile.in$")
511 (("#!/bin/sh")
512 (string-append "#!" (which "sh")))))
513 %standard-phases)
514
515 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
516 ;; they fail because we get an extra line that says "Can't check if
517 ;; filesystem is mounted due to missing mtab file".
518 #:tests? #f))
519 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 520 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
521 (description
522 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
523 (license (list gpl2 ; programs
524 lgpl2.0 ; libext2fs
525 x11)))) ; libuuid
d8482ad0 526
e102f940
LC
527(define-public e2fsck/static
528 (package
529 (name "e2fsck-static")
0997771a 530 (version (package-version e2fsprogs))
e102f940
LC
531 (build-system trivial-build-system)
532 (source #f)
533 (arguments
534 `(#:modules ((guix build utils))
535 #:builder
536 (begin
537 (use-modules (guix build utils)
538 (ice-9 ftw)
539 (srfi srfi-26))
540
541 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
542 "/sbin"))
543 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
544 (mkdir-p bin)
545 (with-directory-excursion bin
546 (for-each (lambda (file)
547 (copy-file (string-append source "/" file)
548 file)
549 (remove-store-references file)
550 (chmod file #o555))
551 (scandir source (cut string-prefix? "fsck." <>))))))))
0997771a 552 (inputs `(("e2fsprogs" ,(static-package e2fsprogs))))
e102f940
LC
553 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
554 (description
555 "This package provides statically-linked command of fsck.ext[234] taken
556from the e2fsprogs package. It is meant to be used in initrds.")
0997771a
LC
557 (home-page (package-home-page e2fsprogs))
558 (license (package-license e2fsprogs))))
e102f940 559
d8482ad0
LC
560(define-public strace
561 (package
562 (name "strace")
563 (version "4.7")
564 (source (origin
565 (method url-fetch)
566 (uri (string-append "mirror://sourceforge/strace/strace-"
567 version ".tar.xz"))
568 (sha256
569 (base32
570 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
571 (build-system gnu-build-system)
c4c4cc05 572 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
573 (home-page "http://strace.sourceforge.net/")
574 (synopsis "System call tracer for Linux")
575 (description
576 "strace is a system call tracer, i.e. a debugging tool which prints out a
577trace of all the system calls made by a another process/program.")
578 (license bsd-3)))
ba04571a
LC
579
580(define-public alsa-lib
581 (package
582 (name "alsa-lib")
583 (version "1.0.27.1")
584 (source (origin
585 (method url-fetch)
586 (uri (string-append
587 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
588 version ".tar.bz2"))
589 (sha256
590 (base32
bcd94e19
MW
591 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
592 (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch")))))
ba04571a
LC
593 (build-system gnu-build-system)
594 (home-page "http://www.alsa-project.org/")
595 (synopsis "The Advanced Linux Sound Architecture libraries")
596 (description
597 "The Advanced Linux Sound Architecture (ALSA) provides audio and
598MIDI functionality to the Linux-based operating system.")
599 (license lgpl2.1+)))
10afdf50 600
17b293a0
LC
601(define-public alsa-utils
602 (package
603 (name "alsa-utils")
604 (version "1.0.27.2")
605 (source (origin
606 (method url-fetch)
607 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-"
608 version ".tar.bz2"))
609 (sha256
610 (base32
611 "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2"))))
612 (build-system gnu-build-system)
613 (arguments
614 ;; XXX: Disable man page creation until we have DocBook.
615 '(#:configure-flags (list "--disable-xmlto"
616 (string-append "--with-udev-rules-dir="
617 (assoc-ref %outputs "out")
618 "/lib/udev/rules.d"))
619 #:phases (alist-cons-before
620 'install 'pre-install
621 (lambda _
622 ;; Don't try to mkdir /var/lib/alsa.
623 (substitute* "Makefile"
624 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
625 "true\n")))
626 %standard-phases)))
627 (inputs
628 `(("libsamplerate" ,libsamplerate)
629 ("ncurses" ,ncurses)
630 ("alsa-lib" ,alsa-lib)
631 ("xmlto" ,xmlto)
1dba6407 632 ("gettext" ,gnu-gettext)))
17b293a0
LC
633 (home-page "http://www.alsa-project.org/")
634 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
635 (description
636 "The Advanced Linux Sound Architecture (ALSA) provides audio and
637MIDI functionality to the Linux-based operating system.")
638
639 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
640 ;; GPLv2-only.
641 (license gpl2)))
642
10afdf50
LC
643(define-public iptables
644 (package
645 (name "iptables")
646 (version "1.4.16.2")
647 (source (origin
648 (method url-fetch)
649 (uri (string-append
650 "http://www.netfilter.org/projects/iptables/files/iptables-"
651 version ".tar.bz2"))
652 (sha256
653 (base32
654 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
655 (build-system gnu-build-system)
656 (arguments '(#:tests? #f)) ; no test suite
657 (home-page "http://www.netfilter.org/projects/iptables/index.html")
658 (synopsis "Program to configure the Linux IP packet filtering rules")
659 (description
660 "iptables is the userspace command line program used to configure the
661Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
662system administrators. Since Network Address Translation is also configured
663from the packet filter ruleset, iptables is used for this, too. The iptables
664package also includes ip6tables. ip6tables is used for configuring the IPv6
665packet filter.")
666 (license gpl2+)))
90a0048f
LC
667
668(define-public iproute
669 (package
670 (name "iproute2")
5fd7f3e0 671 (version "3.12.0")
90a0048f
LC
672 (source (origin
673 (method url-fetch)
674 (uri (string-append
675 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
676 version ".tar.xz"))
677 (sha256
678 (base32
5fd7f3e0 679 "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4"))))
90a0048f
LC
680 (build-system gnu-build-system)
681 (arguments
682 `(#:tests? #f ; no test suite
683 #:make-flags (let ((out (assoc-ref %outputs "out")))
684 (list "DESTDIR="
685 (string-append "LIBDIR=" out "/lib")
686 (string-append "SBINDIR=" out "/sbin")
687 (string-append "CONFDIR=" out "/etc")
688 (string-append "DOCDIR=" out "/share/doc/"
689 ,name "-" ,version)
690 (string-append "MANDIR=" out "/share/man")))
691 #:phases (alist-cons-before
692 'install 'pre-install
693 (lambda _
694 ;; Don't attempt to create /var/lib/arpd.
695 (substitute* "Makefile"
696 (("^.*ARPDDIR.*$") "")))
697 %standard-phases)))
698 (inputs
699 `(("iptables" ,iptables)
c4c4cc05
JD
700 ("db4" ,bdb)))
701 (native-inputs
702 `(("pkg-config" ,pkg-config)
90a0048f
LC
703 ("flex" ,flex)
704 ("bison" ,bison)))
705 (home-page
706 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
707 (synopsis
708 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
709 (description
710 "Iproute2 is a collection of utilities for controlling TCP/IP
711networking and traffic with the Linux kernel.
712
713Most network configuration manuals still refer to ifconfig and route as the
714primary network configuration tools, but ifconfig is known to behave
715inadequately in modern network environments. They should be deprecated, but
716most distros still include them. Most network configuration systems make use
717of ifconfig and thus provide a limited feature set. The /etc/net project aims
718to support most modern network technologies, as it doesn't use ifconfig and
719allows a system administrator to make use of all iproute2 features, including
720traffic control.
721
722iproute2 is usually shipped in a package called iproute or iproute2 and
723consists of several tools, of which the most important are ip and tc. ip
724controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
725tools print detailed usage messages and are accompanied by a set of
726manpages.")
727 (license gpl2+)))
85e0dc6a
LC
728
729(define-public net-tools
730 ;; XXX: This package is basically unmaintained, but it provides a few
731 ;; commands not yet provided by Inetutils, such as 'route', so we have to
732 ;; live with it.
733 (package
734 (name "net-tools")
735 (version "1.60")
736 (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/")
737 (source (origin
738 (method url-fetch)
739 (uri (string-append home-page "/" name "-"
740 version ".tar.bz2"))
741 (sha256
742 (base32
743 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))))
744 (build-system gnu-build-system)
745 (arguments
cd143df0
LC
746 '(#:phases (alist-cons-after
747 'unpack 'patch
85e0dc6a
LC
748 (lambda* (#:key inputs #:allow-other-keys)
749 (define (apply-patch file)
750 (zero? (system* "patch" "-p1" "--batch"
751 "--input" file)))
752
753 (let ((patch.gz (assoc-ref inputs "patch")))
754 (format #t "applying Debian patch set '~a'...~%"
755 patch.gz)
756 (system (string-append "gunzip < " patch.gz " > the-patch"))
757 (pk 'here)
758 (and (apply-patch "the-patch")
759 (for-each apply-patch
760 (find-files "debian/patches"
761 "\\.patch")))))
762 (alist-replace
763 'configure
764 (lambda* (#:key outputs #:allow-other-keys)
765 (let ((out (assoc-ref outputs "out")))
766 (mkdir-p (string-append out "/bin"))
767 (mkdir-p (string-append out "/sbin"))
768
769 ;; Pretend we have everything...
770 (system "yes | make config")
771
772 ;; ... except we don't have libdnet, so remove that
773 ;; definition.
774 (substitute* '("config.make" "config.h")
775 (("^.*HAVE_AFDECnet.*$") ""))))
776 %standard-phases))
777
778 ;; Binaries that depend on libnet-tools.a don't declare that
779 ;; dependency, making it parallel-unsafe.
780 #:parallel-build? #f
781
782 #:tests? #f ; no test suite
0d55c356
MW
783 #:make-flags (let ((out (assoc-ref %outputs "out")))
784 (list "CC=gcc"
785 (string-append "BASEDIR=" out)
786 (string-append "INSTALLNLSDIR=" out "/share/locale")
787 (string-append "mandir=/share/man")))))
85e0dc6a
LC
788
789 ;; Use the big Debian patch set (the thing does not even compile out of
790 ;; the box.)
791 (inputs `(("patch" ,(origin
792 (method url-fetch)
793 (uri
794 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
795 (sha256
796 (base32
797 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1dba6407 798 (native-inputs `(("gettext" ,gnu-gettext)))
85e0dc6a
LC
799
800 (synopsis "Tools for controlling the network subsystem in Linux")
801 (description
802 "This package includes the important tools for controlling the network
803subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
804netstat, rarp and route. Additionally, this package contains utilities
805relating to particular network hardware types (plipconfig, slattach) and
806advanced aspects of IP configuration (iptunnel, ipmaddr).")
807 (license gpl2+)))
c762e82e
LC
808
809(define-public libcap
810 (package
811 (name "libcap")
812 (version "2.22")
813 (source (origin
814 (method url-fetch)
815
816 ;; Tarballs used to be available from
817 ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/>
818 ;; but they never came back after kernel.org was compromised.
819 (uri (string-append
820 "mirror://debian/pool/main/libc/libcap2/libcap2_"
821 version ".orig.tar.gz"))
822 (sha256
823 (base32
824 "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1"))))
825 (build-system gnu-build-system)
826 (arguments '(#:phases (alist-delete 'configure %standard-phases)
827 #:tests? #f ; no 'check' target
828 #:make-flags (list "lib=lib"
829 (string-append "prefix="
830 (assoc-ref %outputs "out"))
831 "RAISE_SETFCAP=no")))
832 (native-inputs `(("perl" ,perl)))
833 (inputs `(("attr" ,attr)))
834 (home-page "https://sites.google.com/site/fullycapable/")
835 (synopsis "Library for working with POSIX capabilities")
836 (description
837 "libcap2 provides a programming interface to POSIX capabilities on
838Linux-based operating systems.")
839
840 ;; License is BSD-3 or GPLv2, at the user's choice.
841 (license gpl2)))
215b6431
LC
842
843(define-public bridge-utils
844 (package
845 (name "bridge-utils")
846 (version "1.5")
847 (source (origin
848 (method url-fetch)
849 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
850 version ".tar.gz"))
851 (sha256
852 (base32
853 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
854 (build-system gnu-build-system)
855
856 ;; The tarball lacks all the generated files.
857 (native-inputs `(("autoconf" ,autoconf)
858 ("automake" ,automake)))
859 (arguments
860 '(#:phases (alist-cons-before
861 'configure 'bootstrap
862 (lambda _
863 (zero? (system* "autoreconf" "-vf")))
864 %standard-phases)
865 #:tests? #f)) ; no 'check' target
866
867 (home-page
868 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
869 (synopsis "Manipulate Ethernet bridges")
870 (description
871 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
872to connect two Ethernet segments together in a protocol independent way.
873Packets are forwarded based on Ethernet address, rather than IP address (like
874a router). Since forwarding is done at Layer 2, all protocols can go
875transparently through a bridge.")
876 (license gpl2+)))
3cc20675
LC
877
878(define-public libnl
879 (package
880 (name "libnl")
881 (version "3.2.13")
882 (source (origin
883 (method url-fetch)
884 (uri (string-append
885 "http://www.infradead.org/~tgr/libnl/files/libnl-"
886 version ".tar.gz"))
887 (sha256
888 (base32
889 "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd"))))
890 (build-system gnu-build-system)
891 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
892 (home-page "http://www.infradead.org/~tgr/libnl/")
893 (synopsis "NetLink protocol library suite")
894 (description
895 "The libnl suite is a collection of libraries providing APIs to netlink
896protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly
897between the kernel and user space processes. It was designed to be a more
898flexible successor to ioctl to provide mainly networking related kernel
899configuration and monitoring interfaces.")
900
901 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
902 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
903 (license gpl2)))
023fef7d
LC
904
905(define-public powertop
906 (package
907 (name "powertop")
908 (version "2.5")
909 (source
910 (origin
911 (method url-fetch)
912 (uri (string-append
913 "https://01.org/powertop/sites/default/files/downloads/powertop-"
914 version ".tar.gz"))
915 (sha256
916 (base32
917 "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b"))))
918 (build-system gnu-build-system)
919 (inputs
920 ;; TODO: Add pciutils.
921 `(("zlib" ,guix:zlib)
023fef7d
LC
922 ;; ("pciutils" ,pciutils)
923 ("ncurses" ,ncurses)
924 ("libnl" ,libnl)))
c4c4cc05
JD
925 (native-inputs
926 `(("pkg-config" ,pkg-config)))
023fef7d
LC
927 (home-page "https://01.org/powertop/")
928 (synopsis "Analyze power consumption on Intel-based laptops")
929 (description
930 "PowerTOP is a Linux tool to diagnose issues with power consumption and
931power management. In addition to being a diagnostic tool, PowerTOP also has
932an interactive mode where the user can experiment various power management
933settings for cases where the operating system has not enabled these
934settings.")
935 (license gpl2)))
6869e5c9
LC
936
937(define-public aumix
938 (package
939 (name "aumix")
940 (version "2.9.1")
941 (source (origin
942 (method url-fetch)
943 (uri (string-append
944 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
945 version ".tar.bz2"))
946 (sha256
947 (base32
948 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
949 (build-system gnu-build-system)
950 (inputs `(("ncurses" ,ncurses)))
951 (home-page "http://www.jpj.net/~trevor/aumix.html")
952 (synopsis "Audio mixer for X and the console")
953 (description
954 "Aumix adjusts an audio mixer from X, the console, a terminal,
955the command line or a script.")
956 (license gpl2+)))
7c0dbe78
SHT
957
958(define-public iotop
959 (package
960 (name "iotop")
961 (version "0.6")
962 (source
963 (origin
964 (method url-fetch)
965 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
966 version ".tar.gz"))
967 (sha256 (base32
968 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
969 (build-system python-build-system)
970 (arguments
35cebf01 971 ;; The setup.py script expects python-2.
7c0dbe78 972 `(#:python ,python-2
35cebf01 973 ;; There are currently no checks in the package.
7c0dbe78
SHT
974 #:tests? #f))
975 (native-inputs `(("python" ,python-2)))
976 (home-page "http://guichaz.free.fr/iotop/")
977 (synopsis
978 "Displays the IO activity of running processes")
979 (description
980 "Iotop is a Python program with a top like user interface to show the
981processes currently causing I/O.")
35cebf01 982 (license gpl2+)))
e30835e2
LC
983
984(define-public fuse
985 (package
986 (name "fuse")
987 (version "2.9.3")
988 (source (origin
989 (method url-fetch)
990 (uri (string-append "mirror://sourceforge/fuse/fuse-"
991 version ".tar.gz"))
992 (sha256
993 (base32
994 "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb"))))
995 (build-system gnu-build-system)
b148bd71 996 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
997 (arguments
998 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
999 (assoc-ref %outputs "out")
1000 "/sbin")
1001 (string-append "INIT_D_PATH="
1002 (assoc-ref %outputs "out")
1003 "/etc/init.d")
1004 (string-append "UDEV_RULES_PATH="
1005 (assoc-ref %outputs "out")
b148bd71
LC
1006 "/etc/udev"))
1007 #:phases (alist-cons-before
1008 'build 'set-file-names
1009 (lambda* (#:key inputs #:allow-other-keys)
1010 ;; libfuse calls out to mount(8) and umount(8). Make sure
1011 ;; it refers to the right ones.
1012 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1013 (("/bin/(u?)mount" _ maybe-u)
1014 (string-append (assoc-ref inputs "util-linux")
1015 "/bin/" maybe-u "mount")))
1016 (substitute* '("util/mount.fuse.c")
1017 (("/bin/sh")
bd663902
LC
1018 (which "sh")))
1019
1020 ;; This hack leads libfuse to search for 'fusermount' in
1021 ;; $PATH, where it may find a setuid-root binary, instead of
1022 ;; trying solely $out/sbin/fusermount and failing because
1023 ;; it's not setuid.
1024 (substitute* "lib/Makefile"
1025 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1026 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1027 %standard-phases)))
e30835e2
LC
1028 (home-page "http://fuse.sourceforge.net/")
1029 (synopsis "Support file systems implemented in user space")
1030 (description
1031 "As a consequence of its monolithic design, file system code for Linux
1032normally goes into the kernel itself---which is not only a robustness issue,
1033but also an impediment to system extensibility. FUSE, for \"file systems in
1034user space\", is a kernel module and user-space library that tries to address
1035part of this problem by allowing users to run file system implementations as
1036user-space processes.")
1037 (license (list lgpl2.1 ; library
1038 gpl2+)))) ; command-line utilities
220193ad
LC
1039
1040(define-public unionfs-fuse
1041 (package
1042 (name "unionfs-fuse")
1043 (version "0.26")
1044 (source (origin
1045 (method url-fetch)
1046 (uri (string-append
1047 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1048 version ".tar.xz"))
1049 (sha256
1050 (base32
1051 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1052 (build-system cmake-build-system)
1053 (inputs `(("fuse" ,fuse)))
1054 (arguments '(#:tests? #f)) ; no tests
1055 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1056 (synopsis "User-space union file system")
1057 (description
1058 "UnionFS-FUSE is a flexible union file system implementation in user
1059space, using the FUSE library. Mounting a union file system allows you to
1060\"aggregate\" the contents of several directories into a single mount point.
1061UnionFS-FUSE additionally supports copy-on-write.")
1062 (license bsd-3)))
ed748588 1063
0b7a0c20
LC
1064(define fuse-static
1065 (package (inherit fuse)
1066 (name "fuse-static")
1067 (source (origin (inherit (package-source fuse))
1068 (modules '((guix build utils)))
1069 (snippet
1070 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1071 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1072 ;; it doesn't do that, allowing us to remove the dependency on
1073 ;; util-linux (something that is useful in initrds.)
1074 '(substitute* '("lib/mount_util.c"
1075 "util/mount_util.c")
1076 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1077 "0")
1078 (("/bin/")
1079 "")))))))
1080
ed748588
LC
1081(define-public unionfs-fuse/static
1082 (package (inherit unionfs-fuse)
1083 (synopsis "User-space union file system (statically linked)")
1084 (name (string-append (package-name unionfs-fuse) "-static"))
1085 (source (origin (inherit (package-source unionfs-fuse))
1086 (modules '((guix build utils)))
1087 (snippet
1088 ;; Add -ldl to the libraries, because libfuse.a needs that.
1089 '(substitute* "src/CMakeLists.txt"
1090 (("target_link_libraries(.*)\\)" _ libs)
1091 (string-append "target_link_libraries"
1092 libs " dl)"))))))
1093 (arguments
1094 '(#:tests? #f
0b7a0c20
LC
1095 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")))
1096 (inputs `(("fuse" ,fuse-static)))))
67b66003 1097
db288efa
LC
1098(define-public sshfs-fuse
1099 (package
1100 (name "sshfs-fuse")
1101 (version "2.5")
1102 (source (origin
1103 (method url-fetch)
1104 (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-"
1105 version ".tar.gz"))
1106 (sha256
1107 (base32
1108 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1109 (build-system gnu-build-system)
1110 (inputs
1111 `(("fuse" ,fuse)
1112 ("glib" ,glib)))
1113 (native-inputs
1114 `(("pkg-config" ,pkg-config)))
1115 (home-page "http://fuse.sourceforge.net/sshfs.html")
1116 (synopsis "Mount remote file systems over SSH")
1117 (description
1118 "This is a file system client based on the SSH File Transfer Protocol.
1119Since most SSH servers already support this protocol it is very easy to set
1120up: on the server side there's nothing to do; on the client side mounting the
1121file system is as easy as logging into the server with an SSH client.")
1122 (license gpl2+)))
1123
67b66003
LC
1124(define-public numactl
1125 (package
1126 (name "numactl")
1127 (version "2.0.9")
1128 (source (origin
1129 (method url-fetch)
1130 (uri (string-append
1131 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1132 version
1133 ".tar.gz"))
1134 (sha256
1135 (base32
1136 "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w"))))
1137 (build-system gnu-build-system)
1138 (arguments
1139 '(#:phases (alist-replace
1140 'configure
1141 (lambda* (#:key outputs #:allow-other-keys)
1142 ;; There's no 'configure' script, just a raw makefile.
1143 (substitute* "Makefile"
1144 (("^prefix := .*$")
1145 (string-append "prefix := " (assoc-ref outputs "out")
1146 "\n"))
1147 (("^libdir := .*$")
1148 ;; By default the thing tries to install under
1149 ;; $prefix/lib64 when on a 64-bit platform.
1150 (string-append "libdir := $(prefix)/lib\n"))))
1151 %standard-phases)
1152
1153 #:make-flags (list
1154 ;; By default the thing tries to use 'cc'.
1155 "CC=gcc"
1156
1157 ;; Make sure programs have an RPATH so they can find
1158 ;; libnuma.so.
1159 (string-append "LDLIBS=-Wl,-rpath="
1160 (assoc-ref %outputs "out") "/lib"))
1161
1162 ;; There's a 'test' target, but it requires NUMA support in the kernel
1163 ;; to run, which we can't assume to have.
1164 #:tests? #f))
1165 (home-page "http://oss.sgi.com/projects/libnuma/")
1166 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1167 (description
1168 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1169memory is not all in one place. The numactl program allows you to run your
1170application program on specific CPU's and memory nodes. It does this by
1171supplying a NUMA memory policy to the operating system before running your
1172program.
1173
1174The package contains other commands, such as numademo, numastat and memhog.
1175The numademo command provides a quick overview of NUMA performance on your
1176system.")
1177 (license (list gpl2 ; programs
1178 lgpl2.1)))) ; library
b10e9ff6
LC
1179
1180(define-public kbd
1181 (package
1182 (name "kbd")
1183 (version "2.0.1")
1184 (source (origin
1185 (method url-fetch)
1186 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1187 version ".tar.gz"))
1188 (sha256
1189 (base32
c8f60748
LC
1190 "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm"))
1191 (modules '((guix build utils)))
1192 (snippet
f2cdcafb
LC
1193 '(begin
1194 (substitute* "tests/Makefile.in"
1195 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1196 (("@VERSION@")
1197 "[@]VERSION[@]"))
1198 (substitute* '("src/unicode_start" "src/unicode_stop")
1199 ;; Assume the Coreutils are in $PATH.
1200 (("/usr/bin/tty")
1201 "tty"))))))
b10e9ff6
LC
1202 (build-system gnu-build-system)
1203 (arguments
1204 '(#:phases (alist-cons-before
1205 'build 'pre-build
1206 (lambda* (#:key inputs #:allow-other-keys)
1207 (let ((gzip (assoc-ref %build-inputs "gzip"))
1208 (bzip2 (assoc-ref %build-inputs "bzip2")))
1209 (substitute* "src/libkeymap/findfile.c"
1210 (("gzip")
1211 (string-append gzip "/bin/gzip"))
1212 (("bzip2")
1213 (string-append bzip2 "/bin/bzip2")))))
f2cdcafb
LC
1214 (alist-cons-after
1215 'install 'post-install
1216 (lambda* (#:key outputs #:allow-other-keys)
1217 ;; Make sure these programs find their comrades.
1218 (let* ((out (assoc-ref outputs "out"))
1219 (bin (string-append out "/bin")))
1220 (for-each (lambda (prog)
1221 (wrap-program (string-append bin "/" prog)
1222 `("PATH" ":" prefix (,bin))))
1223 '("unicode_start" "unicode_stop"))))
1224 %standard-phases))))
b10e9ff6
LC
1225 (inputs `(("check" ,check)
1226 ("gzip" ,guix:gzip)
1227 ("bzip2" ,guix:bzip2)
1228 ("pam" ,linux-pam)))
1229 (native-inputs `(("pkg-config" ,pkg-config)))
1230 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1231 (synopsis "Linux keyboard utilities and keyboard maps")
1232 (description
1233 "This package contains keytable files and keyboard utilities compatible
1234for systems using the Linux kernel. This includes commands such as
1235'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1236 (license gpl2+)))
de0b620e
LC
1237
1238(define-public inotify-tools
1239 (package
1240 (name "inotify-tools")
1241 (version "3.13")
1242 (source (origin
1243 (method url-fetch)
1244 (uri (string-append
1245 "mirror://sourceforge/inotify-tools/inotify-tools/"
1246 version "/inotify-tools-" version ".tar.gz"))
1247 (sha256
1248 (base32
1249 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1250 (build-system gnu-build-system)
1251 (home-page "http://inotify-tools.sourceforge.net/")
1252 (synopsis "Monitor file accesses")
1253 (description
1254 "The inotify-tools packages provides a C library and command-line tools
1255to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1256 (license gpl2+)))
e062d542
AE
1257
1258(define-public kmod
1259 (package
1260 (name "kmod")
1261 (version "17")
1262 (source (origin
1263 (method url-fetch)
1264 (uri
1265 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1266 "kmod-" version ".tar.xz"))
1267 (sha256
1268 (base32
528b6a3d
LC
1269 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
1270 (patches (list (search-patch "kmod-module-directory.patch")))))
e062d542
AE
1271 (build-system gnu-build-system)
1272 (native-inputs
1273 `(("pkg-config" ,pkg-config)))
1274 (inputs
1275 `(("xz" ,guix:xz)
1276 ("zlib" ,guix:zlib)))
1277 (arguments
1278 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1279 #:configure-flags '("--with-xz" "--with-zlib")
1280 #:phases (alist-cons-after
1281 'install 'install-modprobe&co
1282 (lambda* (#:key outputs #:allow-other-keys)
1283 (let* ((out (assoc-ref outputs "out"))
1284 (bin (string-append out "/bin")))
1285 (for-each (lambda (tool)
1286 (symlink "kmod"
1287 (string-append bin "/" tool)))
1288 '("insmod" "rmmod" "lsmod" "modprobe"
1289 "modinfo" "depmod"))))
1290 %standard-phases)))
e062d542
AE
1291 (home-page "https://www.kernel.org/")
1292 (synopsis "Kernel module tools")
1293 (description "kmod is a set of tools to handle common tasks with Linux
1294kernel modules like insert, remove, list, check properties, resolve
1295dependencies and aliases.
1296
1297These tools are designed on top of libkmod, a library that is shipped with
1298kmod. The aim is to be compatible with tools, configurations and indices
1299from the module-init-tools project.")
1300 (license gpl2+))) ; library under lgpl2.1+
d7d42d6b
AE
1301
1302(define-public udev
1303 (package
1304 (name "udev")
1305 (version "182")
1306 (source (origin
1307 (method url-fetch)
1308 (uri (string-append
1309 "mirror://kernel.org/linux/utils/kernel/hotplug/udev-"
1310 version ".tar.xz"))
1311 (sha256
1312 (base32
1313 "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d"))
1314 (patches (list (search-patch "udev-gir-libtool.patch")))))
1315 (build-system gnu-build-system)
1316 (arguments
1317 `(#:configure-flags (list (string-append
1318 "--with-pci-ids-path="
1319 (assoc-ref %build-inputs "pciutils")
1320 "/share/pci.ids.gz")
1321
1322 "--with-firmware-path=/no/firmware"
1323
1324 ;; Work around undefined reference to
1325 ;; 'mq_getattr' in sc-daemon.c.
1326 "LDFLAGS=-lrt")))
1327 (native-inputs
1328 `(("pkg-config" ,pkg-config)
1329 ("gperf" ,gperf)
426adbe8 1330 ("glib" ,glib "bin") ; glib-genmarshal, etc.
d7d42d6b
AE
1331 ("perl" ,perl) ; for the tests
1332 ("python" ,python-2))) ; ditto
1333 (inputs
1334 `(("kmod" ,kmod)
1335 ("pciutils" ,pciutils)
1336 ("usbutils" ,usbutils)
1337 ("util-linux" ,util-linux)
1338 ("glib" ,glib)
1339 ("gobject-introspection" ,gobject-introspection)))
1340 (home-page "http://www.freedesktop.org/software/systemd/libudev/")
1341 (synopsis "Userspace device management")
1342 (description "Udev is a daemon which dynamically creates and removes
1343device nodes from /dev/, handles hotplug events and loads drivers at boot
1344time.")
1345 (license gpl2+))) ; libudev is under lgpl2.1+
000f7559 1346
66269d47
LC
1347(define-public lvm2
1348 (package
1349 (name "lvm2")
1350 (version "2.02.109")
1351 (source (origin
1352 (method url-fetch)
1353 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1354 version ".tgz"))
1355 (sha256
1356 (base32
1357 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1358 (modules '((guix build utils)))
1359 (snippet
1360 '(begin
1361 (use-modules (guix build utils))
1362
1363 ;; Honor sysconfdir.
1364 (substitute* "make.tmpl.in"
1365 (("confdir = .*$")
1366 "confdir = @sysconfdir@\n")
1367 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1368 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1369 (build-system gnu-build-system)
1370 (native-inputs
1371 `(("pkg-config" ,pkg-config)
1372 ("procps" ,procps))) ;tests use 'pgrep'
1373 (inputs
1374 `(("udev" ,udev)))
1375 (arguments
1376 '(#:phases (alist-cons-after
1377 'configure 'set-makefile-shell
1378 (lambda _
1379 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1380 ;; expected.
1381 (setenv "SHELL" (which "sh"))
1382
1383 ;; Replace /bin/sh with the right file name.
1384 (patch-makefile-SHELL "make.tmpl"))
1385 %standard-phases)
1386
1387 #:configure-flags (list (string-append "--sysconfdir="
1388 (assoc-ref %outputs "out")
1389 "/etc/lvm")
1390 "--enable-udev_sync"
1391 "--enable-udev_rules")
1392
1393 ;; The tests use 'mknod', which requires root access.
1394 #:tests? #f))
1395 (home-page "http://sourceware.org/lvm2/")
1396 (synopsis "Logical volume management for Linux")
1397 (description
1398 "LVM2 is the logical volume management tool set for Linux-based systems.
1399This package includes the user-space libraries and tools, including the device
1400mapper. Kernel components are part of Linux-libre.")
1401
1402 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1403 ;; Command-line tools are GPLv2.
1404 (license (list gpl2 lgpl2.1))))
1405
000f7559
DT
1406(define-public wireless-tools
1407 (package
1408 (name "wireless-tools")
1409 (version "30.pre9")
1410 (source (origin
1411 (method url-fetch)
1412 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1413 version ".tar.gz"))
1414 (sha256
1415 (base32
1416 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))))
1417 (build-system gnu-build-system)
1418 (arguments
1419 `(#:phases (alist-replace
1420 'configure
1421 (lambda* (#:key outputs #:allow-other-keys)
1422 (setenv "PREFIX" (assoc-ref outputs "out")))
1423 %standard-phases)
1424 #:tests? #f))
1425 (synopsis "Tools for manipulating Linux Wireless Extensions")
1426 (description "Wireless Tools are used to manipulate the Linux Wireless
1427Extensions. The Wireless Extension is an interface allowing you to set
1428Wireless LAN specific parameters and get the specific stats.")
1429 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
1430 (license gpl2+)))
30016044
MW
1431
1432(define-public lm-sensors
1433 (package
1434 (name "lm-sensors")
1435 (version "3.3.5")
1436 (source (origin
1437 (method url-fetch)
1438 (uri (string-append
1439 "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-"
1440 version ".tar.bz2"))
1441 (sha256
1442 (base32
1443 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
1444 (patches (list (search-patch "lm-sensors-hwmon-attrs.patch")))))
1445 (build-system gnu-build-system)
1446 (inputs `(("rrdtool" ,rrdtool)
1447 ("perl" ,perl)
1448 ("kmod" ,kmod)
1449 ("gnuplot" ,gnuplot)))
1450 (native-inputs `(("pkg-config" ,pkg-config)
1451 ("flex" ,flex)
1452 ("bison" ,bison)
1453 ("which" ,which)))
1454 (arguments
1455 `(#:tests? #f ; no 'check' target
1456 #:make-flags (list (string-append "PREFIX=" %output)
1457 (string-append "ETCDIR=" %output "/etc")
1458 (string-append "MANDIR=" %output "/share/man"))
1459 #:phases
1460 (alist-delete
1461 'configure
1462 (alist-cons-before
1463 'build 'patch-exec-paths
1464 (lambda* (#:key inputs outputs #:allow-other-keys)
1465 (substitute* "prog/detect/sensors-detect"
1466 (("`uname")
1467 (string-append "`" (assoc-ref inputs "coreutils")
1468 "/bin/uname"))
1469 (("(`|\")modprobe" all open-quote)
1470 (string-append open-quote
1471 (assoc-ref inputs "kmod")
1472 "/bin/modprobe")))
1473 (substitute* '("prog/pwm/pwmconfig"
1474 "prog/pwm/fancontrol")
1475 (("gnuplot")
1476 (string-append (assoc-ref inputs "gnuplot")
1477 "/bin/gnuplot"))
1478 (("cat ")
1479 (string-append (assoc-ref inputs "coreutils")
1480 "/bin/cat "))
1481 (("egrep ")
1482 (string-append (assoc-ref inputs "grep")
1483 "/bin/egrep "))
1484 (("sed -e")
1485 (string-append (assoc-ref inputs "sed")
1486 "/bin/sed -e"))
1487 (("cut -d")
1488 (string-append (assoc-ref inputs "coreutils")
1489 "/bin/cut -d"))
1490 (("sleep ")
1491 (string-append (assoc-ref inputs "coreutils")
1492 "/bin/sleep "))
1493 (("readlink -f")
1494 (string-append (assoc-ref inputs "coreutils")
1495 "/bin/readlink -f"))))
1496 %standard-phases))))
1497 (home-page "http://www.lm-sensors.org/")
1498 (synopsis "Utilities to read temperature/voltage/fan sensors")
1499 (description
1500 "lm-sensors is a hardware health monitoring package for Linux. It allows
1501you to access information from temperature, voltage, and fan speed sensors.
1502It works with most newer systems.")
1503 (license gpl2+)))
b087d413
MW
1504
1505(define-public xsensors
1506 (package
1507 (name "xsensors")
1508 (version "0.70")
1509 (source (origin
1510 (method url-fetch)
1511 (uri (string-append
1512 "http://www.linuxhardware.org/xsensors/xsensors-"
1513 version ".tar.gz"))
1514 (sha256
1515 (base32
1516 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1517 (build-system gnu-build-system)
1518 (inputs `(("lm-sensors" ,lm-sensors)
1519 ("gtk" ,gtk+-2)))
1520 (native-inputs `(("pkg-config" ,pkg-config)))
1521 (arguments
1522 `(#:phases (alist-cons-before
1523 'configure 'enable-deprecated
1524 (lambda _
1525 (substitute* "src/Makefile.in"
1526 (("-DGDK_DISABLE_DEPRECATED") "")
1527 (("-DGTK_DISABLE_DEPRECATED") "")))
1528 (alist-cons-before
1529 'configure 'remove-Werror
1530 (lambda _
1531 (substitute* '("configure" "src/Makefile.in")
1532 (("-Werror") "")))
1533 %standard-phases))))
1534 (home-page "http://www.linuxhardware.org/xsensors/")
1535 (synopsis "Hardware health information viewer")
1536 (description
1537 "xsensors reads data from the libsensors library regarding hardware
1538health such as temperature, voltage and fan speed and displays the information
1539in a digital read-out.")
1540 (license gpl2+)))