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