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