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