gnu: Add light.
[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.3")
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 "0ppv953gn2zylcagr4z6zg5y2x93dxrml29plypg6xgbq3hrv2bs"))
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 "3.4")
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 "0248v9f28mrbwabl94ck22gfim29sqhkf70wrpfi52nk4x3bxl17"))))
2479 (build-system gnu-build-system)
2480 (inputs
2481 `(("udev" ,eudev)))
2482 (arguments
2483 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2484 (list "INSTALL=install"
2485 "CHECK_RUN_DIR=0"
2486 ;; TODO: tell it where to find 'sendmail'
2487 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2488 (string-append "BINDIR=" out "/sbin")
2489 (string-append "MANDIR=" out "/share/man")
2490 (string-append "UDEVDIR=" out "/lib/udev")))
2491 #:phases (alist-cons-before
2492 'build 'patch-program-paths
2493 (lambda* (#:key inputs #:allow-other-keys)
2494 (let ((coreutils (assoc-ref inputs "coreutils")))
2495 (substitute* "udev-md-raid-arrays.rules"
2496 (("/usr/bin/(readlink|basename)" all program)
2497 (string-append coreutils "/bin/" program)))))
2498 (alist-cons-before
2499 'build 'remove-W-error
2500 (lambda _
2501 ;; We cannot build with -Werror on i686 due to a
2502 ;; 'sign-compare' warning in util.c.
2503 (substitute* "Makefile"
2504 (("-Werror") ""))
2505 #t)
2506 (alist-delete 'configure %standard-phases)))
2507 ;;tests must be done as root
2508 #:tests? #f))
2509 (home-page "http://neil.brown.name/blog/mdadm")
2510 (synopsis "Tool for managing Linux Software RAID arrays")
2511 (description
2512 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2513 assemble, report on, and monitor arrays. It can also move spares between raid
2514 arrays when needed.")
2515 (license license:gpl2+)))
2516
2517 (define-public mdadm-static
2518 (package
2519 (inherit mdadm)
2520 (name "mdadm-static")
2521 (arguments
2522 (substitute-keyword-arguments (package-arguments mdadm)
2523 ((#:make-flags flags)
2524 `(cons "LDFLAGS = -static" ,flags))
2525 ((#:phases phases)
2526 `(modify-phases ,phases
2527 (add-after 'install 'remove-cruft
2528 (lambda* (#:key outputs #:allow-other-keys)
2529 (let* ((out (assoc-ref outputs "out"))
2530 (precious? (lambda (file)
2531 (member file '("." ".." "sbin"))))
2532 (directories (scandir out (negate precious?))))
2533 (with-directory-excursion out
2534 (for-each delete-file-recursively directories)
2535 (remove-store-references "sbin/mdadm")
2536 (delete-file "sbin/mdmon")
2537 #t))))))
2538 ((#:modules modules %gnu-build-system-modules)
2539 `((ice-9 ftw) ,@modules))
2540 ((#:strip-flags _ '())
2541 ''("--strip-all")) ;strip a few extra KiB
2542 ((#:allowed-references _ '("out"))
2543 '("out")))) ;refer only self
2544 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2545
2546 (define-public libaio
2547 (package
2548 (name "libaio")
2549 (version "0.3.110")
2550 (source (origin
2551 (method url-fetch)
2552 (uri (list
2553 (string-append "mirror://debian/pool/main/liba/libaio/"
2554 name "_" version ".orig.tar.gz")
2555 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2556 name "-" version ".tar.gz")))
2557 (sha256
2558 (base32
2559 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2560 (build-system gnu-build-system)
2561 (arguments
2562 '(#:make-flags
2563 (list "CC=gcc" (string-append "prefix=" %output))
2564 #:test-target "partcheck" ; need root for a full 'check'
2565 #:phases
2566 (alist-delete 'configure %standard-phases))) ; no configure script
2567 (home-page "http://lse.sourceforge.net/io/aio.html")
2568 (synopsis "Linux-native asynchronous I/O access library")
2569 (description
2570 "This library enables userspace to use Linux kernel asynchronous I/O
2571 system calls, important for the performance of databases and other advanced
2572 applications.")
2573 (license license:lgpl2.1+)))
2574
2575 (define-public sbc
2576 (package
2577 (name "sbc")
2578 (version "1.3")
2579 (source (origin
2580 (method url-fetch)
2581 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2582 name "-" version ".tar.xz"))
2583 (sha256
2584 (base32
2585 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2586 (build-system gnu-build-system)
2587 (inputs
2588 `(("libsndfile" ,libsndfile)))
2589 (native-inputs
2590 `(("pkg-config" ,pkg-config)))
2591 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2592 (synopsis "Bluetooth subband audio codec")
2593 (description
2594 "The SBC is a digital audio encoder and decoder used to transfer data to
2595 Bluetooth audio output devices like headphones or loudspeakers.")
2596 (license license:gpl2+)))
2597
2598 (define-public bluez
2599 (package
2600 (name "bluez")
2601 (version "5.43")
2602 (source (origin
2603 (method url-fetch)
2604 (uri (string-append
2605 "mirror://kernel.org/linux/bluetooth/bluez-"
2606 version ".tar.xz"))
2607 (sha256
2608 (base32
2609 "05cdnpz0w2lwq2x5ba87q1h2wgb4lfnpbnbh6p7499hx59fw1j8n"))))
2610 (build-system gnu-build-system)
2611 (arguments
2612 '(#:configure-flags
2613 (let ((out (assoc-ref %outputs "out")))
2614 (list "--sysconfdir=/etc"
2615 "--localstatedir=/var"
2616 "--enable-library"
2617 "--disable-systemd"
2618 ;; Install dbus/udev files to the correct location.
2619 (string-append "--with-dbusconfdir=" out "/etc")
2620 (string-append "--with-udevdir=" out "/lib/udev")))
2621 #:phases
2622 (modify-phases %standard-phases
2623 (add-after 'install 'post-install
2624 (lambda* (#:key inputs outputs #:allow-other-keys)
2625 (let* ((out (assoc-ref outputs "out"))
2626 (servicedir (string-append out "/share/dbus-1/services"))
2627 (service "obexd/src/org.bluez.obex.service")
2628 (rule (string-append
2629 out "/lib/udev/rules.d/97-hid2hci.rules")))
2630 ;; Install the obex dbus service file.
2631 (substitute* service
2632 (("/bin/false")
2633 (string-append out "/libexec/bluetooth/obexd")))
2634 (install-file service servicedir)
2635 ;; Fix paths in the udev rule.
2636 (substitute* rule
2637 (("hid2hci --method")
2638 (string-append out "/lib/udev/hid2hci --method"))
2639 (("/sbin/udevadm")
2640 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2641 #t))))))
2642 (native-inputs
2643 `(("pkg-config" ,pkg-config)
2644 ("gettext" ,gettext-minimal)))
2645 (inputs
2646 `(("glib" ,glib)
2647 ("dbus" ,dbus)
2648 ("eudev" ,eudev)
2649 ("libical" ,libical)
2650 ("readline" ,readline)))
2651 (home-page "http://www.bluez.org/")
2652 (synopsis "Linux Bluetooth protocol stack")
2653 (description
2654 "BlueZ provides support for the core Bluetooth layers and protocols. It
2655 is flexible, efficient and uses a modular implementation.")
2656 (license license:gpl2+)))
2657
2658 (define-public fuse-exfat
2659 (package
2660 (name "fuse-exfat")
2661 (version "1.2.6")
2662 (source (origin
2663 (method url-fetch)
2664 (uri (string-append
2665 "https://github.com/relan/exfat/releases/download/v"
2666 version "/" name "-" version ".tar.gz"))
2667 (sha256
2668 (base32
2669 "1rvq4hapy2anal1vg1yidv4x8rg4iw5sxfwqixkw0q2qsxb54471"))))
2670 (build-system gnu-build-system)
2671 (native-inputs
2672 `(("pkg-config" ,pkg-config)))
2673 (inputs
2674 `(("fuse" ,fuse)))
2675 (home-page "https://github.com/relan/exfat")
2676 (synopsis "Mount exFAT file systems")
2677 (description
2678 "This package provides a FUSE-based file system that provides read and
2679 write access to exFAT devices.")
2680 (license license:gpl2+)))
2681
2682 (define-public gpm
2683 (package
2684 (name "gpm")
2685 (version "1.20.7")
2686 (source (origin
2687 (method url-fetch)
2688 (uri (string-append
2689 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2690 version ".tar.bz2"))
2691 (sha256
2692 (base32
2693 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2694 (build-system gnu-build-system)
2695 (arguments
2696 '(#:phases (modify-phases %standard-phases
2697 (add-before 'configure 'bootstrap
2698 (lambda _
2699 ;; The tarball was not generated with 'make dist' so we
2700 ;; need to bootstrap things ourselves.
2701 (and (zero? (system* "./autogen.sh"))
2702 (begin
2703 (patch-makefile-SHELL "Makefile.include.in")
2704 #t)))))
2705
2706 ;; Make sure programs find libgpm.so.
2707 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2708 (assoc-ref %outputs "out")
2709 "/lib"))))
2710 (native-inputs
2711 `(("texinfo" ,texinfo)
2712 ("bison" ,bison)
2713 ("flex" ,flex)
2714 ("autoconf" ,autoconf)
2715 ("automake" ,automake)
2716 ("libtool" ,libtool)))
2717 (home-page "http://www.nico.schottelius.org/software/gpm/")
2718 (synopsis "Mouse support for the Linux console")
2719 (description
2720 "The GPM (general-purpose mouse) daemon is a mouse server for
2721 applications running on the Linux console. It allows users to select items
2722 and copy/paste text in the console and in xterm.")
2723 (license license:gpl2+)))
2724
2725 (define-public btrfs-progs
2726 (package
2727 (name "btrfs-progs")
2728 (version "4.9.1")
2729 (source (origin
2730 (method url-fetch)
2731 (uri (string-append "mirror://kernel.org/linux/kernel/"
2732 "people/kdave/btrfs-progs/"
2733 "btrfs-progs-v" version ".tar.xz"))
2734 (sha256
2735 (base32
2736 "1ppy2y9vypxw9awchari21yd3s2d7w2a9q3f4jq7dnjy5gyrnjj6"))))
2737 (build-system gnu-build-system)
2738 (outputs '("out"
2739 "static")) ; static versions of binaries in "out" (~16MiB!)
2740 (arguments
2741 '(#:phases (modify-phases %standard-phases
2742 (add-after 'build 'build-static
2743 (lambda _ (zero? (system* "make" "static"))))
2744 (add-after 'install 'install-static
2745 (let ((staticbin (string-append (assoc-ref %outputs "static")
2746 "/bin")))
2747 (lambda _
2748 (zero? (system* "make"
2749 (string-append "bindir=" staticbin)
2750 "install-static"))))))
2751 #:test-target "test"
2752 #:parallel-tests? #f)) ; tests fail when run in parallel
2753 (inputs `(("e2fsprogs" ,e2fsprogs)
2754 ("libblkid" ,util-linux)
2755 ("libblkid:static" ,util-linux "static")
2756 ("libuuid" ,util-linux)
2757 ("libuuid:static" ,util-linux "static")
2758 ("zlib" ,zlib)
2759 ("lzo" ,lzo)))
2760 (native-inputs `(("pkg-config" ,pkg-config)
2761 ("asciidoc" ,asciidoc)
2762 ("xmlto" ,xmlto)
2763 ;; For building documentation.
2764 ("libxml2" ,libxml2)
2765 ("docbook-xml" ,docbook-xml)
2766 ("docbook-xsl" ,docbook-xsl)
2767 ;; For tests.
2768 ("which" ,which)))
2769 (home-page "https://btrfs.wiki.kernel.org/")
2770 (synopsis "Create and manage btrfs copy-on-write file systems")
2771 (description "Btrfs is a copy-on-write (CoW) file system for Linux aimed at
2772 implementing advanced features while focusing on fault tolerance, repair and
2773 easy administration.")
2774 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2775 ;; GPL2: Everything else.
2776 (license (list license:gpl2 license:gpl2+))))
2777
2778 (define-public btrfs-progs/static
2779 (package
2780 (name "btrfs-progs-static")
2781 (version (package-version btrfs-progs))
2782 (source #f)
2783 (build-system trivial-build-system)
2784 (inputs
2785 `(("btrfs-progs:static" ,btrfs-progs "static")))
2786 (arguments
2787 `(#:modules ((guix build utils))
2788 #:builder
2789 (begin
2790 (use-modules (guix build utils)
2791 (ice-9 ftw)
2792 (srfi srfi-26))
2793
2794 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
2795 (out (assoc-ref %outputs "out"))
2796 (source (string-append btrfs "/bin/btrfs.static"))
2797 (target (string-append out "/bin/btrfs")))
2798 (mkdir-p (dirname target))
2799 (copy-file source target)
2800 (remove-store-references target)
2801 (chmod target #o555)))))
2802 (home-page (package-home-page btrfs-progs))
2803 (synopsis "Statically-linked btrfs command from btrfsprogs")
2804 (description "This package provides statically-linked command of btrfs taken
2805 from the btrfsprogs package. It is meant to be used in initrds.")
2806 (license (package-license btrfs-progs))))
2807
2808 (define-public freefall
2809 (package
2810 (name "freefall")
2811 (version (package-version linux-libre))
2812 (source (package-source linux-libre))
2813 (build-system gnu-build-system)
2814 (arguments
2815 '(#:phases (modify-phases %standard-phases
2816 (add-after 'unpack 'enter-subdirectory
2817 (lambda _
2818 (chdir "tools/laptop/freefall")))
2819 (delete 'configure)
2820 (add-before 'build 'increase-timeout
2821 (lambda _
2822 ;; The default of 2 seconds is too low: it assumes an
2823 ;; open lid and AC power without actually checking.
2824 (substitute* "freefall.c"
2825 (("alarm\\(2\\)") "alarm(5)")))))
2826 #:make-flags (list (string-append "PREFIX="
2827 (assoc-ref %outputs "out")))
2828 #:tests? #f)) ;no tests
2829 (home-page (package-home-page linux-libre))
2830 (synopsis "Free-fall protection for spinning laptop hard drives")
2831 (description
2832 "Prevents shock damage to the internal spinning hard drive(s) of some
2833 HP and Dell laptops. When sudden movement is detected, all input/output
2834 operations on the drive are suspended and its heads are parked on the ramp,
2835 where they are less likely to cause damage to the spinning disc. Requires a
2836 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2837 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2838 (license license:gpl2)))
2839
2840 (define-public thinkfan
2841 (package
2842 (name "thinkfan")
2843 (version "0.9.3")
2844 (source (origin
2845 (method url-fetch)
2846 (uri (string-append "mirror://sourceforge/thinkfan/"
2847 "/thinkfan-" version ".tar.gz"))
2848 (sha256
2849 (base32
2850 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2851 (modules '((guix build utils)))
2852 ;; Fix erroneous man page location in Makefile leading to
2853 ;; a compilation failure.
2854 (snippet
2855 '(substitute* "CMakeLists.txt"
2856 (("thinkfan\\.1") "src/thinkfan.1")))))
2857 (build-system cmake-build-system)
2858 (arguments
2859 `(#:modules ((guix build cmake-build-system)
2860 (guix build utils)
2861 (srfi srfi-26))
2862 #:tests? #f ;no test target
2863 #:configure-flags
2864 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2865 `("-DUSE_ATASMART:BOOL=ON")
2866 #:phases
2867 (modify-phases %standard-phases
2868 ;; Install scripts for various foreign init systems. Also fix
2869 ;; hard-coded path for daemon.
2870 (add-after 'install 'install-rc-scripts
2871 (lambda* (#:key outputs #:allow-other-keys)
2872 (let ((out (assoc-ref outputs "out"))
2873 (files (find-files
2874 (string-append "../thinkfan-" ,version "/rcscripts")
2875 ".*")))
2876 (substitute* files
2877 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2878 (string-append out "/sbin/" name)))
2879 (for-each (cute install-file <>
2880 (string-append out "/share/thinkfan"))
2881 files))
2882 #t)))))
2883 (inputs
2884 `(("libatasmart" ,libatasmart)))
2885 (home-page "http://thinkfan.sourceforge.net/")
2886 (synopsis "Simple fan control program")
2887 (description
2888 "Thinkfan is a simple fan control program. It reads temperatures,
2889 checks them against configured limits and switches to appropriate (also
2890 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2891 other @code{hwmon} driver that enables temperature reading and fan control
2892 from userspace.")
2893 (license license:gpl3+)))
2894
2895 (define-public ntfs-3g
2896 (package
2897 (name "ntfs-3g")
2898 (version "2016.2.22")
2899 (source (origin
2900 (method url-fetch)
2901 (uri (string-append "https://tuxera.com/opensource/"
2902 "ntfs-3g_ntfsprogs-" version ".tgz"))
2903 (sha256
2904 (base32
2905 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
2906 (modules '((guix build utils)))
2907 (snippet
2908 ;; Install under $prefix.
2909 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
2910 (("/sbin")
2911 "@sbindir@")))))
2912 (build-system gnu-build-system)
2913 (inputs `(("util-linux" ,util-linux)
2914 ("fuse" ,fuse))) ;libuuid
2915 (native-inputs `(("pkg-config" ,pkg-config)))
2916 (arguments
2917 '(#:configure-flags (list "--exec-prefix=${prefix}"
2918 "--with-fuse=external" ;use our own FUSE
2919 "--enable-mount-helper"
2920 "--enable-posix-acls"
2921 "--enable-xattr-mappings")))
2922 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
2923 (synopsis "Read-write access to NTFS file systems")
2924 (description
2925 "NTFS-3G provides read-write access to NTFS file systems, which are
2926 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
2927 The package provides additional NTFS tools.")
2928 (license license:gpl2+)))
2929
2930 (define-public rng-tools
2931 (package
2932 (name "rng-tools")
2933 (version "5")
2934 (source (origin
2935 (method url-fetch)
2936 (uri (string-append
2937 "http://downloads.sourceforge.net/sourceforge/gkernel/"
2938 "rng-tools-" version ".tar.gz"))
2939 (sha256
2940 (base32
2941 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
2942 (build-system gnu-build-system)
2943 (synopsis "Random number generator daemon")
2944 (description
2945 "Monitor a hardware random number generator, and supply entropy
2946 from that to the system kernel's @file{/dev/random} machinery.")
2947 (home-page "https://sourceforge.net/projects/gkernel")
2948 ;; The source package is offered under the GPL2+, but the files
2949 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
2950 (license (list license:gpl2 license:gpl2+))))
2951
2952 (define-public cpupower
2953 (package
2954 (name "cpupower")
2955 (version (package-version linux-libre))
2956 (source (package-source linux-libre))
2957 (build-system gnu-build-system)
2958 (arguments
2959 '(#:phases (modify-phases %standard-phases
2960 (add-after 'unpack 'enter-subdirectory
2961 (lambda _
2962 (chdir "tools/power/cpupower")))
2963 (delete 'configure)
2964 (add-before 'build 'fix-makefiles
2965 (lambda _
2966 (substitute* "Makefile"
2967 (("/usr/") "/")
2968 (("/bin/(install|pwd)" _ command) command))
2969 (substitute* "bench/Makefile"
2970 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
2971 #:make-flags (let ((out (assoc-ref %outputs "out")))
2972 (list (string-append "DESTDIR=" out)
2973 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
2974 "docdir=/share/doc/cpupower"
2975 "confdir=$(docdir)/examples"
2976 ;; The Makefile recommends the following changes
2977 "DEBUG=false"
2978 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
2979 #:tests? #f)) ;no tests
2980 (native-inputs `(("gettext" ,gettext-minimal)))
2981 (inputs `(("pciutils" ,pciutils)))
2982 (home-page (package-home-page linux-libre))
2983 (synopsis "CPU frequency and voltage scaling tools for Linux")
2984 (description
2985 "cpupower is a set of user-space tools that use the cpufreq feature of the
2986 Linux kernel to retrieve and control processor features related to power saving,
2987 such as frequency and voltage scaling.")
2988 (license license:gpl2)))
2989
2990 (define-public haveged
2991 (package
2992 (name "haveged")
2993 (version "1.9.1")
2994 (source
2995 (origin
2996 (method url-fetch)
2997 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
2998 version ".tar.gz"))
2999 (sha256
3000 (base32
3001 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3002 (build-system gnu-build-system)
3003 (home-page "http://www.issihosts.com/haveged")
3004 (synopsis "Entropy source for the Linux random number generator")
3005 (description
3006 "haveged generates an unpredictable stream of random numbers for use by
3007 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3008 standard mechanisms for filling the entropy pool may not be sufficient for
3009 systems with high needs or limited user interaction, such as headless servers.
3010 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3011 indirect effects of hardware events on hidden processor state using the HArdware
3012 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3013 its environment and provides the same built-in test suite for the output stream
3014 as used on certified hardware security devices.")
3015 (license (list (license:non-copyleft "file://nist/mconf.h")
3016 (license:non-copyleft "file://nist/packtest.c")
3017 license:public-domain ; nist/dfft.c
3018 license:gpl3+)))) ; everything else
3019
3020 (define-public ecryptfs-utils
3021 (package
3022 (name "ecryptfs-utils")
3023 (version "111")
3024 (source
3025 (origin
3026 (method url-fetch)
3027 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3028 version "/+download/ecryptfs-utils_"
3029 version ".orig.tar.gz"))
3030 (sha256
3031 (base32
3032 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3033 (build-system gnu-build-system)
3034 (arguments
3035 `(#:configure-flags (list "--disable-pywrap")))
3036 (native-inputs
3037 `(("intltool" ,intltool)
3038 ("perl" ,perl) ; for pod2man
3039 ("pkg-config" ,pkg-config)))
3040 (inputs
3041 `(("keyutils" ,keyutils)
3042 ("linux-pam" ,linux-pam)
3043 ("nss" ,nss)))
3044 (home-page "http://ecryptfs.org/")
3045 (synopsis "eCryptfs cryptographic file system utilities")
3046 (description
3047 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3048 Each file's cryptographic meta-data is stored inside the file itself, along
3049 with the encrypted contents. This allows individual encrypted files to be
3050 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3051 native Linux file system, and has been part of the Linux kernel since version
3052 2.6.19. This package contains the userland utilities to manage it.")
3053 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3054 ;; grant additional permission to link with OpenSSL.
3055 (license license:gpl2+)))
3056
3057 (define-public libnfsidmap
3058 (package
3059 (name "libnfsidmap")
3060 (version "0.25")
3061 (source (origin
3062 (method url-fetch)
3063 (uri (string-append
3064 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3065 name "/" name "-" version ".tar.gz"))
3066 (sha256
3067 (base32
3068 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3069 (build-system gnu-build-system)
3070 (arguments
3071 `(#:configure-flags (list
3072 (string-append "--with-pluginpath="
3073 (assoc-ref %outputs "out")
3074 "/lib/libnfsidmap"))))
3075 (home-page
3076 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3077 (synopsis
3078 "NFSv4 support library for name/ID mapping")
3079 (description "Libnfsidmap is a library holding mulitiple methods of
3080 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3081 extensible array of mapping functions, currently consisting of two choices:
3082 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3083 (license (license:non-copyleft "file://COPYING"
3084 "See COPYING in the distribution."))))
3085
3086 (define-public module-init-tools
3087 (package
3088 (name "module-init-tools")
3089 (version "3.16")
3090 (source (origin
3091 (method url-fetch)
3092 (uri (string-append
3093 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3094 "module-init-tools-" version ".tar.bz2"))
3095 (sha256
3096 (base32
3097 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3098 (patches (search-patches "module-init-tools-moduledir.patch"))))
3099 (build-system gnu-build-system)
3100 (arguments
3101 ;; FIXME: The upstream tarball lacks man pages, and building them would
3102 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3103 ;; but they vanished. In the meantime, fake it.
3104 '(#:phases (alist-cons-before
3105 'configure 'fake-docbook
3106 (lambda _
3107 (substitute* "Makefile.in"
3108 (("^DOCBOOKTOMAN.*$")
3109 "DOCBOOKTOMAN = true\n")))
3110 %standard-phases)))
3111 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3112 (synopsis "Tools for loading and managing Linux kernel modules")
3113 (description
3114 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3115 `insmod', `lsmod', and more.")
3116 (license license:gpl2+)))
3117
3118 (define-public mcelog
3119 (package
3120 (name "mcelog")
3121 (version "147")
3122 (source (origin
3123 (method url-fetch)
3124 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3125 "mcelog.git/snapshot/v" version ".tar.gz"))
3126 (sha256
3127 (base32
3128 "10xxmqpd348ifbs7w8j0m53agp28r6imv237ha3kmhp632hmyf1d"))
3129 (file-name (string-append name "-" version ".tar.gz"))
3130 (modules '((guix build utils)))
3131 (snippet
3132 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3133 `(substitute* "Makefile"
3134 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3135 (build-system gnu-build-system)
3136 (arguments
3137 `(#:phases (modify-phases %standard-phases
3138 (delete 'configure)) ; no configure script
3139 #:make-flags (let ((out (assoc-ref %outputs "out")))
3140 (list "CC=gcc"
3141 (string-append "prefix=" out)
3142 (string-append "DOCDIR=" out "/share/doc/mcelog")
3143 "etcprefix=$(DOCDIR)/examples"))
3144 ;; The tests will only run as root on certain supported CPU models.
3145 #:tests? #f))
3146 (supported-systems (list "i686-linux" "x86_64-linux"))
3147 (home-page "http://mcelog.org/")
3148 (synopsis "Machine check monitor for x86 Linux systems")
3149 (description
3150 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3151 and other hardware errors on x86 systems. It can also perform user-defined
3152 tasks, such as bringing bad pages off-line, when configurable error thresholds
3153 are exceeded.")
3154 (license license:gpl2)))
3155
3156 (define-public mtd-utils
3157 (package
3158 (name "mtd-utils")
3159 (version "1.5.2")
3160 (source (origin
3161 (method url-fetch)
3162 (uri (string-append
3163 "ftp://ftp.infradead.org/pub/mtd-utils/"
3164 "mtd-utils-" version ".tar.bz2"))
3165 (sha256
3166 (base32
3167 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3168 (inputs
3169 `(("acl" ,acl)
3170 ("libuuid" ,util-linux)
3171 ("lzo", lzo)
3172 ("zlib" ,zlib)))
3173 (build-system gnu-build-system)
3174 (arguments
3175 `(#:test-target "tests"
3176 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3177 #:phases (modify-phases %standard-phases
3178 (delete 'configure))))
3179 (synopsis "MTD Flash Storage Utilities")
3180 (description "This package provides utilities for testing, partitioning, etc
3181 of flash storage.")
3182 (home-page "http://www.linux-mtd.infradead.org/")
3183 (license
3184 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3185 license:mpl1.1 ; All ftl* files
3186 license:expat)))) ; libiniparser
3187
3188 (define-public libseccomp
3189 (package
3190 (name "libseccomp")
3191 (version "2.3.1")
3192 (source (origin
3193 (method url-fetch)
3194 (uri (string-append "https://github.com/seccomp/libseccomp/"
3195 "releases/download/v" version
3196 "/libseccomp-" version ".tar.gz"))
3197 (sha256
3198 (base32
3199 "0asnlkzqms520r0dra08dzcz5hh6hs7lkajfw9wij3vrd0hxsnzz"))))
3200 (build-system gnu-build-system)
3201 (native-inputs
3202 `(("which" ,which)))
3203 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3204 (description "The libseccomp library provides an easy to use, platform
3205 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3206 libseccomp API is designed to abstract away the underlying BPF based syscall
3207 filter language and present a more conventional function-call based filtering
3208 interface that should be familiar to, and easily adopted by, application
3209 developers.")
3210 (home-page "https://github.com/seccomp/libseccomp")
3211 (license license:lgpl2.1)))
3212
3213 (define-public radeontop
3214 (package
3215 (name "radeontop")
3216 (version "0.9")
3217 (home-page "https://github.com/clbr/radeontop/")
3218 (source (origin
3219 (method url-fetch)
3220 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3221 (file-name (string-append name "-" version ".tar.gz"))
3222 (sha256
3223 (base32
3224 "07fnimn6wwablmdjw0av11hk9a6xilbryh09izq4b2ic4b8md2p7"))))
3225 (build-system gnu-build-system)
3226 (arguments
3227 `(#:phases (modify-phases %standard-phases
3228 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3229 ;; dependency, and doesn't even work on release(!) tarballs.
3230 (add-after 'unpack 'report-correct-version
3231 (lambda _ (substitute* "getver.sh"
3232 (("ver=unknown")
3233 (string-append "ver=" ,version)))))
3234 (delete 'configure)) ; no configure script
3235 #:make-flags (list "CC=gcc"
3236 (string-append "PREFIX=" %output))
3237 #:tests? #f)) ; no tests
3238 (native-inputs
3239 `(("gettext" ,gettext-minimal)
3240 ("pkg-config" ,pkg-config)))
3241 (inputs
3242 `(("libdrm" ,libdrm)
3243 ("libpciaccess" ,libpciaccess)
3244 ("ncurses" ,ncurses)))
3245 (synopsis "Usage monitor for AMD Radeon graphics")
3246 (description "RadeonTop monitors resource consumption on supported AMD
3247 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3248 a terminal or saved to a file for further processing. It measures both the
3249 activity of the GPU as a whole, which is also accurate during OpenCL
3250 computations, as well as separate component statistics that are only meaningful
3251 under OpenGL graphics workloads.")
3252 (license license:gpl3)))
3253
3254 (define-public efivar
3255 (package
3256 (name "efivar")
3257 (version "30")
3258 (source (origin
3259 (method url-fetch)
3260 (uri (string-append "https://github.com/rhinstaller/" name
3261 "/releases/download/" version "/" name
3262 "-" version ".tar.bz2"))
3263 (sha256
3264 (base32
3265 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3266 (build-system gnu-build-system)
3267 (arguments
3268 `(;; Tests require a UEFI system and is not detected in the chroot.
3269 #:tests? #f
3270 #:make-flags (list (string-append "prefix=" %output)
3271 (string-append "libdir=" %output "/lib")
3272 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3273 #:phases
3274 (modify-phases %standard-phases
3275 (delete 'configure))))
3276 (native-inputs
3277 `(("pkg-config" ,pkg-config)))
3278 (inputs
3279 `(("popt" ,popt)))
3280 (home-page "https://github.com/rhinstaller/efivar")
3281 (synopsis "Tool and library to manipulate EFI variables")
3282 (description "This package provides a library and a command line
3283 interface to the variable facility of UEFI boot firmware.")
3284 (license license:lgpl2.1+)))
3285
3286 (define-public efibootmgr
3287 (package
3288 (name "efibootmgr")
3289 (version "14")
3290 (source (origin
3291 (method url-fetch)
3292 (uri (string-append "https://github.com/rhinstaller/" name
3293 "/releases/download/" version "/" name
3294 "-" version ".tar.bz2"))
3295 (sha256
3296 (base32
3297 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3298 (build-system gnu-build-system)
3299 (arguments
3300 `(#:tests? #f ; No tests.
3301 #:make-flags (list (string-append "prefix=" %output)
3302 (string-append "libdir=" %output "/lib")
3303 ;; Override CFLAGS to add efivar include directory.
3304 (string-append "CFLAGS=-O2 -g -flto -I"
3305 (assoc-ref %build-inputs "efivar")
3306 "/include/efivar"))
3307 #:phases
3308 (modify-phases %standard-phases
3309 (add-after 'unpack 'branding
3310 ;; Replace default loader path with something more familiar.
3311 (lambda _
3312 (substitute* "src/efibootmgr.c"
3313 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3314 "EFI\\\\gnu"))
3315 #t))
3316 (delete 'configure))))
3317 (native-inputs
3318 `(("pkg-config" ,pkg-config)))
3319 (inputs
3320 `(("efivar" ,efivar)
3321 ("popt" ,popt)))
3322 (home-page "https://github.com/rhinstaller/efibootmgr")
3323 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3324 (description
3325 "@code{efibootmgr} is a user-space application to modify the Intel
3326 Extensible Firmware Interface (EFI) Boot Manager. This application can
3327 create and destroy boot entries, change the boot order, change the next
3328 running boot option, and more.")
3329 (license license:gpl2+)))
3330
3331 (define-public sysstat
3332 (package
3333 (name "sysstat")
3334 (version "11.4.2")
3335 (source (origin
3336 (method url-fetch)
3337 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3338 "sysstat-" version ".tar.xz"))
3339 (sha256
3340 (base32
3341 "0f8gk1hma3bk198ziwrhh5jhisnbbgc1v4rxhny58n0zjzw0gm0z"))))
3342 (build-system gnu-build-system)
3343 (arguments
3344 `(#:tests? #f ; No test suite.
3345 ;; Without this flag, it tries to install the man pages with group 'root'
3346 ;; and fails because /etc/passwd lacks an entry for the root user.
3347 #:configure-flags
3348 (list "--disable-file-attr"
3349 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3350 #:phases
3351 (modify-phases %standard-phases
3352 ;; The build process tries to create '/var/lib/sa', so we skip that
3353 ;; instruction.
3354 (add-after 'build 'skip-touching-var
3355 (lambda _
3356 (substitute* "Makefile"
3357 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3358 ""))
3359 #t)))))
3360 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3361 (synopsis "Performance monitoring tools for Linux")
3362 (description "The sysstat utilities are a collection of performance
3363 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3364 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3365 @code{sadf} and @code{sa}.")
3366 (license license:gpl2+)))
3367
3368 (define-public light
3369 (package
3370 (name "light")
3371 (version "1.0")
3372 (source (origin
3373 (method url-fetch)
3374 (uri (string-append "https://github.com/haikarainen/" name
3375 "/archive/v" version ".tar.gz"))
3376 (sha256
3377 (base32
3378 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3379 (file-name (string-append name "-" version ".tar.gz"))))
3380 (build-system gnu-build-system)
3381 (arguments
3382 '(#:tests? #f ; no tests
3383 #:make-flags (list "CC=gcc"
3384 (string-append "PREFIX=" %output))
3385 #:phases
3386 (modify-phases %standard-phases
3387 (delete 'configure)
3388 (add-after 'unpack 'patch-makefile
3389 (lambda _
3390 (substitute* "Makefile" (("chown") "#")))))))
3391 (native-inputs
3392 `(("help2man" ,help2man)))
3393 (home-page "https://haikarainen.github.io/light")
3394 (synopsis "GNU/Linux application to control backlights")
3395 (description
3396 "Light is a program to send commands to screen backlight controllers
3397 under GNU/Linux. Features include:
3398
3399 @itemize
3400 @item It does not rely on X.
3401 @item Light can automatically figure out the best controller to use, making
3402 full use of underlying hardware.
3403 @item It is possible to set a minimum brightness value, as some controllers
3404 set the screen to be pitch black at a vaĺue of 0 (or higher).
3405 @end itemize
3406
3407 Light is the successor of lightscript.")
3408 (license license:gpl3+)))