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