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