1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017 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 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017 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 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 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@no-reply.pragmatique.xyz>
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 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
30 ;;; This file is part of GNU Guix.
32 ;;; GNU Guix is free software; you can redistribute it and/or modify it
33 ;;; under the terms of the GNU General Public License as published by
34 ;;; the Free Software Foundation; either version 3 of the License, or (at
35 ;;; your option) any later version.
37 ;;; GNU Guix is distributed in the hope that it will be useful, but
38 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
39 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 ;;; GNU General Public License for more details.
42 ;;; You should have received a copy of the GNU General Public License
43 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
45 (define-module (gnu packages linux)
46 #:use-module (gnu packages)
47 #:use-module (gnu packages acl)
48 #:use-module (gnu packages admin)
49 #:use-module (gnu packages algebra)
50 #:use-module (gnu packages attr)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages backup)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages bison)
56 #:use-module (gnu packages calendar)
57 #:use-module (gnu packages check)
58 #:use-module (gnu packages crypto)
59 #:use-module (gnu packages compression)
60 #:use-module (gnu packages databases)
61 #:use-module (gnu packages datastructures)
62 #:use-module (gnu packages docbook)
63 #:use-module (gnu packages documentation)
64 #:use-module (gnu packages elf)
65 #:use-module (gnu packages flex)
66 #:use-module (gnu packages file)
67 #:use-module (gnu packages freedesktop)
68 #:use-module (gnu packages gcc)
69 #:use-module (gnu packages gettext)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnuzilla)
72 #:use-module (gnu packages gperf)
73 #:use-module (gnu packages gtk)
74 #:use-module (gnu packages libusb)
75 #:use-module (gnu packages man)
76 #:use-module (gnu packages maths)
77 #:use-module (gnu packages multiprecision)
78 #:use-module (gnu packages ncurses)
79 #:use-module (gnu packages networking)
80 #:use-module (gnu packages ninja)
81 #:use-module (gnu packages perl)
82 #:use-module (gnu packages pciutils)
83 #:use-module (gnu packages pkg-config)
84 #:use-module (gnu packages popt)
85 #:use-module (gnu packages pulseaudio)
86 #:use-module (gnu packages python)
87 #:use-module (gnu packages readline)
88 #:use-module (gnu packages rrdtool)
89 #:use-module (gnu packages samba)
90 #:use-module (gnu packages slang)
91 #:use-module (gnu packages storage)
92 #:use-module (gnu packages texinfo)
93 #:use-module (gnu packages tls)
94 #:use-module (gnu packages valgrind)
95 #:use-module (gnu packages video)
96 #:use-module (gnu packages web)
97 #:use-module (gnu packages xiph)
98 #:use-module (gnu packages xml)
99 #:use-module (gnu packages xdisorg)
100 #:use-module (gnu packages xorg)
101 #:use-module (guix build-system cmake)
102 #:use-module (guix build-system gnu)
103 #:use-module (guix build-system python)
104 #:use-module (guix build-system trivial)
105 #:use-module (guix download)
106 #:use-module ((guix licenses) #:prefix license:)
107 #:use-module (guix packages)
108 #:use-module (guix utils)
109 #:use-module (srfi srfi-1)
110 #:use-module (srfi srfi-2)
111 #:use-module (srfi srfi-26)
112 #:use-module (ice-9 match))
114 (define-public (system->linux-architecture arch)
115 "Return the Linux architecture name for ARCH, a Guix system name such as
116 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
117 (let ((arch (car (string-split arch #\-))))
118 (cond ((string=? arch "i686") "i386")
119 ((string-prefix? "mips" arch) "mips")
120 ((string-prefix? "arm" arch) "arm")
121 ((string-prefix? "aarch64" arch) "arm64")
122 ((string-prefix? "alpha" arch) "alpha")
125 (define-public (system->defconfig system)
126 "Some systems (notably powerpc-linux) require a special target for kernel
127 defconfig. Return the appropiate make target if applicable, otherwise return
129 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
132 (define (linux-libre-urls version)
133 "Return a list of URLs for Linux-Libre VERSION."
135 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
136 version "-gnu/linux-libre-" version "-gnu.tar.xz")
138 ;; XXX: Work around <http://bugs.gnu.org/14851>.
140 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
141 version "-gnu.tar.xz")
143 ;; Maybe this URL will become valid eventually.
145 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
146 version "-gnu.tar.xz")))
148 (define-public linux-libre-headers
150 (name "linux-libre-headers")
154 (uri (linux-libre-urls version))
157 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
158 (build-system gnu-build-system)
159 (native-inputs `(("perl" ,perl)))
161 `(#:modules ((guix build gnu-build-system)
165 (modify-phases %standard-phases
169 (let ((arch ,(system->linux-architecture
170 (or (%current-target-system)
172 (defconfig ,(system->defconfig
173 (or (%current-target-system)
174 (%current-system)))))
176 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
177 (and (zero? (system* "make" defconfig))
178 (zero? (system* "make" "mrproper" "headers_check"))))))
180 (lambda* (#:key outputs #:allow-other-keys)
181 (let ((out (assoc-ref outputs "out")))
182 (and (zero? (system* "make"
183 (string-append "INSTALL_HDR_PATH=" out)
186 (mkdir (string-append out "/include/config"))
187 (call-with-output-file
189 "/include/config/kernel.release")
191 (format p "~a-default~%" ,version)))
193 ;; Remove the '.install' and '..install.cmd' files; the
194 ;; latter contains store paths, which pulls in bootstrap
195 ;; binaries in the build environment, and prevents bit
196 ;; reproducibility for the bootstrap binaries.
197 (for-each delete-file (find-files out "\\.install"))
200 #:allowed-references ()
202 (home-page "https://www.gnu.org/software/linux-libre/")
203 (synopsis "GNU Linux-Libre kernel headers")
204 (description "Headers of the Linux-Libre kernel.")
205 (license license:gpl2)))
207 (define %boot-logo-patch
208 ;; Linux-Libre boot logo featuring Freedo and a gnu.
211 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
212 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
215 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
217 (define* (kernel-config arch #:key variant)
218 "Return the absolute file name of the Linux-Libre build configuration file
219 for ARCH and optionally VARIANT, or #f if there is no such configuration."
220 (let* ((name (string-append (if variant (string-append variant "-") "")
221 (if (string=? "i386" arch) "i686" arch) ".conf"))
222 (file (string-append "linux-libre/" name)))
223 (search-auxiliary-file file)))
225 (define %default-extra-linux-options
226 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
227 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
228 ;; Modules required for initrd:
229 ("CONFIG_NET_9P" . m)
230 ("CONFIG_NET_9P_VIRTIO" . m)
231 ("CONFIG_VIRTIO_BLK" . m)
232 ("CONFIG_VIRTIO_NET" . m)
233 ("CONFIG_VIRTIO_PCI" . m)
234 ("CONFIG_VIRTIO_BALLOON" . m)
235 ("CONFIG_VIRTIO_MMIO" . m)
236 ("CONFIG_FUSE_FS" . m)
238 ("CONFIG_9P_FS" . m)))
240 (define (config->string options)
241 (string-join (map (match-lambda
243 (string-append option "=m"))
245 (string-append option "=y"))
247 (string-append option "=n")))
251 (define* (make-linux-libre version hash supported-systems
253 ;; A function that takes an arch and a variant.
254 ;; See kernel-config for an example.
256 (configuration-file #f)
257 (defconfig "defconfig")
258 (extra-options %default-extra-linux-options)
259 (patches (list %boot-logo-patch)))
261 (name (if extra-version
262 (string-append "linux-libre-" extra-version)
267 (uri (linux-libre-urls version))
268 (sha256 (base32 hash))
270 (supported-systems supported-systems)
271 (build-system gnu-build-system)
277 ,@(match (and configuration-file
279 (system->linux-architecture
280 (or (%current-target-system) (%current-system)))
281 #:variant (version-major+minor version)))
282 (#f ;no config for this platform
285 `(("kconfig" ,config))))))
287 `(#:modules ((guix build gnu-build-system)
292 (modify-phases %standard-phases
294 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
295 ;; Avoid introducing timestamps
296 (setenv "KCONFIG_NOTIMESTAMP" "1")
297 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
299 ;; Set ARCH and CROSS_COMPILE
300 (let ((arch ,(system->linux-architecture
301 (or (%current-target-system)
302 (%current-system)))))
304 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
307 (setenv "CROSS_COMPILE" (string-append target "-"))
308 (format #t "`CROSS_COMPILE' set to `~a'~%"
309 (getenv "CROSS_COMPILE"))))
311 (setenv "EXTRA_VERSION" ,extra-version)
313 (let ((build (assoc-ref %standard-phases 'build))
314 (config (assoc-ref inputs "kconfig")))
316 ;; Use a custom kernel configuration file or a default
317 ;; configuration file.
320 (copy-file config ".config")
321 (chmod ".config" #o666))
322 (system* "make" ,defconfig))
324 ;; Appending works even when the option wasn't in the
325 ;; file. The last one prevails if duplicated.
326 (let ((port (open-file ".config" "a"))
327 (extra-configuration ,(config->string extra-options)))
328 (display extra-configuration port)
331 (zero? (system* "make" "oldconfig")))))
333 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
334 (let* ((out (assoc-ref outputs "out"))
335 (moddir (string-append out "/lib/modules"))
336 (dtbdir (string-append out "/lib/dtbs"))
337 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
338 ;; Install kernel image, kernel configuration and link map.
339 (for-each (lambda (file) (install-file file out))
340 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
341 ;; Install device tree files
342 (for-each (lambda (file) (install-file file dtbdir))
343 (find-files "." "\\.dtb$"))
344 ;; Install kernel modules
346 (zero? (system* "make"
347 (string-append "DEPMOD=" kmod "/bin/depmod")
348 (string-append "MODULE_DIR=" moddir)
349 (string-append "INSTALL_PATH=" out)
350 (string-append "INSTALL_MOD_PATH=" out)
351 "INSTALL_MOD_STRIP=1"
352 "modules_install"))))))
354 (home-page "https://www.gnu.org/software/linux-libre//")
355 (synopsis "100% free redistribution of a cleaned Linux kernel")
357 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
358 It has been modified to remove all non-free binary blobs.")
359 (license license:gpl2)))
361 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
363 (define %linux-libre-version "4.11.7")
364 (define %linux-libre-hash "0kliwdz4qqjz13pywhavxg19cy1mf6d1f52f6kgapc331309vad9")
366 (define-public linux-libre
367 (make-linux-libre %linux-libre-version
369 %intel-compatible-systems
370 #:configuration-file kernel-config))
372 (define-public linux-libre-4.9
373 (make-linux-libre "4.9.34"
374 "00jm3338kvhfj850lg3mvk680fmfw34mvwaq41lvxgb1z2xqqlz1"
375 %intel-compatible-systems
376 #:configuration-file kernel-config))
378 (define-public linux-libre-4.4
379 (make-linux-libre "4.4.74"
380 "04x2ki3s2jsjkkk6bld0rd9rsk8qqvrfsxawxzfa26mkq6pv87r2"
381 %intel-compatible-systems
382 #:configuration-file kernel-config))
384 (define-public linux-libre-4.1
385 (make-linux-libre "4.1.41"
386 "02mqfl899jxvrmxlh8lvcgvm3klwd8wbsdz4rr2gpchbggj4vgb2"
387 %intel-compatible-systems
388 #:configuration-file kernel-config))
390 (define-public linux-libre-arm-generic
391 (make-linux-libre %linux-libre-version
394 #:defconfig "multi_v7_defconfig"
395 #:extra-version "arm-generic"))
399 ;;; Pluggable authentication modules (PAM).
402 (define-public linux-pam
410 "http://www.linux-pam.org/library/"
411 "Linux-PAM-" version ".tar.bz2"))
414 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
415 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
417 (build-system gnu-build-system)
421 ;; TODO: optional dependencies
422 ;; ("libxcrypt" ,libxcrypt)
423 ;; ("cracklib" ,cracklib)
426 '(;; Most users, such as `shadow', expect the headers to be under
428 #:configure-flags (list (string-append "--includedir="
429 (assoc-ref %outputs "out")
430 "/include/security"))
432 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
435 (home-page "http://www.linux-pam.org/")
436 (synopsis "Pluggable authentication modules for Linux")
438 "A *Free* project to implement OSF's RFC 86.0.
439 Pluggable authentication modules are small shared object files that can
440 be used through the PAM API to perform tasks, like authenticating a user
441 at login. Local and dynamic reconfiguration are its key features.")
442 (license license:bsd-3)))
444 (define-public linux-pam-1.2
452 "http://www.linux-pam.org/library/"
453 "Linux-PAM-" version ".tar.bz2"))
456 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
457 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
464 (define-public psmisc
471 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
475 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
476 (build-system gnu-build-system)
477 (inputs `(("ncurses" ,ncurses)))
478 (home-page "https://gitlab.com/psmisc/psmisc")
480 "Small utilities that use the proc file system")
482 "This PSmisc package is a set of some small useful utilities that
483 use the proc file system. We're not about changing the world, but
484 providing the system administrator with some help in common tasks.")
485 (license license:gpl2+)))
487 (define-public util-linux
493 (uri (string-append "mirror://kernel.org/linux/utils/"
494 name "/v" (version-major+minor version) "/"
495 name "-" version ".tar.xz"))
498 "1qz81w8vzrmy8xn9yx7ls4amkbgwx6vr62pl6kv9g7r0g3ba9kmc"))
499 (patches (search-patches "util-linux-tests.patch"))
500 (modules '((guix build utils)))
502 ;; We take the 'logger' program from GNU Inetutils and 'kill'
503 ;; from GNU Coreutils.
505 (substitute* "configure"
506 (("build_logger=yes") "build_logger=no")
507 (("build_kill=yes") "build_kill=no"))
509 (build-system gnu-build-system)
511 "static")) ; >2 MiB of static .a libraries
513 `(#:configure-flags (list "--disable-use-tty-group"
514 "--enable-fs-paths-default=/run/current-system/profile/sbin"
515 ;; Install completions where our
516 ;; bash-completion package expects them.
517 (string-append "--with-bashcompletiondir="
518 (assoc-ref %outputs "out")
519 "/etc/bash_completion.d"))
520 #:phases (modify-phases %standard-phases
522 'build 'set-umount-file-name
523 (lambda* (#:key outputs #:allow-other-keys)
524 ;; Tell 'eject' the right file name of 'umount'.
525 (let ((out (assoc-ref outputs "out")))
526 (substitute* "sys-utils/eject.c"
528 (string-append "\"" out "/bin/umount\"")))
532 (lambda* (#:key inputs outputs #:allow-other-keys)
533 (let ((out (assoc-ref outputs "out"))
534 (net (assoc-ref inputs "net-base")))
535 ;; Change the test to refer to the right file.
536 (substitute* "tests/ts/misc/mcookie"
538 (string-append net "/etc/services")))
541 'install 'move-static-libraries
542 (lambda* (#:key outputs #:allow-other-keys)
543 (let ((out (assoc-ref outputs "out"))
544 (static (assoc-ref outputs "static")))
545 (mkdir-p (string-append static "/lib"))
546 (with-directory-excursion out
547 (for-each (lambda (file)
549 (string-append static "/"
551 (find-files "lib" "\\.a$")))
553 (inputs `(("zlib" ,zlib)
554 ("ncurses" ,ncurses)))
557 ("net-base" ,net-base))) ;for tests
558 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
559 (synopsis "Collection of utilities for the Linux kernel")
560 (description "Util-linux is a diverse collection of Linux kernel
561 utilities. It provides dmesg and includes tools for working with file systems,
562 block devices, UUIDs, TTYs, and many other tools.")
564 ;; Note that util-linux doesn't use the same license for all the
565 ;; code. GPLv2+ is the default license for a code without an
566 ;; explicitly defined license.
567 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
568 license:bsd-4 license:public-domain))))
576 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
578 (file-name (string-append name "-" version ".tar.gz"))
580 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
581 (build-system cmake-build-system)
582 (arguments '(#:tests? #f))
583 (home-page "https://github.com/bo0ts/ddate")
584 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
586 "ddate displays the Discordian date and holidays of a given date.
587 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
588 by Robert Shea and Robert Anton Wilson.")
589 (license license:public-domain)))
591 (define-public procps
597 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
598 "procps-ng-" version ".tar.xz"))
601 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
602 (build-system gnu-build-system)
604 '(#:modules ((guix build utils)
605 (guix build gnu-build-system)
609 (modify-phases %standard-phases
610 (add-before 'check 'disable-strtod-test
612 ;; Disable the 'strtod' test, which fails on 32-bit systems.
613 ;; This is what upstream does:
614 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
615 (substitute* "Makefile"
616 (("^(TESTS|check_PROGRAMS) = .*$" all)
617 (string-append "# " all "\n")))
620 'install 'post-install
621 ;; Remove commands and man pages redudant with
623 (lambda* (#:key outputs #:allow-other-keys)
624 (let* ((out (assoc-ref outputs "out"))
625 (dup (append-map (cut find-files out <>)
626 '("^kill" "^uptime"))))
627 (for-each delete-file dup)
629 (inputs `(("ncurses" ,ncurses)))
630 (home-page "https://gitlab.com/procps-ng/procps/")
631 (synopsis "Utilities that give information about processes")
633 "Procps is the package that has a bunch of small useful utilities
634 that give information about processes using the Linux /proc file system.
635 The package includes the programs ps, top, vmstat, w, kill, free,
636 slabtop, and skill.")
637 (license license:gpl2)))
639 (define-public usbutils
646 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
647 "usbutils-" version ".tar.xz"))
650 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
651 (build-system gnu-build-system)
654 ("eudev" ,eudev-with-hwdb)))
656 `(("pkg-config" ,pkg-config)))
657 (home-page "http://www.linux-usb.org/")
659 "Tools for working with USB devices, such as lsusb")
661 "Tools for working with USB devices, such as lsusb.")
662 (license license:gpl2+)))
664 (define-public e2fsprogs
671 "mirror://kernel.org/linux/kernel/people/tytso/"
672 name "/v" version "/"
673 name "-" version ".tar.xz"))
676 "092absr4vrlqrkdf9nwh4ykj40ab6hhwrkdr6sjsccd54c8z5csl"))))
677 (build-system gnu-build-system)
678 (inputs `(("util-linux" ,util-linux)))
679 (native-inputs `(("pkg-config" ,pkg-config)
680 ("texinfo" ,texinfo) ;for the libext2fs Info manual
686 '(;; util-linux is the preferred source for some of the libraries and
687 ;; commands, so disable them (see, e.g.,
688 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
689 #:configure-flags (list "--disable-libblkid"
690 "--disable-libuuid" "--disable-uuidd"
693 ;; Use symlinks instead of hard links for
694 ;; 'fsck.extN' etc. This makes the resulting nar
695 ;; smaller and is preserved across copies.
696 "--enable-symlink-install"
698 (string-append "LDFLAGS=-Wl,-rpath="
699 (assoc-ref %outputs "out")
702 ;; Install libext2fs et al.
703 "--enable-elf-shlibs")
706 (modify-phases %standard-phases
707 (add-before 'configure 'patch-shells
709 (substitute* "configure"
710 (("/bin/sh (.*)parse-types.sh" _ dir)
711 (string-append (which "sh") " " dir
713 (substitute* "MCONFIG.in"
714 (("INSTALL_SYMLINK = /bin/sh")
715 "INSTALL_SYMLINK = sh"))
716 (substitute* (find-files "." "^Makefile.in$")
718 (string-append "#!" (which "sh"))))
720 (add-after 'install 'install-libs
721 (lambda* (#:key outputs #:allow-other-keys)
722 (let* ((out (assoc-ref outputs "out"))
723 (lib (string-append out "/lib")))
724 (and (zero? (system* "make" "install-libs"))
726 ;; Make the .a writable so that 'strip' works.
727 ;; Failing to do that, due to debug symbols, we
728 ;; retain a reference to the final
729 ;; linux-libre-headers, which refer to the
730 ;; bootstrap binaries.
731 (let ((archives (find-files lib "\\.a$")))
732 (for-each (lambda (file)
736 (home-page "http://e2fsprogs.sourceforge.net/")
737 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
739 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
740 (license (list license:gpl2 ;programs
741 license:lgpl2.0 ;libext2fs
742 license:x11)))) ;libuuid
744 (define e2fsprogs/static
746 (package (inherit e2fsprogs)
748 ;; Do not build shared libraries.
749 (substitute-keyword-arguments (package-arguments e2fsprogs)
750 ((#:configure-flags _)
751 '(list "--disable-blkid"))
755 (define-public e2fsck/static
757 (name "e2fsck-static")
758 (version (package-version e2fsprogs))
759 (build-system trivial-build-system)
762 `(("e2fsprogs" ,e2fsprogs/static)))
764 `(#:modules ((guix build utils))
767 (use-modules (guix build utils)
771 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
773 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
775 (with-directory-excursion bin
776 (copy-file e2fsck "e2fsck")
777 (remove-store-references "e2fsck")
778 (chmod "e2fsck" #o555))))))
779 (home-page (package-home-page e2fsprogs))
780 (synopsis "Statically-linked e2fsck command from e2fsprogs")
781 (description "This package provides statically-linked e2fsck command taken
782 from the e2fsprogs package. It is meant to be used in initrds.")
783 (license (package-license e2fsprogs))))
785 (define-public extundelete
791 (uri (string-append "mirror://sourceforge/extundelete/"
792 "extundelete/" version "/extundelete-"
796 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
797 (build-system gnu-build-system)
798 (inputs `(("e2fsprogs" ,e2fsprogs)))
799 (home-page "http://extundelete.sourceforge.net/")
800 (synopsis "Recover deleted files from ext2/3/4 partitions")
802 "Extundelete is a set of tools that can recover deleted files from an
803 ext3 or ext4 partition.")
804 (license license:gpl2)))
806 (define-public zerofree
810 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
813 (uri (string-append home-page name "-" version
817 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
818 (build-system gnu-build-system)
820 '(#:phases (alist-replace
822 (lambda* (#:key outputs #:allow-other-keys)
823 (let* ((out (assoc-ref outputs "out"))
824 (bin (string-append out "/bin")))
826 (copy-file "zerofree"
827 (string-append bin "/zerofree"))
828 (chmod (string-append bin "/zerofree")
831 (alist-delete 'configure %standard-phases))
832 #:tests? #f)) ;no tests
833 (inputs `(("libext2fs" ,e2fsprogs)))
834 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
836 "The zerofree command scans the free blocks in an ext2 file system and
837 fills any non-zero blocks with zeroes. This is a useful way to make disk
838 images more compressible.")
839 (license license:gpl2)))
841 (define-public strace
847 (uri (string-append "mirror://sourceforge/strace/strace/" version
848 "/strace-" version ".tar.xz"))
851 "06bl4dld5fk4a3iiq4pyrkm6sh63599ah8dmds0glg5vbw45pww1"))))
852 (build-system gnu-build-system)
855 (modify-phases %standard-phases
856 (add-after 'unpack 'patch-/bin/sh
858 (substitute* "strace.c"
859 (("/bin/sh") (which "sh")))
861 (native-inputs `(("perl" ,perl)))
862 (home-page "https://strace.io/")
863 (synopsis "System call tracer for Linux")
865 "strace is a system call tracer, i.e. a debugging tool which prints out a
866 trace of all the system calls made by a another process/program.")
867 (license license:bsd-3)))
869 (define-public ltrace
875 (uri (string-append "http://www.ltrace.org/ltrace_" version
879 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
880 (build-system gnu-build-system)
881 (inputs `(("libelf" ,libelf)))
883 ;; Compilation uses -Werror by default, but it fails.
884 '(#:configure-flags '("--disable-werror")))
885 (home-page "http://www.ltrace.org/")
886 (synopsis "Library call tracer for Linux")
888 "ltrace intercepts and records dynamic library calls which are called by
889 an executed process and the signals received by that process. It can also
890 intercept and print the system calls executed by the program.")
891 (license license:gpl2+)))
893 (define-public alsa-lib
900 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
904 "174n2psp0328xcy2f1ayls67598bxli6q9cf00d2qnac3012aa3i"))))
905 (build-system gnu-build-system)
906 (home-page "https://www.alsa-project.org/")
907 (synopsis "The Advanced Linux Sound Architecture libraries")
909 "The Advanced Linux Sound Architecture (ALSA) provides audio and
910 MIDI functionality to the Linux-based operating system.")
911 (license license:lgpl2.1+)))
913 (define-public alsa-utils
919 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
920 name "-" version ".tar.bz2"))
923 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
924 (build-system gnu-build-system)
926 ;; XXX: Disable man page creation until we have DocBook.
927 '(#:configure-flags (list "--disable-xmlto"
929 ;; The udev rule is responsible for restoring
931 (string-append "--with-udev-rules-dir="
932 (assoc-ref %outputs "out")
933 "/lib/udev/rules.d"))
935 (modify-phases %standard-phases
937 'install 'pre-install
939 ;; Don't try to mkdir /var/lib/alsa.
940 (substitute* "Makefile"
941 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
945 `(("libsamplerate" ,libsamplerate)
947 ("alsa-lib" ,alsa-lib)
949 ("gettext" ,gettext-minimal)))
950 (home-page "http://www.alsa-project.org/")
951 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
953 "The Advanced Linux Sound Architecture (ALSA) provides audio and
954 MIDI functionality to the Linux-based operating system.")
956 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
958 (license license:gpl2)))
960 (define-public alsa-plugins
962 (name "alsa-plugins")
966 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
967 name "-" version ".tar.bz2"))
970 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
971 (build-system gnu-build-system)
972 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
973 ;; be split, there are references to both in files.
974 ;; TODO: Remove OSS related plugins, they add support to run native
975 ;; ALSA applications on OSS however we do not offer OSS and OSS is
977 (outputs '("out" "pulseaudio"))
980 (modify-phases %standard-phases
981 (add-after 'install 'split
982 (lambda* (#:key inputs outputs #:allow-other-keys)
983 ;; Distribute the binaries to the various outputs.
984 (let* ((out (assoc-ref outputs "out"))
985 (pua (assoc-ref outputs "pulseaudio"))
986 (pualib (string-append pua "/lib/alsa-lib"))
987 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
990 (chdir (string-append out "/share"))
991 (for-each (lambda (file)
992 (rename-file file (string-append puaconf "/" (basename file))))
993 (find-files out "\\.(conf|example)"))
994 (for-each (lambda (file)
995 (rename-file file (string-append pualib "/" (basename file))))
996 (find-files out ".*pulse\\.(la|so)"))
998 ;; We have moved the files to output pulsaudio, the
999 ;; directory is now empty.
1000 (delete-file-recursively (string-append out "/share"))
1003 `(("alsa-lib" ,alsa-lib)
1004 ("speex" ,speex) ; libspeexdsp resampling plugin
1005 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1006 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1007 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1009 `(("pkg-config" ,pkg-config)))
1010 (home-page "http://www.alsa-project.org/")
1011 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1013 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1014 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1015 by providing additional plugins which include: upmixing, downmixing, jackd and
1016 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1017 external rate conversion.")
1018 (license (list license:gpl2+
1019 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1020 license:lgpl2.1+))))
1022 (define-public iptables
1029 "mirror://netfilter.org/iptables/iptables-"
1030 version ".tar.bz2"))
1033 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
1034 (build-system gnu-build-system)
1036 `(("pkg-config" ,pkg-config)
1040 `(("libmnl" ,libmnl)
1041 ("libnftnl" ,libnftnl)))
1043 '(#:tests? #f ; no test suite
1044 #:configure-flags ; add $libdir to the RUNPATH of executables
1045 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1046 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1047 (synopsis "Program to configure the Linux IP packet filtering rules")
1049 "iptables is the userspace command line program used to configure the
1050 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1051 system administrators. Since Network Address Translation is also configured
1052 from the packet filter ruleset, iptables is used for this, too. The iptables
1053 package also includes ip6tables. ip6tables is used for configuring the IPv6
1055 (license license:gpl2+)))
1057 (define-public ebtables
1060 (version "2.0.10-4")
1064 "mirror://netfilter.org/ebtables/ebtables-v"
1068 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1069 (build-system gnu-build-system)
1071 '(#:tests? #f ; no test suite
1073 (let* ((out (assoc-ref %outputs "out"))
1074 (bin (string-append out "/sbin"))
1075 (lib (string-append out "/lib"))
1076 (man (string-append out "/share/man"))
1077 (iptables (assoc-ref %build-inputs "iptables"))
1078 (ethertypes (string-append iptables "/etc/ethertypes")))
1079 (list (string-append "LIBDIR=" lib)
1080 (string-append "MANDIR=" man)
1081 (string-append "BINDIR=" bin)
1082 (string-append "ETHERTYPESFILE=" ethertypes)
1083 ;; With the default CFLAGS, it falis with:
1084 ;; communication.c:259:58: error: variable ‘ret’ set but not
1085 ;; used [-Werror=unused-but-set-variable]
1088 (modify-phases %standard-phases
1090 ;; no configure script
1092 (substitute* "Makefile"
1093 ;; Remove user and group options from install commands,
1094 ;; otherwise it fails with: invalid user 'root'.
1095 (("-o root -g root") "")
1096 ;; Remove 'ethertypes' from the install target.
1098 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1102 ("iptables" ,iptables)))
1103 (synopsis "Ethernet bridge frame table administration")
1104 (home-page "http://ebtables.netfilter.org/")
1106 "ebtables is an application program used to set up and maintain the
1107 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1108 analogous to the iptables application, but less complicated, due to the fact
1109 that the Ethernet protocol is much simpler than the IP protocol.")
1110 (license license:gpl2+)))
1112 (define-public iproute
1119 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1123 "09l0phf09mw17bn3xlzfr80sbhw14mq8xv28iz5x15m6pll10rvj"))))
1124 (build-system gnu-build-system)
1126 `(#:tests? #f ; no test suite
1127 #:make-flags (let ((out (assoc-ref %outputs "out")))
1129 (string-append "BASH_COMPDIR=" out
1130 "/etc/bash_completion.d")
1131 (string-append "LIBDIR=" out "/lib")
1132 (string-append "HDRDIR=" out "/include")
1133 (string-append "SBINDIR=" out "/sbin")
1134 (string-append "CONFDIR=" out "/etc")
1135 (string-append "DOCDIR=" out "/share/doc/"
1137 (string-append "MANDIR=" out "/share/man")))
1138 #:phases (modify-phases %standard-phases
1139 (add-before 'install 'pre-install
1141 ;; Don't attempt to create /var/lib/arpd.
1142 (substitute* "Makefile"
1143 (("^.*ARPDDIR.*$") "")))))))
1145 `(("iptables" ,iptables)
1148 `(("pkg-config" ,pkg-config)
1152 "https://wiki.linuxfoundation.org/networking/iproute2")
1154 "Utilities for controlling TCP/IP networking and traffic in Linux")
1156 "Iproute2 is a collection of utilities for controlling TCP/IP
1157 networking and traffic with the Linux kernel.
1159 Most network configuration manuals still refer to ifconfig and route as the
1160 primary network configuration tools, but ifconfig is known to behave
1161 inadequately in modern network environments. They should be deprecated, but
1162 most distros still include them. Most network configuration systems make use
1163 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1164 to support most modern network technologies, as it doesn't use ifconfig and
1165 allows a system administrator to make use of all iproute2 features, including
1168 iproute2 is usually shipped in a package called iproute or iproute2 and
1169 consists of several tools, of which the most important are @command{ip} and
1170 @command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1171 @command{tc} stands for traffic control. Both tools print detailed usage
1172 messages and are accompanied by a set of manpages.")
1173 (license license:gpl2+)))
1175 (define-public net-tools
1176 ;; XXX: This package is basically unmaintained, but it provides a few
1177 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1182 (home-page "http://net-tools.sourceforge.net/")
1185 (uri (list (string-append
1186 "mirror://sourceforge/net-tools/net-tools-"
1189 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1190 "/base/net-tools/net-tools-1.60.tar.bz2")))
1193 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1194 (patches (search-patches "net-tools-bitrot.patch"))))
1195 (build-system gnu-build-system)
1197 '(#:modules ((guix build gnu-build-system)
1201 #:phases (alist-cons-after
1203 (lambda* (#:key inputs #:allow-other-keys)
1204 (define (apply-patch file)
1205 (zero? (system* "patch" "-p1" "--force"
1208 (let ((patch.gz (assoc-ref inputs "patch")))
1209 (format #t "applying Debian patch set '~a'...~%"
1211 (system (string-append "gunzip < " patch.gz " > the-patch"))
1212 (and (apply-patch "the-patch")
1213 (for-each apply-patch
1214 (find-files "debian/patches"
1218 (lambda* (#:key outputs #:allow-other-keys)
1219 (let ((out (assoc-ref outputs "out")))
1220 (mkdir-p (string-append out "/bin"))
1221 (mkdir-p (string-append out "/sbin"))
1223 ;; Pretend we have everything...
1224 (system "yes | make config")
1226 ;; ... except for the things we don't have.
1227 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1228 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1229 ;; that have been removed.
1230 (substitute* '("config.make" "config.h")
1231 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1233 'install 'remove-redundant-commands
1234 (lambda* (#:key outputs #:allow-other-keys)
1235 ;; Remove commands and man pages redundant with
1237 (let* ((out (assoc-ref outputs "out"))
1238 (dup (append-map (cut find-files out <>)
1240 "^(yp|nis|dns)?domainname"))))
1241 (for-each delete-file dup)
1245 ;; Binaries that depend on libnet-tools.a don't declare that
1246 ;; dependency, making it parallel-unsafe.
1247 #:parallel-build? #f
1249 #:tests? #f ; no test suite
1250 #:make-flags (let ((out (assoc-ref %outputs "out")))
1252 (string-append "BASEDIR=" out)
1253 (string-append "INSTALLNLSDIR=" out "/share/locale")
1254 (string-append "mandir=/share/man")))))
1256 ;; Use the big Debian patch set (the thing does not even compile out of
1258 (inputs `(("patch" ,(origin
1261 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1264 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1265 (native-inputs `(("gettext" ,gettext-minimal)))
1267 (synopsis "Tools for controlling the network subsystem in Linux")
1269 "This package includes the important tools for controlling the network
1270 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1271 netstat, rarp and route. Additionally, this package contains utilities
1272 relating to particular network hardware types (plipconfig, slattach) and
1273 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1274 (license license:gpl2+)))
1276 (define-public libcap
1283 "mirror://kernel.org/linux/libs/security/linux-privs/"
1284 "libcap2/libcap-" version ".tar.xz"))
1287 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1288 (build-system gnu-build-system)
1289 (arguments '(#:phases
1290 (modify-phases %standard-phases
1292 ;; Add $libdir to the RUNPATH of executables.
1294 (substitute* "Make.Rules"
1296 (string-append "LDFLAGS := -Wl,-rpath="
1297 %output "/lib"))))))
1298 #:tests? #f ; no 'check' target
1299 #:make-flags (list "lib=lib"
1300 (string-append "prefix="
1301 (assoc-ref %outputs "out"))
1302 "RAISE_SETFCAP=no")))
1303 (native-inputs `(("perl" ,perl)))
1304 (inputs `(("attr" ,attr)))
1305 (home-page "https://sites.google.com/site/fullycapable/")
1306 (synopsis "Library for working with POSIX capabilities")
1308 "Libcap2 provides a programming interface to POSIX capabilities on
1309 Linux-based operating systems.")
1311 ;; License is BSD-3 or GPLv2, at the user's choice.
1312 (license license:gpl2)))
1314 (define-public bridge-utils
1316 (name "bridge-utils")
1320 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1321 "bridge-utils-" version ".tar.gz"))
1324 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1325 (build-system gnu-build-system)
1327 ;; The tarball lacks all the generated files.
1328 (native-inputs `(("autoconf" ,autoconf)
1329 ("automake" ,automake)))
1331 '(#:phases (alist-cons-after
1334 ;; Fix "field ‘ip6’ has incomplete type" errors.
1335 (substitute* "libbridge/libbridge.h"
1336 (("#include <linux/if_bridge.h>")
1337 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1339 ;; Ensure that the entire build fails if one of the
1340 ;; sub-Makefiles fails.
1341 (substitute* "Makefile.in"
1342 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1343 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1345 (zero? (system* "autoreconf" "-vf")))
1347 #:tests? #f)) ; no 'check' target
1350 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1351 (synopsis "Manipulate Ethernet bridges")
1353 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1354 to connect two Ethernet segments together in a protocol independent way.
1355 Packets are forwarded based on Ethernet address, rather than IP address (like
1356 a router). Since forwarding is done at Layer 2, all protocols can go
1357 transparently through a bridge.")
1358 (license license:gpl2+)))
1360 (define-public libnl
1367 "https://github.com/thom311/libnl/releases/download/"
1368 "libnl" (string-join (string-split version #\.) "_")
1369 "/libnl-" version ".tar.gz"))
1372 "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
1373 (build-system gnu-build-system)
1374 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1375 (home-page "http://www.infradead.org/~tgr/libnl/")
1376 (synopsis "NetLink protocol library suite")
1378 "The libnl suite is a collection of libraries providing APIs to netlink
1379 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1380 between the kernel and user space processes. It was designed to be a more
1381 flexible successor to ioctl to provide mainly networking related kernel
1382 configuration and monitoring interfaces.")
1384 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1385 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1386 (license license:gpl2)))
1395 "mirror://kernel.org/software/network/iw/iw-"
1399 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1400 (build-system gnu-build-system)
1401 (native-inputs `(("pkg-config" ,pkg-config)))
1402 (inputs `(("libnl" ,libnl)))
1404 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1406 #:phases (alist-delete 'configure %standard-phases)))
1407 (home-page "https://wireless.wiki.kernel.org/")
1408 (synopsis "Tool for configuring wireless devices")
1410 "iw is a new nl80211 based CLI configuration utility for wireless
1411 devices. It replaces @code{iwconfig}, which is deprecated.")
1412 (license license:isc)))
1414 (define-public powertop
1422 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1426 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1427 (build-system gnu-build-system)
1430 (modify-phases %standard-phases
1431 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1432 ;; allow calibrating the network interface in GuixSD.
1433 (add-after 'unpack 'patch-absolute-file-names
1434 (lambda* (#:key inputs #:allow-other-keys)
1435 (let ((kmod (assoc-ref inputs "kmod")))
1436 (substitute* (find-files "src" "\\.cpp$")
1437 ;; Give the right 'modprobe' file name so that essential
1438 ;; modules such as msr.ko can be loaded.
1439 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1440 ;; These programs are only needed to calibrate, so using
1441 ;; relative file names avoids adding extra inputs. When they
1442 ;; are missing powertop gracefully handles it.
1443 (("/usr/bin/hcitool") "hcitool")
1444 (("/usr/bin/xset") "xset")
1445 (("/usr/sbin/hciconfig") "hciconfig"))
1450 ("ncurses" ,ncurses)
1451 ("pciutils" ,pciutils)
1454 `(("pkg-config" ,pkg-config)))
1455 (home-page "https://01.org/powertop/")
1456 (synopsis "Analyze power consumption on Intel-based laptops")
1458 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1459 power management. In addition to being a diagnostic tool, PowerTOP also has
1460 an interactive mode where the user can experiment various power management
1461 settings for cases where the operating system has not enabled these
1463 (license license:gpl2)))
1465 (define-public aumix
1472 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1473 version ".tar.bz2"))
1476 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1477 (build-system gnu-build-system)
1478 (inputs `(("ncurses" ,ncurses)))
1479 (home-page "http://www.jpj.net/~trevor/aumix.html")
1480 (synopsis "Audio mixer for X and the console")
1482 "Aumix adjusts an audio mixer from X, the console, a terminal,
1483 the command line or a script.")
1484 (license license:gpl2+)))
1486 (define-public iotop
1493 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1496 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1497 (build-system python-build-system)
1499 ;; The setup.py script expects python-2.
1500 `(#:python ,python-2
1501 ;; There are currently no checks in the package.
1503 (native-inputs `(("python" ,python-2)))
1504 (home-page "http://guichaz.free.fr/iotop/")
1506 "Displays the IO activity of running processes")
1508 "Iotop is a Python program with a top like user interface to show the
1509 processes currently causing I/O.")
1510 (license license:gpl2+)))
1518 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1519 "download/fuse-" version
1520 "/fuse-" version ".tar.gz"))
1523 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1524 (patches (search-patches "fuse-overlapping-headers.patch"))))
1525 (build-system gnu-build-system)
1526 (inputs `(("util-linux" ,util-linux)))
1528 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1529 (assoc-ref %outputs "out")
1531 (string-append "INIT_D_PATH="
1532 (assoc-ref %outputs "out")
1535 ;; The rule makes /dev/fuse 666.
1536 (string-append "UDEV_RULES_PATH="
1537 (assoc-ref %outputs "out")
1538 "/lib/udev/rules.d"))
1539 #:phases (alist-cons-before
1540 'build 'set-file-names
1541 (lambda* (#:key inputs #:allow-other-keys)
1542 ;; libfuse calls out to mount(8) and umount(8). Make sure
1543 ;; it refers to the right ones.
1544 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1545 (("/bin/(u?)mount" _ maybe-u)
1546 (string-append (assoc-ref inputs "util-linux")
1547 "/bin/" maybe-u "mount")))
1548 (substitute* '("util/mount.fuse.c")
1552 ;; This hack leads libfuse to search for 'fusermount' in
1553 ;; $PATH, where it may find a setuid-root binary, instead of
1554 ;; trying solely $out/sbin/fusermount and failing because
1556 (substitute* "lib/Makefile"
1557 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1558 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1560 (home-page "https://github.com/libfuse/libfuse")
1561 (synopsis "Support file systems implemented in user space")
1563 "As a consequence of its monolithic design, file system code for Linux
1564 normally goes into the kernel itself---which is not only a robustness issue,
1565 but also an impediment to system extensibility. FUSE, for \"file systems in
1566 user space\", is a kernel module and user-space library that tries to address
1567 part of this problem by allowing users to run file system implementations as
1568 user-space processes.")
1569 (license (list license:lgpl2.1 ;library
1570 license:gpl2+)))) ;command-line utilities
1572 (define-public unionfs-fuse
1574 (name "unionfs-fuse")
1579 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1581 (file-name (string-append name "-" version ".tar.gz"))
1584 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1585 (build-system cmake-build-system)
1587 `(("python" ,python)
1588 ("python-pytest" ,python-pytest)))
1589 (inputs `(("fuse" ,fuse)))
1592 (modify-phases %standard-phases
1594 ;; Borrowed from the Makefile
1595 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
1596 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1597 (synopsis "User-space union file system")
1599 "UnionFS-FUSE is a flexible union file system implementation in user
1600 space, using the FUSE library. Mounting a union file system allows you to
1601 \"aggregate\" the contents of several directories into a single mount point.
1602 UnionFS-FUSE additionally supports copy-on-write.")
1603 (license license:bsd-3)))
1606 (package (inherit fuse)
1607 (name "fuse-static")
1608 (source (origin (inherit (package-source fuse))
1609 (modules '((guix build utils)))
1611 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1612 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1613 ;; it doesn't do that, allowing us to remove the dependency on
1614 ;; util-linux (something that is useful in initrds.)
1615 '(substitute* '("lib/mount_util.c"
1616 "util/mount_util.c")
1617 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1622 (define-public unionfs-fuse/static
1623 (package (inherit unionfs-fuse)
1624 (synopsis "User-space union file system (statically linked)")
1625 (name (string-append (package-name unionfs-fuse) "-static"))
1626 (source (origin (inherit (package-source unionfs-fuse))
1627 (modules '((guix build utils)))
1629 ;; Add -ldl to the libraries, because libfuse.a needs that.
1630 '(substitute* "src/CMakeLists.txt"
1631 (("target_link_libraries(.*)\\)" _ libs)
1632 (string-append "target_link_libraries"
1636 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1637 #:phases (alist-cons-after
1638 'install 'post-install
1639 (lambda* (#:key outputs #:allow-other-keys)
1640 (let* ((out (assoc-ref outputs "out"))
1641 (exe (string-append out "/bin/unionfs")))
1642 ;; By default, 'unionfs' keeps references to
1643 ;; $glibc/share/locale and similar stuff. Remove them.
1644 (remove-store-references exe)
1646 ;; 'unionfsctl' has references to glibc as well. Since
1647 ;; we don't need it, remove it.
1648 (delete-file (string-append out "/bin/unionfsctl"))
1651 (inputs `(("fuse" ,fuse-static)))))
1653 (define-public sshfs-fuse
1659 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1660 "download/sshfs-" version "/sshfs-" version
1664 "1pp5wsl1jx11apkv2fpp559miifqhi8ka400npy5awp9ghlf3la6"))))
1665 (build-system gnu-build-system)
1670 `(("pkg-config" ,pkg-config)))
1671 (home-page "https://github.com/libfuse/sshfs")
1672 (synopsis "Mount remote file systems over SSH")
1674 "This is a file system client based on the SSH File Transfer Protocol.
1675 Since most SSH servers already support this protocol it is very easy to set
1676 up: on the server side there's nothing to do; on the client side mounting the
1677 file system is as easy as logging into the server with an SSH client.")
1678 (license license:gpl2+)))
1680 (define-public archivemount
1682 (name "archivemount")
1687 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1688 "archivemount-" version ".tar.gz"))
1691 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1692 (build-system gnu-build-system)
1693 (inputs `(("fuse", fuse)
1694 ("libarchive", libarchive)))
1695 (native-inputs `(("pkg-config", pkg-config)))
1696 (home-page "http://www.cybernoia.de/software/archivemount")
1697 (synopsis "Tool for mounting archive files with FUSE")
1698 (description "archivemount is a FUSE-based file system for Unix variants,
1699 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1700 mount point where it can be read from or written to as with any other file
1701 system. This makes accessing the contents of the archive, which may be
1702 compressed, transparent to other programs, without decompressing them.")
1703 (license license:lgpl2.0+)))
1705 (define-public numactl
1712 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1717 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1718 (build-system gnu-build-system)
1720 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1721 ;; to run, which we can't assume to have.
1724 ;; NUMA is apparently not supported on armhf, see
1725 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1726 (supported-systems (delete "armhf-linux" %supported-systems))
1727 (home-page "http://oss.sgi.com/projects/libnuma/")
1728 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1730 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1731 memory is not all in one place. The numactl program allows you to run your
1732 application program on specific CPU's and memory nodes. It does this by
1733 supplying a NUMA memory policy to the operating system before running your
1736 The package contains other commands, such as numademo, numastat and memhog.
1737 The numademo command provides a quick overview of NUMA performance on your
1739 (license (list license:gpl2 ;programs
1740 license:lgpl2.1)))) ;library
1742 (define-public kbd-neo
1749 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1750 version "/linux/console/neo.map"))
1751 (file-name (string-append name "-" version ".map"))
1754 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1755 (build-system trivial-build-system)
1757 `(#:modules ((guix build utils))
1759 (use-modules (guix build utils))
1760 (let ((out (string-append %output "/share/keymaps"))
1761 (source (assoc-ref %build-inputs "source")))
1763 (copy-file source (string-append out "/neo.map"))
1765 (home-page "https://neo-layout.org")
1766 (synopsis "Neo2 console layout")
1768 "Kbd-neo provides the Neo2 keyboard layout for use with
1769 @command{loadkeys(1)} from @code{kbd(4)}.")
1770 ;; The file is located in an svn directory, the entire content of
1771 ;; the directory is licensed as GPL3.
1772 (license license:gpl3+)))
1780 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1784 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1785 (modules '((guix build utils)))
1788 (substitute* "tests/Makefile.in"
1789 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1792 (substitute* '("src/unicode_start" "src/unicode_stop")
1793 ;; Assume the Coreutils are in $PATH.
1796 (build-system gnu-build-system)
1799 (modify-phases %standard-phases
1800 (add-before 'build 'pre-build
1801 (lambda* (#:key inputs #:allow-other-keys)
1802 (let ((gzip (assoc-ref %build-inputs "gzip"))
1803 (bzip2 (assoc-ref %build-inputs "bzip2")))
1804 (substitute* "src/libkeymap/findfile.c"
1806 (string-append gzip "/bin/gzip"))
1808 (string-append bzip2 "/bin/bzip2"))))))
1809 (add-after 'install 'post-install
1810 (lambda* (#:key outputs #:allow-other-keys)
1811 ;; Make sure these programs find their comrades.
1812 (let* ((out (assoc-ref outputs "out"))
1813 (bin (string-append out "/bin")))
1814 (for-each (lambda (prog)
1815 (wrap-program (string-append bin "/" prog)
1816 `("PATH" ":" prefix (,bin))))
1817 '("unicode_start" "unicode_stop"))))))))
1818 (inputs `(("check" ,check)
1821 ("pam" ,linux-pam)))
1822 (native-search-paths
1823 (list (search-path-specification
1824 (variable "LOADKEYS_KEYMAP_PATH")
1825 (files (list "share/keymaps")))))
1826 (native-inputs `(("pkg-config" ,pkg-config)))
1827 (home-page "http://kbd-project.org/")
1828 (synopsis "Linux keyboard utilities and keyboard maps")
1830 "This package contains keytable files and keyboard utilities compatible
1831 for systems using the Linux kernel. This includes commands such as
1832 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1833 (license license:gpl2+)))
1835 (define-public inotify-tools
1837 (name "inotify-tools")
1842 "mirror://sourceforge/inotify-tools/inotify-tools/"
1843 version "/inotify-tools-" version ".tar.gz"))
1846 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1847 (build-system gnu-build-system)
1848 (home-page "http://inotify-tools.sourceforge.net/")
1849 (synopsis "Monitor file accesses")
1851 "The inotify-tools packages provides a C library and command-line tools
1852 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1853 (license license:gpl2+)))
1862 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1863 "kmod-" version ".tar.xz"))
1866 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
1867 (patches (search-patches "kmod-module-directory.patch"))))
1868 (build-system gnu-build-system)
1870 `(("pkg-config" ,pkg-config)))
1875 `(#:tests? #f ; FIXME: Investigate test failures
1876 #:configure-flags '("--with-xz" "--with-zlib")
1877 #:phases (alist-cons-after
1878 'install 'install-modprobe&co
1879 (lambda* (#:key outputs #:allow-other-keys)
1880 (let* ((out (assoc-ref outputs "out"))
1881 (bin (string-append out "/bin")))
1882 (for-each (lambda (tool)
1884 (string-append bin "/" tool)))
1885 '("insmod" "rmmod" "lsmod" "modprobe"
1886 "modinfo" "depmod"))))
1888 (home-page "https://www.kernel.org/")
1889 (synopsis "Kernel module tools")
1890 (description "Kmod is a set of tools to handle common tasks with Linux
1891 kernel modules like insert, remove, list, check properties, resolve
1892 dependencies and aliases.
1894 These tools are designed on top of libkmod, a library that is shipped with
1895 kmod. The aim is to be compatible with tools, configurations and indices
1896 from the module-init-tools project.")
1897 (license license:gpl2+))) ; library under lgpl2.1+
1899 (define-public eudev
1900 ;; The post-systemd fork, maintained by Gentoo.
1907 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1911 "06gyyl90n85x8i7lfhns514y1kg1ians13l467admyzy3kjxkqsp"))
1912 (patches (search-patches "eudev-rules-directory.patch"
1913 "eudev-conflicting-declaration.patch"))))
1914 (build-system gnu-build-system)
1916 `(("pkg-config" ,pkg-config)
1920 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1921 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1922 ;; which contains the rules to do that.
1923 `(("util-linux" ,util-linux) ;for blkid
1925 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1926 (synopsis "Userspace device management")
1927 (description "Udev is a daemon which dynamically creates and removes
1928 device nodes from /dev/, handles hotplug events and loads drivers at boot
1930 (license license:gpl2+)))
1932 (define-public eudev-with-hwdb
1933 ;; TODO: Merge with 'eudev'.
1936 (name "eudev-with-hwdb")
1938 '(#:phases (modify-phases %standard-phases
1939 (add-after 'install 'build-hwdb
1940 (lambda* (#:key outputs #:allow-other-keys)
1941 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1942 ;; similar tools to display product names.
1943 (let ((out (assoc-ref outputs "out")))
1944 (zero? (system* (string-append out "/bin/udevadm")
1945 "hwdb" "--update"))))))))))
1950 (version "2.02.171")
1953 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1957 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
1958 (modules '((guix build utils)))
1961 (use-modules (guix build utils))
1963 ;; Honor sysconfdir.
1964 (substitute* "make.tmpl.in"
1966 "confdir = @sysconfdir@\n")
1967 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1968 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1969 (patches (search-patches "lvm2-static-link.patch"))))
1970 (build-system gnu-build-system)
1972 `(("pkg-config" ,pkg-config)
1973 ("procps" ,procps))) ;tests use 'pgrep'
1978 (modify-phases %standard-phases
1979 (add-after 'configure 'set-makefile-shell
1981 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1983 (setenv "SHELL" (which "sh"))
1985 ;; Replace /bin/sh with the right file name.
1986 (patch-makefile-SHELL "make.tmpl")
1988 (add-before 'strip 'make-objects-writable
1989 (lambda* (#:key outputs #:allow-other-keys)
1990 ;; Make compiled objects writable so they can be stripped.
1991 (let ((out (assoc-ref outputs "out")))
1992 (for-each (lambda (file)
1995 (find-files (string-append out "/lib"))
1996 (find-files (string-append out "/sbin"))))
1999 #:configure-flags (list (string-append "--sysconfdir="
2000 (assoc-ref %outputs "out")
2002 "--enable-udev_sync"
2003 "--enable-udev_rules"
2005 ;; Make sure programs such as 'dmsetup' can
2006 ;; find libdevmapper.so.
2007 (string-append "LDFLAGS=-Wl,-rpath="
2008 (assoc-ref %outputs "out")
2011 ;; The tests use 'mknod', which requires root access.
2013 (home-page "https://sourceware.org/lvm2/")
2014 (synopsis "Logical volume management for Linux")
2016 "LVM2 is the logical volume management tool set for Linux-based systems.
2017 This package includes the user-space libraries and tools, including the device
2018 mapper. Kernel components are part of Linux-libre.")
2020 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2021 ;; Command-line tools are GPLv2.
2022 (license (list license:gpl2 license:lgpl2.1))))
2024 (define-public lvm2-static
2027 (name "lvm2-static")
2029 ;; Propagate udev because libdevmapper.a depends on libudev.
2030 (inputs (alist-delete "udev" (package-inputs lvm2)))
2031 (propagated-inputs `(("udev" ,eudev)))
2034 (substitute-keyword-arguments (package-arguments lvm2)
2035 ((#:configure-flags flags '())
2036 ;; LVM2 doesn't use Libtool, hence the custom option.
2037 `(cons "--enable-static_link" ,flags))))
2038 (synopsis "Logical volume management for Linux (statically linked)")))
2040 (define-public wireless-tools
2042 (name "wireless-tools")
2046 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2050 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2053 ;; Remove the older header files that are not free software.
2054 (for-each (lambda (n)
2055 (delete-file (format #f "wireless.~a.h" n)))
2056 '(10 11 12 13 14 15 16 17 18 19 20))
2058 (build-system gnu-build-system)
2061 (list (string-append "PREFIX=" %output)
2062 (string-append "INSTALL_MAN=" %output "/share/man")
2063 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2065 #:phases (modify-phases %standard-phases
2066 (delete 'configure))
2068 (synopsis "Tools for manipulating Linux Wireless Extensions")
2069 (description "Wireless Tools are used to manipulate the now-deprecated
2070 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2071 Extension was an interface allowing you to set Wireless LAN specific
2072 parameters and get the specific stats. It is deprecated in favor the nl80211
2074 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2075 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2076 ;; other files are distributed under gpl2.
2077 (license (list license:gpl2 license:lgpl2.1+))))
2085 (uri (string-append "mirror://kernel.org/software/network/crda/"
2086 "crda-" version ".tar.xz"))
2089 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2090 (patches (search-patches "crda-optional-gcrypt.patch"))))
2091 (build-system gnu-build-system)
2093 '(#:phases (modify-phases %standard-phases
2096 'build 'no-werror-no-ldconfig
2098 (substitute* "Makefile"
2100 (("ldconfig") "true"))
2103 'build 'set-regulator-db-file-name
2104 (lambda* (#:key inputs #:allow-other-keys)
2105 ;; Tell CRDA where to find our database.
2106 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2107 (substitute* "crda.c"
2108 (("\"/lib/crda/regulatory.bin\"")
2109 (string-append "\"" regdb
2110 "/lib/crda/regulatory.bin\"")))
2112 #:test-target "verify"
2113 #:make-flags (let ((out (assoc-ref %outputs "out"))
2114 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2115 (list "CC=gcc" "V=1"
2117 ;; Disable signature-checking on 'regulatory.bin'.
2118 ;; The reason is that this simplifies maintenance
2119 ;; on our side (no need to manage a distro key
2120 ;; pair), and we can guarantee integrity of
2121 ;; 'regulatory.bin' by other means anyway, such as
2122 ;; 'guix gc --verify'. See
2123 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2127 (string-append "PREFIX=" out)
2128 (string-append "SBINDIR=" out "/sbin/")
2129 (string-append "UDEV_RULE_DIR="
2130 out "/lib/udev/rules.d")
2131 (string-append "LDFLAGS=-Wl,-rpath="
2133 (string-append "REG_BIN=" regdb
2134 "/lib/crda/regulatory.bin")))))
2135 (native-inputs `(("pkg-config" ,pkg-config)
2136 ("python" ,python-2)
2137 ("wireless-regdb" ,wireless-regdb)))
2138 (inputs `(("libnl" ,libnl)))
2140 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2141 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2143 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2144 communication between the kernel Linux and user space for regulatory
2146 (license license:copyleft-next)))
2148 (define-public wireless-regdb
2150 (name "wireless-regdb")
2151 (version "2017.03.07")
2155 "mirror://kernel.org/software/network/wireless-regdb/"
2156 "wireless-regdb-" version ".tar.xz"))
2159 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2161 ;; We're building 'regulatory.bin' by ourselves.
2162 (snippet '(delete-file "regulatory.bin"))))
2163 (build-system gnu-build-system)
2165 '(#:phases (modify-phases %standard-phases
2166 (delete 'configure))
2168 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2169 ;; is computed and can be equal to 'maintainer-clean'; when that
2170 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2171 ;; just built. Thus, build things sequentially.
2172 #:parallel-build? #f
2174 #:tests? #f ;no tests
2175 #:make-flags (let ((out (assoc-ref %outputs "out")))
2176 (list (string-append "PREFIX=" out)
2177 (string-append "LSB_ID=GuixSD")
2178 (string-append "DISTRO_PUBKEY=/dev/null")
2179 (string-append "DISTRO_PRIVKEY=/dev/null")
2180 (string-append "REGDB_PUBKEY=/dev/null")
2182 ;; Leave that empty so that db2bin.py doesn't try
2183 ;; to sign 'regulatory.bin'. This allows us to
2184 ;; avoid managing a key pair for the whole distro.
2185 (string-append "REGDB_PRIVKEY=")))))
2186 (native-inputs `(("python" ,python-2)))
2188 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2189 (synopsis "Wireless regulatory database")
2191 "This package contains the wireless regulatory database Central
2192 Regulatory Database Agent (CRDA) daemon. The database contains information on
2193 country-specific regulations for the wireless spectrum.")
2194 (license license:isc)))
2196 (define-public lm-sensors
2202 (uri (list (string-append
2203 "https://github.com/groeck/lm-sensors/archive/V"
2204 (string-join (string-split version #\.) "-")
2206 (file-name (string-append name "-" version ".tar.gz"))
2209 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2210 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2211 (build-system gnu-build-system)
2212 (inputs `(("rrdtool" ,rrdtool)
2215 ("gnuplot" ,gnuplot)))
2216 (native-inputs `(("pkg-config" ,pkg-config)
2221 `(#:tests? #f ; no 'check' target
2222 #:make-flags (list (string-append "PREFIX=" %output)
2223 (string-append "ETCDIR=" %output "/etc")
2224 (string-append "MANDIR=" %output "/share/man"))
2229 'build 'patch-exec-paths
2230 (lambda* (#:key inputs outputs #:allow-other-keys)
2231 (substitute* "prog/detect/sensors-detect"
2233 (string-append "`" (assoc-ref inputs "coreutils")
2235 (("(`|\")modprobe" all open-quote)
2236 (string-append open-quote
2237 (assoc-ref inputs "kmod")
2239 (substitute* '("prog/pwm/pwmconfig"
2240 "prog/pwm/fancontrol")
2242 (string-append (assoc-ref inputs "gnuplot")
2245 (string-append (assoc-ref inputs "coreutils")
2248 (string-append (assoc-ref inputs "grep")
2251 (string-append (assoc-ref inputs "sed")
2254 (string-append (assoc-ref inputs "coreutils")
2257 (string-append (assoc-ref inputs "coreutils")
2260 (string-append (assoc-ref inputs "coreutils")
2261 "/bin/readlink -f"))))
2262 %standard-phases))))
2263 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2264 (synopsis "Utilities to read temperature/voltage/fan sensors")
2266 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2267 you to access information from temperature, voltage, and fan speed sensors.
2268 It works with most newer systems.")
2269 (license license:gpl2+)))
2271 (define-public i2c-tools
2278 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2279 version ".tar.bz2"))
2282 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2283 (build-system gnu-build-system)
2285 `(#:tests? #f ; no 'check' target
2286 #:make-flags (list (string-append "prefix=" %output)
2288 ;; no configure script
2289 #:phases (alist-delete 'configure %standard-phases)))
2292 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2293 (synopsis "I2C tools for Linux")
2295 "The i2c-tools package contains a heterogeneous set of I2C tools for
2296 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2297 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2299 (license license:gpl2+)))
2301 (define-public xsensors
2308 "http://www.linuxhardware.org/xsensors/xsensors-"
2312 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2313 (build-system gnu-build-system)
2314 (inputs `(("lm-sensors" ,lm-sensors)
2316 (native-inputs `(("pkg-config" ,pkg-config)))
2318 `(#:phases (alist-cons-before
2319 'configure 'enable-deprecated
2321 (substitute* "src/Makefile.in"
2322 (("-DGDK_DISABLE_DEPRECATED") "")
2323 (("-DGTK_DISABLE_DEPRECATED") "")))
2325 'configure 'remove-Werror
2327 (substitute* '("configure" "src/Makefile.in")
2329 %standard-phases))))
2330 (home-page "http://www.linuxhardware.org/xsensors/")
2331 (synopsis "Hardware health information viewer")
2333 "Xsensors reads data from the libsensors library regarding hardware
2334 health such as temperature, voltage and fan speed and displays the information
2335 in a digital read-out.")
2336 (license license:gpl2+)))
2341 (version (package-version linux-libre))
2342 (source (package-source linux-libre))
2343 (build-system gnu-build-system)
2345 '(#:phases (alist-replace
2347 (lambda* (#:key inputs #:allow-other-keys)
2348 (setenv "SHELL_PATH" (which "bash"))
2349 (chdir "tools/perf"))
2351 #:make-flags (list (string-append "DESTDIR="
2352 (assoc-ref %outputs "out"))
2355 ;; By default, 'config/Makefile' uses lib64 on
2356 ;; x86_64. Work around that.
2358 #:tests? #f)) ;no tests
2360 `(("pkg-config" ,pkg-config)
2364 ;; There are build scripts written in these languages.
2366 ("python" ,python-2)))
2368 `(("slang" ,slang) ;for the interactive TUI
2370 ("python" ,python-2) ;'perf' links against libpython
2371 ("elfutils" ,elfutils)
2372 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2375 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2376 ("docbook-xsl" ,docbook-xsl)
2378 ("asciidoc" ,asciidoc)))
2379 (home-page "https://perf.wiki.kernel.org/")
2380 (synopsis "Linux profiling with performance counters")
2382 "perf is a tool suite for profiling using hardware performance counters,
2383 with support in the Linux kernel. perf can instrument CPU performance
2384 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2385 of lightweight profiling. This package contains the user-land tools and in
2386 particular the 'perf' command.")
2387 (license (package-license linux-libre))))
2389 (define-public pflask
2395 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2397 (file-name (string-append name "-" version ".tar.gz"))
2400 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2401 (build-system cmake-build-system)
2403 '(#:tests? #f)) ; no tests
2404 (home-page "http://ghedo.github.io/pflask/")
2405 (synopsis "Simple tool for creating Linux namespace containers")
2406 (description "pflask is a simple tool for creating Linux namespace
2407 containers. It can be used for running a command or even booting an OS inside
2408 an isolated container, created with the help of Linux namespaces. It is
2409 similar in functionality to chroot, although pflask provides better isolation
2410 thanks to the use of namespaces.")
2411 (license license:bsd-2)))
2413 (define-public hdparm
2419 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2420 name "-" version ".tar.gz"))
2423 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
2424 (build-system gnu-build-system)
2426 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2427 (list (string-append "binprefix=" out)
2428 (string-append "manprefix=" out)
2431 (modify-phases %standard-phases
2432 (delete 'configure)) ; no configure script
2433 #:tests? #f)) ; no test suite
2434 (home-page "https://sourceforge.net/projects/hdparm/")
2435 (synopsis "View and tune ATA disk drive parameters")
2437 "@command{hdparm} is a command-line utility to control ATA controllers and
2438 disk drives. It can increase performance and/or reliability by careful tuning
2439 of hardware settings like power and acoustic management, DMA modes, and caching.
2440 It can also display detailed device information, or be used as a simple
2441 performance benchmarking tool.
2443 @command{hdparm} provides a command line interface to various Linux kernel
2444 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2445 IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2446 Command Translation} (SAT) are also supported.")
2447 (license (license:non-copyleft "file://LICENSE.TXT"))))
2449 (define-public rfkill
2455 (uri (string-append "mirror://kernel.org/software/network/"
2456 name "/" name "-" version ".tar.xz"))
2459 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2460 (build-system gnu-build-system)
2462 `(#:make-flags (list "CC=gcc"
2463 (string-append "PREFIX=" %output))
2464 #:phases (modify-phases %standard-phases
2465 (delete 'configure))
2467 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2468 (synopsis "Tool for enabling and disabling wireless devices")
2470 "rfkill is a simple tool for accessing the rfkill device interface,
2471 which is used to enable and disable wireless networking devices, typically
2472 WLAN, Bluetooth and mobile broadband.")
2473 (license (license:non-copyleft "file://COPYING"
2474 "See COPYING in the distribution."))))
2482 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2483 version "/" name "-" version ".tar.gz"))
2486 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2487 (build-system gnu-build-system)
2488 (home-page "http://acpiclient.sourceforge.net")
2489 (synopsis "Display information on ACPI devices")
2490 (description "@code{acpi} attempts to replicate the functionality of the
2491 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2492 information. It does not support ACPI suspending, only displays information
2493 about ACPI devices.")
2494 (license license:gpl2+)))
2496 (define-public acpid
2502 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2506 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2507 (build-system gnu-build-system)
2508 (home-page "https://sourceforge.net/projects/acpid2/")
2509 (synopsis "Daemon for delivering ACPI events to user-space programs")
2511 "acpid is designed to notify user-space programs of Advanced
2512 Configuration and Power Interface (ACPI) events. acpid should be started
2513 during the system boot, and will run as a background process. When an ACPI
2514 event is received from the kernel, acpid will examine the list of rules
2515 specified in /etc/acpi/events and execute the rules that match the event.")
2516 (license license:gpl2+)))
2518 (define-public sysfsutils
2527 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2530 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2531 (build-system gnu-build-system)
2532 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2533 (synopsis "System utilities based on Linux sysfs")
2535 "These are a set of utilities built upon sysfs, a virtual file system in
2536 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2537 also contains the libsysfs library.")
2538 ;; The library is under lgpl2.1+ (all files say "or any later version").
2539 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2540 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2542 (define-public sysfsutils-1
2544 (inherit sysfsutils)
2551 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2552 "/sysfsutils-" version ".tar.gz"))
2554 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2555 (modules '((guix build utils)))
2558 (substitute* "Makefile.in"
2559 (("includedir = /usr/include/sysfs")
2560 "includedir = @includedir@"))
2561 (substitute* "configure"
2562 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2563 (string-append "includedir='" orig "/sysfs'")))))))
2564 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2566 (define-public cpufrequtils
2568 (name "cpufrequtils")
2575 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2578 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2579 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2580 (build-system gnu-build-system)
2582 `(("sysfsutils" ,sysfsutils-1)))
2584 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2585 (assoc-ref %outputs "out") "/lib"))))
2586 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2587 (synopsis "Utilities to get and set CPU frequency on Linux")
2589 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2590 information, and set the CPU frequency if supported, using the cpufreq
2591 capabilities of the Linux kernel.")
2592 (license license:gpl2)))
2594 (define-public libraw1394
2601 "mirror://kernel.org/linux/libs/ieee1394/"
2602 name "-" version ".tar.xz"))
2605 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2606 (build-system gnu-build-system)
2607 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2608 (synopsis "Interface library for the Linux IEEE1394 drivers")
2610 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2611 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2612 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2613 send to and receive from other nodes without requiring a kernel driver for the
2614 protocol in question.")
2615 (license license:lgpl2.1+)))
2617 (define-public libavc1394
2623 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2624 name "-" version ".tar.gz"))
2627 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2628 (build-system gnu-build-system)
2630 `(("pkg-config" ,pkg-config)))
2632 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2633 (home-page "https://sourceforge.net/projects/libavc1394/")
2634 (synopsis "AV/C protocol library for IEEE 1394")
2636 "Libavc1394 is a programming interface to the AV/C specification from
2637 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2638 (license license:lgpl2.1+)))
2640 (define-public libiec61883
2642 (name "libiec61883")
2647 "mirror://kernel.org/linux/libs/ieee1394/"
2648 name "-" version ".tar.xz"))
2651 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2652 (build-system gnu-build-system)
2654 `(("pkg-config" ,pkg-config)))
2656 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2657 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2658 (synopsis "Isochronous streaming media library for IEEE 1394")
2660 "The libiec61883 library provides a higher level API for streaming DV,
2661 MPEG-2 and audio over Linux IEEE 1394.")
2662 (license license:lgpl2.1+)))
2664 (define-public mdadm
2671 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2675 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2676 (build-system gnu-build-system)
2680 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2684 ;; TODO: tell it where to find 'sendmail'
2685 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2686 (string-append "BINDIR=" out "/sbin")
2687 (string-append "MANDIR=" out "/share/man")
2688 (string-append "UDEVDIR=" out "/lib/udev")))
2689 #:phases (alist-cons-before
2690 'build 'patch-program-paths
2691 (lambda* (#:key inputs #:allow-other-keys)
2692 (let ((coreutils (assoc-ref inputs "coreutils")))
2693 (substitute* "udev-md-raid-arrays.rules"
2694 (("/usr/bin/(readlink|basename)" all program)
2695 (string-append coreutils "/bin/" program)))))
2697 'build 'remove-W-error
2699 ;; We cannot build with -Werror on i686 due to a
2700 ;; 'sign-compare' warning in util.c.
2701 (substitute* "Makefile"
2704 (alist-delete 'configure %standard-phases)))
2705 ;;tests must be done as root
2707 (home-page "http://neil.brown.name/blog/mdadm")
2708 (synopsis "Tool for managing Linux Software RAID arrays")
2710 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2711 assemble, report on, and monitor arrays. It can also move spares between raid
2712 arrays when needed.")
2713 (license license:gpl2+)))
2715 (define-public mdadm-static
2718 (name "mdadm-static")
2720 (substitute-keyword-arguments (package-arguments mdadm)
2721 ((#:make-flags flags)
2722 `(cons "LDFLAGS = -static" ,flags))
2724 `(modify-phases ,phases
2725 (add-after 'install 'remove-cruft
2726 (lambda* (#:key outputs #:allow-other-keys)
2727 (let* ((out (assoc-ref outputs "out"))
2728 (precious? (lambda (file)
2729 (member file '("." ".." "sbin"))))
2730 (directories (scandir out (negate precious?))))
2731 (with-directory-excursion out
2732 (for-each delete-file-recursively directories)
2733 (remove-store-references "sbin/mdadm")
2734 (delete-file "sbin/mdmon")
2736 ((#:modules modules %gnu-build-system-modules)
2737 `((ice-9 ftw) ,@modules))
2738 ((#:strip-flags _ '())
2739 ''("--strip-all")) ;strip a few extra KiB
2740 ((#:allowed-references _ '("out"))
2741 '("out")))) ;refer only self
2742 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2744 (define-public multipath-tools
2746 (name "multipath-tools")
2750 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2751 ".git;a=snapshot;h=" version ";sf=tgz"))
2752 (file-name (string-append name "-" version ".tar.gz"))
2755 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2756 (modules '((guix build utils)))
2759 ;; Drop bundled valgrind headers.
2760 (delete-file-recursively "third-party")
2761 (substitute* '("multipathd/main.c"
2762 "libmultipath/debug.c")
2763 (("#include \"../third-party/")
2766 (build-system gnu-build-system)
2768 '(#:tests? #f ; No tests.
2769 #:make-flags (list (string-append "DESTDIR="
2770 (assoc-ref %outputs "out"))
2772 (string-append "LDFLAGS=-Wl,-rpath="
2773 (assoc-ref %outputs "out")
2776 (modify-phases %standard-phases
2777 (add-after 'unpack 'patch-source
2778 (lambda* (#:key inputs #:allow-other-keys)
2779 (let ((lvm2 (assoc-ref inputs "lvm2"))
2780 (udev (assoc-ref inputs "udev")))
2781 (substitute* "Makefile.inc"
2782 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2783 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2784 (("/usr/include/libdevmapper.h")
2785 (string-append lvm2 "/include/libdevmapper.h"))
2786 (("/usr/include/libudev.h")
2787 (string-append udev "/include/libudev.h")))
2790 (add-before 'build 'set-CC
2796 ("pkg-config" ,pkg-config)
2797 ("valgrind" ,valgrind)))
2799 `(("ceph:lib" ,ceph "lib")
2802 ("liburcu" ,liburcu)
2804 ("readline" ,readline)
2806 (home-page "http://christophe.varoqui.free.fr/")
2807 (synopsis "Access block devices through multiple paths")
2809 "This package provides the following binaries to drive the
2810 Linux Device Mapper multipathing driver:
2812 @item @command{multipath} - Device mapper target autoconfig.
2813 @item @command{multipathd} - Multipath daemon.
2814 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2815 @code{dm} multipath devices.
2816 @item @command{kpartx} - Create device maps from partition tables.
2818 (license (list license:gpl2+ ; Main distribution.
2819 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2821 (define-public libaio
2828 (string-append "mirror://debian/pool/main/liba/libaio/"
2829 name "_" version ".orig.tar.gz")))
2832 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2833 (build-system gnu-build-system)
2836 (list "CC=gcc" (string-append "prefix=" %output))
2837 #:test-target "partcheck" ; need root for a full 'check'
2839 (alist-delete 'configure %standard-phases))) ; no configure script
2840 (home-page "http://lse.sourceforge.net/io/aio.html")
2841 (synopsis "Linux-native asynchronous I/O access library")
2843 "This library enables userspace to use Linux kernel asynchronous I/O
2844 system calls, important for the performance of databases and other advanced
2846 (license license:lgpl2.1+)))
2854 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2855 name "-" version ".tar.xz"))
2858 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2859 (build-system gnu-build-system)
2861 `(("libsndfile" ,libsndfile)))
2863 `(("pkg-config" ,pkg-config)))
2864 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2865 (synopsis "Bluetooth subband audio codec")
2867 "The SBC is a digital audio encoder and decoder used to transfer data to
2868 Bluetooth audio output devices like headphones or loudspeakers.")
2869 (license license:gpl2+)))
2871 (define-public bluez
2878 "mirror://kernel.org/linux/bluetooth/bluez-"
2882 "1sb4aflgyrl7apricjipa8wx95qm69yja0lmn2f19g560c3v1b2c"))))
2883 (build-system gnu-build-system)
2886 (let ((out (assoc-ref %outputs "out")))
2887 (list "--sysconfdir=/etc"
2888 "--localstatedir=/var"
2891 ;; Install dbus/udev files to the correct location.
2892 (string-append "--with-dbusconfdir=" out "/etc")
2893 (string-append "--with-udevdir=" out "/lib/udev")))
2895 (modify-phases %standard-phases
2896 (add-after 'install 'post-install
2897 (lambda* (#:key inputs outputs #:allow-other-keys)
2898 (let* ((out (assoc-ref outputs "out"))
2899 (servicedir (string-append out "/share/dbus-1/services"))
2900 (service "obexd/src/org.bluez.obex.service")
2901 (rule (string-append
2902 out "/lib/udev/rules.d/97-hid2hci.rules")))
2903 ;; Install the obex dbus service file.
2904 (substitute* service
2906 (string-append out "/libexec/bluetooth/obexd")))
2907 (install-file service servicedir)
2908 ;; Fix paths in the udev rule.
2910 (("hid2hci --method")
2911 (string-append out "/lib/udev/hid2hci --method"))
2913 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2916 `(("pkg-config" ,pkg-config)
2917 ("gettext" ,gettext-minimal)))
2922 ("libical" ,libical)
2923 ("readline" ,readline)))
2924 (home-page "http://www.bluez.org/")
2925 (synopsis "Linux Bluetooth protocol stack")
2927 "BlueZ provides support for the core Bluetooth layers and protocols. It
2928 is flexible, efficient and uses a modular implementation.")
2929 (license license:gpl2+)))
2931 (define-public fuse-exfat
2938 "https://github.com/relan/exfat/releases/download/v"
2939 version "/" name "-" version ".tar.gz"))
2942 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
2943 (build-system gnu-build-system)
2945 `(("pkg-config" ,pkg-config)))
2948 (home-page "https://github.com/relan/exfat")
2949 (synopsis "Mount exFAT file systems")
2951 "This package provides a FUSE-based file system that provides read and
2952 write access to exFAT devices.")
2953 (license license:gpl2+)))
2962 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2963 version ".tar.bz2"))
2966 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2967 (build-system gnu-build-system)
2969 '(#:phases (modify-phases %standard-phases
2970 (add-before 'configure 'bootstrap
2972 ;; The tarball was not generated with 'make dist' so we
2973 ;; need to bootstrap things ourselves.
2974 (and (zero? (system* "./autogen.sh"))
2976 (patch-makefile-SHELL "Makefile.include.in")
2979 ;; Make sure programs find libgpm.so.
2980 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2981 (assoc-ref %outputs "out")
2984 `(("texinfo" ,texinfo)
2987 ("autoconf" ,autoconf)
2988 ("automake" ,automake)
2989 ("libtool" ,libtool)))
2990 (home-page "http://www.nico.schottelius.org/software/gpm/")
2991 (synopsis "Mouse support for the Linux console")
2993 "The GPM (general-purpose mouse) daemon is a mouse server for
2994 applications running on the Linux console. It allows users to select items
2995 and copy/paste text in the console and in xterm.")
2996 (license license:gpl2+)))
2998 (define-public btrfs-progs
3000 (name "btrfs-progs")
3004 (uri (string-append "mirror://kernel.org/linux/kernel/"
3005 "people/kdave/btrfs-progs/"
3006 "btrfs-progs-v" version ".tar.xz"))
3009 "03mzv89f08gdsqv4ima793g44kdavcfyjialf5dr0zd2ab66hyp1"))))
3010 (build-system gnu-build-system)
3012 "static")) ; static versions of binaries in "out" (~16MiB!)
3014 '(#:phases (modify-phases %standard-phases
3015 (add-after 'build 'build-static
3016 (lambda _ (zero? (system* "make" "static"))))
3017 (add-after 'install 'install-static
3018 (let ((staticbin (string-append (assoc-ref %outputs "static")
3021 (zero? (system* "make"
3022 (string-append "bindir=" staticbin)
3023 "install-static"))))))
3024 #:test-target "test"
3025 #:parallel-tests? #f)) ; tests fail when run in parallel
3026 (inputs `(("e2fsprogs" ,e2fsprogs)
3027 ("libblkid" ,util-linux)
3028 ("libblkid:static" ,util-linux "static")
3029 ("libuuid" ,util-linux)
3030 ("libuuid:static" ,util-linux "static")
3033 (native-inputs `(("pkg-config" ,pkg-config)
3034 ("asciidoc" ,asciidoc)
3036 ;; For building documentation.
3037 ("libxml2" ,libxml2)
3038 ("docbook-xsl" ,docbook-xsl)
3041 (home-page "https://btrfs.wiki.kernel.org/")
3042 (synopsis "Create and manage btrfs copy-on-write file systems")
3043 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3044 aimed at implementing advanced features while focusing on fault tolerance,
3045 repair and easy administration.")
3046 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3047 ;; GPL2: Everything else.
3048 (license (list license:gpl2 license:gpl2+))))
3050 (define-public btrfs-progs/static
3052 (name "btrfs-progs-static")
3053 (version (package-version btrfs-progs))
3055 (build-system trivial-build-system)
3057 `(("btrfs-progs:static" ,btrfs-progs "static")))
3059 `(#:modules ((guix build utils))
3062 (use-modules (guix build utils)
3066 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3067 (out (assoc-ref %outputs "out"))
3068 (source (string-append btrfs "/bin/btrfs.static"))
3069 (target (string-append out "/bin/btrfs")))
3070 (mkdir-p (dirname target))
3071 (copy-file source target)
3072 (remove-store-references target)
3073 (chmod target #o555)))))
3074 (home-page (package-home-page btrfs-progs))
3075 (synopsis "Statically-linked btrfs command from btrfs-progs")
3076 (description "This package provides the statically-linked @command{btrfs}
3077 from the btrfs-progs package. It is meant to be used in initrds.")
3078 (license (package-license btrfs-progs))))
3080 (define-public freefall
3083 (version (package-version linux-libre))
3084 (source (package-source linux-libre))
3085 (build-system gnu-build-system)
3087 '(#:phases (modify-phases %standard-phases
3088 (add-after 'unpack 'enter-subdirectory
3090 (chdir "tools/laptop/freefall")))
3092 (add-before 'build 'increase-timeout
3094 ;; The default of 2 seconds is too low: it assumes an
3095 ;; open lid and AC power without actually checking.
3096 (substitute* "freefall.c"
3097 (("alarm\\(2\\)") "alarm(5)")))))
3098 #:make-flags (list (string-append "PREFIX="
3099 (assoc-ref %outputs "out")))
3100 #:tests? #f)) ;no tests
3101 (home-page (package-home-page linux-libre))
3102 (synopsis "Free-fall protection for spinning laptop hard drives")
3104 "Prevents shock damage to the internal spinning hard drive(s) of some
3105 HP and Dell laptops. When sudden movement is detected, all input/output
3106 operations on the drive are suspended and its heads are parked on the ramp,
3107 where they are less likely to cause damage to the spinning disc. Requires a
3108 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3109 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3110 (license license:gpl2)))
3112 (define-public thinkfan
3118 (uri (string-append "mirror://sourceforge/thinkfan/"
3119 "/thinkfan-" version ".tar.gz"))
3122 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3123 (modules '((guix build utils)))
3124 ;; Fix erroneous man page location in Makefile leading to
3125 ;; a compilation failure.
3127 '(substitute* "CMakeLists.txt"
3128 (("thinkfan\\.1") "src/thinkfan.1")))))
3129 (build-system cmake-build-system)
3131 `(#:modules ((guix build cmake-build-system)
3134 #:tests? #f ;no test target
3136 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3137 `("-DUSE_ATASMART:BOOL=ON")
3139 (modify-phases %standard-phases
3140 ;; Install scripts for various foreign init systems. Also fix
3141 ;; hard-coded path for daemon.
3142 (add-after 'install 'install-rc-scripts
3143 (lambda* (#:key outputs #:allow-other-keys)
3144 (let ((out (assoc-ref outputs "out"))
3146 (string-append "../thinkfan-" ,version "/rcscripts")
3149 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3150 (string-append out "/sbin/" name)))
3151 (for-each (cute install-file <>
3152 (string-append out "/share/thinkfan"))
3156 `(("libatasmart" ,libatasmart)))
3157 (home-page "http://thinkfan.sourceforge.net/")
3158 (synopsis "Simple fan control program")
3160 "Thinkfan is a simple fan control program. It reads temperatures,
3161 checks them against configured limits and switches to appropriate (also
3162 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3163 other @code{hwmon} driver that enables temperature reading and fan control
3165 (license license:gpl3+)))
3167 (define-public ntfs-3g
3170 (version "2016.2.22")
3173 (uri (string-append "https://tuxera.com/opensource/"
3174 "ntfs-3g_ntfsprogs-" version ".tgz"))
3177 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3178 (modules '((guix build utils)))
3179 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
3181 ;; Install under $prefix.
3182 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3185 (build-system gnu-build-system)
3186 (inputs `(("util-linux" ,util-linux)
3187 ("fuse" ,fuse))) ;libuuid
3188 (native-inputs `(("pkg-config" ,pkg-config)))
3190 '(#:configure-flags (list "--exec-prefix=${prefix}"
3191 "--with-fuse=external" ;use our own FUSE
3192 "--enable-mount-helper"
3193 "--enable-posix-acls"
3194 "--enable-xattr-mappings")))
3195 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3196 (synopsis "Read-write access to NTFS file systems")
3198 "NTFS-3G provides read-write access to NTFS file systems, which are
3199 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3200 The package provides additional NTFS tools.")
3201 (license license:gpl2+)))
3203 (define-public rdma-core
3209 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3210 "/releases/download/v" version "/rdma-core-"
3214 "15qdfqkia22vab1dh41s88vgi70yifi40ar5s4x7a456rpbhy8z5"))))
3215 (build-system cmake-build-system)
3217 '(#:tests? #f ; no tests
3218 ;; Upstream uses the "ninja" build system and encourage distros
3219 ;; to do the same for consistency. They also recommend using the
3220 ;; "Release" build type.
3221 #:configure-flags (list "-GNinja"
3222 ;; Defaults to "lib64" on 64-bit archs.
3223 (string-append "-DCMAKE_INSTALL_LIBDIR="
3224 (assoc-ref %outputs "out") "/lib")
3225 "-DCMAKE_BUILD_TYPE=Release")
3227 (modify-phases %standard-phases
3230 (zero? (system* "ninja"
3231 "-j" (number->string (parallel-job-count))))))
3234 (zero? (system* "ninja" "install")))))))
3237 ("pkg-config" ,pkg-config)
3238 ("python" ,python-wrapper)))
3242 (home-page "https://github.com/linux-rdma/rdma-core")
3243 (synopsis "Utilities and libraries for working with RDMA devices")
3245 "This package provides userspace components for the InfiniBand
3246 subsystem of the Linux kernel. Specifically it contains userspace
3247 libraries for the following device nodes:
3250 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3251 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3252 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3255 The following service daemons are also provided:
3257 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3258 @item @code{iwpmd} (for iWARP kernel providers)
3259 @item @code{ibacm} (for InfiniBand communication management assistant)
3261 ;; All library code is dual licensed under GPL2 and a custom MIT
3262 ;; variant. The package also includes some components covered by
3263 ;; other licenses. Consult COPYING.md for full details.
3266 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3267 license:bsd-2 ; Files referring to COPYING.BSD_FB
3268 license:cc0 ; most files in ccan/
3269 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3271 (define-public rng-tools
3278 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3279 "rng-tools-" version ".tar.gz"))
3282 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3283 (build-system gnu-build-system)
3284 (synopsis "Random number generator daemon")
3286 "Monitor a hardware random number generator, and supply entropy
3287 from that to the system kernel's @file{/dev/random} machinery.")
3288 (home-page "https://sourceforge.net/projects/gkernel")
3289 ;; The source package is offered under the GPL2+, but the files
3290 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3291 (license (list license:gpl2 license:gpl2+))))
3293 (define-public cpupower
3296 (version (package-version linux-libre))
3297 (source (package-source linux-libre))
3298 (build-system gnu-build-system)
3300 '(#:phases (modify-phases %standard-phases
3301 (add-after 'unpack 'enter-subdirectory
3303 (chdir "tools/power/cpupower")))
3305 (add-before 'build 'fix-makefiles
3307 (substitute* "Makefile"
3309 (("/bin/(install|pwd)" _ command) command))
3310 (substitute* "bench/Makefile"
3311 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3312 #:make-flags (let ((out (assoc-ref %outputs "out")))
3313 (list (string-append "DESTDIR=" out)
3314 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3315 "docdir=/share/doc/cpupower"
3316 "confdir=$(docdir)/examples"
3317 ;; The Makefile recommends the following changes
3319 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3320 #:tests? #f)) ;no tests
3321 (native-inputs `(("gettext" ,gettext-minimal)))
3322 (inputs `(("pciutils" ,pciutils)))
3323 (home-page (package-home-page linux-libre))
3324 (synopsis "CPU frequency and voltage scaling tools for Linux")
3326 "cpupower is a set of user-space tools that use the cpufreq feature of the
3327 Linux kernel to retrieve and control processor features related to power saving,
3328 such as frequency and voltage scaling.")
3329 (license license:gpl2)))
3331 (define-public haveged
3338 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3342 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3343 (build-system gnu-build-system)
3344 (home-page "http://www.issihosts.com/haveged")
3345 (synopsis "Entropy source for the Linux random number generator")
3347 "haveged generates an unpredictable stream of random numbers for use by
3348 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3349 standard mechanisms for filling the entropy pool may not be sufficient for
3350 systems with high needs or limited user interaction, such as headless servers.
3351 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3352 indirect effects of hardware events on hidden processor state using the HArdware
3353 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3354 its environment and provides the same built-in test suite for the output stream
3355 as used on certified hardware security devices.")
3356 (license (list (license:non-copyleft "file://nist/mconf.h")
3357 (license:non-copyleft "file://nist/packtest.c")
3358 license:public-domain ; nist/dfft.c
3359 license:gpl3+)))) ; everything else
3361 (define-public ecryptfs-utils
3363 (name "ecryptfs-utils")
3368 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3369 version "/+download/ecryptfs-utils_"
3370 version ".orig.tar.gz"))
3373 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3374 (build-system gnu-build-system)
3376 `(#:configure-flags (list "--disable-pywrap")))
3378 `(("intltool" ,intltool)
3379 ("perl" ,perl) ; for pod2man
3380 ("pkg-config" ,pkg-config)))
3382 `(("keyutils" ,keyutils)
3383 ("linux-pam" ,linux-pam)
3385 (home-page "http://ecryptfs.org/")
3386 (synopsis "eCryptfs cryptographic file system utilities")
3388 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3389 Each file's cryptographic meta-data is stored inside the file itself, along
3390 with the encrypted contents. This allows individual encrypted files to be
3391 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3392 native Linux file system, and has been part of the Linux kernel since version
3393 2.6.19. This package contains the userland utilities to manage it.")
3394 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3395 ;; grant additional permission to link with OpenSSL.
3396 (license license:gpl2+)))
3398 (define-public libnfsidmap
3400 (name "libnfsidmap")
3405 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3406 name "/" name "-" version ".tar.gz"))
3409 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3410 (build-system gnu-build-system)
3412 `(#:configure-flags (list
3413 (string-append "--with-pluginpath="
3414 (assoc-ref %outputs "out")
3415 "/lib/libnfsidmap"))))
3417 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3419 "NFSv4 support library for name/ID mapping")
3420 (description "Libnfsidmap is a library holding mulitiple methods of
3421 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3422 extensible array of mapping functions, currently consisting of two choices:
3423 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3424 (license (license:non-copyleft "file://COPYING"
3425 "See COPYING in the distribution."))))
3427 (define-public module-init-tools
3429 (name "module-init-tools")
3434 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3435 "module-init-tools-" version ".tar.bz2"))
3438 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3439 (patches (search-patches "module-init-tools-moduledir.patch"))))
3440 (build-system gnu-build-system)
3442 ;; FIXME: The upstream tarball lacks man pages, and building them would
3443 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3444 ;; but they vanished. In the meantime, fake it.
3445 '(#:phases (alist-cons-before
3446 'configure 'fake-docbook
3448 (substitute* "Makefile.in"
3449 (("^DOCBOOKTOMAN.*$")
3450 "DOCBOOKTOMAN = true\n")))
3452 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3453 (synopsis "Tools for loading and managing Linux kernel modules")
3455 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3456 `insmod', `lsmod', and more.")
3457 (license license:gpl2+)))
3459 (define-public mcelog
3465 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3466 "mcelog.git/snapshot/v" version ".tar.gz"))
3469 "0q40d60p1klzg0aznvxhxgjlddwcxfj2q59s4q86sf9ild6rcdhl"))
3470 (file-name (string-append name "-" version ".tar.gz"))
3471 (modules '((guix build utils)))
3473 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3474 `(substitute* "Makefile"
3475 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3476 (build-system gnu-build-system)
3478 `(#:phases (modify-phases %standard-phases
3479 (delete 'configure)) ; no configure script
3480 #:make-flags (let ((out (assoc-ref %outputs "out")))
3482 (string-append "prefix=" out)
3483 (string-append "DOCDIR=" out "/share/doc/mcelog")
3484 "etcprefix=$(DOCDIR)/examples"))
3485 ;; The tests will only run as root on certain supported CPU models.
3487 (supported-systems (list "i686-linux" "x86_64-linux"))
3488 (home-page "http://mcelog.org/")
3489 (synopsis "Machine check monitor for x86 Linux systems")
3491 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3492 and other hardware errors on x86 systems. It can also perform user-defined
3493 tasks, such as bringing bad pages off-line, when configurable error thresholds
3495 (license license:gpl2)))
3497 (define-public mtd-utils
3504 "ftp://ftp.infradead.org/pub/mtd-utils/"
3505 "mtd-utils-" version ".tar.bz2"))
3508 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3511 ("libuuid" ,util-linux)
3514 (build-system gnu-build-system)
3516 `(#:test-target "tests"
3517 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3518 #:phases (modify-phases %standard-phases
3519 (delete 'configure))))
3520 (synopsis "MTD Flash Storage Utilities")
3521 (description "This package provides utilities for testing, partitioning, etc
3523 (home-page "http://www.linux-mtd.infradead.org/")
3525 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3526 license:mpl1.1 ; All ftl* files
3527 license:expat)))) ; libiniparser
3529 (define-public libseccomp
3535 (uri (string-append "https://github.com/seccomp/libseccomp/"
3536 "releases/download/v" version
3537 "/libseccomp-" version ".tar.gz"))
3540 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3541 (build-system gnu-build-system)
3543 `(("which" ,which)))
3544 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3545 (description "The libseccomp library provides an easy to use, platform
3546 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3547 libseccomp API is designed to abstract away the underlying BPF based syscall
3548 filter language and present a more conventional function-call based filtering
3549 interface that should be familiar to, and easily adopted by, application
3551 (home-page "https://github.com/seccomp/libseccomp")
3552 (license license:lgpl2.1)))
3554 (define-public radeontop
3558 (home-page "https://github.com/clbr/radeontop/")
3561 (uri (string-append home-page "archive/v" version ".tar.gz"))
3562 (file-name (string-append name "-" version ".tar.gz"))
3565 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3566 (build-system gnu-build-system)
3568 `(#:phases (modify-phases %standard-phases
3569 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3570 ;; dependency, and doesn't even work on release(!) tarballs.
3571 (add-after 'unpack 'report-correct-version
3572 (lambda _ (substitute* "getver.sh"
3574 (string-append "ver=" ,version)))))
3575 (delete 'configure)) ; no configure script
3576 #:make-flags (list "CC=gcc"
3577 (string-append "PREFIX=" %output))
3578 #:tests? #f)) ; no tests
3580 `(("gettext" ,gettext-minimal)
3581 ("pkg-config" ,pkg-config)))
3583 `(("libdrm" ,libdrm)
3584 ("libpciaccess" ,libpciaccess)
3586 ("ncurses" ,ncurses)))
3587 (synopsis "Usage monitor for AMD Radeon graphics")
3588 (description "RadeonTop monitors resource consumption on supported AMD
3589 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3590 a terminal or saved to a file for further processing. It measures both the
3591 activity of the GPU as a whole, which is also accurate during OpenCL
3592 computations, as well as separate component statistics that are only meaningful
3593 under OpenGL graphics workloads.")
3594 (license license:gpl3)))
3596 (define-public efivar
3602 (uri (string-append "https://github.com/rhinstaller/" name
3603 "/releases/download/" version "/" name
3604 "-" version ".tar.bz2"))
3607 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3608 (build-system gnu-build-system)
3610 `(;; Tests require a UEFI system and is not detected in the chroot.
3612 #:make-flags (list (string-append "prefix=" %output)
3613 (string-append "libdir=" %output "/lib")
3614 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3616 (modify-phases %standard-phases
3617 (delete 'configure))))
3619 `(("pkg-config" ,pkg-config)))
3622 (home-page "https://github.com/rhinstaller/efivar")
3623 (synopsis "Tool and library to manipulate EFI variables")
3624 (description "This package provides a library and a command line
3625 interface to the variable facility of UEFI boot firmware.")
3626 (license license:lgpl2.1+)))
3628 (define-public efibootmgr
3634 (uri (string-append "https://github.com/rhinstaller/" name
3635 "/releases/download/" version "/" name
3636 "-" version ".tar.bz2"))
3639 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3640 (build-system gnu-build-system)
3642 `(#:tests? #f ; No tests.
3643 #:make-flags (list (string-append "prefix=" %output)
3644 (string-append "libdir=" %output "/lib")
3645 ;; Override CFLAGS to add efivar include directory.
3646 (string-append "CFLAGS=-O2 -g -flto -I"
3647 (assoc-ref %build-inputs "efivar")
3650 (modify-phases %standard-phases
3651 (add-after 'unpack 'branding
3652 ;; Replace default loader path with something more familiar.
3654 (substitute* "src/efibootmgr.c"
3655 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3658 (delete 'configure))))
3660 `(("pkg-config" ,pkg-config)))
3662 `(("efivar" ,efivar)
3664 (home-page "https://github.com/rhinstaller/efibootmgr")
3665 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3667 "@code{efibootmgr} is a user-space application to modify the Intel
3668 Extensible Firmware Interface (EFI) Boot Manager. This application can
3669 create and destroy boot entries, change the boot order, change the next
3670 running boot option, and more.")
3671 (license license:gpl2+)))
3673 (define-public sysstat
3679 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3680 "sysstat-" version ".tar.xz"))
3683 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3684 (build-system gnu-build-system)
3686 `(#:tests? #f ; No test suite.
3687 ;; Without this flag, it tries to install the man pages with group 'root'
3688 ;; and fails because /etc/passwd lacks an entry for the root user.
3690 (list "--disable-file-attr"
3691 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3693 (modify-phases %standard-phases
3694 ;; The build process tries to create '/var/lib/sa', so we skip that
3696 (add-after 'build 'skip-touching-var
3698 (substitute* "Makefile"
3699 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3702 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3703 (synopsis "Performance monitoring tools for Linux")
3704 (description "The sysstat utilities are a collection of performance
3705 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3706 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3707 @code{sadf} and @code{sa}.")
3708 (license license:gpl2+)))
3710 (define-public light
3716 (uri (string-append "https://github.com/haikarainen/" name
3717 "/archive/v" version ".tar.gz"))
3720 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3721 (file-name (string-append name "-" version ".tar.gz"))))
3722 (build-system gnu-build-system)
3724 '(#:tests? #f ; no tests
3725 #:make-flags (list "CC=gcc"
3726 (string-append "PREFIX=" %output))
3728 (modify-phases %standard-phases
3730 (add-after 'unpack 'patch-makefile
3732 (substitute* "Makefile" (("chown") "#")))))))
3734 `(("help2man" ,help2man)))
3735 (home-page "https://haikarainen.github.io/light")
3736 (synopsis "GNU/Linux application to control backlights")
3738 "Light is a program to send commands to screen backlight controllers
3739 under GNU/Linux. Features include:
3742 @item It does not rely on X.
3743 @item Light can automatically figure out the best controller to use, making
3744 full use of underlying hardware.
3745 @item It is possible to set a minimum brightness value, as some controllers
3746 set the screen to be pitch black at a vaĺue of 0 (or higher).
3749 Light is the successor of lightscript.")
3750 (license license:gpl3+)))
3759 "https://github.com/linrunner/"
3760 (string-upcase name)
3761 "/archive/" version ".tar.gz"))
3762 (file-name (string-append name "-" version ".tar.gz"))
3765 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3766 (inputs `(("bash" ,bash)
3768 ("ethtool" ,ethtool)
3772 ("inetutils" ,inetutils)
3775 ("pciutils" ,pciutils)
3779 ("usbutils" ,usbutils)
3780 ("util-linux" ,util-linux)
3781 ("wireless-tools" ,wireless-tools)))
3782 (build-system gnu-build-system)
3785 (modify-phases %standard-phases
3786 (delete 'configure) ; no configure script
3787 (add-before 'build 'setenv
3788 (lambda* (#:key outputs #:allow-other-keys)
3789 (let ((out (assoc-ref outputs "out")))
3790 (setenv "TLP_WITH_SYSTEMD" "0")
3791 (setenv "TLP_NO_INIT" "1")
3792 (setenv "TLP_NO_PMUTILS" "1")
3793 (setenv "TLP_SBIN" (string-append out "/bin"))
3794 (setenv "TLP_BIN" (string-append out "/bin"))
3795 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3796 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3797 (setenv "TLP_CONF" "/etc/tlp")
3799 (string-append out "/share/bash-completion/completions"))
3800 (setenv "TLP_MAN" (string-append out "/share/man")))))
3801 (delete 'check) ; no tests
3802 (add-before 'install 'fix-installation
3804 ;; Stop the Makefile from trying to create system directories.
3805 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
3808 (zero? (system* "make" "install-tlp" "install-man"))))
3809 (add-after 'install 'wrap
3810 (lambda* (#:key inputs outputs #:allow-other-keys)
3811 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3812 (bin-files (find-files bin ".*")))
3813 (define (bin-directory input-name)
3814 (string-append (assoc-ref inputs input-name) "/bin"))
3815 (define (sbin-directory input-name)
3816 (string-append (assoc-ref inputs input-name) "/sbin"))
3817 (for-each (lambda (program)
3818 (wrap-program program
3821 (map bin-directory '("bash"
3832 (map sbin-directory '("ethtool"
3837 "wireless-tools"))))))
3839 (home-page "http://linrunner.de/en/tlp/tlp.html")
3840 (synopsis "Power management tool for Linux")
3841 (description "TLP is a power management tool for Linux. It comes with
3842 a default configuration already optimized for battery life. Nevertheless,
3843 TLP is customizable to fulfil system requirements. TLP settings are applied
3844 every time the power supply source is changed.")
3846 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3848 (license (list license:gpl2+ license:gpl3+))))
3856 (uri (string-append "https://www.ezix.org/software/"
3857 "files/lshw-" version
3861 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3862 (build-system gnu-build-system)
3864 `(#:phases (modify-phases %standard-phases (delete 'configure))
3865 #:tests? #f ; no tests
3867 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3868 (synopsis "List hardware information")
3870 "@command{lshw} (Hardware Lister) is a small tool to provide
3871 detailed information on the hardware configuration of the machine.
3872 It can report exact memory configuration, firmware version, mainboard
3873 configuration, CPU version and speed, cache configuration, bus speed,
3874 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3875 machines (PowerMac G4 is known to work).")
3876 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3877 (license license:gpl2+)))
3879 (define-public libmnl
3886 (uri (string-append "mirror://netfilter.org/libmnl/"
3887 "libmnl-" version ".tar.bz2"))
3890 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
3891 (build-system gnu-build-system)
3892 (home-page "https://www.netfilter.org/projects/libmnl/")
3893 (synopsis "Netlink utility library")
3894 (description "Libmnl is a minimalistic user-space library oriented to
3895 Netlink developers. There are a lot of common tasks in parsing, validating,
3896 constructing of both the Netlink header and TLVs that are repetitive and easy to
3897 get wrong. This library aims to provide simple helpers that allows you to
3898 re-use code and to avoid re-inventing the wheel.")
3899 (license license:lgpl2.1+)))
3901 (define-public libnftnl
3908 (uri (string-append "mirror://netfilter.org/libnftnl/"
3909 "libnftnl-" version ".tar.bz2"))
3912 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
3913 (build-system gnu-build-system)
3915 `(("pkg-config" ,pkg-config)))
3917 `(("libmnl" ,libmnl)))
3918 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
3919 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
3920 (description "Libnftnl is a userspace library providing a low-level netlink
3921 programming interface to the in-kernel nf_tables subsystem. The library
3922 libnftnl has been previously known as libnftables. This library is currently
3924 (license license:gpl2+)))
3926 (define-public nftables
3933 (uri (string-append "http://www.nftables.org/projects/nftables"
3934 "/files/nftables-" version ".tar.bz2"))
3937 "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy"))))
3938 (build-system gnu-build-system)
3939 (inputs `(("bison", bison)
3943 ("libnftnl", libnftnl)
3944 ("readline", readline)))
3945 (native-inputs `(("pkg-config", pkg-config)))
3946 (home-page "http://www.nftables.org")
3947 (synopsis "Userspace utility for Linux packet filtering")
3948 (description "nftables is the project that aims to replace the existing
3949 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
3950 filtering framework, a new userspace utility and also a compatibility layer for
3951 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
3952 infrastructure such as the existing hooks, the connection tracking system, the
3953 userspace queueing component and the logging subsystem.")
3954 (license license:gpl2)))
3956 (define-public proot
3960 (home-page "https://github.com/proot-me/PRoot")
3963 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3964 (file-name (string-append name "-" version ".tar.gz"))
3967 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
3968 (patches (search-patches "proot-test-fhs.patch"))))
3969 (build-system gnu-build-system)
3971 '(#:make-flags '("-C" "src")
3973 #:phases (modify-phases %standard-phases
3975 (add-before 'build 'set-shell-file-name
3976 (lambda* (#:key inputs #:allow-other-keys)
3977 (substitute* (find-files "src" "\\.[ch]$")
3980 (assoc-ref inputs "bash")
3983 (add-before 'check 'fix-fhs-assumptions-in-tests
3985 (substitute* "tests/test-c6b77b77.mk"
3986 (("/bin/bash") (which "bash"))
3987 (("/usr/bin/test") (which "test")))
3988 (substitute* '("tests/test-16573e73.c")
3989 (("/bin/([a-z-]+)" _ program)
3992 (substitute* (find-files "tests" "\\.sh$")
3993 ;; Some of the tests try to "bind-mount" /bin/true.
3995 (string-append "-b " (which "true") ":"))
3996 ;; Likewise for /bin.
3997 (("-b /bin:") "-b /gnu:")
3998 ;; Others try to run /bin/sh.
3999 (("/bin/sh") (which "sh"))
4000 ;; Others assume /etc/fstab exists.
4001 (("/etc/fstab") "/etc/passwd"))
4003 (substitute* "tests/GNUmakefile"
4004 (("-b /bin:") "-b /gnu:"))
4006 ;; XXX: This test fails in an obscure corner case, just
4008 (delete-file "tests/test-kkkkkkkk.c")
4013 (let ((n (parallel-job-count)))
4014 ;; For some reason we get lots of segfaults with
4015 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4016 (setenv "PROOT_NO_SECCOMP" "1")
4018 ;; Most of the tests expect "/bin" to be in $PATH so
4019 ;; they can run things that live in $ROOTFS/bin.
4021 (string-append (getenv "PATH") ":/bin"))
4023 (zero? (system* "make" "check" "-C" "tests"
4025 "-j" (number->string n))))))
4027 (lambda* (#:key outputs #:allow-other-keys)
4028 ;; The 'install' rule does nearly nothing.
4029 (let ((out (assoc-ref outputs "out")))
4031 ;; TODO: 'make install-care' (does not even
4032 ;; build currently.)
4033 (system* "make" "-C" "src" "install"
4034 (string-append "PREFIX=" out)))
4035 (let ((man1 (string-append out
4036 "/share/man/man1")))
4038 (copy-file "doc/proot/man.1"
4039 (string-append man1 "/proot.1"))
4041 (native-inputs `(("which" ,which)
4043 ;; For 'mcookie', used by some of the tests.
4044 ("util-linux" ,util-linux)))
4045 (inputs `(("talloc" ,talloc)))
4046 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4048 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4049 and @code{binfmt_misc}. This means that users don't need any privileges or
4050 setup to do things like using an arbitrary directory as the new root
4051 filesystem, making files accessible somewhere else in the file system
4052 hierarchy, or executing programs built for another CPU architecture
4053 transparently through QEMU user-mode. Also, developers can use PRoot as a
4054 generic process instrumentation engine thanks to its extension mechanism.
4055 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4056 available in the kernel Linux.")
4057 (license license:gpl2+)))
4059 (define-public proot-static
4062 (name "proot-static")
4064 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4065 (inputs `(("talloc" ,talloc/static)))
4067 (substitute-keyword-arguments (package-arguments proot)
4068 ((#:make-flags flags)
4069 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4071 `(modify-phases ,phases
4072 (add-after 'strip 'remove-store-references
4073 (lambda* (#:key outputs #:allow-other-keys)
4074 (let* ((out (assoc-ref outputs "out")))
4075 (with-directory-excursion out
4076 (remove-store-references "bin/proot")
4078 ((#:allowed-references _ '("out"))
4081 (define-public cpuid
4084 (version "20170122")
4087 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4088 version ".src.tar.gz"))
4091 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4092 (build-system gnu-build-system)
4094 '(#:make-flags '("CC=gcc")
4095 #:tests? #f ; no tests
4096 #:phases (modify-phases %standard-phases
4098 (add-before 'install 'fix-makefile
4099 (lambda* (#:key outputs #:allow-other-keys)
4100 (substitute* "Makefile"
4101 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4102 ;; Make the compressed manpages writable so that the
4103 ;; reset-gzip-timestamps phase does not error out.
4104 (substitute* "Makefile"
4105 (("-m 444") "-m 644"))
4107 (inputs `(("perl" ,perl)))
4108 (supported-systems '("i686-linux" "x86_64-linux"))
4109 (home-page "http://www.etallen.com/cpuid.html")
4110 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4111 (description "cpuid dumps detailed information about the CPU(s) gathered
4112 from the CPUID instruction, and also determines the exact model of CPU(s). It
4113 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4114 NexGen, Rise, and SiS CPUs.")
4115 (license license:gpl2+)))
4117 (define-public jmtpfs
4124 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4126 (file-name (string-append name "-" version ".tar.gz"))
4129 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4130 (build-system gnu-build-system)
4134 ("libmtp" ,libmtp)))
4136 `(("pkg-config" ,pkg-config)))
4137 (home-page "https://github.com/JasonFerrara/jmtpfs")
4138 (synopsis "Use a FUSE filesystem to access data over MTP")
4139 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4140 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4141 the MTP device as a filesystem.")
4142 (license license:gpl3)))