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