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