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