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