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