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