1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
22 ;;; Copyright © 2017 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>
31 ;;; This file is part of GNU Guix.
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
46 (define-module (gnu packages linux)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages acl)
49 #:use-module (gnu packages admin)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages attr)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages bash)
56 #:use-module (gnu packages bison)
57 #:use-module (gnu packages calendar)
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages crypto)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages databases)
62 #:use-module (gnu packages datastructures)
63 #:use-module (gnu packages docbook)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages elf)
66 #:use-module (gnu packages flex)
67 #:use-module (gnu packages file)
68 #:use-module (gnu packages freedesktop)
69 #:use-module (gnu packages gcc)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages glib)
72 #:use-module (gnu packages gnuzilla)
73 #:use-module (gnu packages gperf)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages libunwind)
76 #:use-module (gnu packages libusb)
77 #:use-module (gnu packages man)
78 #:use-module (gnu packages maths)
79 #:use-module (gnu packages multiprecision)
80 #:use-module (gnu packages ncurses)
81 #:use-module (gnu packages netpbm)
82 #:use-module (gnu packages networking)
83 #:use-module (gnu packages ninja)
84 #:use-module (gnu packages perl)
85 #:use-module (gnu packages pciutils)
86 #:use-module (gnu packages pkg-config)
87 #:use-module (gnu packages popt)
88 #:use-module (gnu packages pulseaudio)
89 #:use-module (gnu packages python)
90 #:use-module (gnu packages readline)
91 #:use-module (gnu packages rrdtool)
92 #:use-module (gnu packages samba)
93 #:use-module (gnu packages slang)
94 #:use-module (gnu packages storage)
95 #:use-module (gnu packages texinfo)
96 #:use-module (gnu packages tls)
97 #:use-module (gnu packages valgrind)
98 #:use-module (gnu packages video)
99 #:use-module (gnu packages web)
100 #:use-module (gnu packages xiph)
101 #:use-module (gnu packages xml)
102 #:use-module (gnu packages xdisorg)
103 #:use-module (gnu packages xorg)
104 #:use-module (gnu packages groff)
105 #:use-module (gnu packages selinux)
106 #:use-module (gnu packages swig)
107 #:use-module (guix build-system cmake)
108 #:use-module (guix build-system gnu)
109 #:use-module (guix build-system python)
110 #:use-module (guix build-system trivial)
111 #:use-module (guix download)
112 #:use-module (guix git-download)
113 #:use-module ((guix licenses) #:prefix license:)
114 #:use-module (guix packages)
115 #:use-module (guix utils)
116 #:use-module (srfi srfi-1)
117 #:use-module (srfi srfi-2)
118 #:use-module (srfi srfi-26)
119 #:use-module (ice-9 match))
121 (define-public (system->linux-architecture arch)
122 "Return the Linux architecture name for ARCH, a Guix system name such as
123 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
124 (let ((arch (car (string-split arch #\-))))
125 (cond ((string=? arch "i686") "i386")
126 ((string-prefix? "mips" arch) "mips")
127 ((string-prefix? "arm" arch) "arm")
128 ((string-prefix? "aarch64" arch) "arm64")
129 ((string-prefix? "alpha" arch) "alpha")
130 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
131 ((string-prefix? "s390" arch) "s390")
134 (define-public (system->defconfig system)
135 "Some systems (notably powerpc-linux) require a special target for kernel
136 defconfig. Return the appropriate make target if applicable, otherwise return
138 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
139 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
142 (define (linux-libre-urls version)
143 "Return a list of URLs for Linux-Libre VERSION."
145 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
146 version "-gnu/linux-libre-" version "-gnu.tar.xz")
148 ;; XXX: Work around <http://bugs.gnu.org/14851>.
150 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
151 version "-gnu.tar.xz")
153 ;; Maybe this URL will become valid eventually.
155 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
156 version "-gnu.tar.xz")))
158 (define-public linux-libre-headers
160 (name "linux-libre-headers")
164 (uri (linux-libre-urls version))
167 "1m2zr17wpasg5riysbaa4g5i492jzr93py2jm088ki818s4a9cm3"))))
168 (build-system gnu-build-system)
169 (native-inputs `(("perl" ,perl)))
171 `(#:modules ((guix build gnu-build-system)
175 (modify-phases %standard-phases
179 (let ((arch ,(system->linux-architecture
180 (or (%current-target-system)
182 (defconfig ,(system->defconfig
183 (or (%current-target-system)
184 (%current-system)))))
186 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
187 (invoke "make" defconfig)
188 (invoke "make" "mrproper" "headers_check"))))
190 (lambda* (#:key outputs #:allow-other-keys)
191 (let ((out (assoc-ref outputs "out")))
193 (string-append "INSTALL_HDR_PATH=" out)
196 (mkdir (string-append out "/include/config"))
197 (call-with-output-file
199 "/include/config/kernel.release")
201 (format p "~a-default~%" ,version)))
203 ;; Remove the '.install' and '..install.cmd' files; the
204 ;; latter contains store paths, which pulls in bootstrap
205 ;; binaries in the build environment, and prevents bit
206 ;; reproducibility for the bootstrap binaries.
207 (for-each delete-file (find-files out "\\.install"))
210 #:allowed-references ()
212 (home-page "https://www.gnu.org/software/linux-libre/")
213 (synopsis "GNU Linux-Libre kernel headers")
214 (description "Headers of the Linux-Libre kernel.")
215 (license license:gpl2)))
217 (define %boot-logo-patch
218 ;; Linux-Libre boot logo featuring Freedo and a gnu.
221 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
222 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
225 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
227 (define* (kernel-config arch #:key variant)
228 "Return the absolute file name of the Linux-Libre build configuration file
229 for ARCH and optionally VARIANT, or #f if there is no such configuration."
230 (let* ((name (string-append (if variant (string-append variant "-") "")
231 (if (string=? "i386" arch) "i686" arch) ".conf"))
232 (file (string-append "linux-libre/" name)))
233 (search-auxiliary-file file)))
235 (define %default-extra-linux-options
236 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
237 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
238 ;; Modules required for initrd:
239 ("CONFIG_NET_9P" . m)
240 ("CONFIG_NET_9P_VIRTIO" . m)
241 ("CONFIG_VIRTIO_BLK" . m)
242 ("CONFIG_VIRTIO_NET" . m)
243 ("CONFIG_VIRTIO_PCI" . m)
244 ("CONFIG_VIRTIO_BALLOON" . m)
245 ("CONFIG_VIRTIO_MMIO" . m)
246 ("CONFIG_FUSE_FS" . m)
248 ("CONFIG_9P_FS" . m)))
250 (define (config->string options)
251 (string-join (map (match-lambda
253 (string-append option "=m"))
255 (string-append option "=y"))
257 (string-append option "=n")))
261 (define* (make-linux-libre version hash supported-systems
263 ;; A function that takes an arch and a variant.
264 ;; See kernel-config for an example.
266 (configuration-file #f)
267 (defconfig "defconfig")
268 (extra-options %default-extra-linux-options)
269 (patches (list %boot-logo-patch)))
271 (name (if extra-version
272 (string-append "linux-libre-" extra-version)
277 (uri (linux-libre-urls version))
278 (sha256 (base32 hash))
280 (supported-systems supported-systems)
281 (build-system gnu-build-system)
287 ;; On x86, build with GCC-7 for full retpoline support.
288 ;; FIXME: Remove this when our default compiler has retpoline support.
289 ,@(match (system->linux-architecture
290 (or (%current-target-system) (%current-system)))
291 ((or "x86_64" "i386")
295 ,@(match (and configuration-file
297 (system->linux-architecture
298 (or (%current-target-system) (%current-system)))
299 #:variant (version-major+minor version)))
300 (#f ;no config for this platform
303 `(("kconfig" ,config))))))
305 `(#:modules ((guix build gnu-build-system)
310 (modify-phases %standard-phases
312 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
313 ;; Avoid introducing timestamps
314 (setenv "KCONFIG_NOTIMESTAMP" "1")
315 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
317 ;; Set ARCH and CROSS_COMPILE
318 (let ((arch ,(system->linux-architecture
319 (or (%current-target-system)
320 (%current-system)))))
322 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
325 (setenv "CROSS_COMPILE" (string-append target "-"))
326 (format #t "`CROSS_COMPILE' set to `~a'~%"
327 (getenv "CROSS_COMPILE"))))
329 (setenv "EXTRA_VERSION" ,extra-version)
331 (let ((build (assoc-ref %standard-phases 'build))
332 (config (assoc-ref (or native-inputs inputs) "kconfig")))
334 ;; Use a custom kernel configuration file or a default
335 ;; configuration file.
338 (copy-file config ".config")
339 (chmod ".config" #o666))
340 (invoke "make" ,defconfig))
342 ;; Appending works even when the option wasn't in the
343 ;; file. The last one prevails if duplicated.
344 (let ((port (open-file ".config" "a"))
345 (extra-configuration ,(config->string extra-options)))
346 (display extra-configuration port)
349 (invoke "make" "oldconfig"))))
351 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
352 (let* ((out (assoc-ref outputs "out"))
353 (moddir (string-append out "/lib/modules"))
354 (dtbdir (string-append out "/lib/dtbs"))
355 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
356 ;; Install kernel image, kernel configuration and link map.
357 (for-each (lambda (file) (install-file file out))
358 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map)$"))
359 ;; Install device tree files
360 (for-each (lambda (file) (install-file file dtbdir))
361 (find-files "." "\\.dtb$"))
362 ;; Install kernel modules
365 (string-append "DEPMOD=" kmod "/bin/depmod")
366 (string-append "MODULE_DIR=" moddir)
367 (string-append "INSTALL_PATH=" out)
368 (string-append "INSTALL_MOD_PATH=" out)
369 "INSTALL_MOD_STRIP=1"
370 "modules_install")))))
372 (home-page "https://www.gnu.org/software/linux-libre/")
373 (synopsis "100% free redistribution of a cleaned Linux kernel")
375 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
376 It has been modified to remove all non-free binary blobs.")
377 (license license:gpl2)))
379 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
380 (define %linux-compatible-systems '("x86_64-linux" "i686-linux" "armhf-linux"))
382 ;; linux-libre configuration for armhf-linux is derived from Debian armmp. It
383 ;; supports qemu "virt" machine and possibly a large number of ARM boards.
384 ;; See : https://wiki.debian.org/DebianKernel/ARMMP.
386 (define %linux-libre-version "4.15.11")
387 (define %linux-libre-hash "0nrsmw7x5nsc3906dfvfakkibv8pv09r1sf5ckzbkcbkwpyq62h8")
389 (define-public linux-libre
390 (make-linux-libre %linux-libre-version
392 %linux-compatible-systems
393 #:configuration-file kernel-config))
395 (define %linux-libre-4.14-version "4.14.28")
396 (define %linux-libre-4.14-hash "0xg3zsm1yjsvxir8sz7zliz8gcc8d45xh23qyiszl75cfqjl36l3")
398 (define-public linux-libre-4.14
399 (make-linux-libre %linux-libre-4.14-version
400 %linux-libre-4.14-hash
401 %linux-compatible-systems
402 #:configuration-file kernel-config))
404 (define-public linux-libre-4.9
405 (make-linux-libre "4.9.88"
406 "0qlhd8xw3g00i7krpfndkwxzjszk067h26qsxxsszvxyx2s6gp4x"
407 %intel-compatible-systems
408 #:configuration-file kernel-config))
410 (define-public linux-libre-4.4
411 (make-linux-libre "4.4.122"
412 "1ayilv7474vsif3jpb723jbcy4kymv1fpdr96c1g743bad1wkqqq"
413 %intel-compatible-systems
414 #:configuration-file kernel-config))
416 (define-public linux-libre-4.1
417 (make-linux-libre "4.1.50"
418 "1hl1pk724v2waa55bhxfmxyz9nl6pkcj4dc3l80jfvqdfgr55mm2"
419 %intel-compatible-systems
420 #:configuration-file kernel-config))
422 (define-public linux-libre-arm-generic
423 (make-linux-libre %linux-libre-version
426 #:defconfig "multi_v7_defconfig"
427 #:extra-version "arm-generic"))
429 (define-public linux-libre-arm-generic-4.14
430 (make-linux-libre %linux-libre-4.14-version
431 %linux-libre-4.14-hash
433 #:defconfig "multi_v7_defconfig"
434 #:extra-version "arm-generic"))
436 (define-public linux-libre-arm-omap2plus
437 (make-linux-libre %linux-libre-version
440 #:defconfig "omap2plus_defconfig"
441 #:extra-version "arm-omap2plus"))
443 (define-public linux-libre-arm-omap2plus-4.14
444 (make-linux-libre %linux-libre-4.14-version
445 %linux-libre-4.14-hash
447 #:defconfig "omap2plus_defconfig"
448 #:extra-version "arm-omap2plus"))
452 ;;; Pluggable authentication modules (PAM).
455 (define-public linux-pam
463 "http://www.linux-pam.org/library/"
464 "Linux-PAM-" version ".tar.bz2"))
467 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
468 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
470 (build-system gnu-build-system)
474 ;; TODO: optional dependencies
475 ;; ("libxcrypt" ,libxcrypt)
476 ;; ("cracklib" ,cracklib)
479 `(;; Most users, such as `shadow', expect the headers to be under
481 #:configure-flags (list (string-append "--includedir="
482 (assoc-ref %outputs "out")
485 ;; XXX: <rpc/rpc.h> is missing from glibc when
486 ;; cross-compiling, so we have to disable NIS
487 ;; support altogether.
488 ,@(if (%current-target-system)
492 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
495 (home-page "http://www.linux-pam.org/")
496 (synopsis "Pluggable authentication modules for Linux")
498 "A *Free* project to implement OSF's RFC 86.0.
499 Pluggable authentication modules are small shared object files that can
500 be used through the PAM API to perform tasks, like authenticating a user
501 at login. Local and dynamic reconfiguration are its key features.")
502 (license license:bsd-3)))
504 (define-public linux-pam-1.2
512 "http://www.linux-pam.org/library/"
513 "Linux-PAM-" version ".tar.bz2"))
516 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
517 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
524 (define-public psmisc
531 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
535 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
536 (build-system gnu-build-system)
537 (inputs `(("ncurses" ,ncurses)))
538 (home-page "https://gitlab.com/psmisc/psmisc")
540 "Small utilities that use the proc file system")
542 "This PSmisc package is a set of some small useful utilities that
543 use the proc file system. We're not about changing the world, but
544 providing the system administrator with some help in common tasks.")
545 (license license:gpl2+)))
547 (define-public util-linux
553 (uri (string-append "mirror://kernel.org/linux/utils/"
554 name "/v" (version-major+minor version) "/"
555 name "-" version ".tar.xz"))
558 "04fzrnrr3pvqskvjn9f81y0knh0jvvqx4lmbz5pd4lfdm5pv2l8s"))
559 (patches (search-patches "util-linux-tests.patch"
560 "util-linux-CVE-2018-7738.patch"))
561 (modules '((guix build utils)))
563 ;; We take the 'logger' program from GNU Inetutils and 'kill'
564 ;; from GNU Coreutils.
566 (substitute* "configure"
567 (("build_logger=yes") "build_logger=no")
568 (("build_kill=yes") "build_kill=no"))
570 (build-system gnu-build-system)
572 "static")) ; >2 MiB of static .a libraries
574 `(#:configure-flags (list "--disable-use-tty-group"
575 "--enable-fs-paths-default=/run/current-system/profile/sbin"
576 ;; Don't try to chown root:root mount and umount
577 "--disable-makeinstall-chown"
578 ;; Install completions where our
579 ;; bash-completion package expects them.
580 (string-append "--with-bashcompletiondir="
581 (assoc-ref %outputs "out")
582 "/etc/bash_completion.d"))
583 #:phases (modify-phases %standard-phases
585 'build 'set-umount-file-name
586 (lambda* (#:key outputs #:allow-other-keys)
587 ;; Tell 'eject' the right file name of 'umount'.
588 (let ((out (assoc-ref outputs "out")))
589 (substitute* "sys-utils/eject.c"
591 (string-append "\"" out "/bin/umount\"")))
595 (lambda* (#:key inputs outputs #:allow-other-keys)
596 (let ((out (assoc-ref outputs "out"))
597 (net (assoc-ref inputs "net-base")))
598 ;; Change the test to refer to the right file.
599 (substitute* "tests/ts/misc/mcookie"
601 (string-append net "/etc/services")))
604 'install 'move-static-libraries
605 (lambda* (#:key outputs #:allow-other-keys)
606 (let ((out (assoc-ref outputs "out"))
607 (static (assoc-ref outputs "static")))
608 (mkdir-p (string-append static "/lib"))
609 (with-directory-excursion out
610 (for-each (lambda (file)
612 (string-append static "/"
614 (find-files "lib" "\\.a$")))
616 (inputs `(("zlib" ,zlib)
619 ;; XXX: This is so that the 'pre-check' phase can find it.
620 ,@(if (%current-target-system)
621 `(("net-base" ,net-base))
625 ("net-base" ,net-base))) ;for tests
626 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
627 (synopsis "Collection of utilities for the Linux kernel")
628 (description "Util-linux is a diverse collection of Linux kernel
629 utilities. It provides dmesg and includes tools for working with file systems,
630 block devices, UUIDs, TTYs, and many other tools.")
632 ;; Note that util-linux doesn't use the same license for all the
633 ;; code. GPLv2+ is the default license for a code without an
634 ;; explicitly defined license.
635 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
636 license:bsd-4 license:public-domain))))
644 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
646 (file-name (string-append name "-" version ".tar.gz"))
648 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
649 (build-system cmake-build-system)
650 (arguments '(#:tests? #f))
651 (home-page "https://github.com/bo0ts/ddate")
652 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
654 "ddate displays the Discordian date and holidays of a given date.
655 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
656 by Robert Shea and Robert Anton Wilson.")
657 (license license:public-domain)))
659 (define-public procps
665 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
666 "procps-ng-" version ".tar.xz"))
669 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
670 (build-system gnu-build-system)
672 '(#:modules ((guix build utils)
673 (guix build gnu-build-system)
677 (modify-phases %standard-phases
678 (add-before 'check 'disable-strtod-test
680 ;; Disable the 'strtod' test, which fails on 32-bit systems.
681 ;; This is what upstream does:
682 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
683 (substitute* "Makefile"
684 (("^(TESTS|check_PROGRAMS) = .*$" all)
685 (string-append "# " all "\n")))
688 'install 'post-install
689 ;; Remove commands and man pages redudant with
691 (lambda* (#:key outputs #:allow-other-keys)
692 (let* ((out (assoc-ref outputs "out"))
693 (dup (append-map (cut find-files out <>)
694 '("^kill" "^uptime"))))
695 (for-each delete-file dup)
697 (inputs `(("ncurses" ,ncurses)))
698 (home-page "https://gitlab.com/procps-ng/procps/")
699 (synopsis "Utilities that give information about processes")
701 "Procps is the package that has a bunch of small useful utilities
702 that give information about processes using the Linux /proc file system.
703 The package includes the programs ps, top, vmstat, w, kill, free,
704 slabtop, and skill.")
705 (license license:gpl2)))
707 (define-public usbutils
714 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
715 "usbutils-" version ".tar.xz"))
718 "0q3iavmak2bs9xw486w4xfbjl0hbzii93ssgpr95mxmm9kjz1gwb"))))
719 (build-system gnu-build-system)
724 `(("pkg-config" ,pkg-config)))
725 (home-page "http://www.linux-usb.org/")
727 "Tools for working with USB devices, such as lsusb")
729 "Tools for working with USB devices, such as lsusb.")
730 (license license:gpl2+)))
732 (define-public e2fsprogs
739 "mirror://kernel.org/linux/kernel/people/tytso/"
740 name "/v" version "/"
741 name "-" version ".tar.xz"))
744 "00ilv65dzcgiap435j89xk86shf7rrav3wsik7cahy789qijdcn9"))))
745 (build-system gnu-build-system)
746 (inputs `(("util-linux" ,util-linux)))
747 (native-inputs `(("pkg-config" ,pkg-config)
748 ("texinfo" ,texinfo) ;for the libext2fs Info manual
754 '(;; util-linux is the preferred source for some of the libraries and
755 ;; commands, so disable them (see, e.g.,
756 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
757 #:configure-flags (list "--disable-libblkid"
758 "--disable-libuuid" "--disable-uuidd"
761 ;; Use symlinks instead of hard links for
762 ;; 'fsck.extN' etc. This makes the resulting nar
763 ;; smaller and is preserved across copies.
764 "--enable-symlink-install"
766 (string-append "LDFLAGS=-Wl,-rpath="
767 (assoc-ref %outputs "out")
770 ;; Install libext2fs et al.
771 "--enable-elf-shlibs")
774 (modify-phases %standard-phases
775 (add-before 'configure 'patch-shells
777 (substitute* "configure"
778 (("/bin/sh (.*)parse-types.sh" _ dir)
779 (string-append (which "sh") " " dir
781 (substitute* "MCONFIG.in"
782 (("INSTALL_SYMLINK = /bin/sh")
783 "INSTALL_SYMLINK = sh"))
784 (substitute* (find-files "." "^Makefile.in$")
786 (string-append "#!" (which "sh"))))
788 (add-after 'install 'install-libs
789 (lambda* (#:key outputs #:allow-other-keys)
790 (let* ((out (assoc-ref outputs "out"))
791 (lib (string-append out "/lib")))
792 (and (zero? (system* "make" "install-libs"))
794 ;; Make the .a writable so that 'strip' works.
795 ;; Failing to do that, due to debug symbols, we
796 ;; retain a reference to the final
797 ;; linux-libre-headers, which refer to the
798 ;; bootstrap binaries.
799 (let ((archives (find-files lib "\\.a$")))
800 (for-each (lambda (file)
804 (home-page "http://e2fsprogs.sourceforge.net/")
805 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
807 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
808 (license (list license:gpl2 ;programs
809 license:lgpl2.0 ;libext2fs
810 license:x11)))) ;libuuid
812 (define e2fsprogs/static
814 (package (inherit e2fsprogs)
816 ;; Do not build shared libraries.
817 (substitute-keyword-arguments (package-arguments e2fsprogs)
818 ((#:configure-flags _)
819 '(list "--disable-blkid"))
823 (define-public e2fsck/static
825 (name "e2fsck-static")
826 (version (package-version e2fsprogs))
827 (build-system trivial-build-system)
830 `(("e2fsprogs" ,e2fsprogs/static)))
832 `(#:modules ((guix build utils))
835 (use-modules (guix build utils)
839 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
841 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
843 (with-directory-excursion bin
844 (copy-file e2fsck "e2fsck")
845 (remove-store-references "e2fsck")
846 (chmod "e2fsck" #o555))))))
847 (home-page (package-home-page e2fsprogs))
848 (synopsis "Statically-linked e2fsck command from e2fsprogs")
849 (description "This package provides statically-linked e2fsck command taken
850 from the e2fsprogs package. It is meant to be used in initrds.")
851 (license (package-license e2fsprogs))))
853 (define-public extundelete
859 (uri (string-append "mirror://sourceforge/extundelete/"
860 "extundelete/" version "/extundelete-"
864 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
865 (build-system gnu-build-system)
866 (inputs `(("e2fsprogs" ,e2fsprogs)))
867 (home-page "http://extundelete.sourceforge.net/")
868 (synopsis "Recover deleted files from ext2/3/4 partitions")
870 "Extundelete is a set of tools that can recover deleted files from an
871 ext3 or ext4 partition.")
872 (license license:gpl2)))
874 (define-public zerofree
878 (home-page "https://frippery.org/uml/")
881 (uri (string-append home-page name "-" version
885 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
886 (build-system gnu-build-system)
889 (modify-phases %standard-phases
890 (delete 'configure) ; no configure script
892 ;; The Makefile lacks an ‘install’ target.
893 (lambda* (#:key outputs #:allow-other-keys)
894 (let* ((out (assoc-ref outputs "out"))
895 (bin (string-append out "/bin")))
896 (chmod "zerofree" #o555)
897 (install-file "zerofree" bin)
899 #:tests? #f)) ; no tests
900 (inputs `(("libext2fs" ,e2fsprogs)))
901 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
903 "Zerofree finds the unallocated blocks with non-zero value content in an
904 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
905 This is a simple way to make disk images more compressible.
906 Zerofree requires the file system to be unmounted or mounted read-only.")
907 (license license:gpl2)))
909 (define-public strace
915 (uri (string-append "https://github.com/strace/strace/releases/"
916 "download/v" version "/strace-" version ".tar.xz"))
919 "0dsw6xcfrmygidp1dj2ch8cl8icrar7789snkb2r8gh78kdqhxjw"))))
920 (build-system gnu-build-system)
923 (modify-phases %standard-phases
924 (add-after 'unpack 'patch-/bin/sh
926 (substitute* "strace.c"
927 (("/bin/sh") (which "sh")))
929 (native-inputs `(("perl" ,perl)))
930 (home-page "https://strace.io/")
931 (synopsis "System call tracer for Linux")
933 "strace is a system call tracer, i.e. a debugging tool which prints out a
934 trace of all the system calls made by a another process/program.")
935 (license license:bsd-3)))
937 (define-public ltrace
943 (uri (string-append "http://www.ltrace.org/ltrace_" version
947 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
948 (build-system gnu-build-system)
949 (inputs `(("libelf" ,libelf)))
951 ;; Compilation uses -Werror by default, but it fails.
952 '(#:configure-flags '("--disable-werror")))
953 (home-page "https://www.ltrace.org/")
954 (synopsis "Library call tracer for Linux")
956 "ltrace intercepts and records dynamic library calls which are called by
957 an executed process and the signals received by that process. It can also
958 intercept and print the system calls executed by the program.")
959 (license license:gpl2+)))
961 (define-public alsa-lib
968 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
972 "1rhacnlj0grvfagjx5qzsnbhw7m7lyccghqs4jsv0dnsqv9qmxpl"))))
973 (build-system gnu-build-system)
974 (home-page "https://www.alsa-project.org/")
975 (synopsis "The Advanced Linux Sound Architecture libraries")
977 "The Advanced Linux Sound Architecture (ALSA) provides audio and
978 MIDI functionality to the Linux-based operating system.")
979 (license license:lgpl2.1+)))
981 (define-public alsa-utils
987 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
988 name "-" version ".tar.bz2"))
991 "1s727md6mb408y2cfwzjkx23abxhampyrjdkgpyygdhxx62x42rj"))))
992 (build-system gnu-build-system)
994 ;; XXX: Disable man page creation until we have DocBook.
995 '(#:configure-flags (list "--disable-xmlto"
997 ;; The udev rule is responsible for restoring
999 (string-append "--with-udev-rules-dir="
1000 (assoc-ref %outputs "out")
1001 "/lib/udev/rules.d"))
1003 (modify-phases %standard-phases
1005 'install 'pre-install
1007 ;; Don't try to mkdir /var/lib/alsa.
1008 (substitute* "Makefile"
1009 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1013 `(("libsamplerate" ,libsamplerate)
1014 ("ncurses" ,ncurses)
1015 ("alsa-lib" ,alsa-lib)
1017 ("gettext" ,gettext-minimal)))
1018 (home-page "http://www.alsa-project.org/")
1019 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1021 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1022 MIDI functionality to the Linux-based operating system.")
1024 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1026 (license license:gpl2)))
1028 (define-public alsa-plugins
1030 (name "alsa-plugins")
1034 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1035 name "-" version ".tar.bz2"))
1038 "073zpgvj4pldmzqq97l40wngvbqnvrkc8yw153mgny9kypwaazbr"))))
1039 (build-system gnu-build-system)
1040 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1041 ;; be split, there are references to both in files.
1042 ;; TODO: Remove OSS related plugins, they add support to run native
1043 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1045 (outputs '("out" "pulseaudio"))
1048 (modify-phases %standard-phases
1049 (add-after 'install 'split
1050 (lambda* (#:key inputs outputs #:allow-other-keys)
1051 ;; Distribute the binaries to the various outputs.
1052 (let* ((out (assoc-ref outputs "out"))
1053 (pua (assoc-ref outputs "pulseaudio"))
1054 (pualib (string-append pua "/lib/alsa-lib"))
1055 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
1058 (chdir (string-append out "/share"))
1059 (for-each (lambda (file)
1060 (rename-file file (string-append puaconf "/" (basename file))))
1061 (find-files out "\\.(conf|example)"))
1062 (for-each (lambda (file)
1063 (rename-file file (string-append pualib "/" (basename file))))
1064 (find-files out ".*pulse\\.(la|so)"))
1066 ;; We have moved the files to output pulsaudio, the
1067 ;; directory is now empty.
1068 (delete-file-recursively (string-append out "/share"))
1071 `(("alsa-lib" ,alsa-lib)
1072 ("speex" ,speex) ; libspeexdsp resampling plugin
1073 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1074 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1075 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1077 `(("pkg-config" ,pkg-config)))
1078 (home-page "http://www.alsa-project.org/")
1079 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1081 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1082 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1083 by providing additional plugins which include: upmixing, downmixing, jackd and
1084 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1085 external rate conversion.")
1086 (license (list license:gpl2+
1087 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1088 license:lgpl2.1+))))
1090 (define-public iptables
1097 "mirror://netfilter.org/iptables/iptables-"
1098 version ".tar.bz2"))
1101 "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
1102 (build-system gnu-build-system)
1104 `(("pkg-config" ,pkg-config)
1108 `(("libmnl" ,libmnl)
1109 ("libnftnl" ,libnftnl)))
1111 '(#:tests? #f ; no test suite
1112 #:configure-flags ; add $libdir to the RUNPATH of executables
1113 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1114 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1115 (synopsis "Programs to configure Linux IP packet filtering rules")
1117 "@command{iptables} is the user-space command line program used to
1118 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1119 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1121 This package also includes @command{ip6tables}, which is used to configure the
1124 Both commands are targeted at system administrators.
1126 (license license:gpl2+)))
1128 (define-public ebtables
1131 (version "2.0.10-4")
1135 "mirror://netfilter.org/ebtables/ebtables-v"
1139 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1140 (build-system gnu-build-system)
1142 '(#:tests? #f ; no test suite
1144 (let* ((out (assoc-ref %outputs "out"))
1145 (bin (string-append out "/sbin"))
1146 (lib (string-append out "/lib"))
1147 (man (string-append out "/share/man"))
1148 (iptables (assoc-ref %build-inputs "iptables"))
1149 (ethertypes (string-append iptables "/etc/ethertypes")))
1150 (list (string-append "LIBDIR=" lib)
1151 (string-append "MANDIR=" man)
1152 (string-append "BINDIR=" bin)
1153 (string-append "ETHERTYPESFILE=" ethertypes)
1154 ;; With the default CFLAGS, it falis with:
1155 ;; communication.c:259:58: error: variable ‘ret’ set but not
1156 ;; used [-Werror=unused-but-set-variable]
1159 (modify-phases %standard-phases
1161 ;; no configure script
1163 (substitute* "Makefile"
1164 ;; Remove user and group options from install commands,
1165 ;; otherwise it fails with: invalid user 'root'.
1166 (("-o root -g root") "")
1167 ;; Remove 'ethertypes' from the install target.
1169 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1173 ("iptables" ,iptables)))
1174 (synopsis "Ethernet bridge frame table administration")
1175 (home-page "http://ebtables.netfilter.org/")
1177 "ebtables is an application program used to set up and maintain the
1178 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1179 analogous to the iptables application, but less complicated, due to the fact
1180 that the Ethernet protocol is much simpler than the IP protocol.")
1181 (license license:gpl2+)))
1183 (define-public iproute
1190 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1194 "0mc3g4kj7h3jhwz2b2gdf41gp6bhqn7axh4mnyvhkdnpk5m63m28"))))
1195 (build-system gnu-build-system)
1197 `(#:tests? #f ; no test suite
1198 #:make-flags (let ((out (assoc-ref %outputs "out")))
1200 (string-append "BASH_COMPDIR=" out
1201 "/etc/bash_completion.d")
1202 (string-append "LIBDIR=" out "/lib")
1203 (string-append "HDRDIR=" out "/include")
1204 (string-append "SBINDIR=" out "/sbin")
1205 (string-append "CONFDIR=" out "/etc")
1206 (string-append "DOCDIR=" out "/share/doc/"
1208 (string-append "MANDIR=" out "/share/man")))
1209 #:phases (modify-phases %standard-phases
1210 (add-before 'install 'pre-install
1212 ;; Don't attempt to create /var/lib/arpd.
1213 (substitute* "Makefile"
1214 (("^.*ARPDDIR.*$") "")))))))
1216 `(("iptables" ,iptables)
1219 `(("pkg-config" ,pkg-config)
1223 "https://wiki.linuxfoundation.org/networking/iproute2")
1225 "Utilities for controlling TCP/IP networking and traffic in Linux")
1227 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1228 and traffic with the Linux kernel. The most important of these are
1229 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1232 Most network configuration manuals still refer to ifconfig and route as the
1233 primary network configuration tools, but ifconfig is known to behave
1234 inadequately in modern network environments, and both should be deprecated.")
1235 (license license:gpl2+)))
1237 (define-public net-tools
1238 ;; XXX: This package is basically unmaintained, but it provides a few
1239 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1241 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1245 (version (string-append "1.60-" revision "." (string-take commit 7)))
1248 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1249 "n/ne/net-tools/code.git/net-tools-code-"
1251 (file-name (string-append name "-" version ".zip"))
1254 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1255 (home-page "http://net-tools.sourceforge.net/")
1256 (build-system gnu-build-system)
1258 '(#:modules ((guix build gnu-build-system)
1263 (modify-phases %standard-phases
1265 (lambda* (#:key outputs #:allow-other-keys)
1266 (let ((out (assoc-ref outputs "out")))
1267 (mkdir-p (string-append out "/bin"))
1268 (mkdir-p (string-append out "/sbin"))
1270 ;; Pretend we have everything...
1271 (system "yes | make config")
1273 ;; ... except for the things we don't have.
1274 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1275 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1276 ;; that have been removed.
1277 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1278 ;; think about adding them later.
1279 (substitute* '("config.make" "config.h")
1280 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1283 (add-after 'install 'remove-redundant-commands
1284 (lambda* (#:key outputs #:allow-other-keys)
1285 ;; Remove commands and man pages redundant with Inetutils.
1286 (let* ((out (assoc-ref outputs "out"))
1287 (dup (append-map (cut find-files out <>)
1289 "^(yp|nis|dns)?domainname"))))
1290 (for-each delete-file dup)
1292 ;; Binaries that depend on libnet-tools.a don't declare that
1293 ;; dependency, making it parallel-unsafe.
1294 #:parallel-build? #f
1296 #:tests? #f ; no test suite
1297 #:make-flags (let ((out (assoc-ref %outputs "out")))
1299 (string-append "BASEDIR=" out)
1300 (string-append "INSTALLNLSDIR=" out "/share/locale")
1301 (string-append "mandir=/share/man")))))
1302 (native-inputs `(("gettext" ,gettext-minimal)
1304 (synopsis "Tools for controlling the network subsystem in Linux")
1306 "This package includes the important tools for controlling the network
1307 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1308 route. Additionally, this package contains utilities relating to particular
1309 network hardware types (plipconfig, slattach) and advanced aspects of IP
1310 configuration (iptunnel, ipmaddr).")
1311 (license license:gpl2+))))
1313 (define-public libcap
1320 "mirror://kernel.org/linux/libs/security/linux-privs/"
1321 "libcap2/libcap-" version ".tar.xz"))
1324 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1325 (build-system gnu-build-system)
1326 (arguments '(#:phases
1327 (modify-phases %standard-phases
1329 ;; Add $libdir to the RUNPATH of executables.
1331 (substitute* "Make.Rules"
1333 (string-append "LDFLAGS := -Wl,-rpath="
1336 #:tests? #f ; no 'check' target
1337 #:make-flags (list "lib=lib"
1338 (string-append "prefix="
1339 (assoc-ref %outputs "out"))
1340 "RAISE_SETFCAP=no")))
1341 (native-inputs `(("perl" ,perl)))
1342 (inputs `(("attr" ,attr)))
1343 (home-page "https://sites.google.com/site/fullycapable/")
1344 (synopsis "Library for working with POSIX capabilities")
1346 "Libcap2 provides a programming interface to POSIX capabilities on
1347 Linux-based operating systems.")
1349 ;; License is BSD-3 or GPLv2, at the user's choice.
1350 (license license:gpl2)))
1352 (define-public bridge-utils
1354 (name "bridge-utils")
1358 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1359 "bridge-utils-" version ".tar.gz"))
1362 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1363 (build-system gnu-build-system)
1365 ;; The tarball lacks all the generated files.
1366 (native-inputs `(("autoconf" ,autoconf)
1367 ("automake" ,automake)))
1370 (modify-phases %standard-phases
1371 (add-before 'bootstrap 'patch-stuff
1373 ;; Fix "field ‘ip6’ has incomplete type" errors.
1374 (substitute* "libbridge/libbridge.h"
1375 (("#include <linux/if_bridge.h>")
1376 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1378 ;; Ensure that the entire build fails if one of the
1379 ;; sub-Makefiles fails.
1380 (substitute* "Makefile.in"
1381 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1382 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1385 #:tests? #f)) ; no 'check' target
1388 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1389 (synopsis "Manipulate Ethernet bridges")
1391 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1392 to connect two Ethernet segments together in a protocol independent way.
1393 Packets are forwarded based on Ethernet address, rather than IP address (like
1394 a router). Since forwarding is done at Layer 2, all protocols can go
1395 transparently through a bridge.")
1396 (license license:gpl2+)))
1398 (define-public libnl
1405 "https://github.com/thom311/libnl/releases/download/"
1406 "libnl" (string-join (string-split version #\.) "_")
1407 "/libnl-" version ".tar.gz"))
1410 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
1411 (build-system gnu-build-system)
1415 ("pkg-config" ,pkg-config)
1421 "https://github.com/thom311/libnl/releases/download/libnl"
1422 (string-join (string-split version #\.) "_")
1423 "/libnl-doc-" version ".tar.gz"))
1425 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
1427 `(("python-2" ,python-2)
1428 ("python-3" ,python-3)))
1429 (outputs '("out" "doc" "python2" "python3"))
1431 `(#:modules ((guix build gnu-build-system)
1435 (modify-phases %standard-phases
1436 (add-after 'install 'install-python
1437 (lambda* (#:key outputs #:allow-other-keys)
1438 (define (python-inst python)
1439 (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
1440 (assoc-ref %outputs "out")))
1441 (pyout (assoc-ref %outputs python)))
1443 (zero? (system (format #f "~a ~a setup.py build"
1444 ldflags python pyout)))
1446 (system (format #f "~a ~a setup.py install --prefix=~a"
1447 ldflags python pyout)))
1448 (zero? (system* python "setup.py" "clean")))))
1449 (with-directory-excursion "./python"
1450 (every python-inst '("python2" "python3")))))
1451 (add-after 'install 'install-doc
1452 (lambda* (#:key inputs outputs #:allow-other-keys)
1453 (let ((dest (string-append (assoc-ref outputs "doc")
1454 "/share/doc/libnl")))
1456 (zero? (system* "tar" "xf" (assoc-ref inputs "libnl3-doc")
1457 "--strip-components=1" "-C" dest))))))))
1458 (home-page "https://www.infradead.org/~tgr/libnl/")
1459 (synopsis "NetLink protocol library suite")
1461 "The libnl suite is a collection of libraries providing APIs to netlink
1462 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1463 between the kernel and user space processes. It was designed to be a more
1464 flexible successor to ioctl to provide mainly networking related kernel
1465 configuration and monitoring interfaces.")
1467 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1468 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1469 (license license:gpl2)))
1478 "mirror://kernel.org/software/network/iw/iw-"
1482 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
1483 (build-system gnu-build-system)
1484 (native-inputs `(("pkg-config" ,pkg-config)))
1485 (inputs `(("libnl" ,libnl)))
1487 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1489 #:phases (modify-phases %standard-phases (delete 'configure))))
1490 (home-page "https://wireless.wiki.kernel.org/")
1491 (synopsis "Tool for configuring wireless devices")
1493 "iw is a new nl80211 based CLI configuration utility for wireless
1494 devices. It replaces @code{iwconfig}, which is deprecated.")
1495 (license license:isc)))
1497 (define-public powertop
1505 "https://01.org/sites/default/files/downloads/powertop/powertop-v"
1509 "0l4jjlf05li2mc6g8nrss3h435wjhmnqd8m7v3kha3x0x7cbfzxa"))))
1510 (build-system gnu-build-system)
1513 (modify-phases %standard-phases
1514 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1515 ;; allow calibrating the network interface in GuixSD.
1516 (add-after 'unpack 'patch-absolute-file-names
1517 (lambda* (#:key inputs #:allow-other-keys)
1518 (let ((kmod (assoc-ref inputs "kmod")))
1519 (substitute* (find-files "src" "\\.cpp$")
1520 ;; Give the right 'modprobe' file name so that essential
1521 ;; modules such as msr.ko can be loaded.
1522 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1523 ;; These programs are only needed to calibrate, so using
1524 ;; relative file names avoids adding extra inputs. When they
1525 ;; are missing powertop gracefully handles it.
1526 (("/usr/bin/hcitool") "hcitool")
1527 (("/usr/bin/xset") "xset")
1528 (("/usr/sbin/hciconfig") "hciconfig"))
1533 ("ncurses" ,ncurses)
1534 ("pciutils" ,pciutils)
1537 `(("pkg-config" ,pkg-config)))
1538 (home-page "https://01.org/powertop/")
1539 (synopsis "Analyze power consumption on Intel-based laptops")
1541 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1542 power management. In addition to being a diagnostic tool, PowerTOP also has
1543 an interactive mode where the user can experiment various power management
1544 settings for cases where the operating system has not enabled these
1546 (license license:gpl2)))
1548 (define-public aumix
1555 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1556 version ".tar.bz2"))
1559 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1560 (build-system gnu-build-system)
1561 (inputs `(("ncurses" ,ncurses)))
1562 (home-page "http://www.jpj.net/~trevor/aumix.html")
1563 (synopsis "Audio mixer for X and the console")
1565 "Aumix adjusts an audio mixer from X, the console, a terminal,
1566 the command line or a script.")
1567 (license license:gpl2+)))
1569 (define-public iotop
1576 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1579 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1580 (build-system python-build-system)
1582 ;; The setup.py script expects python-2.
1583 `(#:python ,python-2
1584 ;; There are currently no checks in the package.
1586 (native-inputs `(("python" ,python-2)))
1587 (home-page "http://guichaz.free.fr/iotop/")
1589 "Displays the IO activity of running processes")
1591 "Iotop is a Python program with a top like user interface to show the
1592 processes currently causing I/O.")
1593 (license license:gpl2+)))
1601 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1602 "download/fuse-" version
1603 "/fuse-" version ".tar.gz"))
1606 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1607 (patches (search-patches "fuse-overlapping-headers.patch"))))
1608 (build-system gnu-build-system)
1609 (inputs `(("util-linux" ,util-linux)))
1611 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1612 (assoc-ref %outputs "out")
1614 (string-append "INIT_D_PATH="
1615 (assoc-ref %outputs "out")
1618 ;; The rule makes /dev/fuse 666.
1619 (string-append "UDEV_RULES_PATH="
1620 (assoc-ref %outputs "out")
1621 "/lib/udev/rules.d"))
1623 (modify-phases %standard-phases
1624 (add-before 'build 'set-file-names
1625 (lambda* (#:key inputs #:allow-other-keys)
1626 ;; libfuse calls out to mount(8) and umount(8). Make sure
1627 ;; it refers to the right ones.
1628 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1629 (("/bin/(u?)mount" _ maybe-u)
1630 (string-append (assoc-ref inputs "util-linux")
1631 "/bin/" maybe-u "mount")))
1632 (substitute* '("util/mount.fuse.c")
1636 ;; This hack leads libfuse to search for 'fusermount' in
1637 ;; $PATH, where it may find a setuid-root binary, instead of
1638 ;; trying solely $out/sbin/fusermount and failing because
1640 (substitute* "lib/Makefile"
1641 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1642 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
1644 (home-page "https://github.com/libfuse/libfuse")
1645 (synopsis "Support file systems implemented in user space")
1647 "As a consequence of its monolithic design, file system code for Linux
1648 normally goes into the kernel itself---which is not only a robustness issue,
1649 but also an impediment to system extensibility. FUSE, for \"file systems in
1650 user space\", is a kernel module and user-space library that tries to address
1651 part of this problem by allowing users to run file system implementations as
1652 user-space processes.")
1653 (license (list license:lgpl2.1 ;library
1654 license:gpl2+)))) ;command-line utilities
1656 (define-public unionfs-fuse
1658 (name "unionfs-fuse")
1663 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1665 (file-name (string-append name "-" version ".tar.gz"))
1668 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1669 (build-system cmake-build-system)
1671 `(("python" ,python)))
1672 (inputs `(("fuse" ,fuse)))
1674 ;; The tests were never actually run ("collected 0 items"), but in recent
1675 ;; versions of pytest that causes an error.
1677 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1678 (synopsis "User-space union file system")
1680 "UnionFS-FUSE is a flexible union file system implementation in user
1681 space, using the FUSE library. Mounting a union file system allows you to
1682 \"aggregate\" the contents of several directories into a single mount point.
1683 UnionFS-FUSE additionally supports copy-on-write.")
1684 (license license:bsd-3)))
1687 (package (inherit fuse)
1688 (name "fuse-static")
1689 (source (origin (inherit (package-source fuse))
1690 (modules '((guix build utils)))
1693 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1694 ;; updated. Change calls to 'mtab_needs_update' to 0 so
1695 ;; that it doesn't do that, allowing us to remove the
1696 ;; dependency on util-linux (something that is useful in
1698 (substitute* '("lib/mount_util.c"
1699 "util/mount_util.c")
1700 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1706 (define-public unionfs-fuse/static
1707 (package (inherit unionfs-fuse)
1708 (synopsis "User-space union file system (statically linked)")
1709 (name (string-append (package-name unionfs-fuse) "-static"))
1710 (source (origin (inherit (package-source unionfs-fuse))
1711 (modules '((guix build utils)))
1714 ;; Add -ldl to the libraries, because libfuse.a needs that.
1715 (substitute* "src/CMakeLists.txt"
1716 (("target_link_libraries(.*)\\)" _ libs)
1717 (string-append "target_link_libraries"
1722 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1724 (modify-phases %standard-phases
1725 (add-after 'install 'post-install
1726 (lambda* (#:key outputs #:allow-other-keys)
1727 (let* ((out (assoc-ref outputs "out"))
1728 (exe (string-append out "/bin/unionfs")))
1729 ;; By default, 'unionfs' keeps references to
1730 ;; $glibc/share/locale and similar stuff. Remove them.
1731 (remove-store-references exe)
1733 ;; 'unionfsctl' has references to glibc as well. Since
1734 ;; we don't need it, remove it.
1735 (delete-file (string-append out "/bin/unionfsctl"))
1737 (inputs `(("fuse" ,fuse-static)))))
1739 (define-public sshfs-fuse
1745 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1746 "download/sshfs-" version "/sshfs-" version
1750 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
1751 (build-system gnu-build-system)
1756 `(("pkg-config" ,pkg-config)))
1757 (home-page "https://github.com/libfuse/sshfs")
1758 (synopsis "Mount remote file systems over SSH")
1760 "This is a file system client based on the SSH File Transfer Protocol.
1761 Since most SSH servers already support this protocol it is very easy to set
1762 up: on the server side there's nothing to do; on the client side mounting the
1763 file system is as easy as logging into the server with an SSH client.")
1764 (license license:gpl2+)))
1766 (define-public archivemount
1768 (name "archivemount")
1773 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1774 "archivemount-" version ".tar.gz"))
1777 "0v4si1ri6lhnq9q87gkx7fsh6lv6xz4bynknwndqncpvfp5cy1jg"))))
1778 (build-system gnu-build-system)
1779 (inputs `(("fuse" ,fuse)
1780 ("libarchive" ,libarchive)))
1781 (native-inputs `(("pkg-config" ,pkg-config)))
1782 (home-page "http://www.cybernoia.de/software/archivemount")
1783 (synopsis "Tool for mounting archive files with FUSE")
1784 (description "archivemount is a FUSE-based file system for Unix variants,
1785 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1786 mount point where it can be read from or written to as with any other file
1787 system. This makes accessing the contents of the archive, which may be
1788 compressed, transparent to other programs, without decompressing them.")
1789 (license license:lgpl2.0+)))
1791 (define-public numactl
1798 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1803 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1804 (build-system gnu-build-system)
1806 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1807 ;; to run, which we can't assume to have.
1810 ;; NUMA is apparently not supported on armhf, see
1811 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1812 (supported-systems (delete "armhf-linux" %supported-systems))
1813 (home-page "http://oss.sgi.com/projects/libnuma/")
1814 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1816 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1817 memory is not all in one place. The numactl program allows you to run your
1818 application program on specific CPU's and memory nodes. It does this by
1819 supplying a NUMA memory policy to the operating system before running your
1822 The package contains other commands, such as numademo, numastat and memhog.
1823 The numademo command provides a quick overview of NUMA performance on your
1825 (license (list license:gpl2 ;programs
1826 license:lgpl2.1)))) ;library
1828 (define-public kbd-neo
1835 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1836 version "/linux/console/neo.map"))
1837 (file-name (string-append name "-" version ".map"))
1840 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1841 (build-system trivial-build-system)
1843 `(#:modules ((guix build utils))
1845 (use-modules (guix build utils))
1846 (let ((out (string-append %output "/share/keymaps"))
1847 (source (assoc-ref %build-inputs "source")))
1849 (copy-file source (string-append out "/neo.map"))
1851 (home-page "https://neo-layout.org")
1852 (synopsis "Neo2 console layout")
1854 "Kbd-neo provides the Neo2 keyboard layout for use with
1855 @command{loadkeys(1)} from @code{kbd(4)}.")
1856 ;; The file is located in an svn directory, the entire content of
1857 ;; the directory is licensed as GPL3.
1858 (license license:gpl3+)))
1866 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1870 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1871 (modules '((guix build utils)))
1874 (substitute* "tests/Makefile.in"
1875 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1878 (substitute* '("src/unicode_start" "src/unicode_stop")
1879 ;; Assume the Coreutils are in $PATH.
1883 (build-system gnu-build-system)
1886 (modify-phases %standard-phases
1887 (add-before 'build 'pre-build
1888 (lambda* (#:key inputs #:allow-other-keys)
1889 (let ((gzip (assoc-ref %build-inputs "gzip"))
1890 (bzip2 (assoc-ref %build-inputs "bzip2")))
1891 (substitute* "src/libkeymap/findfile.c"
1893 (string-append gzip "/bin/gzip"))
1895 (string-append bzip2 "/bin/bzip2"))))))
1896 (add-after 'install 'post-install
1897 (lambda* (#:key outputs #:allow-other-keys)
1898 ;; Make sure these programs find their comrades.
1899 (let* ((out (assoc-ref outputs "out"))
1900 (bin (string-append out "/bin")))
1901 (for-each (lambda (prog)
1902 (wrap-program (string-append bin "/" prog)
1903 `("PATH" ":" prefix (,bin))))
1904 '("unicode_start" "unicode_stop"))))))))
1905 (inputs `(("check" ,check)
1908 ("pam" ,linux-pam)))
1909 (native-search-paths
1910 (list (search-path-specification
1911 (variable "LOADKEYS_KEYMAP_PATH")
1912 ;; Append ‘/**’ to recursively search all directories. One can then
1913 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
1914 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
1915 (files (list "share/keymaps/**")))))
1916 (native-inputs `(("pkg-config" ,pkg-config)))
1917 (home-page "http://kbd-project.org/")
1918 (synopsis "Linux keyboard utilities and keyboard maps")
1920 "This package contains keytable files and keyboard utilities compatible
1921 for systems using the Linux kernel. This includes commands such as
1922 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1923 (license license:gpl2+)))
1925 (define-public inotify-tools
1927 (name "inotify-tools")
1932 "mirror://sourceforge/inotify-tools/inotify-tools/"
1933 version "/inotify-tools-" version ".tar.gz"))
1936 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1937 (build-system gnu-build-system)
1938 (home-page "http://inotify-tools.sourceforge.net/")
1939 (synopsis "Monitor file accesses")
1941 "The inotify-tools packages provides a C library and command-line tools
1942 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1943 (license license:gpl2+)))
1952 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1953 "kmod-" version ".tar.xz"))
1956 "1kgixs4m3jvwk7fb3d18n6j77qhgi9qfv4csj35rs5ancr4ycrbi"))
1957 (patches (search-patches "kmod-module-directory.patch"))))
1958 (build-system gnu-build-system)
1960 `(("pkg-config" ,pkg-config)))
1965 `(#:tests? #f ; FIXME: Investigate test failures
1966 #:configure-flags '("--with-xz" "--with-zlib")
1968 (modify-phases %standard-phases
1969 (add-after 'install 'install-modprobe&co
1970 (lambda* (#:key outputs #:allow-other-keys)
1971 (let* ((out (assoc-ref outputs "out"))
1972 (bin (string-append out "/bin")))
1973 (for-each (lambda (tool)
1975 (string-append bin "/" tool)))
1976 '("insmod" "rmmod" "lsmod" "modprobe"
1977 "modinfo" "depmod"))
1979 (home-page "https://www.kernel.org/")
1980 (synopsis "Kernel module tools")
1981 (description "Kmod is a set of tools to handle common tasks with Linux
1982 kernel modules like insert, remove, list, check properties, resolve
1983 dependencies and aliases.
1985 These tools are designed on top of libkmod, a library that is shipped with
1986 kmod. The aim is to be compatible with tools, configurations and indices
1987 from the module-init-tools project.")
1988 (license license:gpl2+))) ; library under lgpl2.1+
1990 (define-public eudev
1991 ;; The post-systemd fork, maintained by Gentoo.
1997 (uri (string-append "https://github.com/gentoo/eudev/archive/v"
1999 (file-name (string-append name "-" version ".zip"))
2002 "0c9l3m3mr1nvrvlcnzh5gjdg9p9k7hh0jk04wh596cbmbass2nhd"))
2003 (patches (search-patches "eudev-rules-directory.patch"))))
2004 (build-system gnu-build-system)
2007 (modify-phases %standard-phases
2008 (add-before 'bootstrap 'patch-file-names
2009 (lambda* (#:key inputs #:allow-other-keys)
2010 (substitute* "man/make.sh"
2011 (("/usr/bin/xsltproc")
2012 (string-append (assoc-ref inputs "xsltproc")
2015 (add-after 'install 'build-hwdb
2016 (lambda* (#:key outputs #:allow-other-keys)
2017 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2018 ;; similar tools to display product names.
2019 (let ((out (assoc-ref outputs "out")))
2020 (invoke (string-append out "/bin/udevadm")
2021 "hwdb" "--update")))))
2022 #:configure-flags (list "--enable-manpages")))
2024 `(("autoconf" ,autoconf)
2025 ("automake" ,automake)
2027 ("libtool" ,libtool)
2028 ("pkg-config" ,pkg-config)
2031 ("python" ,python-wrapper)
2032 ;; For documentation.
2033 ("docbook-xml" ,docbook-xml-4.2)
2034 ("docbook-xsl" ,docbook-xsl)
2035 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2036 ("xsltproc" ,libxslt)))
2038 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2039 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2040 ;; which contains the rules to do that.
2041 `(("util-linux" ,util-linux) ;for blkid
2043 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2044 (synopsis "Userspace device management")
2045 (description "Udev is a daemon which dynamically creates and removes
2046 device nodes from /dev/, handles hotplug events and loads drivers at boot
2048 (license license:gpl2+)))
2050 (define-public eudev-with-hwdb
2051 (deprecated-package "eudev-with-hwdb" eudev))
2056 (version "2.02.177")
2059 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2063 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2064 (modules '((guix build utils)))
2067 (use-modules (guix build utils))
2069 ;; Honor sysconfdir.
2070 (substitute* "make.tmpl.in"
2072 "confdir = @sysconfdir@\n")
2073 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2074 "DEFAULT_SYS_DIR = @sysconfdir@"))
2076 (patches (search-patches "lvm2-static-link.patch"))))
2077 (build-system gnu-build-system)
2079 `(("pkg-config" ,pkg-config)
2080 ("procps" ,procps))) ;tests use 'pgrep'
2085 (modify-phases %standard-phases
2086 (add-after 'configure 'set-makefile-shell
2088 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2090 (setenv "SHELL" (which "sh"))
2092 ;; Replace /bin/sh with the right file name.
2093 (patch-makefile-SHELL "make.tmpl")
2096 #:configure-flags (list (string-append "--sysconfdir="
2097 (assoc-ref %outputs "out")
2099 "--enable-udev_sync"
2100 "--enable-udev_rules"
2102 ;; Make sure programs such as 'dmsetup' can
2103 ;; find libdevmapper.so.
2104 (string-append "LDFLAGS=-Wl,-rpath="
2105 (assoc-ref %outputs "out")
2108 ;; The tests use 'mknod', which requires root access.
2110 (home-page "https://sourceware.org/lvm2/")
2111 (synopsis "Logical volume management for Linux")
2113 "LVM2 is the logical volume management tool set for Linux-based systems.
2114 This package includes the user-space libraries and tools, including the device
2115 mapper. Kernel components are part of Linux-libre.")
2117 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2118 ;; Command-line tools are GPLv2.
2119 (license (list license:gpl2 license:lgpl2.1))))
2121 (define-public lvm2-static
2124 (name "lvm2-static")
2126 ;; Propagate udev because libdevmapper.a depends on libudev.
2127 (inputs (alist-delete "udev" (package-inputs lvm2)))
2128 (propagated-inputs `(("udev" ,eudev)))
2131 (substitute-keyword-arguments (package-arguments lvm2)
2132 ((#:configure-flags flags '())
2133 ;; LVM2 doesn't use Libtool, hence the custom option.
2134 `(cons "--enable-static_link" ,flags))))
2135 (synopsis "Logical volume management for Linux (statically linked)")))
2137 (define-public wireless-tools
2139 (name "wireless-tools")
2143 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2147 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2150 ;; Remove the older header files that are not free software.
2151 (for-each (lambda (n)
2152 (delete-file (format #f "wireless.~a.h" n)))
2153 '(10 11 12 13 14 15 16 17 18 19 20))
2155 (build-system gnu-build-system)
2158 (list (string-append "PREFIX=" %output)
2159 (string-append "INSTALL_MAN=" %output "/share/man")
2160 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2162 #:phases (modify-phases %standard-phases
2163 (delete 'configure))
2165 (synopsis "Tools for manipulating Linux Wireless Extensions")
2166 (description "Wireless Tools are used to manipulate the now-deprecated
2167 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2168 Extension was an interface allowing you to set Wireless LAN specific
2169 parameters and get the specific stats. It is deprecated in favor the nl80211
2171 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2172 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2173 ;; other files are distributed under gpl2.
2174 (license (list license:gpl2 license:lgpl2.1+))))
2182 (uri (string-append "mirror://kernel.org/software/network/crda/"
2183 "crda-" version ".tar.xz"))
2186 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2187 (patches (search-patches "crda-optional-gcrypt.patch"))))
2188 (build-system gnu-build-system)
2190 '(#:phases (modify-phases %standard-phases
2193 'build 'no-werror-no-ldconfig
2195 (substitute* "Makefile"
2197 (("ldconfig") "true"))
2200 'build 'set-regulator-db-file-name
2201 (lambda* (#:key inputs #:allow-other-keys)
2202 ;; Tell CRDA where to find our database.
2203 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2204 (substitute* "crda.c"
2205 (("\"/lib/crda/regulatory.bin\"")
2206 (string-append "\"" regdb
2207 "/lib/crda/regulatory.bin\"")))
2209 #:test-target "verify"
2210 #:make-flags (let ((out (assoc-ref %outputs "out"))
2211 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2212 (list "CC=gcc" "V=1"
2214 ;; Disable signature-checking on 'regulatory.bin'.
2215 ;; The reason is that this simplifies maintenance
2216 ;; on our side (no need to manage a distro key
2217 ;; pair), and we can guarantee integrity of
2218 ;; 'regulatory.bin' by other means anyway, such as
2219 ;; 'guix gc --verify'. See
2220 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2224 (string-append "PREFIX=" out)
2225 (string-append "SBINDIR=" out "/sbin/")
2226 (string-append "UDEV_RULE_DIR="
2227 out "/lib/udev/rules.d")
2228 (string-append "LDFLAGS=-Wl,-rpath="
2230 (string-append "REG_BIN=" regdb
2231 "/lib/crda/regulatory.bin")))))
2232 (native-inputs `(("pkg-config" ,pkg-config)
2233 ("python" ,python-2)
2234 ("wireless-regdb" ,wireless-regdb)))
2235 (inputs `(("libnl" ,libnl)))
2237 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2238 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2240 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2241 communication between the kernel Linux and user space for regulatory
2243 (license license:copyleft-next)))
2245 (define-public wireless-regdb
2247 (name "wireless-regdb")
2248 (version "2017.03.07")
2252 "mirror://kernel.org/software/network/wireless-regdb/"
2253 "wireless-regdb-" version ".tar.xz"))
2256 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2258 ;; We're building 'regulatory.bin' by ourselves.
2260 (delete-file "regulatory.bin")
2262 (build-system gnu-build-system)
2264 '(#:phases (modify-phases %standard-phases
2265 (delete 'configure))
2267 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2268 ;; is computed and can be equal to 'maintainer-clean'; when that
2269 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2270 ;; just built. Thus, build things sequentially.
2271 #:parallel-build? #f
2273 #:tests? #f ;no tests
2274 #:make-flags (let ((out (assoc-ref %outputs "out")))
2275 (list (string-append "PREFIX=" out)
2276 (string-append "LSB_ID=GuixSD")
2277 (string-append "DISTRO_PUBKEY=/dev/null")
2278 (string-append "DISTRO_PRIVKEY=/dev/null")
2279 (string-append "REGDB_PUBKEY=/dev/null")
2281 ;; Leave that empty so that db2bin.py doesn't try
2282 ;; to sign 'regulatory.bin'. This allows us to
2283 ;; avoid managing a key pair for the whole distro.
2284 (string-append "REGDB_PRIVKEY=")))))
2285 (native-inputs `(("python" ,python-2)))
2287 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2288 (synopsis "Wireless regulatory database")
2290 "This package contains the wireless regulatory database Central
2291 Regulatory Database Agent (CRDA) daemon. The database contains information on
2292 country-specific regulations for the wireless spectrum.")
2293 (license license:isc)))
2295 (define-public lm-sensors
2301 (uri (list (string-append
2302 "https://github.com/groeck/lm-sensors/archive/V"
2303 (string-join (string-split version #\.) "-")
2305 (file-name (string-append name "-" version ".tar.gz"))
2308 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2309 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2310 (build-system gnu-build-system)
2311 (inputs `(("rrdtool" ,rrdtool)
2314 ("gnuplot" ,gnuplot)))
2315 (native-inputs `(("pkg-config" ,pkg-config)
2319 (outputs '("lib" ;avoid perl in closure
2322 `(#:tests? #f ; no 'check' target
2323 #:make-flags (list (string-append "PREFIX=" %output)
2324 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2325 (string-append "INCLUDEDIR="
2326 (assoc-ref %outputs "lib") "/include")
2327 (string-append "MANDIR=" %output "/share/man")
2328 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2330 (modify-phases %standard-phases
2332 (add-before 'build 'patch-exec-paths
2333 (lambda* (#:key inputs outputs #:allow-other-keys)
2334 (substitute* "prog/detect/sensors-detect"
2336 (string-append "`" (assoc-ref inputs "coreutils")
2338 (("(`|\")modprobe" all open-quote)
2339 (string-append open-quote
2340 (assoc-ref inputs "kmod")
2342 (substitute* '("prog/pwm/pwmconfig"
2343 "prog/pwm/fancontrol")
2345 (string-append (assoc-ref inputs "gnuplot")
2348 (string-append (assoc-ref inputs "coreutils")
2351 (string-append (assoc-ref inputs "grep")
2354 (string-append (assoc-ref inputs "sed")
2357 (string-append (assoc-ref inputs "coreutils")
2360 (string-append (assoc-ref inputs "coreutils")
2363 (string-append (assoc-ref inputs "coreutils")
2364 "/bin/readlink -f")))
2366 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2367 (synopsis "Utilities to read temperature/voltage/fan sensors")
2369 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2370 you to access information from temperature, voltage, and fan speed sensors.
2371 It works with most newer systems.")
2372 (license license:gpl2+)))
2374 (define-public iucode-tool
2376 (name "iucode-tool")
2380 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2381 "/raw/latest/iucode-tool_" version ".tar.xz"))
2384 "0w99k1aq1xw148ffk1xykqf60rdbphb1jknw98jcmadq4pwxl44q"))))
2385 (build-system gnu-build-system)
2386 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2387 (synopsis "Manipulate Intel microcode bundles")
2389 "@command{iucode_tool} is a utility to work with microcode packages for
2390 Intel processors. It can convert between formats, extract specific versions,
2391 create a firmware image suitable for the Linux kernel, and more.")
2392 ;; cpuid.h is available for i686, x86_64, and ia64.
2393 (supported-systems '("i686-linux" "x86_64-linux"))
2394 (license license:gpl2+)))
2396 (define-public i2c-tools
2403 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2404 version ".tar.bz2"))
2407 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2408 (build-system gnu-build-system)
2410 `(#:tests? #f ; no 'check' target
2411 #:make-flags (list (string-append "prefix=" %output)
2413 ;; no configure script
2414 #:phases (modify-phases %standard-phases (delete 'configure))))
2417 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2418 (synopsis "I2C tools for Linux")
2420 "The i2c-tools package contains a heterogeneous set of I2C tools for
2421 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2422 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2424 (license license:gpl2+)))
2426 (define-public xsensors
2433 "http://www.linuxhardware.org/xsensors/xsensors-"
2437 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2438 (build-system gnu-build-system)
2439 (inputs `(("lm-sensors" ,lm-sensors "lib")
2441 (native-inputs `(("pkg-config" ,pkg-config)))
2444 (modify-phases %standard-phases
2445 (add-before 'configure 'enable-deprecated
2447 (substitute* "src/Makefile.in"
2448 (("-DGDK_DISABLE_DEPRECATED") "")
2449 (("-DGTK_DISABLE_DEPRECATED") ""))
2451 (add-before 'configure 'remove-Werror
2453 (substitute* '("configure" "src/Makefile.in")
2456 (home-page "http://www.linuxhardware.org/xsensors/")
2457 (synopsis "Hardware health information viewer")
2459 "Xsensors reads data from the libsensors library regarding hardware
2460 health such as temperature, voltage and fan speed and displays the information
2461 in a digital read-out.")
2462 (license license:gpl2+)))
2467 (version (package-version linux-libre))
2468 (source (package-source linux-libre))
2469 (build-system gnu-build-system)
2472 (modify-phases %standard-phases
2474 (lambda* (#:key inputs #:allow-other-keys)
2475 (setenv "SHELL_PATH" (which "bash"))
2476 (chdir "tools/perf")
2478 #:make-flags (list (string-append "prefix="
2479 (assoc-ref %outputs "out"))
2482 ;; By default, 'config/Makefile' uses lib64 on
2483 ;; x86_64. Work around that.
2485 #:tests? #f)) ;no tests
2487 `(("pkg-config" ,pkg-config)
2491 ;; There are build scripts written in these languages.
2493 ("python" ,python-2)))
2495 `(("slang" ,slang) ;for the interactive TUI
2497 ("python" ,python-2) ;'perf' links against libpython
2498 ("elfutils" ,elfutils)
2499 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2500 ("libunwind" ,libunwind) ;better stack walking
2501 ("numactl" ,numactl) ;for 'perf bench numa mem'
2504 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2505 ("docbook-xsl" ,docbook-xsl)
2507 ("asciidoc" ,asciidoc)))
2508 (home-page "https://perf.wiki.kernel.org/")
2509 (synopsis "Linux profiling with performance counters")
2511 "perf is a tool suite for profiling using hardware performance counters,
2512 with support in the Linux kernel. perf can instrument CPU performance
2513 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2514 of lightweight profiling. This package contains the user-land tools and in
2515 particular the 'perf' command.")
2516 (license (package-license linux-libre))))
2518 (define-public pflask
2524 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2526 (file-name (string-append name "-" version ".tar.gz"))
2529 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2530 (build-system cmake-build-system)
2532 '(#:tests? #f)) ; no tests
2533 (home-page "https://ghedo.github.io/pflask/")
2534 (synopsis "Simple tool for creating Linux namespace containers")
2535 (description "pflask is a simple tool for creating Linux namespace
2536 containers. It can be used for running a command or even booting an OS inside
2537 an isolated container, created with the help of Linux namespaces. It is
2538 similar in functionality to chroot, although pflask provides better isolation
2539 thanks to the use of namespaces.")
2540 (license license:bsd-2)))
2542 (define-public hdparm
2548 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2549 name "-" version ".tar.gz"))
2552 "1ivdvrzimaayiq03by8mcq0mhmdljndj06h012zkdpw34irnpixm"))))
2553 (build-system gnu-build-system)
2555 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2556 (list (string-append "binprefix=" out)
2557 (string-append "manprefix=" out)
2560 (modify-phases %standard-phases
2561 (delete 'configure)) ; no configure script
2562 #:tests? #f)) ; no test suite
2563 (home-page "https://sourceforge.net/projects/hdparm/")
2564 (synopsis "View and tune ATA disk drive parameters")
2566 "@command{hdparm} is a command-line utility to control ATA controllers and
2567 disk drives. It can increase performance and/or reliability by careful tuning
2568 of hardware settings like power and acoustic management, DMA modes, and caching.
2569 It can also display detailed device information, or be used as a simple
2570 performance benchmarking tool.
2572 @command{hdparm} provides a command line interface to various Linux kernel
2573 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2574 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2575 Translation (@dfn{SAT}) are also supported.")
2576 (license (license:non-copyleft "file://LICENSE.TXT"))))
2578 (define-public rfkill
2584 (uri (string-append "mirror://kernel.org/software/network/"
2585 name "/" name "-" version ".tar.xz"))
2588 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2589 (build-system gnu-build-system)
2591 `(#:make-flags (list "CC=gcc"
2592 (string-append "PREFIX=" %output))
2593 #:phases (modify-phases %standard-phases
2594 (delete 'configure))
2596 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2597 (synopsis "Tool for enabling and disabling wireless devices")
2599 "rfkill is a simple tool for accessing the rfkill device interface,
2600 which is used to enable and disable wireless networking devices, typically
2601 WLAN, Bluetooth and mobile broadband.")
2602 (license (license:non-copyleft "file://COPYING"
2603 "See COPYING in the distribution."))
2604 ;; rfkill is part of util-linux as of 2.31.
2605 (properties `((superseded . ,util-linux)))))
2613 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2614 version "/" name "-" version ".tar.gz"))
2617 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2618 (build-system gnu-build-system)
2619 (home-page "http://acpiclient.sourceforge.net")
2620 (synopsis "Display information on ACPI devices")
2621 (description "@code{acpi} attempts to replicate the functionality of the
2622 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2623 information. It does not support ACPI suspending, only displays information
2624 about ACPI devices.")
2625 (license license:gpl2+)))
2627 (define-public acpid
2633 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2637 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2638 (build-system gnu-build-system)
2639 (home-page "https://sourceforge.net/projects/acpid2/")
2640 (synopsis "Daemon for delivering ACPI events to user-space programs")
2642 "acpid is designed to notify user-space programs of Advanced
2643 Configuration and Power Interface (ACPI) events. acpid should be started
2644 during the system boot, and will run as a background process. When an ACPI
2645 event is received from the kernel, acpid will examine the list of rules
2646 specified in /etc/acpi/events and execute the rules that match the event.")
2647 (license license:gpl2+)))
2649 (define-public sysfsutils
2658 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2661 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2662 (build-system gnu-build-system)
2663 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2664 (synopsis "System utilities based on Linux sysfs")
2666 "These are a set of utilities built upon sysfs, a virtual file system in
2667 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2668 also contains the libsysfs library.")
2669 ;; The library is under lgpl2.1+ (all files say "or any later version").
2670 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2671 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2673 (define-public sysfsutils-1
2675 (inherit sysfsutils)
2682 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2683 "/sysfsutils-" version ".tar.gz"))
2685 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2686 (modules '((guix build utils)))
2689 (substitute* "Makefile.in"
2690 (("includedir = /usr/include/sysfs")
2691 "includedir = @includedir@"))
2692 (substitute* "configure"
2693 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2694 (string-append "includedir='" orig "/sysfs'")))
2696 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2698 (define-public cpufrequtils
2700 (name "cpufrequtils")
2707 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2710 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2711 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2712 (build-system gnu-build-system)
2714 `(("sysfsutils" ,sysfsutils-1)))
2716 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2717 (assoc-ref %outputs "out") "/lib"))))
2718 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2719 (synopsis "Utilities to get and set CPU frequency on Linux")
2721 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2722 information, and set the CPU frequency if supported, using the cpufreq
2723 capabilities of the Linux kernel.")
2724 (license license:gpl2)))
2726 (define-public libraw1394
2733 "mirror://kernel.org/linux/libs/ieee1394/"
2734 name "-" version ".tar.xz"))
2737 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2738 (build-system gnu-build-system)
2739 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2740 (synopsis "Interface library for the Linux IEEE1394 drivers")
2742 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2743 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2744 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2745 send to and receive from other nodes without requiring a kernel driver for the
2746 protocol in question.")
2747 (license license:lgpl2.1+)))
2749 (define-public libavc1394
2755 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2756 name "-" version ".tar.gz"))
2759 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2760 (build-system gnu-build-system)
2762 `(("pkg-config" ,pkg-config)))
2764 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2765 (home-page "https://sourceforge.net/projects/libavc1394/")
2766 (synopsis "AV/C protocol library for IEEE 1394")
2768 "Libavc1394 is a programming interface to the AV/C specification from
2769 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2770 (license license:lgpl2.1+)))
2772 (define-public libiec61883
2774 (name "libiec61883")
2779 "mirror://kernel.org/linux/libs/ieee1394/"
2780 name "-" version ".tar.xz"))
2783 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2784 (build-system gnu-build-system)
2786 `(("pkg-config" ,pkg-config)))
2788 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2789 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2790 (synopsis "Isochronous streaming media library for IEEE 1394")
2792 "The libiec61883 library provides a higher level API for streaming DV,
2793 MPEG-2 and audio over Linux IEEE 1394.")
2794 (license license:lgpl2.1+)))
2796 (define-public mdadm
2803 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2807 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2808 (build-system gnu-build-system)
2812 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2816 ;; TODO: tell it where to find 'sendmail'
2817 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2818 (string-append "BINDIR=" out "/sbin")
2819 (string-append "MANDIR=" out "/share/man")
2820 (string-append "UDEVDIR=" out "/lib/udev")))
2822 (modify-phases %standard-phases
2823 (add-before 'build 'patch-program-paths
2824 (lambda* (#:key inputs #:allow-other-keys)
2825 (let ((coreutils (assoc-ref inputs "coreutils")))
2826 (substitute* "udev-md-raid-arrays.rules"
2827 (("/usr/bin/(readlink|basename)" all program)
2828 (string-append coreutils "/bin/" program))))
2830 (add-before 'build 'remove-W-error
2832 ;; We cannot build with -Werror on i686 due to a
2833 ;; 'sign-compare' warning in util.c.
2834 (substitute* "Makefile"
2837 (delete 'configure))
2838 ;;tests must be done as root
2840 (home-page "http://neil.brown.name/blog/mdadm")
2841 (synopsis "Tool for managing Linux Software RAID arrays")
2843 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2844 assemble, report on, and monitor arrays. It can also move spares between raid
2845 arrays when needed.")
2846 (license license:gpl2+)))
2848 (define-public mdadm-static
2851 (name "mdadm-static")
2853 (substitute-keyword-arguments (package-arguments mdadm)
2854 ((#:make-flags flags)
2855 `(cons "LDFLAGS = -static" ,flags))
2857 `(modify-phases ,phases
2858 (add-after 'install 'remove-cruft
2859 (lambda* (#:key outputs #:allow-other-keys)
2860 (let* ((out (assoc-ref outputs "out"))
2861 (precious? (lambda (file)
2862 (member file '("." ".." "sbin"))))
2863 (directories (scandir out (negate precious?))))
2864 (with-directory-excursion out
2865 (for-each delete-file-recursively directories)
2866 (remove-store-references "sbin/mdadm")
2867 (delete-file "sbin/mdmon")
2869 ((#:modules modules %gnu-build-system-modules)
2870 `((ice-9 ftw) ,@modules))
2871 ((#:strip-flags _ '())
2872 ''("--strip-all")) ;strip a few extra KiB
2873 ((#:allowed-references _ '("out"))
2874 '("out")))) ;refer only self
2875 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2877 (define-public multipath-tools
2879 (name "multipath-tools")
2883 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
2884 ".git;a=snapshot;h=" version ";sf=tgz"))
2885 (file-name (string-append name "-" version ".tar.gz"))
2888 "02lk453wa2gfxkl8zmdws15nkcibln2yw76zm779pkngkhggl6w8"))
2889 (modules '((guix build utils)))
2892 ;; Drop bundled valgrind headers.
2893 (delete-file-recursively "third-party")
2894 (substitute* '("multipathd/main.c"
2895 "libmultipath/debug.c")
2896 (("#include \"../third-party/")
2899 (build-system gnu-build-system)
2901 '(#:tests? #f ; No tests.
2902 #:make-flags (list (string-append "DESTDIR="
2903 (assoc-ref %outputs "out"))
2905 (string-append "LDFLAGS=-Wl,-rpath="
2906 (assoc-ref %outputs "out")
2909 (modify-phases %standard-phases
2910 (add-after 'unpack 'patch-source
2911 (lambda* (#:key inputs #:allow-other-keys)
2912 (let ((lvm2 (assoc-ref inputs "lvm2"))
2913 (udev (assoc-ref inputs "udev")))
2914 (substitute* "Makefile.inc"
2915 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2916 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2917 (("/usr/include/libdevmapper.h")
2918 (string-append lvm2 "/include/libdevmapper.h"))
2919 (("/usr/include/libudev.h")
2920 (string-append udev "/include/libudev.h")))
2923 (add-before 'build 'set-CC
2929 ("pkg-config" ,pkg-config)
2930 ("valgrind" ,valgrind)))
2932 `(("ceph:lib" ,ceph "lib")
2935 ("liburcu" ,liburcu)
2937 ("readline" ,readline)
2939 (home-page "http://christophe.varoqui.free.fr/")
2940 (synopsis "Access block devices through multiple paths")
2942 "This package provides the following binaries to drive the
2943 Linux Device Mapper multipathing driver:
2945 @item @command{multipath} - Device mapper target autoconfig.
2946 @item @command{multipathd} - Multipath daemon.
2947 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2948 @code{dm} multipath devices.
2949 @item @command{kpartx} - Create device maps from partition tables.
2951 (license (list license:gpl2+ ; Main distribution.
2952 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2954 (define-public libaio
2961 (string-append "mirror://debian/pool/main/liba/libaio/"
2962 name "_" version ".orig.tar.gz")))
2965 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2966 (build-system gnu-build-system)
2969 (list "CC=gcc" (string-append "prefix=" %output))
2970 #:test-target "partcheck" ; need root for a full 'check'
2972 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
2973 (home-page "http://lse.sourceforge.net/io/aio.html")
2974 (synopsis "Linux-native asynchronous I/O access library")
2976 "This library enables userspace to use Linux kernel asynchronous I/O
2977 system calls, important for the performance of databases and other advanced
2979 (license license:lgpl2.1+)))
2987 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2988 name "-" version ".tar.xz"))
2991 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2992 (build-system gnu-build-system)
2994 `(("libsndfile" ,libsndfile)))
2996 `(("pkg-config" ,pkg-config)))
2997 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2998 (synopsis "Bluetooth subband audio codec")
3000 "The SBC is a digital audio encoder and decoder used to transfer data to
3001 Bluetooth audio output devices like headphones or loudspeakers.")
3002 (license license:gpl2+)))
3004 (define-public bluez
3011 "mirror://kernel.org/linux/bluetooth/bluez-"
3015 "15ffsaz7l3fgdg03l7g1xx9jw7xgs6pc548zxqsxawsca5x1sc1k"))))
3016 (build-system gnu-build-system)
3019 (let ((out (assoc-ref %outputs "out")))
3020 (list "--sysconfdir=/etc"
3021 "--localstatedir=/var"
3024 ;; Install dbus/udev files to the correct location.
3025 (string-append "--with-dbusconfdir=" out "/etc")
3026 (string-append "--with-udevdir=" out "/lib/udev")))
3028 (modify-phases %standard-phases
3029 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3030 ;; issue (discussion on upstream mailing list:
3031 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3032 (add-before 'check 'skip-wonky-test
3034 (substitute* "unit/test-gatt.c"
3035 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3037 (add-after 'install 'post-install
3038 (lambda* (#:key inputs outputs #:allow-other-keys)
3039 (let* ((out (assoc-ref outputs "out"))
3040 (servicedir (string-append out "/share/dbus-1/services"))
3041 (service "obexd/src/org.bluez.obex.service")
3042 (rule (string-append
3043 out "/lib/udev/rules.d/97-hid2hci.rules")))
3044 ;; Install the obex dbus service file.
3045 (substitute* service
3047 (string-append out "/libexec/bluetooth/obexd")))
3048 (install-file service servicedir)
3049 ;; Fix paths in the udev rule.
3051 (("hid2hci --method")
3052 (string-append out "/lib/udev/hid2hci --method"))
3054 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3057 `(("pkg-config" ,pkg-config)
3058 ("gettext" ,gettext-minimal)))
3063 ("libical" ,libical)
3064 ("readline" ,readline)))
3065 (home-page "http://www.bluez.org/")
3066 (synopsis "Linux Bluetooth protocol stack")
3068 "BlueZ provides support for the core Bluetooth layers and protocols. It
3069 is flexible, efficient and uses a modular implementation.")
3070 (license license:gpl2+)))
3072 (define-public fuse-exfat
3079 "https://github.com/relan/exfat/releases/download/v"
3080 version "/" name "-" version ".tar.gz"))
3083 "1jwnxw0bg9v5ij8xvbg4xpjr50nykq8a1lmc2xkblz204rq7wd8z"))))
3084 (build-system gnu-build-system)
3086 `(("pkg-config" ,pkg-config)))
3089 (home-page "https://github.com/relan/exfat")
3090 (synopsis "Mount exFAT file systems")
3092 "This package provides a FUSE-based file system that provides read and
3093 write access to exFAT devices.")
3094 (license license:gpl2+)))
3103 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3104 version ".tar.bz2"))
3105 (patches (search-patches "gpm-glibc-2.26.patch"))
3108 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3109 (build-system gnu-build-system)
3111 '(#:phases (modify-phases %standard-phases
3114 ;; The tarball was not generated with 'make dist' so we
3115 ;; need to bootstrap things ourselves.
3116 (substitute* "autogen.sh"
3117 (("/bin/sh") (which "sh")))
3118 (and (zero? (system* "./autogen.sh"))
3120 (patch-makefile-SHELL "Makefile.include.in")
3123 ;; Make sure programs find libgpm.so.
3124 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3125 (assoc-ref %outputs "out")
3128 `(("texinfo" ,texinfo)
3131 ("autoconf" ,autoconf)
3132 ("automake" ,automake)
3133 ("libtool" ,libtool)))
3134 (home-page "http://www.nico.schottelius.org/software/gpm/")
3135 (synopsis "Mouse support for the Linux console")
3137 "The GPM (general-purpose mouse) daemon is a mouse server for
3138 applications running on the Linux console. It allows users to select items
3139 and copy/paste text in the console and in xterm.")
3140 (license license:gpl2+)))
3142 (define-public btrfs-progs
3144 (name "btrfs-progs")
3148 (uri (string-append "mirror://kernel.org/linux/kernel/"
3149 "people/kdave/btrfs-progs/"
3150 "btrfs-progs-v" version ".tar.xz"))
3153 "1palnddw3d50kyflwk1j4xapbc6jniid6j5i9dsr8l8a7nkv7ich"))))
3154 (build-system gnu-build-system)
3156 "static")) ; static versions of the binaries in "out"
3158 '(#:phases (modify-phases %standard-phases
3159 (add-after 'build 'build-static
3160 (lambda _ (zero? (system* "make" "static"))))
3161 (add-after 'install 'install-bash-completion
3162 (lambda* (#:key outputs #:allow-other-keys)
3163 (let* ((out (assoc-ref outputs "out"))
3164 (bashcomp (string-append out "/etc/bash_completion.d")))
3166 (copy-file "btrfs-completion"
3167 (string-append bashcomp "/btrfs"))
3169 (add-after 'install 'install-static
3170 (let ((staticbin (string-append (assoc-ref %outputs "static")
3173 (zero? (system* "make"
3174 (string-append "bindir=" staticbin)
3175 "install-static"))))))
3176 #:test-target "test"
3177 #:parallel-tests? #f)) ; tests fail when run in parallel
3178 (inputs `(("e2fsprogs" ,e2fsprogs)
3179 ("libblkid" ,util-linux)
3180 ("libblkid:static" ,util-linux "static")
3181 ("libuuid" ,util-linux)
3182 ("libuuid:static" ,util-linux "static")
3186 (native-inputs `(("pkg-config" ,pkg-config)
3187 ("asciidoc" ,asciidoc)
3189 ;; For building documentation.
3190 ("libxml2" ,libxml2)
3191 ("docbook-xsl" ,docbook-xsl)
3195 (home-page "https://btrfs.wiki.kernel.org/")
3196 (synopsis "Create and manage btrfs copy-on-write file systems")
3197 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3198 aimed at implementing advanced features while focusing on fault tolerance,
3199 repair and easy administration.")
3200 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3201 ;; GPL2: Everything else.
3202 (license (list license:gpl2 license:gpl2+))))
3204 (define-public btrfs-progs/static
3206 (name "btrfs-progs-static")
3207 (version (package-version btrfs-progs))
3209 (build-system trivial-build-system)
3211 `(("btrfs-progs:static" ,btrfs-progs "static")))
3213 `(#:modules ((guix build utils))
3216 (use-modules (guix build utils)
3220 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3221 (out (assoc-ref %outputs "out"))
3222 (source (string-append btrfs "/bin/btrfs.static"))
3223 (target (string-append out "/bin/btrfs")))
3224 (mkdir-p (dirname target))
3225 (copy-file source target)
3226 (remove-store-references target)
3227 (chmod target #o555)))))
3228 (home-page (package-home-page btrfs-progs))
3229 (synopsis "Statically-linked btrfs command from btrfs-progs")
3230 (description "This package provides the statically-linked @command{btrfs}
3231 from the btrfs-progs package. It is meant to be used in initrds.")
3232 (license (package-license btrfs-progs))))
3234 (define-public f2fs-tools
3241 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3242 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3245 "1bir9ladb58ijlcvrjrq1fb1xv5ys50zdjaq0yzliib0apsyrnyl"))))
3246 (build-system gnu-build-system)
3248 `(("autoconf" ,autoconf)
3249 ("automake" ,automake)
3250 ("libtool" ,libtool)
3251 ("pkg-config" ,pkg-config)))
3253 `(("libuuid" ,util-linux)))
3254 (home-page "https://f2fs.wiki.kernel.org/")
3255 (synopsis "Userland tools for f2fs")
3257 "F2FS, the Flash-Friendly File System, is a modern file system
3258 designed to be fast and durable on flash devices such as solid-state
3259 disks and SD cards. This package provides the userland utilities.")
3260 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3261 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3262 (license (list license:gpl2 license:lgpl2.1))))
3264 (define-public freefall
3267 (version (package-version linux-libre))
3268 (source (package-source linux-libre))
3269 (build-system gnu-build-system)
3271 '(#:phases (modify-phases %standard-phases
3272 (add-after 'unpack 'enter-subdirectory
3274 (chdir "tools/laptop/freefall")))
3276 (add-before 'build 'increase-timeout
3278 ;; The default of 2 seconds is too low: it assumes an
3279 ;; open lid and AC power without actually checking.
3280 (substitute* "freefall.c"
3281 (("alarm\\(2\\)") "alarm(5)")))))
3282 #:make-flags (list (string-append "PREFIX="
3283 (assoc-ref %outputs "out")))
3284 #:tests? #f)) ;no tests
3285 (home-page (package-home-page linux-libre))
3286 (synopsis "Free-fall protection for spinning laptop hard drives")
3288 "Prevents shock damage to the internal spinning hard drive(s) of some
3289 HP and Dell laptops. When sudden movement is detected, all input/output
3290 operations on the drive are suspended and its heads are parked on the ramp,
3291 where they are less likely to cause damage to the spinning disc. Requires a
3292 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3293 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3294 (license license:gpl2)))
3296 (define-public thinkfan
3302 (uri (string-append "mirror://sourceforge/thinkfan/"
3303 "/thinkfan-" version ".tar.gz"))
3306 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3307 (modules '((guix build utils)))
3308 ;; Fix erroneous man page location in Makefile leading to
3309 ;; a compilation failure.
3311 (substitute* "CMakeLists.txt"
3312 (("thinkfan\\.1") "src/thinkfan.1"))
3314 (build-system cmake-build-system)
3316 `(#:modules ((guix build cmake-build-system)
3319 #:tests? #f ;no test target
3321 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3322 `("-DUSE_ATASMART:BOOL=ON")
3324 (modify-phases %standard-phases
3325 ;; Install scripts for various foreign init systems. Also fix
3326 ;; hard-coded path for daemon.
3327 (add-after 'install 'install-rc-scripts
3328 (lambda* (#:key outputs #:allow-other-keys)
3329 (let ((out (assoc-ref outputs "out"))
3331 (string-append "../thinkfan-" ,version "/rcscripts")
3334 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3335 (string-append out "/sbin/" name)))
3336 (for-each (cute install-file <>
3337 (string-append out "/share/thinkfan"))
3341 `(("libatasmart" ,libatasmart)))
3342 (home-page "http://thinkfan.sourceforge.net/")
3343 (synopsis "Simple fan control program")
3345 "Thinkfan is a simple fan control program. It reads temperatures,
3346 checks them against configured limits and switches to appropriate (also
3347 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3348 other @code{hwmon} driver that enables temperature reading and fan control
3350 (license license:gpl3+)))
3352 (define-public ntfs-3g
3355 (version "2017.3.23")
3358 (uri (string-append "https://tuxera.com/opensource/"
3359 "ntfs-3g_ntfsprogs-" version ".tgz"))
3362 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
3363 (modules '((guix build utils)))
3365 ;; Install under $prefix.
3366 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3370 (build-system gnu-build-system)
3371 (inputs `(("util-linux" ,util-linux)
3372 ("fuse" ,fuse))) ;libuuid
3373 (native-inputs `(("pkg-config" ,pkg-config)))
3375 '(#:configure-flags (list "--exec-prefix=${prefix}"
3376 "--with-fuse=external" ;use our own FUSE
3377 "--enable-mount-helper"
3378 "--enable-posix-acls"
3379 "--enable-xattr-mappings")))
3380 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
3381 (synopsis "Read-write access to NTFS file systems")
3383 "NTFS-3G provides read-write access to NTFS file systems, which are
3384 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3385 The package provides additional NTFS tools.")
3386 (license license:gpl2+)))
3388 (define-public rdma-core
3394 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3395 "/releases/download/v" version "/rdma-core-"
3399 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3400 (build-system cmake-build-system)
3402 '(#:tests? #f ; no tests
3403 ;; Upstream uses the "ninja" build system and encourage distros
3404 ;; to do the same for consistency. They also recommend using the
3405 ;; "Release" build type.
3406 #:build-type "Release"
3407 #:configure-flags (list "-GNinja")
3409 (modify-phases %standard-phases
3412 (zero? (system* "ninja"
3413 "-j" (number->string (parallel-job-count))))))
3416 (zero? (system* "ninja" "install")))))))
3419 ("pkg-config" ,pkg-config)
3420 ("python" ,python-wrapper)))
3424 (home-page "https://github.com/linux-rdma/rdma-core")
3425 (synopsis "Utilities and libraries for working with RDMA devices")
3427 "This package provides userspace components for the InfiniBand
3428 subsystem of the Linux kernel. Specifically it contains userspace
3429 libraries for the following device nodes:
3432 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3433 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3434 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3437 The following service daemons are also provided:
3439 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3440 @item @code{iwpmd} (for iWARP kernel providers)
3441 @item @code{ibacm} (for InfiniBand communication management assistant)
3443 ;; All library code is dual licensed under GPL2 and a custom MIT
3444 ;; variant. The package also includes some components covered by
3445 ;; other licenses. Consult COPYING.md for full details.
3448 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3449 license:bsd-2 ; Files referring to COPYING.BSD_FB
3450 license:cc0 ; most files in ccan/
3451 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3453 (define-public rng-tools
3459 (uri (string-append "https://github.com/nhorman/rng-tools/"
3460 "archive/v" version ".tar.gz"))
3461 (file-name (string-append name "-" version ".tar.gz"))
3464 "00ywsknjpc9jd9kfmz2syk9l0xkiiwyx5qhl5zvhhc69v6682i31"))))
3465 (build-system gnu-build-system)
3467 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
3468 #:configure-flags '("--without-nistbeacon")))
3470 `(("autoconf" ,autoconf)
3471 ("automake" ,automake)
3472 ("pkg-config" ,pkg-config)))
3474 `(("libsysfs" ,sysfsutils)))
3475 (synopsis "Random number generator daemon")
3477 "Monitor a hardware random number generator, and supply entropy
3478 from that to the system kernel's @file{/dev/random} machinery.")
3479 (home-page "https://sourceforge.net/projects/gkernel")
3480 ;; The source package is offered under the GPL2+, but the files
3481 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3482 (license (list license:gpl2 license:gpl2+))))
3484 (define-public cpupower
3487 (version (package-version linux-libre))
3488 (source (package-source linux-libre))
3489 (build-system gnu-build-system)
3491 '(#:phases (modify-phases %standard-phases
3492 (add-after 'unpack 'enter-subdirectory
3494 (chdir "tools/power/cpupower")))
3496 (add-before 'build 'fix-makefiles
3498 (substitute* "Makefile"
3500 (("/bin/(install|pwd)" _ command) command))
3501 (substitute* "bench/Makefile"
3502 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3503 #:make-flags (let ((out (assoc-ref %outputs "out")))
3504 (list (string-append "DESTDIR=" out)
3505 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3506 "docdir=/share/doc/cpupower"
3507 "confdir=$(docdir)/examples"
3508 ;; The Makefile recommends the following changes
3510 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3511 #:tests? #f)) ;no tests
3512 (native-inputs `(("gettext" ,gettext-minimal)))
3513 (inputs `(("pciutils" ,pciutils)))
3514 (home-page (package-home-page linux-libre))
3515 (synopsis "CPU frequency and voltage scaling tools for Linux")
3517 "cpupower is a set of user-space tools that use the cpufreq feature of the
3518 Linux kernel to retrieve and control processor features related to power saving,
3519 such as frequency and voltage scaling.")
3520 (license license:gpl2)))
3522 (define-public haveged
3529 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3533 "0w5ypz6451msckivjriwyw8djydlwffam7x23xh626s2vzdrlzgp"))))
3534 (build-system gnu-build-system)
3535 (home-page "http://www.issihosts.com/haveged")
3536 (synopsis "Entropy source for the Linux random number generator")
3538 "haveged generates an unpredictable stream of random numbers for use by
3539 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3540 standard mechanisms for filling the entropy pool may not be sufficient for
3541 systems with high needs or limited user interaction, such as headless servers.
3542 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3543 indirect effects of hardware events on hidden processor state using the HArdware
3544 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3545 its environment and provides the same built-in test suite for the output stream
3546 as used on certified hardware security devices.")
3547 (license (list (license:non-copyleft "file://nist/mconf.h")
3548 (license:non-copyleft "file://nist/packtest.c")
3549 license:public-domain ; nist/dfft.c
3550 license:gpl3+)))) ; everything else
3552 (define-public ecryptfs-utils
3554 (name "ecryptfs-utils")
3559 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3560 version "/+download/ecryptfs-utils_"
3561 version ".orig.tar.gz"))
3564 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3565 (build-system gnu-build-system)
3567 `(#:configure-flags (list "--disable-pywrap")))
3569 `(("intltool" ,intltool)
3570 ("perl" ,perl) ; for pod2man
3571 ("pkg-config" ,pkg-config)))
3573 `(("keyutils" ,keyutils)
3574 ("linux-pam" ,linux-pam)
3576 (home-page "http://ecryptfs.org/")
3577 (synopsis "eCryptfs cryptographic file system utilities")
3579 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3580 Each file's cryptographic meta-data is stored inside the file itself, along
3581 with the encrypted contents. This allows individual encrypted files to be
3582 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3583 native Linux file system, and has been part of the Linux kernel since version
3584 2.6.19. This package contains the userland utilities to manage it.")
3585 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3586 ;; grant additional permission to link with OpenSSL.
3587 (license license:gpl2+)))
3589 (define-public libnfsidmap
3591 (name "libnfsidmap")
3596 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3597 name "/" name "-" version ".tar.gz"))
3600 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3601 (build-system gnu-build-system)
3603 `(#:configure-flags (list
3604 (string-append "--with-pluginpath="
3605 (assoc-ref %outputs "out")
3606 "/lib/libnfsidmap"))))
3608 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3610 "NFSv4 support library for name/ID mapping")
3611 (description "Libnfsidmap is a library holding mulitiple methods of
3612 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3613 extensible array of mapping functions, currently consisting of two choices:
3614 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3615 (license (license:non-copyleft "file://COPYING"
3616 "See COPYING in the distribution."))))
3618 (define-public module-init-tools
3620 (name "module-init-tools")
3625 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3626 "module-init-tools-" version ".tar.bz2"))
3629 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3630 (patches (search-patches "module-init-tools-moduledir.patch"))))
3631 (build-system gnu-build-system)
3633 ;; FIXME: The upstream tarball lacks man pages, and building them would
3634 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3635 ;; but they vanished. In the meantime, fake it.
3637 (modify-phases %standard-phases
3638 (add-before 'configure 'fake-docbook
3640 (substitute* "Makefile.in"
3641 (("^DOCBOOKTOMAN.*$")
3642 "DOCBOOKTOMAN = true\n"))
3644 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3645 (synopsis "Tools for loading and managing Linux kernel modules")
3647 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3648 `insmod', `lsmod', and more.")
3649 (license license:gpl2+)))
3651 (define-public mcelog
3657 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3658 "mcelog.git/snapshot/v" version ".tar.gz"))
3661 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
3662 (file-name (string-append name "-" version ".tar.gz"))
3663 (modules '((guix build utils)))
3666 ;; The snapshots lack a .git directory,
3667 ;; breaking ‘git describe’.
3668 (substitute* "Makefile"
3669 (("\"unknown\"") (string-append "\"v" ,version "\"")))
3671 (build-system gnu-build-system)
3673 `(#:phases (modify-phases %standard-phases
3674 (delete 'configure)) ; no configure script
3675 #:make-flags (let ((out (assoc-ref %outputs "out")))
3677 (string-append "prefix=" out)
3678 (string-append "DOCDIR=" out "/share/doc/mcelog")
3679 "etcprefix=$(DOCDIR)/examples"))
3680 ;; The tests will only run as root on certain supported CPU models.
3682 (supported-systems (list "i686-linux" "x86_64-linux"))
3683 (home-page "https://mcelog.org/")
3684 (synopsis "Machine check monitor for x86 Linux systems")
3686 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3687 and other hardware errors on x86 systems. It can also perform user-defined
3688 tasks, such as bringing bad pages off-line, when configurable error thresholds
3690 (license license:gpl2)))
3692 (define-public mtd-utils
3699 "ftp://ftp.infradead.org/pub/mtd-utils/"
3700 "mtd-utils-" version ".tar.bz2"))
3703 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3706 ("libuuid" ,util-linux)
3709 (build-system gnu-build-system)
3711 `(#:test-target "tests"
3712 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3713 #:phases (modify-phases %standard-phases
3714 (delete 'configure))))
3715 (synopsis "MTD Flash Storage Utilities")
3716 (description "This package provides utilities for testing, partitioning, etc
3718 (home-page "http://www.linux-mtd.infradead.org/")
3720 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3721 license:mpl1.1 ; All ftl* files
3722 license:expat)))) ; libiniparser
3724 (define-public libseccomp
3730 (uri (string-append "https://github.com/seccomp/libseccomp/"
3731 "releases/download/v" version
3732 "/libseccomp-" version ".tar.gz"))
3735 "0mdiyfljrkfl50q1m3ws8yfcyfjwf1zgkvcva8ffcwncji18zhkz"))))
3736 (build-system gnu-build-system)
3738 `(("which" ,which)))
3739 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3740 (description "The libseccomp library provides an easy to use, platform
3741 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3742 libseccomp API is designed to abstract away the underlying BPF based syscall
3743 filter language and present a more conventional function-call based filtering
3744 interface that should be familiar to, and easily adopted by, application
3746 (home-page "https://github.com/seccomp/libseccomp")
3747 (license license:lgpl2.1)))
3749 (define-public radeontop
3753 (home-page "https://github.com/clbr/radeontop/")
3756 (uri (string-append home-page "archive/v" version ".tar.gz"))
3757 (file-name (string-append name "-" version ".tar.gz"))
3760 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3761 (build-system gnu-build-system)
3763 `(#:phases (modify-phases %standard-phases
3764 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3765 ;; dependency, and doesn't even work on release(!) tarballs.
3766 (add-after 'unpack 'report-correct-version
3767 (lambda _ (substitute* "getver.sh"
3769 (string-append "ver=" ,version)))))
3770 (delete 'configure)) ; no configure script
3771 #:make-flags (list "CC=gcc"
3772 (string-append "PREFIX=" %output))
3773 #:tests? #f)) ; no tests
3775 `(("gettext" ,gettext-minimal)
3776 ("pkg-config" ,pkg-config)))
3778 `(("libdrm" ,libdrm)
3779 ("libpciaccess" ,libpciaccess)
3781 ("ncurses" ,ncurses)))
3782 (synopsis "Usage monitor for AMD Radeon graphics")
3783 (description "RadeonTop monitors resource consumption on supported AMD
3784 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3785 a terminal or saved to a file for further processing. It measures both the
3786 activity of the GPU as a whole, which is also accurate during OpenCL
3787 computations, as well as separate component statistics that are only meaningful
3788 under OpenGL graphics workloads.")
3789 (license license:gpl3)))
3791 (define-public efivar
3797 (uri (string-append "https://github.com/rhinstaller/" name
3798 "/releases/download/" version "/" name
3799 "-" version ".tar.bz2"))
3802 "09a31y6sl3b33myy42gl9k732k1f440ycd07l6ac5d5l53kk8zhv"))))
3803 (build-system gnu-build-system)
3805 `(;; Tests require a UEFI system and is not detected in the chroot.
3807 #:make-flags (list (string-append "prefix=" %output)
3808 (string-append "libdir=" %output "/lib")
3810 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3812 (modify-phases %standard-phases
3813 (delete 'configure))))
3815 `(("pkg-config" ,pkg-config)))
3818 (home-page "https://github.com/rhinstaller/efivar")
3819 (synopsis "Tool and library to manipulate EFI variables")
3820 (description "This package provides a library and a command line
3821 interface to the variable facility of UEFI boot firmware.")
3822 (license license:lgpl2.1+)))
3824 (define-public efibootmgr
3830 (uri (string-append "https://github.com/rhinstaller/" name
3831 "/releases/download/" version "/" name
3832 "-" version ".tar.bz2"))
3835 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3836 (build-system gnu-build-system)
3838 `(#:tests? #f ; No tests.
3839 #:make-flags (list (string-append "prefix=" %output)
3840 (string-append "libdir=" %output "/lib")
3841 ;; Override CFLAGS to add efivar include directory.
3842 (string-append "CFLAGS=-O2 -g -flto -I"
3843 (assoc-ref %build-inputs "efivar")
3846 (modify-phases %standard-phases
3847 (add-after 'unpack 'branding
3848 ;; Replace default loader path with something more familiar.
3850 (substitute* "src/efibootmgr.c"
3851 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3854 (delete 'configure))))
3856 `(("pkg-config" ,pkg-config)))
3858 `(("efivar" ,efivar)
3860 (home-page "https://github.com/rhinstaller/efibootmgr")
3861 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3863 "@code{efibootmgr} is a user-space application to modify the Intel
3864 Extensible Firmware Interface (EFI) Boot Manager. This application can
3865 create and destroy boot entries, change the boot order, change the next
3866 running boot option, and more.")
3867 (license license:gpl2+)))
3869 (define-public sysstat
3875 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3876 "sysstat-" version ".tar.xz"))
3879 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3880 (build-system gnu-build-system)
3882 `(#:tests? #f ; No test suite.
3883 ;; Without this flag, it tries to install the man pages with group 'root'
3884 ;; and fails because /etc/passwd lacks an entry for the root user.
3886 (list "--disable-file-attr"
3887 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3889 (modify-phases %standard-phases
3890 ;; The build process tries to create '/var/lib/sa', so we skip that
3892 (add-after 'build 'skip-touching-var
3894 (substitute* "Makefile"
3895 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3898 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3899 (synopsis "Performance monitoring tools for Linux")
3900 (description "The sysstat utilities are a collection of performance
3901 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3902 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3903 @code{sadf} and @code{sa}.")
3904 (license license:gpl2+)))
3906 (define-public light
3912 (uri (string-append "https://github.com/haikarainen/" name
3913 "/archive/v" version ".tar.gz"))
3916 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3917 (file-name (string-append name "-" version ".tar.gz"))))
3918 (build-system gnu-build-system)
3920 '(#:tests? #f ; no tests
3921 #:make-flags (list "CC=gcc"
3922 (string-append "PREFIX=" %output))
3924 (modify-phases %standard-phases
3926 (add-after 'unpack 'patch-makefile
3928 (substitute* "Makefile" (("chown") "#")))))))
3930 `(("help2man" ,help2man)))
3931 (home-page "https://haikarainen.github.io/light")
3932 (synopsis "GNU/Linux application to control backlights")
3934 "Light is a program to send commands to screen backlight controllers
3935 under GNU/Linux. Features include:
3938 @item It does not rely on X.
3939 @item Light can automatically figure out the best controller to use, making
3940 full use of underlying hardware.
3941 @item It is possible to set a minimum brightness value, as some controllers
3942 set the screen to be pitch black at a vaĺue of 0 (or higher).
3945 Light is the successor of lightscript.")
3946 (license license:gpl3+)))
3955 "https://github.com/linrunner/"
3956 (string-upcase name)
3957 "/archive/" version ".tar.gz"))
3958 (file-name (string-append name "-" version ".tar.gz"))
3961 "068hzmh90x600saynbl7iwg1pm0ywldn4jazyxx5y1fixs8s1qbn"))))
3962 (inputs `(("bash" ,bash)
3964 ("ethtool" ,ethtool)
3968 ("inetutils" ,inetutils)
3971 ("pciutils" ,pciutils)
3975 ("usbutils" ,usbutils)
3976 ("util-linux" ,util-linux)
3977 ("wireless-tools" ,wireless-tools)))
3978 (build-system gnu-build-system)
3981 (modify-phases %standard-phases
3982 (delete 'configure) ; no configure script
3983 (add-before 'build 'setenv
3984 (lambda* (#:key outputs #:allow-other-keys)
3985 (let ((out (assoc-ref outputs "out")))
3986 (setenv "TLP_WITH_SYSTEMD" "0")
3987 (setenv "TLP_NO_INIT" "1")
3988 (setenv "TLP_NO_PMUTILS" "1")
3989 (setenv "TLP_SBIN" (string-append out "/bin"))
3990 (setenv "TLP_BIN" (string-append out "/bin"))
3991 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3992 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3993 (setenv "TLP_CONF" "/etc/tlp")
3995 (string-append out "/share/bash-completion/completions"))
3996 (setenv "TLP_MAN" (string-append out "/share/man"))
3997 (setenv "TLP_META" (string-append out "/share/metainfo")))))
3998 (delete 'check) ; no tests
3999 (add-before 'install 'fix-installation
4001 ;; Stop the Makefile from trying to create system directories.
4002 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
4005 (invoke "make" "install-tlp" "install-man")
4007 (add-after 'install 'wrap
4008 (lambda* (#:key inputs outputs #:allow-other-keys)
4009 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4010 (bin-files (find-files bin ".*")))
4011 (define (bin-directory input-name)
4012 (string-append (assoc-ref inputs input-name) "/bin"))
4013 (define (sbin-directory input-name)
4014 (string-append (assoc-ref inputs input-name) "/sbin"))
4015 (for-each (lambda (program)
4016 (wrap-program program
4019 (map bin-directory '("bash"
4030 (map sbin-directory '("ethtool"
4035 "wireless-tools"))))))
4037 (home-page "http://linrunner.de/en/tlp/tlp.html")
4038 (synopsis "Power management tool for Linux")
4039 (description "TLP is a power management tool for Linux. It comes with
4040 a default configuration already optimized for battery life. Nevertheless,
4041 TLP is customizable to fulfil system requirements. TLP settings are applied
4042 every time the power supply source is changed.")
4044 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4046 (license (list license:gpl2+ license:gpl3+))))
4054 (uri (string-append "https://www.ezix.org/software/"
4055 "files/lshw-" version
4059 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4060 (build-system gnu-build-system)
4062 `(#:phases (modify-phases %standard-phases (delete 'configure))
4063 #:tests? #f ; no tests
4065 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4066 (synopsis "List hardware information")
4068 "@command{lshw} (Hardware Lister) is a small tool to provide
4069 detailed information on the hardware configuration of the machine.
4070 It can report exact memory configuration, firmware version, mainboard
4071 configuration, CPU version and speed, cache configuration, bus speed,
4072 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4073 machines (PowerMac G4 is known to work).")
4074 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4075 (license license:gpl2+)))
4077 (define-public libmnl
4084 (uri (string-append "mirror://netfilter.org/libmnl/"
4085 "libmnl-" version ".tar.bz2"))
4088 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4089 (build-system gnu-build-system)
4090 (home-page "https://www.netfilter.org/projects/libmnl/")
4091 (synopsis "Netlink utility library")
4092 (description "Libmnl is a minimalistic user-space library oriented to
4093 Netlink developers. There are a lot of common tasks in parsing, validating,
4094 constructing of both the Netlink header and TLVs that are repetitive and easy to
4095 get wrong. This library aims to provide simple helpers that allows you to
4096 re-use code and to avoid re-inventing the wheel.")
4097 (license license:lgpl2.1+)))
4099 (define-public libnftnl
4106 (uri (string-append "mirror://netfilter.org/libnftnl/"
4107 "libnftnl-" version ".tar.bz2"))
4110 "0d9nkdbdck8sg6msysqyv3m9kjr9sjif5amf26dfa0g3mqjdihgy"))))
4111 (build-system gnu-build-system)
4113 `(("pkg-config" ,pkg-config)))
4115 `(("libmnl" ,libmnl)))
4116 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4117 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4118 (description "Libnftnl is a userspace library providing a low-level netlink
4119 programming interface to the in-kernel nf_tables subsystem. The library
4120 libnftnl has been previously known as libnftables. This library is currently
4122 (license license:gpl2+)))
4124 (define-public nftables
4131 (uri (string-append "http://www.nftables.org/projects/nftables"
4132 "/files/nftables-" version ".tar.bz2"))
4135 "1i1gfy8l7qyhc5vlrpp63s0n5kybmc9pi4dywiq8rmkhrrnddsla"))))
4136 (build-system gnu-build-system)
4137 (inputs `(("bison" ,bison)
4141 ("libnftnl" ,libnftnl)
4142 ("readline" ,readline)))
4143 (native-inputs `(("pkg-config" ,pkg-config)))
4144 (home-page "http://www.nftables.org")
4145 (synopsis "Userspace utility for Linux packet filtering")
4146 (description "nftables is the project that aims to replace the existing
4147 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4148 filtering framework, a new userspace utility and also a compatibility layer for
4149 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4150 infrastructure such as the existing hooks, the connection tracking system, the
4151 userspace queueing component and the logging subsystem.")
4152 (license license:gpl2)))
4154 (define-public proot
4158 (home-page "https://github.com/proot-me/PRoot")
4161 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4162 (file-name (string-append name "-" version ".tar.gz"))
4165 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4166 (patches (search-patches "proot-test-fhs.patch"))))
4167 (build-system gnu-build-system)
4169 '(#:make-flags '("-C" "src")
4171 #:phases (modify-phases %standard-phases
4173 (add-before 'build 'set-shell-file-name
4174 (lambda* (#:key inputs #:allow-other-keys)
4175 (substitute* (find-files "src" "\\.[ch]$")
4178 (assoc-ref inputs "bash")
4181 (add-before 'check 'fix-fhs-assumptions-in-tests
4183 (substitute* "tests/test-c6b77b77.mk"
4184 (("/bin/bash") (which "bash"))
4185 (("/usr/bin/test") (which "test")))
4186 (substitute* '("tests/test-16573e73.c")
4187 (("/bin/([a-z-]+)" _ program)
4190 (substitute* (find-files "tests" "\\.sh$")
4191 ;; Some of the tests try to "bind-mount" /bin/true.
4193 (string-append "-b " (which "true") ":"))
4194 ;; Likewise for /bin.
4195 (("-b /bin:") "-b /gnu:")
4196 ;; Others try to run /bin/sh.
4197 (("/bin/sh") (which "sh"))
4198 ;; Others assume /etc/fstab exists.
4199 (("/etc/fstab") "/etc/passwd"))
4201 (substitute* "tests/GNUmakefile"
4202 (("-b /bin:") "-b /gnu:"))
4204 ;; XXX: This test fails in an obscure corner case, just
4206 (delete-file "tests/test-kkkkkkkk.c")
4211 (let ((n (parallel-job-count)))
4212 ;; For some reason we get lots of segfaults with
4213 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4214 (setenv "PROOT_NO_SECCOMP" "1")
4216 ;; Most of the tests expect "/bin" to be in $PATH so
4217 ;; they can run things that live in $ROOTFS/bin.
4219 (string-append (getenv "PATH") ":/bin"))
4221 (zero? (system* "make" "check" "-C" "tests"
4223 "-j" (number->string n))))))
4225 (lambda* (#:key outputs #:allow-other-keys)
4226 ;; The 'install' rule does nearly nothing.
4227 (let ((out (assoc-ref outputs "out")))
4229 ;; TODO: 'make install-care' (does not even
4230 ;; build currently.)
4231 (system* "make" "-C" "src" "install"
4232 (string-append "PREFIX=" out)))
4233 (let ((man1 (string-append out
4234 "/share/man/man1")))
4236 (copy-file "doc/proot/man.1"
4237 (string-append man1 "/proot.1"))
4239 (native-inputs `(("which" ,which)
4241 ;; For 'mcookie', used by some of the tests.
4242 ("util-linux" ,util-linux)))
4243 (inputs `(("talloc" ,talloc)))
4244 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4246 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4247 and @code{binfmt_misc}. This means that users don't need any privileges or
4248 setup to do things like using an arbitrary directory as the new root
4249 file system, making files accessible somewhere else in the file system
4250 hierarchy, or executing programs built for another CPU architecture
4251 transparently through QEMU user-mode. Also, developers can use PRoot as a
4252 generic process instrumentation engine thanks to its extension mechanism.
4253 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4254 available in the kernel Linux.")
4255 (license license:gpl2+)))
4257 (define-public proot-static
4260 (name "proot-static")
4262 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4263 (inputs `(("talloc" ,talloc/static)))
4265 (substitute-keyword-arguments (package-arguments proot)
4266 ((#:make-flags flags)
4267 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4269 `(modify-phases ,phases
4270 (add-after 'strip 'remove-store-references
4271 (lambda* (#:key outputs #:allow-other-keys)
4272 (let* ((out (assoc-ref outputs "out")))
4273 (with-directory-excursion out
4274 (remove-store-references "bin/proot")
4276 ((#:allowed-references _ '("out"))
4279 (define-public cpuid
4282 (version "20170122")
4285 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4286 version ".src.tar.gz"))
4289 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4290 (build-system gnu-build-system)
4292 '(#:make-flags '("CC=gcc")
4293 #:tests? #f ; no tests
4294 #:phases (modify-phases %standard-phases
4296 (add-before 'install 'fix-makefile
4297 (lambda* (#:key outputs #:allow-other-keys)
4298 (substitute* "Makefile"
4299 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4300 ;; Make the compressed manpages writable so that the
4301 ;; reset-gzip-timestamps phase does not error out.
4302 (substitute* "Makefile"
4303 (("-m 444") "-m 644"))
4305 (inputs `(("perl" ,perl)))
4306 (supported-systems '("i686-linux" "x86_64-linux"))
4307 (home-page "http://www.etallen.com/cpuid.html")
4308 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4309 (description "cpuid dumps detailed information about the CPU(s) gathered
4310 from the CPUID instruction, and also determines the exact model of CPU(s). It
4311 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4312 NexGen, Rise, and SiS CPUs.")
4313 (license license:gpl2+)))
4315 (define-public jmtpfs
4322 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4324 (file-name (string-append name "-" version ".tar.gz"))
4327 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4328 (build-system gnu-build-system)
4332 ("libmtp" ,libmtp)))
4334 `(("pkg-config" ,pkg-config)))
4335 (home-page "https://github.com/JasonFerrara/jmtpfs")
4336 (synopsis "Use a FUSE file system to access data over MTP")
4337 (description "jmtpfs uses FUSE (file system in userspace) to provide access
4338 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4339 the MTP device as a file system.")
4340 (license license:gpl3)))
4342 (define-public procenv
4349 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4351 (file-name (string-append name "-" version ".tar.gz"))
4353 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
4354 (build-system gnu-build-system)
4355 (arguments `(#:configure-flags '("--disable-silent-rules")))
4356 (native-inputs `(("pkg-config" ,pkg-config)))
4357 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4358 ("groff" ,groff) ; for tests
4359 ("libselinux" ,libselinux)))
4360 (synopsis "Utility to show process environment")
4361 (description "Procenv is a command-line tool that displays as much detail about
4362 itself and its environment as possible. It can be used as a test
4363 tool, to understand the type of environment a process runs in, and for
4364 comparing system environments.")
4365 (home-page "http://github.com/jamesodhunt/procenv/")
4366 (license license:gpl3+)))
4368 (define-public libfabric
4376 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4377 version "/libfabric-" version ".tar.bz2"))
4379 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4380 (build-system gnu-build-system)
4381 (inputs `(("rdma-core" ,rdma-core)
4382 ,@(match (%current-system)
4383 ((member (package-supported-systems psm))
4387 (home-page "https://ofiwg.github.io/libfabric/")
4388 (synopsis "Open Fabric Interfaces")
4390 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4391 communication services to applications. OFI is best described as a collection
4392 of libraries and applications used to export fabric services. The key
4393 components of OFI are: application interfaces, provider libraries, kernel
4394 services, daemons, and test applications.
4396 Libfabric is a core component of OFI. It is the library that defines and
4397 exports the user-space API of OFI, and is typically the only software that
4398 applications deal with directly. It works in conjunction with provider
4399 libraries, which are often integrated directly into libfabric.")
4400 (license (list license:bsd-2 license:gpl2)))) ;dual
4405 (version "3.3.20170428")
4406 (home-page "https://github.com/intel/psm")
4410 (uri (git-reference (url home-page)
4411 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
4412 (file-name (string-append "psm-" version ".tar.gz"))
4414 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
4415 (patches (search-patches
4416 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
4417 "psm-ldflags.patch" ; build shared lib with LDFLAGS
4418 "psm-repro.patch")))) ; reproducibility
4419 (build-system gnu-build-system)
4420 (inputs `(("libuuid" ,util-linux)))
4422 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
4423 ,(string-append "INSTALL_PREFIX=" %output)
4424 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4426 #:phases (modify-phases %standard-phases
4428 (add-after 'unpack 'patch-/usr/include
4430 (substitute* "Makefile"
4431 (("\\$\\{DESTDIR}/usr/include")
4432 (string-append %output "/include")))
4433 (substitute* "Makefile"
4434 (("/lib64") "/lib"))
4436 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
4438 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
4439 communications interface for the True Scale family of products. PSM users are
4440 enabled with mechanisms necessary to implement higher level communications
4441 interfaces in parallel environments.")
4442 ;; Only Intel-compatable processors are supported.
4443 (supported-systems '("i686-linux" "x86_64-linux"))
4444 (license (list license:bsd-2 license:gpl2)))) ;dual
4446 (define-public snapscreenshot
4448 (name "snapscreenshot")
4449 (version "1.0.14.3")
4453 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
4454 name "-" version ".tar.bz2"))
4456 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
4457 (build-system gnu-build-system)
4460 (let ((out (assoc-ref %outputs "out")))
4461 (list (string-append "BINDIR=" out "/bin")
4462 (string-append "MANDIR=" out "/share/man")))
4463 #:tests? #f ; no test suite
4465 (modify-phases %standard-phases
4466 (delete 'configure) ; ./configure is a snarky no-op
4467 (add-before 'install 'fix-ownership
4468 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
4470 (substitute* "depfun.mak"
4471 ((" -o bin -g bin ") " "))
4473 (add-before 'install 'create-output-directories
4474 (lambda* (#:key outputs #:allow-other-keys)
4475 (let ((out (assoc-ref outputs "out")))
4476 (mkdir-p (string-append out "/share/man/man1"))
4478 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
4479 (synopsis "Take screenshots of one or more Linux text consoles")
4481 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
4482 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
4483 relevant @file{/dev/vcs*} file(s).")
4484 (license license:gpl2)))
4486 (define-public fbcat
4493 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
4494 version "/" name "-" version ".tar.gz"))
4496 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
4497 (build-system gnu-build-system)
4499 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
4500 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
4501 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
4502 `(("pnmtopng" ,netpbm)))
4503 (outputs (list "out" "fbgrab"))
4507 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4508 #:tests? #f ; no tests
4510 (modify-phases %standard-phases
4511 (delete 'configure) ; no configure script
4512 (add-after 'build 'qualify-references
4513 (lambda* (#:key inputs outputs #:allow-other-keys)
4514 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
4515 (out (assoc-ref outputs "out")))
4516 (substitute* "fbgrab"
4518 (string-append out "/bin/" all))
4520 (string-append pnmtopng "/bin/" all)))
4522 (add-after 'install 'split-fbgrab-output
4523 (lambda* (#:key outputs #:allow-other-keys)
4524 (let* ((out (assoc-ref outputs "out"))
4525 (out:fbgrab (assoc-ref outputs "fbgrab")))
4526 (for-each (lambda (file)
4527 (let ((old (string-append out "/" file))
4528 (new (string-append out:fbgrab "/" file)))
4529 (mkdir-p (dirname new))
4530 (rename-file old new)))
4532 "share/man/man1/fbgrab.1"))
4534 (home-page "https://jwilk.net/software/fbcat")
4535 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
4537 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
4538 a dump therof. It supports a wide range of drivers and pixel formats.
4539 @command{fbcat} can take screenshots of virtually any application that can be
4540 made to write its output to the framebuffer, including (but not limited to)
4541 text-mode or graphical applications that don't use a display server.
4543 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
4544 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
4545 (license license:gpl2)))