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