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