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