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