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