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 ng0 <ng0@infotropique.org>
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 "0z8hq8a6ic38xh33idzl0k0yi4isgd7ncl2g1d6mzf9ixw5krhvc"))))
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 (and (zero? (system* "make" defconfig))
188 (zero? (system* "make" "mrproper" "headers_check"))))))
190 (lambda* (#:key outputs #:allow-other-keys)
191 (let ((out (assoc-ref outputs "out")))
192 (and (zero? (system* "make"
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.5")
387 (define %linux-libre-hash "1vrqya5zkhzl37fpj5v0v1igm7jf2gi13apkpak90l51xiw592cs")
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.21")
396 (define %linux-libre-4.14-hash "07d27mph514jxxkzil4b3c848ywfd4r4js0wl5wsfy7a3j757278")
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.83"
406 "09mw2r2fbn0g6xfhyxk0n54c7sg0vk9nlp7k2ca3v0v24n7lrfza"
407 %intel-compatible-systems
408 #:configuration-file kernel-config))
410 (define-public linux-libre-4.4
411 (make-linux-libre "4.4.117"
412 "1mlq9npyriwj0wpj24zah55bkxil31l182ypbn6b3x4yvmr8lhz0"
413 %intel-compatible-systems
414 #:configuration-file kernel-config))
416 (define-public linux-libre-4.1
417 (make-linux-libre "4.1.49"
418 "0dklmqj6ayjlkz97b811zdvpgb3yppahinji9l9jmkz4ssi7a1gs"
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 (modules '((guix build utils)))
562 ;; We take the 'logger' program from GNU Inetutils and 'kill'
563 ;; from GNU Coreutils.
565 (substitute* "configure"
566 (("build_logger=yes") "build_logger=no")
567 (("build_kill=yes") "build_kill=no"))
569 (build-system gnu-build-system)
571 "static")) ; >2 MiB of static .a libraries
573 `(#:configure-flags (list "--disable-use-tty-group"
574 "--enable-fs-paths-default=/run/current-system/profile/sbin"
575 ;; Don't try to chown root:root mount and umount
576 "--disable-makeinstall-chown"
577 ;; Install completions where our
578 ;; bash-completion package expects them.
579 (string-append "--with-bashcompletiondir="
580 (assoc-ref %outputs "out")
581 "/etc/bash_completion.d"))
582 #:phases (modify-phases %standard-phases
584 'build 'set-umount-file-name
585 (lambda* (#:key outputs #:allow-other-keys)
586 ;; Tell 'eject' the right file name of 'umount'.
587 (let ((out (assoc-ref outputs "out")))
588 (substitute* "sys-utils/eject.c"
590 (string-append "\"" out "/bin/umount\"")))
594 (lambda* (#:key inputs outputs #:allow-other-keys)
595 (let ((out (assoc-ref outputs "out"))
596 (net (assoc-ref inputs "net-base")))
597 ;; Change the test to refer to the right file.
598 (substitute* "tests/ts/misc/mcookie"
600 (string-append net "/etc/services")))
603 'install 'move-static-libraries
604 (lambda* (#:key outputs #:allow-other-keys)
605 (let ((out (assoc-ref outputs "out"))
606 (static (assoc-ref outputs "static")))
607 (mkdir-p (string-append static "/lib"))
608 (with-directory-excursion out
609 (for-each (lambda (file)
611 (string-append static "/"
613 (find-files "lib" "\\.a$")))
615 (inputs `(("zlib" ,zlib)
618 ;; XXX: This is so that the 'pre-check' phase can find it.
619 ,@(if (%current-target-system)
620 `(("net-base" ,net-base))
624 ("net-base" ,net-base))) ;for tests
625 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
626 (synopsis "Collection of utilities for the Linux kernel")
627 (description "Util-linux is a diverse collection of Linux kernel
628 utilities. It provides dmesg and includes tools for working with file systems,
629 block devices, UUIDs, TTYs, and many other tools.")
631 ;; Note that util-linux doesn't use the same license for all the
632 ;; code. GPLv2+ is the default license for a code without an
633 ;; explicitly defined license.
634 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
635 license:bsd-4 license:public-domain))))
643 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
645 (file-name (string-append name "-" version ".tar.gz"))
647 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
648 (build-system cmake-build-system)
649 (arguments '(#:tests? #f))
650 (home-page "https://github.com/bo0ts/ddate")
651 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
653 "ddate displays the Discordian date and holidays of a given date.
654 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
655 by Robert Shea and Robert Anton Wilson.")
656 (license license:public-domain)))
658 (define-public procps
664 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
665 "procps-ng-" version ".tar.xz"))
668 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
669 (build-system gnu-build-system)
671 '(#:modules ((guix build utils)
672 (guix build gnu-build-system)
676 (modify-phases %standard-phases
677 (add-before 'check 'disable-strtod-test
679 ;; Disable the 'strtod' test, which fails on 32-bit systems.
680 ;; This is what upstream does:
681 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
682 (substitute* "Makefile"
683 (("^(TESTS|check_PROGRAMS) = .*$" all)
684 (string-append "# " all "\n")))
687 'install 'post-install
688 ;; Remove commands and man pages redudant with
690 (lambda* (#:key outputs #:allow-other-keys)
691 (let* ((out (assoc-ref outputs "out"))
692 (dup (append-map (cut find-files out <>)
693 '("^kill" "^uptime"))))
694 (for-each delete-file dup)
696 (inputs `(("ncurses" ,ncurses)))
697 (home-page "https://gitlab.com/procps-ng/procps/")
698 (synopsis "Utilities that give information about processes")
700 "Procps is the package that has a bunch of small useful utilities
701 that give information about processes using the Linux /proc file system.
702 The package includes the programs ps, top, vmstat, w, kill, free,
703 slabtop, and skill.")
704 (license license:gpl2)))
706 (define-public usbutils
713 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
714 "usbutils-" version ".tar.xz"))
717 "0q3iavmak2bs9xw486w4xfbjl0hbzii93ssgpr95mxmm9kjz1gwb"))))
718 (build-system gnu-build-system)
723 `(("pkg-config" ,pkg-config)))
724 (home-page "http://www.linux-usb.org/")
726 "Tools for working with USB devices, such as lsusb")
728 "Tools for working with USB devices, such as lsusb.")
729 (license license:gpl2+)))
731 (define-public e2fsprogs
738 "mirror://kernel.org/linux/kernel/people/tytso/"
739 name "/v" version "/"
740 name "-" version ".tar.xz"))
743 "00ilv65dzcgiap435j89xk86shf7rrav3wsik7cahy789qijdcn9"))))
744 (build-system gnu-build-system)
745 (inputs `(("util-linux" ,util-linux)))
746 (native-inputs `(("pkg-config" ,pkg-config)
747 ("texinfo" ,texinfo) ;for the libext2fs Info manual
753 '(;; util-linux is the preferred source for some of the libraries and
754 ;; commands, so disable them (see, e.g.,
755 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
756 #:configure-flags (list "--disable-libblkid"
757 "--disable-libuuid" "--disable-uuidd"
760 ;; Use symlinks instead of hard links for
761 ;; 'fsck.extN' etc. This makes the resulting nar
762 ;; smaller and is preserved across copies.
763 "--enable-symlink-install"
765 (string-append "LDFLAGS=-Wl,-rpath="
766 (assoc-ref %outputs "out")
769 ;; Install libext2fs et al.
770 "--enable-elf-shlibs")
773 (modify-phases %standard-phases
774 (add-before 'configure 'patch-shells
776 (substitute* "configure"
777 (("/bin/sh (.*)parse-types.sh" _ dir)
778 (string-append (which "sh") " " dir
780 (substitute* "MCONFIG.in"
781 (("INSTALL_SYMLINK = /bin/sh")
782 "INSTALL_SYMLINK = sh"))
783 (substitute* (find-files "." "^Makefile.in$")
785 (string-append "#!" (which "sh"))))
787 (add-after 'install 'install-libs
788 (lambda* (#:key outputs #:allow-other-keys)
789 (let* ((out (assoc-ref outputs "out"))
790 (lib (string-append out "/lib")))
791 (and (zero? (system* "make" "install-libs"))
793 ;; Make the .a writable so that 'strip' works.
794 ;; Failing to do that, due to debug symbols, we
795 ;; retain a reference to the final
796 ;; linux-libre-headers, which refer to the
797 ;; bootstrap binaries.
798 (let ((archives (find-files lib "\\.a$")))
799 (for-each (lambda (file)
803 (home-page "http://e2fsprogs.sourceforge.net/")
804 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
806 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
807 (license (list license:gpl2 ;programs
808 license:lgpl2.0 ;libext2fs
809 license:x11)))) ;libuuid
811 (define e2fsprogs/static
813 (package (inherit e2fsprogs)
815 ;; Do not build shared libraries.
816 (substitute-keyword-arguments (package-arguments e2fsprogs)
817 ((#:configure-flags _)
818 '(list "--disable-blkid"))
822 (define-public e2fsck/static
824 (name "e2fsck-static")
825 (version (package-version e2fsprogs))
826 (build-system trivial-build-system)
829 `(("e2fsprogs" ,e2fsprogs/static)))
831 `(#:modules ((guix build utils))
834 (use-modules (guix build utils)
838 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
840 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
842 (with-directory-excursion bin
843 (copy-file e2fsck "e2fsck")
844 (remove-store-references "e2fsck")
845 (chmod "e2fsck" #o555))))))
846 (home-page (package-home-page e2fsprogs))
847 (synopsis "Statically-linked e2fsck command from e2fsprogs")
848 (description "This package provides statically-linked e2fsck command taken
849 from the e2fsprogs package. It is meant to be used in initrds.")
850 (license (package-license e2fsprogs))))
852 (define-public extundelete
858 (uri (string-append "mirror://sourceforge/extundelete/"
859 "extundelete/" version "/extundelete-"
863 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
864 (build-system gnu-build-system)
865 (inputs `(("e2fsprogs" ,e2fsprogs)))
866 (home-page "http://extundelete.sourceforge.net/")
867 (synopsis "Recover deleted files from ext2/3/4 partitions")
869 "Extundelete is a set of tools that can recover deleted files from an
870 ext3 or ext4 partition.")
871 (license license:gpl2)))
873 (define-public zerofree
877 (home-page "https://frippery.org/uml/")
880 (uri (string-append home-page name "-" version
884 "059g29x5r1xj6wcj4xj85l8w6qrxyl86yqbybjqqz6nxz4falxzf"))))
885 (build-system gnu-build-system)
888 (modify-phases %standard-phases
889 (delete 'configure) ; no configure script
891 ;; The Makefile lacks an ‘install’ target.
892 (lambda* (#:key outputs #:allow-other-keys)
893 (let* ((out (assoc-ref outputs "out"))
894 (bin (string-append out "/bin")))
895 (chmod "zerofree" #o555)
896 (install-file "zerofree" bin)
898 #:tests? #f)) ; no tests
899 (inputs `(("libext2fs" ,e2fsprogs)))
900 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
902 "Zerofree finds the unallocated blocks with non-zero value content in an
903 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
904 This is a simple way to make disk images more compressible.
905 Zerofree requires the file system to be unmounted or mounted read-only.")
906 (license license:gpl2)))
908 (define-public strace
914 (uri (string-append "https://github.com/strace/strace/releases/"
915 "download/v" version "/strace-" version ".tar.xz"))
918 "0dsw6xcfrmygidp1dj2ch8cl8icrar7789snkb2r8gh78kdqhxjw"))))
919 (build-system gnu-build-system)
922 (modify-phases %standard-phases
923 (add-after 'unpack 'patch-/bin/sh
925 (substitute* "strace.c"
926 (("/bin/sh") (which "sh")))
928 (native-inputs `(("perl" ,perl)))
929 (home-page "https://strace.io/")
930 (synopsis "System call tracer for Linux")
932 "strace is a system call tracer, i.e. a debugging tool which prints out a
933 trace of all the system calls made by a another process/program.")
934 (license license:bsd-3)))
936 (define-public ltrace
942 (uri (string-append "http://www.ltrace.org/ltrace_" version
946 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
947 (build-system gnu-build-system)
948 (inputs `(("libelf" ,libelf)))
950 ;; Compilation uses -Werror by default, but it fails.
951 '(#:configure-flags '("--disable-werror")))
952 (home-page "https://www.ltrace.org/")
953 (synopsis "Library call tracer for Linux")
955 "ltrace intercepts and records dynamic library calls which are called by
956 an executed process and the signals received by that process. It can also
957 intercept and print the system calls executed by the program.")
958 (license license:gpl2+)))
960 (define-public alsa-lib
967 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
971 "0xjvi381105gldhv0z872a0x58sghznyx19j45lw5iyi2h68gfwi"))))
972 (build-system gnu-build-system)
973 (home-page "https://www.alsa-project.org/")
974 (synopsis "The Advanced Linux Sound Architecture libraries")
976 "The Advanced Linux Sound Architecture (ALSA) provides audio and
977 MIDI functionality to the Linux-based operating system.")
978 (license license:lgpl2.1+)))
980 (define-public alsa-utils
986 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
987 name "-" version ".tar.bz2"))
990 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
991 (build-system gnu-build-system)
993 ;; XXX: Disable man page creation until we have DocBook.
994 '(#:configure-flags (list "--disable-xmlto"
996 ;; The udev rule is responsible for restoring
998 (string-append "--with-udev-rules-dir="
999 (assoc-ref %outputs "out")
1000 "/lib/udev/rules.d"))
1002 (modify-phases %standard-phases
1004 'install 'pre-install
1006 ;; Don't try to mkdir /var/lib/alsa.
1007 (substitute* "Makefile"
1008 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1012 `(("libsamplerate" ,libsamplerate)
1013 ("ncurses" ,ncurses)
1014 ("alsa-lib" ,alsa-lib)
1016 ("gettext" ,gettext-minimal)))
1017 (home-page "http://www.alsa-project.org/")
1018 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1020 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1021 MIDI functionality to the Linux-based operating system.")
1023 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1025 (license license:gpl2)))
1027 (define-public alsa-plugins
1029 (name "alsa-plugins")
1033 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1034 name "-" version ".tar.bz2"))
1037 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
1038 (build-system gnu-build-system)
1039 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1040 ;; be split, there are references to both in files.
1041 ;; TODO: Remove OSS related plugins, they add support to run native
1042 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1044 (outputs '("out" "pulseaudio"))
1047 (modify-phases %standard-phases
1048 (add-after 'install 'split
1049 (lambda* (#:key inputs outputs #:allow-other-keys)
1050 ;; Distribute the binaries to the various outputs.
1051 (let* ((out (assoc-ref outputs "out"))
1052 (pua (assoc-ref outputs "pulseaudio"))
1053 (pualib (string-append pua "/lib/alsa-lib"))
1054 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
1057 (chdir (string-append out "/share"))
1058 (for-each (lambda (file)
1059 (rename-file file (string-append puaconf "/" (basename file))))
1060 (find-files out "\\.(conf|example)"))
1061 (for-each (lambda (file)
1062 (rename-file file (string-append pualib "/" (basename file))))
1063 (find-files out ".*pulse\\.(la|so)"))
1065 ;; We have moved the files to output pulsaudio, the
1066 ;; directory is now empty.
1067 (delete-file-recursively (string-append out "/share"))
1070 `(("alsa-lib" ,alsa-lib)
1071 ("speex" ,speex) ; libspeexdsp resampling plugin
1072 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1073 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1074 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1076 `(("pkg-config" ,pkg-config)))
1077 (home-page "http://www.alsa-project.org/")
1078 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1080 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1081 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1082 by providing additional plugins which include: upmixing, downmixing, jackd and
1083 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1084 external rate conversion.")
1085 (license (list license:gpl2+
1086 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1087 license:lgpl2.1+))))
1089 (define-public iptables
1096 "mirror://netfilter.org/iptables/iptables-"
1097 version ".tar.bz2"))
1100 "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
1101 (build-system gnu-build-system)
1103 `(("pkg-config" ,pkg-config)
1107 `(("libmnl" ,libmnl)
1108 ("libnftnl" ,libnftnl)))
1110 '(#:tests? #f ; no test suite
1111 #:configure-flags ; add $libdir to the RUNPATH of executables
1112 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1113 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1114 (synopsis "Programs to configure Linux IP packet filtering rules")
1116 "@command{iptables} is the user-space command line program used to
1117 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1118 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1120 This package also includes @command{ip6tables}, which is used to configure the
1123 Both commands are targeted at system administrators.
1125 (license license:gpl2+)))
1127 (define-public ebtables
1130 (version "2.0.10-4")
1134 "mirror://netfilter.org/ebtables/ebtables-v"
1138 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1139 (build-system gnu-build-system)
1141 '(#:tests? #f ; no test suite
1143 (let* ((out (assoc-ref %outputs "out"))
1144 (bin (string-append out "/sbin"))
1145 (lib (string-append out "/lib"))
1146 (man (string-append out "/share/man"))
1147 (iptables (assoc-ref %build-inputs "iptables"))
1148 (ethertypes (string-append iptables "/etc/ethertypes")))
1149 (list (string-append "LIBDIR=" lib)
1150 (string-append "MANDIR=" man)
1151 (string-append "BINDIR=" bin)
1152 (string-append "ETHERTYPESFILE=" ethertypes)
1153 ;; With the default CFLAGS, it falis with:
1154 ;; communication.c:259:58: error: variable ‘ret’ set but not
1155 ;; used [-Werror=unused-but-set-variable]
1158 (modify-phases %standard-phases
1160 ;; no configure script
1162 (substitute* "Makefile"
1163 ;; Remove user and group options from install commands,
1164 ;; otherwise it fails with: invalid user 'root'.
1165 (("-o root -g root") "")
1166 ;; Remove 'ethertypes' from the install target.
1168 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1172 ("iptables" ,iptables)))
1173 (synopsis "Ethernet bridge frame table administration")
1174 (home-page "http://ebtables.netfilter.org/")
1176 "ebtables is an application program used to set up and maintain the
1177 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1178 analogous to the iptables application, but less complicated, due to the fact
1179 that the Ethernet protocol is much simpler than the IP protocol.")
1180 (license license:gpl2+)))
1182 (define-public iproute
1189 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1193 "0mc3g4kj7h3jhwz2b2gdf41gp6bhqn7axh4mnyvhkdnpk5m63m28"))))
1194 (build-system gnu-build-system)
1196 `(#:tests? #f ; no test suite
1197 #:make-flags (let ((out (assoc-ref %outputs "out")))
1199 (string-append "BASH_COMPDIR=" out
1200 "/etc/bash_completion.d")
1201 (string-append "LIBDIR=" out "/lib")
1202 (string-append "HDRDIR=" out "/include")
1203 (string-append "SBINDIR=" out "/sbin")
1204 (string-append "CONFDIR=" out "/etc")
1205 (string-append "DOCDIR=" out "/share/doc/"
1207 (string-append "MANDIR=" out "/share/man")))
1208 #:phases (modify-phases %standard-phases
1209 (add-before 'install 'pre-install
1211 ;; Don't attempt to create /var/lib/arpd.
1212 (substitute* "Makefile"
1213 (("^.*ARPDDIR.*$") "")))))))
1215 `(("iptables" ,iptables)
1218 `(("pkg-config" ,pkg-config)
1222 "https://wiki.linuxfoundation.org/networking/iproute2")
1224 "Utilities for controlling TCP/IP networking and traffic in Linux")
1226 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1227 and traffic with the Linux kernel. The most important of these are
1228 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1231 Most network configuration manuals still refer to ifconfig and route as the
1232 primary network configuration tools, but ifconfig is known to behave
1233 inadequately in modern network environments, and both should be deprecated.")
1234 (license license:gpl2+)))
1236 (define-public net-tools
1237 ;; XXX: This package is basically unmaintained, but it provides a few
1238 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1240 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1244 (version (string-append "1.60-" revision "." (string-take commit 7)))
1247 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1248 "n/ne/net-tools/code.git/net-tools-code-"
1250 (file-name (string-append name "-" version ".zip"))
1253 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1254 (home-page "http://net-tools.sourceforge.net/")
1255 (build-system gnu-build-system)
1257 '(#:modules ((guix build gnu-build-system)
1262 (modify-phases %standard-phases
1264 (lambda* (#:key outputs #:allow-other-keys)
1265 (let ((out (assoc-ref outputs "out")))
1266 (mkdir-p (string-append out "/bin"))
1267 (mkdir-p (string-append out "/sbin"))
1269 ;; Pretend we have everything...
1270 (system "yes | make config")
1272 ;; ... except for the things we don't have.
1273 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1274 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1275 ;; that have been removed.
1276 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1277 ;; think about adding them later.
1278 (substitute* '("config.make" "config.h")
1279 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1281 (add-after 'install 'remove-redundant-commands
1282 (lambda* (#:key outputs #:allow-other-keys)
1283 ;; Remove commands and man pages redundant with Inetutils.
1284 (let* ((out (assoc-ref outputs "out"))
1285 (dup (append-map (cut find-files out <>)
1287 "^(yp|nis|dns)?domainname"))))
1288 (for-each delete-file dup)
1290 ;; Binaries that depend on libnet-tools.a don't declare that
1291 ;; dependency, making it parallel-unsafe.
1292 #:parallel-build? #f
1294 #:tests? #f ; no test suite
1295 #:make-flags (let ((out (assoc-ref %outputs "out")))
1297 (string-append "BASEDIR=" out)
1298 (string-append "INSTALLNLSDIR=" out "/share/locale")
1299 (string-append "mandir=/share/man")))))
1300 (native-inputs `(("gettext" ,gettext-minimal)
1302 (synopsis "Tools for controlling the network subsystem in Linux")
1304 "This package includes the important tools for controlling the network
1305 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1306 route. Additionally, this package contains utilities relating to particular
1307 network hardware types (plipconfig, slattach) and advanced aspects of IP
1308 configuration (iptunnel, ipmaddr).")
1309 (license license:gpl2+))))
1311 (define-public libcap
1318 "mirror://kernel.org/linux/libs/security/linux-privs/"
1319 "libcap2/libcap-" version ".tar.xz"))
1322 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1323 (build-system gnu-build-system)
1324 (arguments '(#:phases
1325 (modify-phases %standard-phases
1327 ;; Add $libdir to the RUNPATH of executables.
1329 (substitute* "Make.Rules"
1331 (string-append "LDFLAGS := -Wl,-rpath="
1332 %output "/lib"))))))
1333 #:tests? #f ; no 'check' target
1334 #:make-flags (list "lib=lib"
1335 (string-append "prefix="
1336 (assoc-ref %outputs "out"))
1337 "RAISE_SETFCAP=no")))
1338 (native-inputs `(("perl" ,perl)))
1339 (inputs `(("attr" ,attr)))
1340 (home-page "https://sites.google.com/site/fullycapable/")
1341 (synopsis "Library for working with POSIX capabilities")
1343 "Libcap2 provides a programming interface to POSIX capabilities on
1344 Linux-based operating systems.")
1346 ;; License is BSD-3 or GPLv2, at the user's choice.
1347 (license license:gpl2)))
1349 (define-public bridge-utils
1351 (name "bridge-utils")
1355 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1356 "bridge-utils-" version ".tar.gz"))
1359 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1360 (build-system gnu-build-system)
1362 ;; The tarball lacks all the generated files.
1363 (native-inputs `(("autoconf" ,autoconf)
1364 ("automake" ,automake)))
1367 (modify-phases %standard-phases
1368 (add-before 'bootstrap 'patch-stuff
1370 ;; Fix "field ‘ip6’ has incomplete type" errors.
1371 (substitute* "libbridge/libbridge.h"
1372 (("#include <linux/if_bridge.h>")
1373 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1375 ;; Ensure that the entire build fails if one of the
1376 ;; sub-Makefiles fails.
1377 (substitute* "Makefile.in"
1378 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1379 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1382 #:tests? #f)) ; no 'check' target
1385 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1386 (synopsis "Manipulate Ethernet bridges")
1388 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1389 to connect two Ethernet segments together in a protocol independent way.
1390 Packets are forwarded based on Ethernet address, rather than IP address (like
1391 a router). Since forwarding is done at Layer 2, all protocols can go
1392 transparently through a bridge.")
1393 (license license:gpl2+)))
1395 (define-public libnl
1402 "https://github.com/thom311/libnl/releases/download/"
1403 "libnl" (string-join (string-split version #\.) "_")
1404 "/libnl-" version ".tar.gz"))
1407 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
1408 (build-system gnu-build-system)
1412 ("pkg-config" ,pkg-config)
1418 "https://github.com/thom311/libnl/releases/download/libnl"
1419 (string-join (string-split version #\.) "_")
1420 "/libnl-doc-" version ".tar.gz"))
1422 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
1424 `(("python-2" ,python-2)
1425 ("python-3" ,python-3)))
1426 (outputs '("out" "doc" "python2" "python3"))
1428 `(#:modules ((guix build gnu-build-system)
1432 (modify-phases %standard-phases
1433 (add-after 'install 'install-python
1434 (lambda* (#:key outputs #:allow-other-keys)
1435 (define (python-inst python)
1436 (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
1437 (assoc-ref %outputs "out")))
1438 (pyout (assoc-ref %outputs python)))
1440 (zero? (system (format #f "~a ~a setup.py build"
1441 ldflags python pyout)))
1443 (system (format #f "~a ~a setup.py install --prefix=~a"
1444 ldflags python pyout)))
1445 (zero? (system* python "setup.py" "clean")))))
1446 (with-directory-excursion "./python"
1447 (every python-inst '("python2" "python3")))))
1448 (add-after 'install 'install-doc
1449 (lambda* (#:key inputs outputs #:allow-other-keys)
1450 (let ((dest (string-append (assoc-ref outputs "doc")
1451 "/share/doc/libnl")))
1453 (zero? (system* "tar" "xf" (assoc-ref inputs "libnl3-doc")
1454 "--strip-components=1" "-C" dest))))))))
1455 (home-page "https://www.infradead.org/~tgr/libnl/")
1456 (synopsis "NetLink protocol library suite")
1458 "The libnl suite is a collection of libraries providing APIs to netlink
1459 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1460 between the kernel and user space processes. It was designed to be a more
1461 flexible successor to ioctl to provide mainly networking related kernel
1462 configuration and monitoring interfaces.")
1464 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1465 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1466 (license license:gpl2)))
1475 "mirror://kernel.org/software/network/iw/iw-"
1479 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
1480 (build-system gnu-build-system)
1481 (native-inputs `(("pkg-config" ,pkg-config)))
1482 (inputs `(("libnl" ,libnl)))
1484 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1486 #:phases (modify-phases %standard-phases (delete 'configure))))
1487 (home-page "https://wireless.wiki.kernel.org/")
1488 (synopsis "Tool for configuring wireless devices")
1490 "iw is a new nl80211 based CLI configuration utility for wireless
1491 devices. It replaces @code{iwconfig}, which is deprecated.")
1492 (license license:isc)))
1494 (define-public powertop
1502 "https://01.org/sites/default/files/downloads/powertop/powertop-v"
1506 "0l4jjlf05li2mc6g8nrss3h435wjhmnqd8m7v3kha3x0x7cbfzxa"))))
1507 (build-system gnu-build-system)
1510 (modify-phases %standard-phases
1511 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1512 ;; allow calibrating the network interface in GuixSD.
1513 (add-after 'unpack 'patch-absolute-file-names
1514 (lambda* (#:key inputs #:allow-other-keys)
1515 (let ((kmod (assoc-ref inputs "kmod")))
1516 (substitute* (find-files "src" "\\.cpp$")
1517 ;; Give the right 'modprobe' file name so that essential
1518 ;; modules such as msr.ko can be loaded.
1519 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1520 ;; These programs are only needed to calibrate, so using
1521 ;; relative file names avoids adding extra inputs. When they
1522 ;; are missing powertop gracefully handles it.
1523 (("/usr/bin/hcitool") "hcitool")
1524 (("/usr/bin/xset") "xset")
1525 (("/usr/sbin/hciconfig") "hciconfig"))
1530 ("ncurses" ,ncurses)
1531 ("pciutils" ,pciutils)
1534 `(("pkg-config" ,pkg-config)))
1535 (home-page "https://01.org/powertop/")
1536 (synopsis "Analyze power consumption on Intel-based laptops")
1538 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1539 power management. In addition to being a diagnostic tool, PowerTOP also has
1540 an interactive mode where the user can experiment various power management
1541 settings for cases where the operating system has not enabled these
1543 (license license:gpl2)))
1545 (define-public aumix
1552 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1553 version ".tar.bz2"))
1556 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1557 (build-system gnu-build-system)
1558 (inputs `(("ncurses" ,ncurses)))
1559 (home-page "http://www.jpj.net/~trevor/aumix.html")
1560 (synopsis "Audio mixer for X and the console")
1562 "Aumix adjusts an audio mixer from X, the console, a terminal,
1563 the command line or a script.")
1564 (license license:gpl2+)))
1566 (define-public iotop
1573 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1576 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1577 (build-system python-build-system)
1579 ;; The setup.py script expects python-2.
1580 `(#:python ,python-2
1581 ;; There are currently no checks in the package.
1583 (native-inputs `(("python" ,python-2)))
1584 (home-page "http://guichaz.free.fr/iotop/")
1586 "Displays the IO activity of running processes")
1588 "Iotop is a Python program with a top like user interface to show the
1589 processes currently causing I/O.")
1590 (license license:gpl2+)))
1598 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1599 "download/fuse-" version
1600 "/fuse-" version ".tar.gz"))
1603 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1604 (patches (search-patches "fuse-overlapping-headers.patch"))))
1605 (build-system gnu-build-system)
1606 (inputs `(("util-linux" ,util-linux)))
1608 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1609 (assoc-ref %outputs "out")
1611 (string-append "INIT_D_PATH="
1612 (assoc-ref %outputs "out")
1615 ;; The rule makes /dev/fuse 666.
1616 (string-append "UDEV_RULES_PATH="
1617 (assoc-ref %outputs "out")
1618 "/lib/udev/rules.d"))
1620 (modify-phases %standard-phases
1621 (add-before 'build 'set-file-names
1622 (lambda* (#:key inputs #:allow-other-keys)
1623 ;; libfuse calls out to mount(8) and umount(8). Make sure
1624 ;; it refers to the right ones.
1625 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1626 (("/bin/(u?)mount" _ maybe-u)
1627 (string-append (assoc-ref inputs "util-linux")
1628 "/bin/" maybe-u "mount")))
1629 (substitute* '("util/mount.fuse.c")
1633 ;; This hack leads libfuse to search for 'fusermount' in
1634 ;; $PATH, where it may find a setuid-root binary, instead of
1635 ;; trying solely $out/sbin/fusermount and failing because
1637 (substitute* "lib/Makefile"
1638 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1639 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
1641 (home-page "https://github.com/libfuse/libfuse")
1642 (synopsis "Support file systems implemented in user space")
1644 "As a consequence of its monolithic design, file system code for Linux
1645 normally goes into the kernel itself---which is not only a robustness issue,
1646 but also an impediment to system extensibility. FUSE, for \"file systems in
1647 user space\", is a kernel module and user-space library that tries to address
1648 part of this problem by allowing users to run file system implementations as
1649 user-space processes.")
1650 (license (list license:lgpl2.1 ;library
1651 license:gpl2+)))) ;command-line utilities
1653 (define-public unionfs-fuse
1655 (name "unionfs-fuse")
1660 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1662 (file-name (string-append name "-" version ".tar.gz"))
1665 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1666 (build-system cmake-build-system)
1668 `(("python" ,python)))
1669 (inputs `(("fuse" ,fuse)))
1671 ;; The tests were never actually run ("collected 0 items"), but in recent
1672 ;; versions of pytest that causes an error.
1674 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1675 (synopsis "User-space union file system")
1677 "UnionFS-FUSE is a flexible union file system implementation in user
1678 space, using the FUSE library. Mounting a union file system allows you to
1679 \"aggregate\" the contents of several directories into a single mount point.
1680 UnionFS-FUSE additionally supports copy-on-write.")
1681 (license license:bsd-3)))
1684 (package (inherit fuse)
1685 (name "fuse-static")
1686 (source (origin (inherit (package-source fuse))
1687 (modules '((guix build utils)))
1689 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1690 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1691 ;; it doesn't do that, allowing us to remove the dependency on
1692 ;; util-linux (something that is useful in initrds.)
1693 '(substitute* '("lib/mount_util.c"
1694 "util/mount_util.c")
1695 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1700 (define-public unionfs-fuse/static
1701 (package (inherit unionfs-fuse)
1702 (synopsis "User-space union file system (statically linked)")
1703 (name (string-append (package-name unionfs-fuse) "-static"))
1704 (source (origin (inherit (package-source unionfs-fuse))
1705 (modules '((guix build utils)))
1707 ;; Add -ldl to the libraries, because libfuse.a needs that.
1708 '(substitute* "src/CMakeLists.txt"
1709 (("target_link_libraries(.*)\\)" _ libs)
1710 (string-append "target_link_libraries"
1714 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1716 (modify-phases %standard-phases
1717 (add-after 'install 'post-install
1718 (lambda* (#:key outputs #:allow-other-keys)
1719 (let* ((out (assoc-ref outputs "out"))
1720 (exe (string-append out "/bin/unionfs")))
1721 ;; By default, 'unionfs' keeps references to
1722 ;; $glibc/share/locale and similar stuff. Remove them.
1723 (remove-store-references exe)
1725 ;; 'unionfsctl' has references to glibc as well. Since
1726 ;; we don't need it, remove it.
1727 (delete-file (string-append out "/bin/unionfsctl"))
1729 (inputs `(("fuse" ,fuse-static)))))
1731 (define-public sshfs-fuse
1737 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1738 "download/sshfs-" version "/sshfs-" version
1742 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
1743 (build-system gnu-build-system)
1748 `(("pkg-config" ,pkg-config)))
1749 (home-page "https://github.com/libfuse/sshfs")
1750 (synopsis "Mount remote file systems over SSH")
1752 "This is a file system client based on the SSH File Transfer Protocol.
1753 Since most SSH servers already support this protocol it is very easy to set
1754 up: on the server side there's nothing to do; on the client side mounting the
1755 file system is as easy as logging into the server with an SSH client.")
1756 (license license:gpl2+)))
1758 (define-public archivemount
1760 (name "archivemount")
1765 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1766 "archivemount-" version ".tar.gz"))
1769 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1770 (build-system gnu-build-system)
1771 (inputs `(("fuse", fuse)
1772 ("libarchive", libarchive)))
1773 (native-inputs `(("pkg-config", pkg-config)))
1774 (home-page "http://www.cybernoia.de/software/archivemount")
1775 (synopsis "Tool for mounting archive files with FUSE")
1776 (description "archivemount is a FUSE-based file system for Unix variants,
1777 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1778 mount point where it can be read from or written to as with any other file
1779 system. This makes accessing the contents of the archive, which may be
1780 compressed, transparent to other programs, without decompressing them.")
1781 (license license:lgpl2.0+)))
1783 (define-public numactl
1790 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1795 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1796 (build-system gnu-build-system)
1798 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1799 ;; to run, which we can't assume to have.
1802 ;; NUMA is apparently not supported on armhf, see
1803 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1804 (supported-systems (delete "armhf-linux" %supported-systems))
1805 (home-page "http://oss.sgi.com/projects/libnuma/")
1806 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1808 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1809 memory is not all in one place. The numactl program allows you to run your
1810 application program on specific CPU's and memory nodes. It does this by
1811 supplying a NUMA memory policy to the operating system before running your
1814 The package contains other commands, such as numademo, numastat and memhog.
1815 The numademo command provides a quick overview of NUMA performance on your
1817 (license (list license:gpl2 ;programs
1818 license:lgpl2.1)))) ;library
1820 (define-public kbd-neo
1827 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1828 version "/linux/console/neo.map"))
1829 (file-name (string-append name "-" version ".map"))
1832 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1833 (build-system trivial-build-system)
1835 `(#:modules ((guix build utils))
1837 (use-modules (guix build utils))
1838 (let ((out (string-append %output "/share/keymaps"))
1839 (source (assoc-ref %build-inputs "source")))
1841 (copy-file source (string-append out "/neo.map"))
1843 (home-page "https://neo-layout.org")
1844 (synopsis "Neo2 console layout")
1846 "Kbd-neo provides the Neo2 keyboard layout for use with
1847 @command{loadkeys(1)} from @code{kbd(4)}.")
1848 ;; The file is located in an svn directory, the entire content of
1849 ;; the directory is licensed as GPL3.
1850 (license license:gpl3+)))
1858 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1862 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1863 (modules '((guix build utils)))
1866 (substitute* "tests/Makefile.in"
1867 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1870 (substitute* '("src/unicode_start" "src/unicode_stop")
1871 ;; Assume the Coreutils are in $PATH.
1874 (build-system gnu-build-system)
1877 (modify-phases %standard-phases
1878 (add-before 'build 'pre-build
1879 (lambda* (#:key inputs #:allow-other-keys)
1880 (let ((gzip (assoc-ref %build-inputs "gzip"))
1881 (bzip2 (assoc-ref %build-inputs "bzip2")))
1882 (substitute* "src/libkeymap/findfile.c"
1884 (string-append gzip "/bin/gzip"))
1886 (string-append bzip2 "/bin/bzip2"))))))
1887 (add-after 'install 'post-install
1888 (lambda* (#:key outputs #:allow-other-keys)
1889 ;; Make sure these programs find their comrades.
1890 (let* ((out (assoc-ref outputs "out"))
1891 (bin (string-append out "/bin")))
1892 (for-each (lambda (prog)
1893 (wrap-program (string-append bin "/" prog)
1894 `("PATH" ":" prefix (,bin))))
1895 '("unicode_start" "unicode_stop"))))))))
1896 (inputs `(("check" ,check)
1899 ("pam" ,linux-pam)))
1900 (native-search-paths
1901 (list (search-path-specification
1902 (variable "LOADKEYS_KEYMAP_PATH")
1903 ;; Append ‘/**’ to recursively search all directories. One can then
1904 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
1905 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
1906 (files (list "share/keymaps/**")))))
1907 (native-inputs `(("pkg-config" ,pkg-config)))
1908 (home-page "http://kbd-project.org/")
1909 (synopsis "Linux keyboard utilities and keyboard maps")
1911 "This package contains keytable files and keyboard utilities compatible
1912 for systems using the Linux kernel. This includes commands such as
1913 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1914 (license license:gpl2+)))
1916 (define-public inotify-tools
1918 (name "inotify-tools")
1923 "mirror://sourceforge/inotify-tools/inotify-tools/"
1924 version "/inotify-tools-" version ".tar.gz"))
1927 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1928 (build-system gnu-build-system)
1929 (home-page "http://inotify-tools.sourceforge.net/")
1930 (synopsis "Monitor file accesses")
1932 "The inotify-tools packages provides a C library and command-line tools
1933 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1934 (license license:gpl2+)))
1943 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1944 "kmod-" version ".tar.xz"))
1947 "1kgixs4m3jvwk7fb3d18n6j77qhgi9qfv4csj35rs5ancr4ycrbi"))
1948 (patches (search-patches "kmod-module-directory.patch"))))
1949 (build-system gnu-build-system)
1951 `(("pkg-config" ,pkg-config)))
1956 `(#:tests? #f ; FIXME: Investigate test failures
1957 #:configure-flags '("--with-xz" "--with-zlib")
1959 (modify-phases %standard-phases
1960 (add-after 'install 'install-modprobe&co
1961 (lambda* (#:key outputs #:allow-other-keys)
1962 (let* ((out (assoc-ref outputs "out"))
1963 (bin (string-append out "/bin")))
1964 (for-each (lambda (tool)
1966 (string-append bin "/" tool)))
1967 '("insmod" "rmmod" "lsmod" "modprobe"
1968 "modinfo" "depmod"))
1970 (home-page "https://www.kernel.org/")
1971 (synopsis "Kernel module tools")
1972 (description "Kmod is a set of tools to handle common tasks with Linux
1973 kernel modules like insert, remove, list, check properties, resolve
1974 dependencies and aliases.
1976 These tools are designed on top of libkmod, a library that is shipped with
1977 kmod. The aim is to be compatible with tools, configurations and indices
1978 from the module-init-tools project.")
1979 (license license:gpl2+))) ; library under lgpl2.1+
1981 (define-public eudev
1982 ;; The post-systemd fork, maintained by Gentoo.
1988 (uri (string-append "https://github.com/gentoo/eudev/archive/v"
1990 (file-name (string-append name "-" version ".zip"))
1993 "0c9l3m3mr1nvrvlcnzh5gjdg9p9k7hh0jk04wh596cbmbass2nhd"))
1994 (patches (search-patches "eudev-rules-directory.patch"))))
1995 (build-system gnu-build-system)
1998 (modify-phases %standard-phases
1999 (add-before 'bootstrap 'patch-file-names
2000 (lambda* (#:key inputs #:allow-other-keys)
2001 (substitute* "man/make.sh"
2002 (("/usr/bin/xsltproc")
2003 (string-append (assoc-ref inputs "xsltproc")
2006 (add-after 'install 'build-hwdb
2007 (lambda* (#:key outputs #:allow-other-keys)
2008 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2009 ;; similar tools to display product names.
2010 (let ((out (assoc-ref outputs "out")))
2011 (zero? (system* (string-append out "/bin/udevadm")
2012 "hwdb" "--update"))))))
2013 #:configure-flags (list "--enable-manpages")))
2015 `(("autoconf" ,autoconf)
2016 ("automake" ,automake)
2018 ("libtool" ,libtool)
2019 ("pkg-config" ,pkg-config)
2022 ("python" ,python-wrapper)
2023 ;; For documentation.
2024 ("docbook-xml" ,docbook-xml-4.2)
2025 ("docbook-xsl" ,docbook-xsl)
2026 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2027 ("xsltproc", libxslt)))
2029 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2030 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2031 ;; which contains the rules to do that.
2032 `(("util-linux" ,util-linux) ;for blkid
2034 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2035 (synopsis "Userspace device management")
2036 (description "Udev is a daemon which dynamically creates and removes
2037 device nodes from /dev/, handles hotplug events and loads drivers at boot
2039 (license license:gpl2+)))
2041 (define-public eudev-with-hwdb
2042 (deprecated-package "eudev-with-hwdb" eudev))
2047 (version "2.02.177")
2050 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2054 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2055 (modules '((guix build utils)))
2058 (use-modules (guix build utils))
2060 ;; Honor sysconfdir.
2061 (substitute* "make.tmpl.in"
2063 "confdir = @sysconfdir@\n")
2064 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2065 "DEFAULT_SYS_DIR = @sysconfdir@"))))
2066 (patches (search-patches "lvm2-static-link.patch"))))
2067 (build-system gnu-build-system)
2069 `(("pkg-config" ,pkg-config)
2070 ("procps" ,procps))) ;tests use 'pgrep'
2075 (modify-phases %standard-phases
2076 (add-after 'configure 'set-makefile-shell
2078 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2080 (setenv "SHELL" (which "sh"))
2082 ;; Replace /bin/sh with the right file name.
2083 (patch-makefile-SHELL "make.tmpl")
2086 #:configure-flags (list (string-append "--sysconfdir="
2087 (assoc-ref %outputs "out")
2089 "--enable-udev_sync"
2090 "--enable-udev_rules"
2092 ;; Make sure programs such as 'dmsetup' can
2093 ;; find libdevmapper.so.
2094 (string-append "LDFLAGS=-Wl,-rpath="
2095 (assoc-ref %outputs "out")
2098 ;; The tests use 'mknod', which requires root access.
2100 (home-page "https://sourceware.org/lvm2/")
2101 (synopsis "Logical volume management for Linux")
2103 "LVM2 is the logical volume management tool set for Linux-based systems.
2104 This package includes the user-space libraries and tools, including the device
2105 mapper. Kernel components are part of Linux-libre.")
2107 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2108 ;; Command-line tools are GPLv2.
2109 (license (list license:gpl2 license:lgpl2.1))))
2111 (define-public lvm2-static
2114 (name "lvm2-static")
2116 ;; Propagate udev because libdevmapper.a depends on libudev.
2117 (inputs (alist-delete "udev" (package-inputs lvm2)))
2118 (propagated-inputs `(("udev" ,eudev)))
2121 (substitute-keyword-arguments (package-arguments lvm2)
2122 ((#:configure-flags flags '())
2123 ;; LVM2 doesn't use Libtool, hence the custom option.
2124 `(cons "--enable-static_link" ,flags))))
2125 (synopsis "Logical volume management for Linux (statically linked)")))
2127 (define-public wireless-tools
2129 (name "wireless-tools")
2133 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2137 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2140 ;; Remove the older header files that are not free software.
2141 (for-each (lambda (n)
2142 (delete-file (format #f "wireless.~a.h" n)))
2143 '(10 11 12 13 14 15 16 17 18 19 20))
2145 (build-system gnu-build-system)
2148 (list (string-append "PREFIX=" %output)
2149 (string-append "INSTALL_MAN=" %output "/share/man")
2150 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2152 #:phases (modify-phases %standard-phases
2153 (delete 'configure))
2155 (synopsis "Tools for manipulating Linux Wireless Extensions")
2156 (description "Wireless Tools are used to manipulate the now-deprecated
2157 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2158 Extension was an interface allowing you to set Wireless LAN specific
2159 parameters and get the specific stats. It is deprecated in favor the nl80211
2161 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2162 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2163 ;; other files are distributed under gpl2.
2164 (license (list license:gpl2 license:lgpl2.1+))))
2172 (uri (string-append "mirror://kernel.org/software/network/crda/"
2173 "crda-" version ".tar.xz"))
2176 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2177 (patches (search-patches "crda-optional-gcrypt.patch"))))
2178 (build-system gnu-build-system)
2180 '(#:phases (modify-phases %standard-phases
2183 'build 'no-werror-no-ldconfig
2185 (substitute* "Makefile"
2187 (("ldconfig") "true"))
2190 'build 'set-regulator-db-file-name
2191 (lambda* (#:key inputs #:allow-other-keys)
2192 ;; Tell CRDA where to find our database.
2193 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2194 (substitute* "crda.c"
2195 (("\"/lib/crda/regulatory.bin\"")
2196 (string-append "\"" regdb
2197 "/lib/crda/regulatory.bin\"")))
2199 #:test-target "verify"
2200 #:make-flags (let ((out (assoc-ref %outputs "out"))
2201 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2202 (list "CC=gcc" "V=1"
2204 ;; Disable signature-checking on 'regulatory.bin'.
2205 ;; The reason is that this simplifies maintenance
2206 ;; on our side (no need to manage a distro key
2207 ;; pair), and we can guarantee integrity of
2208 ;; 'regulatory.bin' by other means anyway, such as
2209 ;; 'guix gc --verify'. See
2210 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2214 (string-append "PREFIX=" out)
2215 (string-append "SBINDIR=" out "/sbin/")
2216 (string-append "UDEV_RULE_DIR="
2217 out "/lib/udev/rules.d")
2218 (string-append "LDFLAGS=-Wl,-rpath="
2220 (string-append "REG_BIN=" regdb
2221 "/lib/crda/regulatory.bin")))))
2222 (native-inputs `(("pkg-config" ,pkg-config)
2223 ("python" ,python-2)
2224 ("wireless-regdb" ,wireless-regdb)))
2225 (inputs `(("libnl" ,libnl)))
2227 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2228 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2230 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2231 communication between the kernel Linux and user space for regulatory
2233 (license license:copyleft-next)))
2235 (define-public wireless-regdb
2237 (name "wireless-regdb")
2238 (version "2017.03.07")
2242 "mirror://kernel.org/software/network/wireless-regdb/"
2243 "wireless-regdb-" version ".tar.xz"))
2246 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2248 ;; We're building 'regulatory.bin' by ourselves.
2249 (snippet '(delete-file "regulatory.bin"))))
2250 (build-system gnu-build-system)
2252 '(#:phases (modify-phases %standard-phases
2253 (delete 'configure))
2255 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2256 ;; is computed and can be equal to 'maintainer-clean'; when that
2257 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2258 ;; just built. Thus, build things sequentially.
2259 #:parallel-build? #f
2261 #:tests? #f ;no tests
2262 #:make-flags (let ((out (assoc-ref %outputs "out")))
2263 (list (string-append "PREFIX=" out)
2264 (string-append "LSB_ID=GuixSD")
2265 (string-append "DISTRO_PUBKEY=/dev/null")
2266 (string-append "DISTRO_PRIVKEY=/dev/null")
2267 (string-append "REGDB_PUBKEY=/dev/null")
2269 ;; Leave that empty so that db2bin.py doesn't try
2270 ;; to sign 'regulatory.bin'. This allows us to
2271 ;; avoid managing a key pair for the whole distro.
2272 (string-append "REGDB_PRIVKEY=")))))
2273 (native-inputs `(("python" ,python-2)))
2275 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2276 (synopsis "Wireless regulatory database")
2278 "This package contains the wireless regulatory database Central
2279 Regulatory Database Agent (CRDA) daemon. The database contains information on
2280 country-specific regulations for the wireless spectrum.")
2281 (license license:isc)))
2283 (define-public lm-sensors
2289 (uri (list (string-append
2290 "https://github.com/groeck/lm-sensors/archive/V"
2291 (string-join (string-split version #\.) "-")
2293 (file-name (string-append name "-" version ".tar.gz"))
2296 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2297 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2298 (build-system gnu-build-system)
2299 (inputs `(("rrdtool" ,rrdtool)
2302 ("gnuplot" ,gnuplot)))
2303 (native-inputs `(("pkg-config" ,pkg-config)
2307 (outputs '("lib" ;avoid perl in closure
2310 `(#:tests? #f ; no 'check' target
2311 #:make-flags (list (string-append "PREFIX=" %output)
2312 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2313 (string-append "INCLUDEDIR="
2314 (assoc-ref %outputs "lib") "/include")
2315 (string-append "MANDIR=" %output "/share/man")
2316 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2318 (modify-phases %standard-phases
2320 (add-before 'build 'patch-exec-paths
2321 (lambda* (#:key inputs outputs #:allow-other-keys)
2322 (substitute* "prog/detect/sensors-detect"
2324 (string-append "`" (assoc-ref inputs "coreutils")
2326 (("(`|\")modprobe" all open-quote)
2327 (string-append open-quote
2328 (assoc-ref inputs "kmod")
2330 (substitute* '("prog/pwm/pwmconfig"
2331 "prog/pwm/fancontrol")
2333 (string-append (assoc-ref inputs "gnuplot")
2336 (string-append (assoc-ref inputs "coreutils")
2339 (string-append (assoc-ref inputs "grep")
2342 (string-append (assoc-ref inputs "sed")
2345 (string-append (assoc-ref inputs "coreutils")
2348 (string-append (assoc-ref inputs "coreutils")
2351 (string-append (assoc-ref inputs "coreutils")
2352 "/bin/readlink -f")))
2354 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2355 (synopsis "Utilities to read temperature/voltage/fan sensors")
2357 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2358 you to access information from temperature, voltage, and fan speed sensors.
2359 It works with most newer systems.")
2360 (license license:gpl2+)))
2362 (define-public iucode-tool
2364 (name "iucode-tool")
2368 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2369 "/raw/latest/iucode-tool_" version ".tar.xz"))
2372 "0w99k1aq1xw148ffk1xykqf60rdbphb1jknw98jcmadq4pwxl44q"))))
2373 (build-system gnu-build-system)
2374 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2375 (synopsis "Manipulate Intel microcode bundles")
2377 "@command{iucode_tool} is a utility to work with microcode packages for
2378 Intel processors. It can convert between formats, extract specific versions,
2379 create a firmware image suitable for the Linux kernel, and more.")
2380 ;; cpuid.h is available for i686, x86_64, and ia64.
2381 (supported-systems '("i686-linux" "x86_64-linux"))
2382 (license license:gpl2+)))
2384 (define-public i2c-tools
2391 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2392 version ".tar.bz2"))
2395 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2396 (build-system gnu-build-system)
2398 `(#:tests? #f ; no 'check' target
2399 #:make-flags (list (string-append "prefix=" %output)
2401 ;; no configure script
2402 #:phases (modify-phases %standard-phases (delete 'configure))))
2405 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2406 (synopsis "I2C tools for Linux")
2408 "The i2c-tools package contains a heterogeneous set of I2C tools for
2409 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2410 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2412 (license license:gpl2+)))
2414 (define-public xsensors
2421 "http://www.linuxhardware.org/xsensors/xsensors-"
2425 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2426 (build-system gnu-build-system)
2427 (inputs `(("lm-sensors" ,lm-sensors "lib")
2429 (native-inputs `(("pkg-config" ,pkg-config)))
2432 (modify-phases %standard-phases
2433 (add-before 'configure 'enable-deprecated
2435 (substitute* "src/Makefile.in"
2436 (("-DGDK_DISABLE_DEPRECATED") "")
2437 (("-DGTK_DISABLE_DEPRECATED") ""))
2439 (add-before 'configure 'remove-Werror
2441 (substitute* '("configure" "src/Makefile.in")
2444 (home-page "http://www.linuxhardware.org/xsensors/")
2445 (synopsis "Hardware health information viewer")
2447 "Xsensors reads data from the libsensors library regarding hardware
2448 health such as temperature, voltage and fan speed and displays the information
2449 in a digital read-out.")
2450 (license license:gpl2+)))
2455 (version (package-version linux-libre))
2456 (source (package-source linux-libre))
2457 (build-system gnu-build-system)
2460 (modify-phases %standard-phases
2462 (lambda* (#:key inputs #:allow-other-keys)
2463 (setenv "SHELL_PATH" (which "bash"))
2464 (chdir "tools/perf")
2466 #:make-flags (list (string-append "prefix="
2467 (assoc-ref %outputs "out"))
2470 ;; By default, 'config/Makefile' uses lib64 on
2471 ;; x86_64. Work around that.
2473 #:tests? #f)) ;no tests
2475 `(("pkg-config" ,pkg-config)
2479 ;; There are build scripts written in these languages.
2481 ("python" ,python-2)))
2483 `(("slang" ,slang) ;for the interactive TUI
2485 ("python" ,python-2) ;'perf' links against libpython
2486 ("elfutils" ,elfutils)
2487 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2488 ("libunwind" ,libunwind) ;better stack walking
2489 ("numactl" ,numactl) ;for 'perf bench numa mem'
2492 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2493 ("docbook-xsl" ,docbook-xsl)
2495 ("asciidoc" ,asciidoc)))
2496 (home-page "https://perf.wiki.kernel.org/")
2497 (synopsis "Linux profiling with performance counters")
2499 "perf is a tool suite for profiling using hardware performance counters,
2500 with support in the Linux kernel. perf can instrument CPU performance
2501 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2502 of lightweight profiling. This package contains the user-land tools and in
2503 particular the 'perf' command.")
2504 (license (package-license linux-libre))))
2506 (define-public pflask
2512 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2514 (file-name (string-append name "-" version ".tar.gz"))
2517 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2518 (build-system cmake-build-system)
2520 '(#:tests? #f)) ; no tests
2521 (home-page "https://ghedo.github.io/pflask/")
2522 (synopsis "Simple tool for creating Linux namespace containers")
2523 (description "pflask is a simple tool for creating Linux namespace
2524 containers. It can be used for running a command or even booting an OS inside
2525 an isolated container, created with the help of Linux namespaces. It is
2526 similar in functionality to chroot, although pflask provides better isolation
2527 thanks to the use of namespaces.")
2528 (license license:bsd-2)))
2530 (define-public hdparm
2536 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2537 name "-" version ".tar.gz"))
2540 "1rb5086gp4l1h1fn2nk10ziqxjxigsd0c1zczahwc5k9vy8zawr6"))))
2541 (build-system gnu-build-system)
2543 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2544 (list (string-append "binprefix=" out)
2545 (string-append "manprefix=" out)
2548 (modify-phases %standard-phases
2549 (delete 'configure)) ; no configure script
2550 #:tests? #f)) ; no test suite
2551 (home-page "https://sourceforge.net/projects/hdparm/")
2552 (synopsis "View and tune ATA disk drive parameters")
2554 "@command{hdparm} is a command-line utility to control ATA controllers and
2555 disk drives. It can increase performance and/or reliability by careful tuning
2556 of hardware settings like power and acoustic management, DMA modes, and caching.
2557 It can also display detailed device information, or be used as a simple
2558 performance benchmarking tool.
2560 @command{hdparm} provides a command line interface to various Linux kernel
2561 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2562 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2563 Translation (@dfn{SAT}) are also supported.")
2564 (license (license:non-copyleft "file://LICENSE.TXT"))))
2566 (define-public rfkill
2572 (uri (string-append "mirror://kernel.org/software/network/"
2573 name "/" name "-" version ".tar.xz"))
2576 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2577 (build-system gnu-build-system)
2579 `(#:make-flags (list "CC=gcc"
2580 (string-append "PREFIX=" %output))
2581 #:phases (modify-phases %standard-phases
2582 (delete 'configure))
2584 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2585 (synopsis "Tool for enabling and disabling wireless devices")
2587 "rfkill is a simple tool for accessing the rfkill device interface,
2588 which is used to enable and disable wireless networking devices, typically
2589 WLAN, Bluetooth and mobile broadband.")
2590 (license (license:non-copyleft "file://COPYING"
2591 "See COPYING in the distribution."))
2592 ;; rfkill is part of util-linux as of 2.31.
2593 (properties `((superseded . ,util-linux)))))
2601 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2602 version "/" name "-" version ".tar.gz"))
2605 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2606 (build-system gnu-build-system)
2607 (home-page "http://acpiclient.sourceforge.net")
2608 (synopsis "Display information on ACPI devices")
2609 (description "@code{acpi} attempts to replicate the functionality of the
2610 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2611 information. It does not support ACPI suspending, only displays information
2612 about ACPI devices.")
2613 (license license:gpl2+)))
2615 (define-public acpid
2621 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2625 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2626 (build-system gnu-build-system)
2627 (home-page "https://sourceforge.net/projects/acpid2/")
2628 (synopsis "Daemon for delivering ACPI events to user-space programs")
2630 "acpid is designed to notify user-space programs of Advanced
2631 Configuration and Power Interface (ACPI) events. acpid should be started
2632 during the system boot, and will run as a background process. When an ACPI
2633 event is received from the kernel, acpid will examine the list of rules
2634 specified in /etc/acpi/events and execute the rules that match the event.")
2635 (license license:gpl2+)))
2637 (define-public sysfsutils
2646 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2649 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2650 (build-system gnu-build-system)
2651 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2652 (synopsis "System utilities based on Linux sysfs")
2654 "These are a set of utilities built upon sysfs, a virtual file system in
2655 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2656 also contains the libsysfs library.")
2657 ;; The library is under lgpl2.1+ (all files say "or any later version").
2658 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2659 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2661 (define-public sysfsutils-1
2663 (inherit sysfsutils)
2670 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2671 "/sysfsutils-" version ".tar.gz"))
2673 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2674 (modules '((guix build utils)))
2677 (substitute* "Makefile.in"
2678 (("includedir = /usr/include/sysfs")
2679 "includedir = @includedir@"))
2680 (substitute* "configure"
2681 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2682 (string-append "includedir='" orig "/sysfs'")))))))
2683 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2685 (define-public cpufrequtils
2687 (name "cpufrequtils")
2694 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2697 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2698 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2699 (build-system gnu-build-system)
2701 `(("sysfsutils" ,sysfsutils-1)))
2703 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2704 (assoc-ref %outputs "out") "/lib"))))
2705 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2706 (synopsis "Utilities to get and set CPU frequency on Linux")
2708 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2709 information, and set the CPU frequency if supported, using the cpufreq
2710 capabilities of the Linux kernel.")
2711 (license license:gpl2)))
2713 (define-public libraw1394
2720 "mirror://kernel.org/linux/libs/ieee1394/"
2721 name "-" version ".tar.xz"))
2724 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2725 (build-system gnu-build-system)
2726 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2727 (synopsis "Interface library for the Linux IEEE1394 drivers")
2729 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2730 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2731 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2732 send to and receive from other nodes without requiring a kernel driver for the
2733 protocol in question.")
2734 (license license:lgpl2.1+)))
2736 (define-public libavc1394
2742 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2743 name "-" version ".tar.gz"))
2746 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2747 (build-system gnu-build-system)
2749 `(("pkg-config" ,pkg-config)))
2751 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2752 (home-page "https://sourceforge.net/projects/libavc1394/")
2753 (synopsis "AV/C protocol library for IEEE 1394")
2755 "Libavc1394 is a programming interface to the AV/C specification from
2756 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2757 (license license:lgpl2.1+)))
2759 (define-public libiec61883
2761 (name "libiec61883")
2766 "mirror://kernel.org/linux/libs/ieee1394/"
2767 name "-" version ".tar.xz"))
2770 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2771 (build-system gnu-build-system)
2773 `(("pkg-config" ,pkg-config)))
2775 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2776 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2777 (synopsis "Isochronous streaming media library for IEEE 1394")
2779 "The libiec61883 library provides a higher level API for streaming DV,
2780 MPEG-2 and audio over Linux IEEE 1394.")
2781 (license license:lgpl2.1+)))
2783 (define-public mdadm
2790 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2794 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2795 (build-system gnu-build-system)
2799 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2803 ;; TODO: tell it where to find 'sendmail'
2804 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2805 (string-append "BINDIR=" out "/sbin")
2806 (string-append "MANDIR=" out "/share/man")
2807 (string-append "UDEVDIR=" out "/lib/udev")))
2809 (modify-phases %standard-phases
2810 (add-before 'build 'patch-program-paths
2811 (lambda* (#:key inputs #:allow-other-keys)
2812 (let ((coreutils (assoc-ref inputs "coreutils")))
2813 (substitute* "udev-md-raid-arrays.rules"
2814 (("/usr/bin/(readlink|basename)" all program)
2815 (string-append coreutils "/bin/" program))))
2817 (add-before 'build 'remove-W-error
2819 ;; We cannot build with -Werror on i686 due to a
2820 ;; 'sign-compare' warning in util.c.
2821 (substitute* "Makefile"
2824 (delete 'configure))
2825 ;;tests must be done as root
2827 (home-page "http://neil.brown.name/blog/mdadm")
2828 (synopsis "Tool for managing Linux Software RAID arrays")
2830 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2831 assemble, report on, and monitor arrays. It can also move spares between raid
2832 arrays when needed.")
2833 (license license:gpl2+)))
2835 (define-public mdadm-static
2838 (name "mdadm-static")
2840 (substitute-keyword-arguments (package-arguments mdadm)
2841 ((#:make-flags flags)
2842 `(cons "LDFLAGS = -static" ,flags))
2844 `(modify-phases ,phases
2845 (add-after 'install 'remove-cruft
2846 (lambda* (#:key outputs #:allow-other-keys)
2847 (let* ((out (assoc-ref outputs "out"))
2848 (precious? (lambda (file)
2849 (member file '("." ".." "sbin"))))
2850 (directories (scandir out (negate precious?))))
2851 (with-directory-excursion out
2852 (for-each delete-file-recursively directories)
2853 (remove-store-references "sbin/mdadm")
2854 (delete-file "sbin/mdmon")
2856 ((#:modules modules %gnu-build-system-modules)
2857 `((ice-9 ftw) ,@modules))
2858 ((#:strip-flags _ '())
2859 ''("--strip-all")) ;strip a few extra KiB
2860 ((#:allowed-references _ '("out"))
2861 '("out")))) ;refer only self
2862 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2864 (define-public multipath-tools
2866 (name "multipath-tools")
2870 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2871 ".git;a=snapshot;h=" version ";sf=tgz"))
2872 (file-name (string-append name "-" version ".tar.gz"))
2875 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2876 (modules '((guix build utils)))
2879 ;; Drop bundled valgrind headers.
2880 (delete-file-recursively "third-party")
2881 (substitute* '("multipathd/main.c"
2882 "libmultipath/debug.c")
2883 (("#include \"../third-party/")
2886 (build-system gnu-build-system)
2888 '(#:tests? #f ; No tests.
2889 #:make-flags (list (string-append "DESTDIR="
2890 (assoc-ref %outputs "out"))
2892 (string-append "LDFLAGS=-Wl,-rpath="
2893 (assoc-ref %outputs "out")
2896 (modify-phases %standard-phases
2897 (add-after 'unpack 'patch-source
2898 (lambda* (#:key inputs #:allow-other-keys)
2899 (let ((lvm2 (assoc-ref inputs "lvm2"))
2900 (udev (assoc-ref inputs "udev")))
2901 (substitute* "Makefile.inc"
2902 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2903 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2904 (("/usr/include/libdevmapper.h")
2905 (string-append lvm2 "/include/libdevmapper.h"))
2906 (("/usr/include/libudev.h")
2907 (string-append udev "/include/libudev.h")))
2910 (add-before 'build 'set-CC
2916 ("pkg-config" ,pkg-config)
2917 ("valgrind" ,valgrind)))
2919 `(("ceph:lib" ,ceph "lib")
2922 ("liburcu" ,liburcu)
2924 ("readline" ,readline)
2926 (home-page "http://christophe.varoqui.free.fr/")
2927 (synopsis "Access block devices through multiple paths")
2929 "This package provides the following binaries to drive the
2930 Linux Device Mapper multipathing driver:
2932 @item @command{multipath} - Device mapper target autoconfig.
2933 @item @command{multipathd} - Multipath daemon.
2934 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2935 @code{dm} multipath devices.
2936 @item @command{kpartx} - Create device maps from partition tables.
2938 (license (list license:gpl2+ ; Main distribution.
2939 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2941 (define-public libaio
2948 (string-append "mirror://debian/pool/main/liba/libaio/"
2949 name "_" version ".orig.tar.gz")))
2952 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2953 (build-system gnu-build-system)
2956 (list "CC=gcc" (string-append "prefix=" %output))
2957 #:test-target "partcheck" ; need root for a full 'check'
2959 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
2960 (home-page "http://lse.sourceforge.net/io/aio.html")
2961 (synopsis "Linux-native asynchronous I/O access library")
2963 "This library enables userspace to use Linux kernel asynchronous I/O
2964 system calls, important for the performance of databases and other advanced
2966 (license license:lgpl2.1+)))
2974 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2975 name "-" version ".tar.xz"))
2978 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2979 (build-system gnu-build-system)
2981 `(("libsndfile" ,libsndfile)))
2983 `(("pkg-config" ,pkg-config)))
2984 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2985 (synopsis "Bluetooth subband audio codec")
2987 "The SBC is a digital audio encoder and decoder used to transfer data to
2988 Bluetooth audio output devices like headphones or loudspeakers.")
2989 (license license:gpl2+)))
2991 (define-public bluez
2998 "mirror://kernel.org/linux/bluetooth/bluez-"
3002 "1j22hfjz0fp4pgclgz9mfcwjbr4wqgah3gd2qhfg4r6msmybyxfg"))))
3003 (build-system gnu-build-system)
3006 (let ((out (assoc-ref %outputs "out")))
3007 (list "--sysconfdir=/etc"
3008 "--localstatedir=/var"
3011 ;; Install dbus/udev files to the correct location.
3012 (string-append "--with-dbusconfdir=" out "/etc")
3013 (string-append "--with-udevdir=" out "/lib/udev")))
3015 (modify-phases %standard-phases
3016 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3017 ;; issue (discussion on upstream mailing list:
3018 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3019 (add-before 'check 'skip-wonky-test
3021 (substitute* "unit/test-gatt.c"
3022 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3024 (add-after 'install 'post-install
3025 (lambda* (#:key inputs outputs #:allow-other-keys)
3026 (let* ((out (assoc-ref outputs "out"))
3027 (servicedir (string-append out "/share/dbus-1/services"))
3028 (service "obexd/src/org.bluez.obex.service")
3029 (rule (string-append
3030 out "/lib/udev/rules.d/97-hid2hci.rules")))
3031 ;; Install the obex dbus service file.
3032 (substitute* service
3034 (string-append out "/libexec/bluetooth/obexd")))
3035 (install-file service servicedir)
3036 ;; Fix paths in the udev rule.
3038 (("hid2hci --method")
3039 (string-append out "/lib/udev/hid2hci --method"))
3041 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3044 `(("pkg-config" ,pkg-config)
3045 ("gettext" ,gettext-minimal)))
3050 ("libical" ,libical)
3051 ("readline" ,readline)))
3052 (home-page "http://www.bluez.org/")
3053 (synopsis "Linux Bluetooth protocol stack")
3055 "BlueZ provides support for the core Bluetooth layers and protocols. It
3056 is flexible, efficient and uses a modular implementation.")
3057 (license license:gpl2+)))
3059 (define-public fuse-exfat
3066 "https://github.com/relan/exfat/releases/download/v"
3067 version "/" name "-" version ".tar.gz"))
3070 "1jwnxw0bg9v5ij8xvbg4xpjr50nykq8a1lmc2xkblz204rq7wd8z"))))
3071 (build-system gnu-build-system)
3073 `(("pkg-config" ,pkg-config)))
3076 (home-page "https://github.com/relan/exfat")
3077 (synopsis "Mount exFAT file systems")
3079 "This package provides a FUSE-based file system that provides read and
3080 write access to exFAT devices.")
3081 (license license:gpl2+)))
3090 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3091 version ".tar.bz2"))
3092 (patches (search-patches "gpm-glibc-2.26.patch"))
3095 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3096 (build-system gnu-build-system)
3098 '(#:phases (modify-phases %standard-phases
3101 ;; The tarball was not generated with 'make dist' so we
3102 ;; need to bootstrap things ourselves.
3103 (substitute* "autogen.sh"
3104 (("/bin/sh") (which "sh")))
3105 (and (zero? (system* "./autogen.sh"))
3107 (patch-makefile-SHELL "Makefile.include.in")
3110 ;; Make sure programs find libgpm.so.
3111 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3112 (assoc-ref %outputs "out")
3115 `(("texinfo" ,texinfo)
3118 ("autoconf" ,autoconf)
3119 ("automake" ,automake)
3120 ("libtool" ,libtool)))
3121 (home-page "http://www.nico.schottelius.org/software/gpm/")
3122 (synopsis "Mouse support for the Linux console")
3124 "The GPM (general-purpose mouse) daemon is a mouse server for
3125 applications running on the Linux console. It allows users to select items
3126 and copy/paste text in the console and in xterm.")
3127 (license license:gpl2+)))
3129 (define-public btrfs-progs
3131 (name "btrfs-progs")
3135 (uri (string-append "mirror://kernel.org/linux/kernel/"
3136 "people/kdave/btrfs-progs/"
3137 "btrfs-progs-v" version ".tar.xz"))
3140 "1palnddw3d50kyflwk1j4xapbc6jniid6j5i9dsr8l8a7nkv7ich"))))
3141 (build-system gnu-build-system)
3143 "static")) ; static versions of the binaries in "out"
3145 '(#:phases (modify-phases %standard-phases
3146 (add-after 'build 'build-static
3147 (lambda _ (zero? (system* "make" "static"))))
3148 (add-after 'install 'install-bash-completion
3149 (lambda* (#:key outputs #:allow-other-keys)
3150 (let* ((out (assoc-ref outputs "out"))
3151 (bashcomp (string-append out "/etc/bash_completion.d")))
3153 (copy-file "btrfs-completion"
3154 (string-append bashcomp "/btrfs"))
3156 (add-after 'install 'install-static
3157 (let ((staticbin (string-append (assoc-ref %outputs "static")
3160 (zero? (system* "make"
3161 (string-append "bindir=" staticbin)
3162 "install-static"))))))
3163 #:test-target "test"
3164 #:parallel-tests? #f)) ; tests fail when run in parallel
3165 (inputs `(("e2fsprogs" ,e2fsprogs)
3166 ("libblkid" ,util-linux)
3167 ("libblkid:static" ,util-linux "static")
3168 ("libuuid" ,util-linux)
3169 ("libuuid:static" ,util-linux "static")
3173 (native-inputs `(("pkg-config" ,pkg-config)
3174 ("asciidoc" ,asciidoc)
3176 ;; For building documentation.
3177 ("libxml2" ,libxml2)
3178 ("docbook-xsl" ,docbook-xsl)
3182 (home-page "https://btrfs.wiki.kernel.org/")
3183 (synopsis "Create and manage btrfs copy-on-write file systems")
3184 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3185 aimed at implementing advanced features while focusing on fault tolerance,
3186 repair and easy administration.")
3187 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3188 ;; GPL2: Everything else.
3189 (license (list license:gpl2 license:gpl2+))))
3191 (define-public btrfs-progs/static
3193 (name "btrfs-progs-static")
3194 (version (package-version btrfs-progs))
3196 (build-system trivial-build-system)
3198 `(("btrfs-progs:static" ,btrfs-progs "static")))
3200 `(#:modules ((guix build utils))
3203 (use-modules (guix build utils)
3207 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3208 (out (assoc-ref %outputs "out"))
3209 (source (string-append btrfs "/bin/btrfs.static"))
3210 (target (string-append out "/bin/btrfs")))
3211 (mkdir-p (dirname target))
3212 (copy-file source target)
3213 (remove-store-references target)
3214 (chmod target #o555)))))
3215 (home-page (package-home-page btrfs-progs))
3216 (synopsis "Statically-linked btrfs command from btrfs-progs")
3217 (description "This package provides the statically-linked @command{btrfs}
3218 from the btrfs-progs package. It is meant to be used in initrds.")
3219 (license (package-license btrfs-progs))))
3221 (define-public f2fs-tools
3228 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3229 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3232 "1bir9ladb58ijlcvrjrq1fb1xv5ys50zdjaq0yzliib0apsyrnyl"))))
3233 (build-system gnu-build-system)
3235 `(("autoconf" ,autoconf)
3236 ("automake" ,automake)
3237 ("libtool" ,libtool)
3238 ("pkg-config" ,pkg-config)))
3240 `(("libuuid" ,util-linux)))
3241 (home-page "https://f2fs.wiki.kernel.org/")
3242 (synopsis "Userland tools for f2fs")
3244 "F2FS, the Flash-Friendly File System, is a modern file system
3245 designed to be fast and durable on flash devices such as solid-state
3246 disks and SD cards. This package provides the userland utilities.")
3247 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3248 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3249 (license (list license:gpl2 license:lgpl2.1))))
3251 (define-public freefall
3254 (version (package-version linux-libre))
3255 (source (package-source linux-libre))
3256 (build-system gnu-build-system)
3258 '(#:phases (modify-phases %standard-phases
3259 (add-after 'unpack 'enter-subdirectory
3261 (chdir "tools/laptop/freefall")))
3263 (add-before 'build 'increase-timeout
3265 ;; The default of 2 seconds is too low: it assumes an
3266 ;; open lid and AC power without actually checking.
3267 (substitute* "freefall.c"
3268 (("alarm\\(2\\)") "alarm(5)")))))
3269 #:make-flags (list (string-append "PREFIX="
3270 (assoc-ref %outputs "out")))
3271 #:tests? #f)) ;no tests
3272 (home-page (package-home-page linux-libre))
3273 (synopsis "Free-fall protection for spinning laptop hard drives")
3275 "Prevents shock damage to the internal spinning hard drive(s) of some
3276 HP and Dell laptops. When sudden movement is detected, all input/output
3277 operations on the drive are suspended and its heads are parked on the ramp,
3278 where they are less likely to cause damage to the spinning disc. Requires a
3279 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3280 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3281 (license license:gpl2)))
3283 (define-public thinkfan
3289 (uri (string-append "mirror://sourceforge/thinkfan/"
3290 "/thinkfan-" version ".tar.gz"))
3293 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3294 (modules '((guix build utils)))
3295 ;; Fix erroneous man page location in Makefile leading to
3296 ;; a compilation failure.
3298 '(substitute* "CMakeLists.txt"
3299 (("thinkfan\\.1") "src/thinkfan.1")))))
3300 (build-system cmake-build-system)
3302 `(#:modules ((guix build cmake-build-system)
3305 #:tests? #f ;no test target
3307 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3308 `("-DUSE_ATASMART:BOOL=ON")
3310 (modify-phases %standard-phases
3311 ;; Install scripts for various foreign init systems. Also fix
3312 ;; hard-coded path for daemon.
3313 (add-after 'install 'install-rc-scripts
3314 (lambda* (#:key outputs #:allow-other-keys)
3315 (let ((out (assoc-ref outputs "out"))
3317 (string-append "../thinkfan-" ,version "/rcscripts")
3320 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3321 (string-append out "/sbin/" name)))
3322 (for-each (cute install-file <>
3323 (string-append out "/share/thinkfan"))
3327 `(("libatasmart" ,libatasmart)))
3328 (home-page "http://thinkfan.sourceforge.net/")
3329 (synopsis "Simple fan control program")
3331 "Thinkfan is a simple fan control program. It reads temperatures,
3332 checks them against configured limits and switches to appropriate (also
3333 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3334 other @code{hwmon} driver that enables temperature reading and fan control
3336 (license license:gpl3+)))
3338 (define-public ntfs-3g
3341 (version "2017.3.23")
3344 (uri (string-append "https://tuxera.com/opensource/"
3345 "ntfs-3g_ntfsprogs-" version ".tgz"))
3348 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
3349 (modules '((guix build utils)))
3351 ;; Install under $prefix.
3352 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3355 (build-system gnu-build-system)
3356 (inputs `(("util-linux" ,util-linux)
3357 ("fuse" ,fuse))) ;libuuid
3358 (native-inputs `(("pkg-config" ,pkg-config)))
3360 '(#:configure-flags (list "--exec-prefix=${prefix}"
3361 "--with-fuse=external" ;use our own FUSE
3362 "--enable-mount-helper"
3363 "--enable-posix-acls"
3364 "--enable-xattr-mappings")))
3365 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
3366 (synopsis "Read-write access to NTFS file systems")
3368 "NTFS-3G provides read-write access to NTFS file systems, which are
3369 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3370 The package provides additional NTFS tools.")
3371 (license license:gpl2+)))
3373 (define-public rdma-core
3379 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3380 "/releases/download/v" version "/rdma-core-"
3384 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3385 (build-system cmake-build-system)
3387 '(#:tests? #f ; no tests
3388 ;; Upstream uses the "ninja" build system and encourage distros
3389 ;; to do the same for consistency. They also recommend using the
3390 ;; "Release" build type.
3391 #:configure-flags (list "-GNinja"
3392 "-DCMAKE_BUILD_TYPE=Release")
3394 (modify-phases %standard-phases
3397 (zero? (system* "ninja"
3398 "-j" (number->string (parallel-job-count))))))
3401 (zero? (system* "ninja" "install")))))))
3404 ("pkg-config" ,pkg-config)
3405 ("python" ,python-wrapper)))
3409 (home-page "https://github.com/linux-rdma/rdma-core")
3410 (synopsis "Utilities and libraries for working with RDMA devices")
3412 "This package provides userspace components for the InfiniBand
3413 subsystem of the Linux kernel. Specifically it contains userspace
3414 libraries for the following device nodes:
3417 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3418 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3419 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3422 The following service daemons are also provided:
3424 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3425 @item @code{iwpmd} (for iWARP kernel providers)
3426 @item @code{ibacm} (for InfiniBand communication management assistant)
3428 ;; All library code is dual licensed under GPL2 and a custom MIT
3429 ;; variant. The package also includes some components covered by
3430 ;; other licenses. Consult COPYING.md for full details.
3433 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3434 license:bsd-2 ; Files referring to COPYING.BSD_FB
3435 license:cc0 ; most files in ccan/
3436 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3438 (define-public rng-tools
3444 (uri (string-append "https://github.com/nhorman/rng-tools/"
3445 "archive/v" version ".tar.gz"))
3446 (file-name (string-append name "-" version ".tar.gz"))
3449 "00ywsknjpc9jd9kfmz2syk9l0xkiiwyx5qhl5zvhhc69v6682i31"))))
3450 (build-system gnu-build-system)
3452 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
3453 #:configure-flags '("--without-nistbeacon")))
3455 `(("autoconf" ,autoconf)
3456 ("automake" ,automake)
3457 ("pkg-config" ,pkg-config)))
3459 `(("libsysfs" ,sysfsutils)))
3460 (synopsis "Random number generator daemon")
3462 "Monitor a hardware random number generator, and supply entropy
3463 from that to the system kernel's @file{/dev/random} machinery.")
3464 (home-page "https://sourceforge.net/projects/gkernel")
3465 ;; The source package is offered under the GPL2+, but the files
3466 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3467 (license (list license:gpl2 license:gpl2+))))
3469 (define-public cpupower
3472 (version (package-version linux-libre))
3473 (source (package-source linux-libre))
3474 (build-system gnu-build-system)
3476 '(#:phases (modify-phases %standard-phases
3477 (add-after 'unpack 'enter-subdirectory
3479 (chdir "tools/power/cpupower")))
3481 (add-before 'build 'fix-makefiles
3483 (substitute* "Makefile"
3485 (("/bin/(install|pwd)" _ command) command))
3486 (substitute* "bench/Makefile"
3487 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3488 #:make-flags (let ((out (assoc-ref %outputs "out")))
3489 (list (string-append "DESTDIR=" out)
3490 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3491 "docdir=/share/doc/cpupower"
3492 "confdir=$(docdir)/examples"
3493 ;; The Makefile recommends the following changes
3495 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3496 #:tests? #f)) ;no tests
3497 (native-inputs `(("gettext" ,gettext-minimal)))
3498 (inputs `(("pciutils" ,pciutils)))
3499 (home-page (package-home-page linux-libre))
3500 (synopsis "CPU frequency and voltage scaling tools for Linux")
3502 "cpupower is a set of user-space tools that use the cpufreq feature of the
3503 Linux kernel to retrieve and control processor features related to power saving,
3504 such as frequency and voltage scaling.")
3505 (license license:gpl2)))
3507 (define-public haveged
3514 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3518 "0w5ypz6451msckivjriwyw8djydlwffam7x23xh626s2vzdrlzgp"))))
3519 (build-system gnu-build-system)
3520 (home-page "http://www.issihosts.com/haveged")
3521 (synopsis "Entropy source for the Linux random number generator")
3523 "haveged generates an unpredictable stream of random numbers for use by
3524 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3525 standard mechanisms for filling the entropy pool may not be sufficient for
3526 systems with high needs or limited user interaction, such as headless servers.
3527 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3528 indirect effects of hardware events on hidden processor state using the HArdware
3529 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3530 its environment and provides the same built-in test suite for the output stream
3531 as used on certified hardware security devices.")
3532 (license (list (license:non-copyleft "file://nist/mconf.h")
3533 (license:non-copyleft "file://nist/packtest.c")
3534 license:public-domain ; nist/dfft.c
3535 license:gpl3+)))) ; everything else
3537 (define-public ecryptfs-utils
3539 (name "ecryptfs-utils")
3544 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3545 version "/+download/ecryptfs-utils_"
3546 version ".orig.tar.gz"))
3549 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3550 (build-system gnu-build-system)
3552 `(#:configure-flags (list "--disable-pywrap")))
3554 `(("intltool" ,intltool)
3555 ("perl" ,perl) ; for pod2man
3556 ("pkg-config" ,pkg-config)))
3558 `(("keyutils" ,keyutils)
3559 ("linux-pam" ,linux-pam)
3561 (home-page "http://ecryptfs.org/")
3562 (synopsis "eCryptfs cryptographic file system utilities")
3564 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3565 Each file's cryptographic meta-data is stored inside the file itself, along
3566 with the encrypted contents. This allows individual encrypted files to be
3567 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3568 native Linux file system, and has been part of the Linux kernel since version
3569 2.6.19. This package contains the userland utilities to manage it.")
3570 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3571 ;; grant additional permission to link with OpenSSL.
3572 (license license:gpl2+)))
3574 (define-public libnfsidmap
3576 (name "libnfsidmap")
3581 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3582 name "/" name "-" version ".tar.gz"))
3585 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3586 (build-system gnu-build-system)
3588 `(#:configure-flags (list
3589 (string-append "--with-pluginpath="
3590 (assoc-ref %outputs "out")
3591 "/lib/libnfsidmap"))))
3593 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3595 "NFSv4 support library for name/ID mapping")
3596 (description "Libnfsidmap is a library holding mulitiple methods of
3597 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3598 extensible array of mapping functions, currently consisting of two choices:
3599 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3600 (license (license:non-copyleft "file://COPYING"
3601 "See COPYING in the distribution."))))
3603 (define-public module-init-tools
3605 (name "module-init-tools")
3610 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3611 "module-init-tools-" version ".tar.bz2"))
3614 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3615 (patches (search-patches "module-init-tools-moduledir.patch"))))
3616 (build-system gnu-build-system)
3618 ;; FIXME: The upstream tarball lacks man pages, and building them would
3619 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3620 ;; but they vanished. In the meantime, fake it.
3622 (modify-phases %standard-phases
3623 (add-before 'configure 'fake-docbook
3625 (substitute* "Makefile.in"
3626 (("^DOCBOOKTOMAN.*$")
3627 "DOCBOOKTOMAN = true\n"))
3629 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3630 (synopsis "Tools for loading and managing Linux kernel modules")
3632 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3633 `insmod', `lsmod', and more.")
3634 (license license:gpl2+)))
3636 (define-public mcelog
3642 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3643 "mcelog.git/snapshot/v" version ".tar.gz"))
3646 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
3647 (file-name (string-append name "-" version ".tar.gz"))
3648 (modules '((guix build utils)))
3650 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3651 `(substitute* "Makefile"
3652 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3653 (build-system gnu-build-system)
3655 `(#:phases (modify-phases %standard-phases
3656 (delete 'configure)) ; no configure script
3657 #:make-flags (let ((out (assoc-ref %outputs "out")))
3659 (string-append "prefix=" out)
3660 (string-append "DOCDIR=" out "/share/doc/mcelog")
3661 "etcprefix=$(DOCDIR)/examples"))
3662 ;; The tests will only run as root on certain supported CPU models.
3664 (supported-systems (list "i686-linux" "x86_64-linux"))
3665 (home-page "https://mcelog.org/")
3666 (synopsis "Machine check monitor for x86 Linux systems")
3668 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3669 and other hardware errors on x86 systems. It can also perform user-defined
3670 tasks, such as bringing bad pages off-line, when configurable error thresholds
3672 (license license:gpl2)))
3674 (define-public mtd-utils
3681 "ftp://ftp.infradead.org/pub/mtd-utils/"
3682 "mtd-utils-" version ".tar.bz2"))
3685 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3688 ("libuuid" ,util-linux)
3691 (build-system gnu-build-system)
3693 `(#:test-target "tests"
3694 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3695 #:phases (modify-phases %standard-phases
3696 (delete 'configure))))
3697 (synopsis "MTD Flash Storage Utilities")
3698 (description "This package provides utilities for testing, partitioning, etc
3700 (home-page "http://www.linux-mtd.infradead.org/")
3702 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3703 license:mpl1.1 ; All ftl* files
3704 license:expat)))) ; libiniparser
3706 (define-public libseccomp
3712 (uri (string-append "https://github.com/seccomp/libseccomp/"
3713 "releases/download/v" version
3714 "/libseccomp-" version ".tar.gz"))
3717 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3718 (build-system gnu-build-system)
3720 `(("which" ,which)))
3721 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3722 (description "The libseccomp library provides an easy to use, platform
3723 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3724 libseccomp API is designed to abstract away the underlying BPF based syscall
3725 filter language and present a more conventional function-call based filtering
3726 interface that should be familiar to, and easily adopted by, application
3728 (home-page "https://github.com/seccomp/libseccomp")
3729 (license license:lgpl2.1)))
3731 (define-public radeontop
3735 (home-page "https://github.com/clbr/radeontop/")
3738 (uri (string-append home-page "archive/v" version ".tar.gz"))
3739 (file-name (string-append name "-" version ".tar.gz"))
3742 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3743 (build-system gnu-build-system)
3745 `(#:phases (modify-phases %standard-phases
3746 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3747 ;; dependency, and doesn't even work on release(!) tarballs.
3748 (add-after 'unpack 'report-correct-version
3749 (lambda _ (substitute* "getver.sh"
3751 (string-append "ver=" ,version)))))
3752 (delete 'configure)) ; no configure script
3753 #:make-flags (list "CC=gcc"
3754 (string-append "PREFIX=" %output))
3755 #:tests? #f)) ; no tests
3757 `(("gettext" ,gettext-minimal)
3758 ("pkg-config" ,pkg-config)))
3760 `(("libdrm" ,libdrm)
3761 ("libpciaccess" ,libpciaccess)
3763 ("ncurses" ,ncurses)))
3764 (synopsis "Usage monitor for AMD Radeon graphics")
3765 (description "RadeonTop monitors resource consumption on supported AMD
3766 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3767 a terminal or saved to a file for further processing. It measures both the
3768 activity of the GPU as a whole, which is also accurate during OpenCL
3769 computations, as well as separate component statistics that are only meaningful
3770 under OpenGL graphics workloads.")
3771 (license license:gpl3)))
3773 (define-public efivar
3779 (uri (string-append "https://github.com/rhinstaller/" name
3780 "/releases/download/" version "/" name
3781 "-" version ".tar.bz2"))
3784 "09a31y6sl3b33myy42gl9k732k1f440ycd07l6ac5d5l53kk8zhv"))))
3785 (build-system gnu-build-system)
3787 `(;; Tests require a UEFI system and is not detected in the chroot.
3789 #:make-flags (list (string-append "prefix=" %output)
3790 (string-append "libdir=" %output "/lib")
3792 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3794 (modify-phases %standard-phases
3795 (delete 'configure))))
3797 `(("pkg-config" ,pkg-config)))
3800 (home-page "https://github.com/rhinstaller/efivar")
3801 (synopsis "Tool and library to manipulate EFI variables")
3802 (description "This package provides a library and a command line
3803 interface to the variable facility of UEFI boot firmware.")
3804 (license license:lgpl2.1+)))
3806 (define-public efibootmgr
3812 (uri (string-append "https://github.com/rhinstaller/" name
3813 "/releases/download/" version "/" name
3814 "-" version ".tar.bz2"))
3817 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3818 (build-system gnu-build-system)
3820 `(#:tests? #f ; No tests.
3821 #:make-flags (list (string-append "prefix=" %output)
3822 (string-append "libdir=" %output "/lib")
3823 ;; Override CFLAGS to add efivar include directory.
3824 (string-append "CFLAGS=-O2 -g -flto -I"
3825 (assoc-ref %build-inputs "efivar")
3828 (modify-phases %standard-phases
3829 (add-after 'unpack 'branding
3830 ;; Replace default loader path with something more familiar.
3832 (substitute* "src/efibootmgr.c"
3833 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3836 (delete 'configure))))
3838 `(("pkg-config" ,pkg-config)))
3840 `(("efivar" ,efivar)
3842 (home-page "https://github.com/rhinstaller/efibootmgr")
3843 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3845 "@code{efibootmgr} is a user-space application to modify the Intel
3846 Extensible Firmware Interface (EFI) Boot Manager. This application can
3847 create and destroy boot entries, change the boot order, change the next
3848 running boot option, and more.")
3849 (license license:gpl2+)))
3851 (define-public sysstat
3857 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3858 "sysstat-" version ".tar.xz"))
3861 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3862 (build-system gnu-build-system)
3864 `(#:tests? #f ; No test suite.
3865 ;; Without this flag, it tries to install the man pages with group 'root'
3866 ;; and fails because /etc/passwd lacks an entry for the root user.
3868 (list "--disable-file-attr"
3869 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3871 (modify-phases %standard-phases
3872 ;; The build process tries to create '/var/lib/sa', so we skip that
3874 (add-after 'build 'skip-touching-var
3876 (substitute* "Makefile"
3877 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3880 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3881 (synopsis "Performance monitoring tools for Linux")
3882 (description "The sysstat utilities are a collection of performance
3883 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3884 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3885 @code{sadf} and @code{sa}.")
3886 (license license:gpl2+)))
3888 (define-public light
3894 (uri (string-append "https://github.com/haikarainen/" name
3895 "/archive/v" version ".tar.gz"))
3898 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3899 (file-name (string-append name "-" version ".tar.gz"))))
3900 (build-system gnu-build-system)
3902 '(#:tests? #f ; no tests
3903 #:make-flags (list "CC=gcc"
3904 (string-append "PREFIX=" %output))
3906 (modify-phases %standard-phases
3908 (add-after 'unpack 'patch-makefile
3910 (substitute* "Makefile" (("chown") "#")))))))
3912 `(("help2man" ,help2man)))
3913 (home-page "https://haikarainen.github.io/light")
3914 (synopsis "GNU/Linux application to control backlights")
3916 "Light is a program to send commands to screen backlight controllers
3917 under GNU/Linux. Features include:
3920 @item It does not rely on X.
3921 @item Light can automatically figure out the best controller to use, making
3922 full use of underlying hardware.
3923 @item It is possible to set a minimum brightness value, as some controllers
3924 set the screen to be pitch black at a vaĺue of 0 (or higher).
3927 Light is the successor of lightscript.")
3928 (license license:gpl3+)))
3937 "https://github.com/linrunner/"
3938 (string-upcase name)
3939 "/archive/" version ".tar.gz"))
3940 (file-name (string-append name "-" version ".tar.gz"))
3943 "068hzmh90x600saynbl7iwg1pm0ywldn4jazyxx5y1fixs8s1qbn"))))
3944 (inputs `(("bash" ,bash)
3946 ("ethtool" ,ethtool)
3950 ("inetutils" ,inetutils)
3953 ("pciutils" ,pciutils)
3957 ("usbutils" ,usbutils)
3958 ("util-linux" ,util-linux)
3959 ("wireless-tools" ,wireless-tools)))
3960 (build-system gnu-build-system)
3963 (modify-phases %standard-phases
3964 (delete 'configure) ; no configure script
3965 (add-before 'build 'setenv
3966 (lambda* (#:key outputs #:allow-other-keys)
3967 (let ((out (assoc-ref outputs "out")))
3968 (setenv "TLP_WITH_SYSTEMD" "0")
3969 (setenv "TLP_NO_INIT" "1")
3970 (setenv "TLP_NO_PMUTILS" "1")
3971 (setenv "TLP_SBIN" (string-append out "/bin"))
3972 (setenv "TLP_BIN" (string-append out "/bin"))
3973 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3974 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3975 (setenv "TLP_CONF" "/etc/tlp")
3977 (string-append out "/share/bash-completion/completions"))
3978 (setenv "TLP_MAN" (string-append out "/share/man"))
3979 (setenv "TLP_META" (string-append out "/share/metainfo")))))
3980 (delete 'check) ; no tests
3981 (add-before 'install 'fix-installation
3983 ;; Stop the Makefile from trying to create system directories.
3984 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
3987 (invoke "make" "install-tlp" "install-man")
3989 (add-after 'install 'wrap
3990 (lambda* (#:key inputs outputs #:allow-other-keys)
3991 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3992 (bin-files (find-files bin ".*")))
3993 (define (bin-directory input-name)
3994 (string-append (assoc-ref inputs input-name) "/bin"))
3995 (define (sbin-directory input-name)
3996 (string-append (assoc-ref inputs input-name) "/sbin"))
3997 (for-each (lambda (program)
3998 (wrap-program program
4001 (map bin-directory '("bash"
4012 (map sbin-directory '("ethtool"
4017 "wireless-tools"))))))
4019 (home-page "http://linrunner.de/en/tlp/tlp.html")
4020 (synopsis "Power management tool for Linux")
4021 (description "TLP is a power management tool for Linux. It comes with
4022 a default configuration already optimized for battery life. Nevertheless,
4023 TLP is customizable to fulfil system requirements. TLP settings are applied
4024 every time the power supply source is changed.")
4026 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4028 (license (list license:gpl2+ license:gpl3+))))
4036 (uri (string-append "https://www.ezix.org/software/"
4037 "files/lshw-" version
4041 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4042 (build-system gnu-build-system)
4044 `(#:phases (modify-phases %standard-phases (delete 'configure))
4045 #:tests? #f ; no tests
4047 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4048 (synopsis "List hardware information")
4050 "@command{lshw} (Hardware Lister) is a small tool to provide
4051 detailed information on the hardware configuration of the machine.
4052 It can report exact memory configuration, firmware version, mainboard
4053 configuration, CPU version and speed, cache configuration, bus speed,
4054 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4055 machines (PowerMac G4 is known to work).")
4056 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4057 (license license:gpl2+)))
4059 (define-public libmnl
4066 (uri (string-append "mirror://netfilter.org/libmnl/"
4067 "libmnl-" version ".tar.bz2"))
4070 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4071 (build-system gnu-build-system)
4072 (home-page "https://www.netfilter.org/projects/libmnl/")
4073 (synopsis "Netlink utility library")
4074 (description "Libmnl is a minimalistic user-space library oriented to
4075 Netlink developers. There are a lot of common tasks in parsing, validating,
4076 constructing of both the Netlink header and TLVs that are repetitive and easy to
4077 get wrong. This library aims to provide simple helpers that allows you to
4078 re-use code and to avoid re-inventing the wheel.")
4079 (license license:lgpl2.1+)))
4081 (define-public libnftnl
4088 (uri (string-append "mirror://netfilter.org/libnftnl/"
4089 "libnftnl-" version ".tar.bz2"))
4092 "0d9nkdbdck8sg6msysqyv3m9kjr9sjif5amf26dfa0g3mqjdihgy"))))
4093 (build-system gnu-build-system)
4095 `(("pkg-config" ,pkg-config)))
4097 `(("libmnl" ,libmnl)))
4098 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4099 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4100 (description "Libnftnl is a userspace library providing a low-level netlink
4101 programming interface to the in-kernel nf_tables subsystem. The library
4102 libnftnl has been previously known as libnftables. This library is currently
4104 (license license:gpl2+)))
4106 (define-public nftables
4113 (uri (string-append "http://www.nftables.org/projects/nftables"
4114 "/files/nftables-" version ".tar.bz2"))
4117 "1i1gfy8l7qyhc5vlrpp63s0n5kybmc9pi4dywiq8rmkhrrnddsla"))))
4118 (build-system gnu-build-system)
4119 (inputs `(("bison", bison)
4123 ("libnftnl", libnftnl)
4124 ("readline", readline)))
4125 (native-inputs `(("pkg-config", pkg-config)))
4126 (home-page "http://www.nftables.org")
4127 (synopsis "Userspace utility for Linux packet filtering")
4128 (description "nftables is the project that aims to replace the existing
4129 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4130 filtering framework, a new userspace utility and also a compatibility layer for
4131 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4132 infrastructure such as the existing hooks, the connection tracking system, the
4133 userspace queueing component and the logging subsystem.")
4134 (license license:gpl2)))
4136 (define-public proot
4140 (home-page "https://github.com/proot-me/PRoot")
4143 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4144 (file-name (string-append name "-" version ".tar.gz"))
4147 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4148 (patches (search-patches "proot-test-fhs.patch"))))
4149 (build-system gnu-build-system)
4151 '(#:make-flags '("-C" "src")
4153 #:phases (modify-phases %standard-phases
4155 (add-before 'build 'set-shell-file-name
4156 (lambda* (#:key inputs #:allow-other-keys)
4157 (substitute* (find-files "src" "\\.[ch]$")
4160 (assoc-ref inputs "bash")
4163 (add-before 'check 'fix-fhs-assumptions-in-tests
4165 (substitute* "tests/test-c6b77b77.mk"
4166 (("/bin/bash") (which "bash"))
4167 (("/usr/bin/test") (which "test")))
4168 (substitute* '("tests/test-16573e73.c")
4169 (("/bin/([a-z-]+)" _ program)
4172 (substitute* (find-files "tests" "\\.sh$")
4173 ;; Some of the tests try to "bind-mount" /bin/true.
4175 (string-append "-b " (which "true") ":"))
4176 ;; Likewise for /bin.
4177 (("-b /bin:") "-b /gnu:")
4178 ;; Others try to run /bin/sh.
4179 (("/bin/sh") (which "sh"))
4180 ;; Others assume /etc/fstab exists.
4181 (("/etc/fstab") "/etc/passwd"))
4183 (substitute* "tests/GNUmakefile"
4184 (("-b /bin:") "-b /gnu:"))
4186 ;; XXX: This test fails in an obscure corner case, just
4188 (delete-file "tests/test-kkkkkkkk.c")
4193 (let ((n (parallel-job-count)))
4194 ;; For some reason we get lots of segfaults with
4195 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4196 (setenv "PROOT_NO_SECCOMP" "1")
4198 ;; Most of the tests expect "/bin" to be in $PATH so
4199 ;; they can run things that live in $ROOTFS/bin.
4201 (string-append (getenv "PATH") ":/bin"))
4203 (zero? (system* "make" "check" "-C" "tests"
4205 "-j" (number->string n))))))
4207 (lambda* (#:key outputs #:allow-other-keys)
4208 ;; The 'install' rule does nearly nothing.
4209 (let ((out (assoc-ref outputs "out")))
4211 ;; TODO: 'make install-care' (does not even
4212 ;; build currently.)
4213 (system* "make" "-C" "src" "install"
4214 (string-append "PREFIX=" out)))
4215 (let ((man1 (string-append out
4216 "/share/man/man1")))
4218 (copy-file "doc/proot/man.1"
4219 (string-append man1 "/proot.1"))
4221 (native-inputs `(("which" ,which)
4223 ;; For 'mcookie', used by some of the tests.
4224 ("util-linux" ,util-linux)))
4225 (inputs `(("talloc" ,talloc)))
4226 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4228 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4229 and @code{binfmt_misc}. This means that users don't need any privileges or
4230 setup to do things like using an arbitrary directory as the new root
4231 file system, making files accessible somewhere else in the file system
4232 hierarchy, or executing programs built for another CPU architecture
4233 transparently through QEMU user-mode. Also, developers can use PRoot as a
4234 generic process instrumentation engine thanks to its extension mechanism.
4235 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4236 available in the kernel Linux.")
4237 (license license:gpl2+)))
4239 (define-public proot-static
4242 (name "proot-static")
4244 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4245 (inputs `(("talloc" ,talloc/static)))
4247 (substitute-keyword-arguments (package-arguments proot)
4248 ((#:make-flags flags)
4249 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4251 `(modify-phases ,phases
4252 (add-after 'strip 'remove-store-references
4253 (lambda* (#:key outputs #:allow-other-keys)
4254 (let* ((out (assoc-ref outputs "out")))
4255 (with-directory-excursion out
4256 (remove-store-references "bin/proot")
4258 ((#:allowed-references _ '("out"))
4261 (define-public cpuid
4264 (version "20170122")
4267 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4268 version ".src.tar.gz"))
4271 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4272 (build-system gnu-build-system)
4274 '(#:make-flags '("CC=gcc")
4275 #:tests? #f ; no tests
4276 #:phases (modify-phases %standard-phases
4278 (add-before 'install 'fix-makefile
4279 (lambda* (#:key outputs #:allow-other-keys)
4280 (substitute* "Makefile"
4281 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4282 ;; Make the compressed manpages writable so that the
4283 ;; reset-gzip-timestamps phase does not error out.
4284 (substitute* "Makefile"
4285 (("-m 444") "-m 644"))
4287 (inputs `(("perl" ,perl)))
4288 (supported-systems '("i686-linux" "x86_64-linux"))
4289 (home-page "http://www.etallen.com/cpuid.html")
4290 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4291 (description "cpuid dumps detailed information about the CPU(s) gathered
4292 from the CPUID instruction, and also determines the exact model of CPU(s). It
4293 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4294 NexGen, Rise, and SiS CPUs.")
4295 (license license:gpl2+)))
4297 (define-public jmtpfs
4304 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4306 (file-name (string-append name "-" version ".tar.gz"))
4309 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4310 (build-system gnu-build-system)
4314 ("libmtp" ,libmtp)))
4316 `(("pkg-config" ,pkg-config)))
4317 (home-page "https://github.com/JasonFerrara/jmtpfs")
4318 (synopsis "Use a FUSE file system to access data over MTP")
4319 (description "jmtpfs uses FUSE (file system in userspace) to provide access
4320 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4321 the MTP device as a file system.")
4322 (license license:gpl3)))
4324 (define-public procenv
4331 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4333 (file-name (string-append name "-" version ".tar.gz"))
4335 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
4336 (build-system gnu-build-system)
4337 (arguments `(#:configure-flags '("--disable-silent-rules")))
4338 (native-inputs `(("pkg-config" ,pkg-config)))
4339 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4340 ("groff" ,groff) ; for tests
4341 ("libselinux" ,libselinux)))
4342 (synopsis "Utility to show process environment")
4343 (description "Procenv is a command-line tool that displays as much detail about
4344 itself and its environment as possible. It can be used as a test
4345 tool, to understand the type of environment a process runs in, and for
4346 comparing system environments.")
4347 (home-page "http://github.com/jamesodhunt/procenv/")
4348 (license license:gpl3+)))
4350 (define-public libfabric
4358 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4359 version "/libfabric-" version ".tar.bz2"))
4361 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4362 (build-system gnu-build-system)
4363 (inputs `(("rdma-core" ,rdma-core)
4364 ,@(match (%current-system)
4365 ((member (package-supported-systems psm))
4369 (home-page "https://ofiwg.github.io/libfabric/")
4370 (synopsis "Open Fabric Interfaces")
4372 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4373 communication services to applications. OFI is best described as a collection
4374 of libraries and applications used to export fabric services. The key
4375 components of OFI are: application interfaces, provider libraries, kernel
4376 services, daemons, and test applications.
4378 Libfabric is a core component of OFI. It is the library that defines and
4379 exports the user-space API of OFI, and is typically the only software that
4380 applications deal with directly. It works in conjunction with provider
4381 libraries, which are often integrated directly into libfabric.")
4382 (license (list license:bsd-2 license:gpl2)))) ;dual
4387 (version "3.3.20170428")
4388 (home-page "https://github.com/intel/psm")
4392 (uri (git-reference (url home-page)
4393 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
4394 (file-name (string-append "psm-" version ".tar.gz"))
4396 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
4397 (patches (search-patches
4398 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
4399 "psm-ldflags.patch" ; build shared lib with LDFLAGS
4400 "psm-repro.patch")))) ; reproducibility
4401 (build-system gnu-build-system)
4402 (inputs `(("libuuid" ,util-linux)))
4404 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
4405 ,(string-append "INSTALL_PREFIX=" %output)
4406 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4408 #:phases (modify-phases %standard-phases
4410 (add-after 'unpack 'patch-/usr/include
4412 (substitute* "Makefile"
4413 (("\\$\\{DESTDIR}/usr/include")
4414 (string-append %output "/include")))
4415 (substitute* "Makefile"
4416 (("/lib64") "/lib"))
4418 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
4420 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
4421 communications interface for the True Scale family of products. PSM users are
4422 enabled with mechanisms necessary to implement higher level communications
4423 interfaces in parallel environments.")
4424 ;; Only Intel-compatable processors are supported.
4425 (supported-systems '("i686-linux" "x86_64-linux"))
4426 (license (list license:bsd-2 license:gpl2)))) ;dual
4428 (define-public snapscreenshot
4430 (name "snapscreenshot")
4431 (version "1.0.14.3")
4435 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
4436 name "-" version ".tar.bz2"))
4438 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
4439 (build-system gnu-build-system)
4442 (let ((out (assoc-ref %outputs "out")))
4443 (list (string-append "BINDIR=" out "/bin")
4444 (string-append "MANDIR=" out "/share/man")))
4445 #:tests? #f ; no test suite
4447 (modify-phases %standard-phases
4448 (delete 'configure) ; ./configure is a snarky no-op
4449 (add-before 'install 'fix-ownership
4450 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
4452 (substitute* "depfun.mak"
4453 ((" -o bin -g bin ") " "))
4455 (add-before 'install 'create-output-directories
4456 (lambda* (#:key outputs #:allow-other-keys)
4457 (let ((out (assoc-ref outputs "out")))
4458 (mkdir-p (string-append out "/share/man/man1"))
4460 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
4461 (synopsis "Take screenshots of one or more Linux text consoles")
4463 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
4464 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
4465 relevant @file{/dev/vcs*} file(s).")
4466 (license license:gpl2)))
4468 (define-public fbcat
4475 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
4476 version "/" name "-" version ".tar.gz"))
4478 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
4479 (build-system gnu-build-system)
4481 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
4482 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
4483 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
4484 `(("pnmtopng" ,netpbm)))
4485 (outputs (list "out" "fbgrab"))
4489 (string-append "PREFIX=" (assoc-ref %outputs "out")))
4490 #:tests? #f ; no tests
4492 (modify-phases %standard-phases
4493 (delete 'configure) ; no configure script
4494 (add-after 'build 'qualify-references
4495 (lambda* (#:key inputs outputs #:allow-other-keys)
4496 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
4497 (out (assoc-ref outputs "out")))
4498 (substitute* "fbgrab"
4500 (string-append out "/bin/" all))
4502 (string-append pnmtopng "/bin/" all)))
4504 (add-after 'install 'split-fbgrab-output
4505 (lambda* (#:key outputs #:allow-other-keys)
4506 (let* ((out (assoc-ref outputs "out"))
4507 (out:fbgrab (assoc-ref outputs "fbgrab")))
4508 (for-each (lambda (file)
4509 (let ((old (string-append out "/" file))
4510 (new (string-append out:fbgrab "/" file)))
4511 (mkdir-p (dirname new))
4512 (rename-file old new)))
4514 "share/man/man1/fbgrab.1"))
4516 (home-page "https://jwilk.net/software/fbcat")
4517 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
4519 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
4520 a dump therof. It supports a wide range of drivers and pixel formats.
4521 @command{fbcat} can take screenshots of virtually any application that can be
4522 made to write its output to the framebuffer, including (but not limited to)
4523 text-mode or graphical applications that don't use a display server.
4525 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
4526 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
4527 (license license:gpl2)))