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