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