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