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