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