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