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