1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Mark H Weaver <mhw@netris.org>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
8 ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
11 ;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
12 ;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
13 ;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
14 ;;; Copyright © 2016, 2018, 2019 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
16 ;;; Copyright © 2016 David Craven <david@craven.ch>
17 ;;; Copyright © 2016 John Darrington <jmd@gnu.org>
18 ;;; Copyright © 2016, 2017, 2018, 2019 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
22 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
23 ;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
24 ;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
25 ;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
26 ;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
27 ;;; Copyright © 2017, 2018, 2019 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
31 ;;; Copyright © 2018 Brendan Tildesley <mail@brendan.scot>
32 ;;; Copyright © 2018 Manuel Graf <graf@init.at>
33 ;;; Copyright © 2018 Pierre Langlois <pierre.langlois@gmx.com>
34 ;;; Copyright © 2018 Vasile Dumitrascu <va511e@yahoo.com>
35 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
36 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
38 ;;; This file is part of GNU Guix.
40 ;;; GNU Guix is free software; you can redistribute it and/or modify it
41 ;;; under the terms of the GNU General Public License as published by
42 ;;; the Free Software Foundation; either version 3 of the License, or (at
43 ;;; your option) any later version.
45 ;;; GNU Guix is distributed in the hope that it will be useful, but
46 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
47 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48 ;;; GNU General Public License for more details.
50 ;;; You should have received a copy of the GNU General Public License
51 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
53 (define-module (gnu packages linux)
54 #:use-module (gnu packages)
55 #:use-module (gnu packages acl)
56 #:use-module (gnu packages admin)
57 #:use-module (gnu packages algebra)
58 #:use-module (gnu packages attr)
59 #:use-module (gnu packages audio)
60 #:use-module (gnu packages autotools)
61 #:use-module (gnu packages backup)
62 #:use-module (gnu packages base)
63 #:use-module (gnu packages bash)
64 #:use-module (gnu packages bison)
65 #:use-module (gnu packages calendar)
66 #:use-module (gnu packages check)
67 #:use-module (gnu packages crypto)
68 #:use-module (gnu packages cryptsetup)
69 #:use-module (gnu packages compression)
70 #:use-module (gnu packages dbm)
71 #:use-module (gnu packages datastructures)
72 #:use-module (gnu packages docbook)
73 #:use-module (gnu packages documentation)
74 #:use-module (gnu packages elf)
75 #:use-module (gnu packages flex)
76 #:use-module (gnu packages file)
77 #:use-module (gnu packages freedesktop)
78 #:use-module (gnu packages gcc)
79 #:use-module (gnu packages gettext)
80 #:use-module (gnu packages glib)
81 #:use-module (gnu packages golang)
82 #:use-module (gnu packages gperf)
83 #:use-module (gnu packages gtk)
84 #:use-module (gnu packages libunwind)
85 #:use-module (gnu packages libusb)
86 #:use-module (gnu packages man)
87 #:use-module (gnu packages maths)
88 #:use-module (gnu packages multiprecision)
89 #:use-module (gnu packages ncurses)
90 #:use-module (gnu packages netpbm)
91 #:use-module (gnu packages nettle)
92 #:use-module (gnu packages networking)
93 #:use-module (gnu packages ninja)
94 #:use-module (gnu packages nss)
95 #:use-module (gnu packages perl)
96 #:use-module (gnu packages pciutils)
97 #:use-module (gnu packages pkg-config)
98 #:use-module (gnu packages popt)
99 #:use-module (gnu packages pulseaudio)
100 #:use-module (gnu packages python)
101 #:use-module (gnu packages readline)
102 #:use-module (gnu packages rrdtool)
103 #:use-module (gnu packages samba)
104 #:use-module (gnu packages serialization)
105 #:use-module (gnu packages slang)
106 #:use-module (gnu packages storage)
107 #:use-module (gnu packages texinfo)
108 #:use-module (gnu packages tls)
109 #:use-module (gnu packages valgrind)
110 #:use-module (gnu packages video)
111 #:use-module (gnu packages web)
112 #:use-module (gnu packages xiph)
113 #:use-module (gnu packages xml)
114 #:use-module (gnu packages xdisorg)
115 #:use-module (gnu packages xorg)
116 #:use-module (gnu packages groff)
117 #:use-module (gnu packages selinux)
118 #:use-module (gnu packages swig)
119 #:use-module (guix build-system cmake)
120 #:use-module (guix build-system gnu)
121 #:use-module (guix build-system go)
122 #:use-module (guix build-system python)
123 #:use-module (guix build-system trivial)
124 #:use-module (guix build-system linux-module)
125 #:use-module (guix download)
126 #:use-module (guix git-download)
127 #:use-module ((guix licenses) #:prefix license:)
128 #:use-module (guix packages)
129 #:use-module (guix utils)
130 #:use-module (srfi srfi-1)
131 #:use-module (srfi srfi-2)
132 #:use-module (srfi srfi-26)
133 #:use-module (ice-9 match))
135 (define-public (system->linux-architecture arch)
136 "Return the Linux architecture name for ARCH, a Guix system name such as
137 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
138 (let ((arch (car (string-split arch #\-))))
139 (cond ((string=? arch "i686") "i386")
140 ((string-prefix? "mips" arch) "mips")
141 ((string-prefix? "arm" arch) "arm")
142 ((string-prefix? "aarch64" arch) "arm64")
143 ((string-prefix? "alpha" arch) "alpha")
144 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
145 ((string-prefix? "s390" arch) "s390")
148 (define-public (system->defconfig system)
149 "Some systems (notably powerpc-linux) require a special target for kernel
150 defconfig. Return the appropriate make target if applicable, otherwise return
152 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
153 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
156 (define (linux-libre-urls version)
157 "Return a list of URLs for Linux-Libre VERSION."
159 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
160 version "-gnu/linux-libre-" version "-gnu.tar.xz")
162 ;; XXX: Work around <http://bugs.gnu.org/14851>.
164 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
165 version "-gnu.tar.xz")
167 ;; Maybe this URL will become valid eventually.
169 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
170 version "-gnu.tar.xz")))
172 (define-public linux-libre-headers
174 (name "linux-libre-headers")
178 (uri (linux-libre-urls version))
181 "050zvdxjy6sc64q75pr1gxsmh49chwav2pwxz8xlif39bvahnrpg"))))
182 (build-system gnu-build-system)
183 (native-inputs `(("perl" ,perl)))
185 `(#:modules ((guix build gnu-build-system)
189 (modify-phases %standard-phases
193 (let ((arch ,(system->linux-architecture
194 (or (%current-target-system)
196 (defconfig ,(system->defconfig
197 (or (%current-target-system)
198 (%current-system)))))
200 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
201 (invoke "make" defconfig)
202 (invoke "make" "mrproper" "headers_check"))))
204 (lambda* (#:key outputs #:allow-other-keys)
205 (let ((out (assoc-ref outputs "out")))
207 (string-append "INSTALL_HDR_PATH=" out)
210 (mkdir (string-append out "/include/config"))
211 (call-with-output-file
213 "/include/config/kernel.release")
215 (format p "~a-default~%" ,version)))
217 ;; Remove the '.install' and '..install.cmd' files; the
218 ;; latter contains store paths, which pulls in bootstrap
219 ;; binaries in the build environment, and prevents bit
220 ;; reproducibility for the bootstrap binaries.
221 (for-each delete-file (find-files out "\\.install"))
224 #:allowed-references ()
226 (home-page "https://www.gnu.org/software/linux-libre/")
227 (synopsis "GNU Linux-Libre kernel headers")
228 (description "Headers of the Linux-Libre kernel.")
229 (license license:gpl2)))
231 (define %boot-logo-patch
232 ;; Linux-Libre boot logo featuring Freedo and a gnu.
235 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
236 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
239 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
241 (define %linux-libre-arm-export-__sync_icache_dcache-patch
245 "https://salsa.debian.org/kernel-team/linux"
246 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
247 "/debian/patches/bugfix/arm/"
248 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
249 (file-name "linux-libre-4.19-arm-export-__sync_icache_dcache.patch")
251 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
253 (define* (kernel-config arch #:key variant)
254 "Return the absolute file name of the Linux-Libre build configuration file
255 for ARCH and optionally VARIANT, or #f if there is no such configuration."
256 (let* ((name (string-append (if variant (string-append variant "-") "")
257 (if (string=? "i386" arch) "i686" arch) ".conf"))
258 (file (string-append "linux-libre/" name)))
259 (search-auxiliary-file file)))
261 ;; FIXME: merge into kernel-config
262 (define* (kernel-config-veyron arch #:key variant)
263 "Return the absolute file name of the Linux-Libre build configuration file
264 for ARCH and optionally VARIANT, or #f if there is no such configuration."
265 (let* ((name (string-append (if variant (string-append variant "-") "")
266 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
267 (file (string-append "linux-libre/" name)))
268 (search-auxiliary-file file)))
270 (define %default-extra-linux-options
271 `(;; Modules required for initrd:
272 ("CONFIG_NET_9P" . m)
273 ("CONFIG_NET_9P_VIRTIO" . m)
274 ("CONFIG_VIRTIO_BLK" . m)
275 ("CONFIG_VIRTIO_NET" . m)
276 ("CONFIG_VIRTIO_PCI" . m)
277 ("CONFIG_VIRTIO_BALLOON" . m)
278 ("CONFIG_VIRTIO_MMIO" . m)
279 ("CONFIG_FUSE_FS" . m)
281 ("CONFIG_9P_FS" . m)))
283 (define (config->string options)
284 (string-join (map (match-lambda
286 (string-append option "=m"))
288 (string-append option "=y"))
290 (string-append option "=n")))
294 (define* (make-linux-libre version hash supported-systems
296 ;; A function that takes an arch and a variant.
297 ;; See kernel-config for an example.
299 (configuration-file #f)
300 (defconfig "defconfig")
301 (extra-options %default-extra-linux-options)
302 (patches (list %boot-logo-patch)))
304 (name (if extra-version
305 (string-append "linux-libre-" extra-version)
310 (uri (linux-libre-urls version))
311 (sha256 (base32 hash))
313 (supported-systems supported-systems)
314 (build-system gnu-build-system)
320 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
324 ;; Build with GCC-7 for full retpoline support.
325 ;; FIXME: Remove this when our default compiler has retpoline support.
328 ;; These are needed to compile the GCC plugins.
333 ,@(match (and configuration-file
335 (system->linux-architecture
336 (or (%current-target-system) (%current-system)))
337 #:variant (version-major+minor version)))
338 (#f ;no config for this platform
341 `(("kconfig" ,config))))))
343 `(#:modules ((guix build gnu-build-system)
348 (modify-phases %standard-phases
349 (add-after 'unpack 'patch-/bin/pwd
351 (substitute* (find-files "." "^Makefile(\\.include)?$")
352 (("/bin/pwd") "pwd"))
354 (add-before 'configure 'work-around-gcc-7-include-path-issue
356 (unsetenv "C_INCLUDE_PATH")
357 (unsetenv "CPLUS_INCLUDE_PATH")
360 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
361 ;; Avoid introducing timestamps
362 (setenv "KCONFIG_NOTIMESTAMP" "1")
363 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
365 ;; Set ARCH and CROSS_COMPILE
366 (let ((arch ,(system->linux-architecture
367 (or (%current-target-system)
368 (%current-system)))))
370 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
373 (setenv "CROSS_COMPILE" (string-append target "-"))
374 (format #t "`CROSS_COMPILE' set to `~a'~%"
375 (getenv "CROSS_COMPILE"))))
377 (setenv "EXTRA_VERSION" ,extra-version)
379 (let ((build (assoc-ref %standard-phases 'build))
380 (config (assoc-ref (or native-inputs inputs) "kconfig")))
382 ;; Use a custom kernel configuration file or a default
383 ;; configuration file.
386 (copy-file config ".config")
387 (chmod ".config" #o666))
388 (invoke "make" ,defconfig))
390 ;; Appending works even when the option wasn't in the
391 ;; file. The last one prevails if duplicated.
392 (let ((port (open-file ".config" "a"))
393 (extra-configuration ,(config->string extra-options)))
394 (display extra-configuration port)
397 (invoke "make" "oldconfig"))))
399 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
400 (let* ((out (assoc-ref outputs "out"))
401 (moddir (string-append out "/lib/modules"))
402 (dtbdir (string-append out "/lib/dtbs"))
403 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
404 ;; Install kernel image, kernel configuration and link map.
405 (for-each (lambda (file) (install-file file out))
406 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
407 ;; Install device tree files
408 (unless (null? (find-files "." "\\.dtb$"))
410 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
412 ;; Install kernel modules
415 (string-append "DEPMOD=" kmod "/bin/depmod")
416 (string-append "MODULE_DIR=" moddir)
417 (string-append "INSTALL_PATH=" out)
418 (string-append "INSTALL_MOD_PATH=" out)
419 "INSTALL_MOD_STRIP=1"
420 "modules_install")))))
422 (home-page "https://www.gnu.org/software/linux-libre/")
423 (synopsis "100% free redistribution of a cleaned Linux kernel")
425 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
426 It has been modified to remove all non-free binary blobs.")
427 (license license:gpl2)))
429 (define %linux-libre-version "5.1.2")
430 (define %linux-libre-hash "1v4i5lf95zjp3gvswhla9jz7yqkl0k13blf6y2z0229xh05627jb")
432 (define %linux-libre-5.1-patches
433 (list %boot-logo-patch
434 %linux-libre-arm-export-__sync_icache_dcache-patch))
436 (define-public linux-libre
437 (make-linux-libre %linux-libre-version
439 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
440 #:patches %linux-libre-5.1-patches
441 #:configuration-file kernel-config))
443 (define %linux-libre-4.19-version "4.19.43")
444 (define %linux-libre-4.19-hash "15lx2igfqazn6v0nzs0y1ii6a0mmwqi9dnivs36a9r2f17l8p6p7")
446 (define %linux-libre-4.19-patches
447 (list %boot-logo-patch
448 %linux-libre-arm-export-__sync_icache_dcache-patch))
450 (define-public linux-libre-4.19
451 (make-linux-libre %linux-libre-4.19-version
452 %linux-libre-4.19-hash
453 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
454 #:patches %linux-libre-4.19-patches
455 #:configuration-file kernel-config))
457 (define %linux-libre-4.14-version "4.14.119")
458 (define %linux-libre-4.14-hash "18bi9cjmy1cw0kjwckcbiaj1iw8sx2isz3vpdgb3si9zhzfcjnz2")
460 (define-public linux-libre-4.14
461 (make-linux-libre %linux-libre-4.14-version
462 %linux-libre-4.14-hash
463 '("x86_64-linux" "i686-linux" "armhf-linux")
464 #:configuration-file kernel-config))
466 (define-public linux-libre-4.9
467 (make-linux-libre "4.9.176"
468 "0v5rhb1nd9h4ssm0jxf3vspcm954pp7vkmz2k99p0yhw45i3aj6x"
469 '("x86_64-linux" "i686-linux")
470 #:configuration-file kernel-config))
472 (define-public linux-libre-4.4
473 (make-linux-libre "4.4.180"
474 "157kfs4slii86q9yrspvqdynpiv6rff80hrrn569v6h4nkc4b7ag"
475 '("x86_64-linux" "i686-linux")
476 #:configuration-file kernel-config
479 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
480 ;; This option was removed upstream in version 4.7.
481 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
482 %default-extra-linux-options)))
484 (define-public linux-libre-arm-generic
485 (make-linux-libre %linux-libre-version
488 #:patches %linux-libre-5.1-patches
489 #:defconfig "multi_v7_defconfig"
490 #:extra-version "arm-generic"))
492 (define-public linux-libre-arm-veyron
493 (make-linux-libre %linux-libre-version
496 #:patches %linux-libre-5.1-patches
497 #:configuration-file kernel-config-veyron
498 #:extra-version "arm-veyron"))
500 (define-public linux-libre-arm-generic-4.19
501 (make-linux-libre %linux-libre-4.19-version
502 %linux-libre-4.19-hash
504 #:patches %linux-libre-4.19-patches
505 #:defconfig "multi_v7_defconfig"
506 #:extra-version "arm-generic"))
508 (define-public linux-libre-arm-generic-4.14
509 (make-linux-libre %linux-libre-4.14-version
510 %linux-libre-4.14-hash
512 #:defconfig "multi_v7_defconfig"
513 #:extra-version "arm-generic"))
515 (define-public linux-libre-arm-omap2plus
516 (make-linux-libre %linux-libre-version
519 #:patches %linux-libre-5.1-patches
520 #:defconfig "omap2plus_defconfig"
521 #:extra-version "arm-omap2plus"))
523 (define-public linux-libre-arm-omap2plus-4.19
524 (make-linux-libre %linux-libre-4.19-version
525 %linux-libre-4.19-hash
527 #:patches %linux-libre-4.19-patches
528 #:defconfig "omap2plus_defconfig"
529 #:extra-version "arm-omap2plus"))
531 (define-public linux-libre-arm-omap2plus-4.14
532 (make-linux-libre %linux-libre-4.14-version
533 %linux-libre-4.14-hash
535 #:defconfig "omap2plus_defconfig"
536 #:extra-version "arm-omap2plus"))
538 (define-public vhba-module
545 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
549 "1513hq130raxp9z5grj54cwfjfxj05apipxg425j0zicii59a60c"))))
550 (build-system linux-module-build-system)
554 (home-page "https://cdemu.sourceforge.io/")
555 (synopsis "Kernel module that emulates SCSI devices")
556 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
557 between the CDemu userspace daemon and linux kernel.")
558 (license license:gpl2+)))
562 ;;; Pluggable authentication modules (PAM).
565 (define-public linux-pam
573 "https://github.com/linux-pam/linux-pam/releases/download/v"
574 version "/Linux-PAM-" version ".tar.xz"))
577 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
578 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
580 (build-system gnu-build-system)
584 ;; TODO: optional dependencies
585 ;; ("libxcrypt" ,libxcrypt)
586 ;; ("cracklib" ,cracklib)
589 `(;; Most users, such as `shadow', expect the headers to be under
591 #:configure-flags (list (string-append "--includedir="
592 (assoc-ref %outputs "out")
595 ;; XXX: <rpc/rpc.h> is missing from glibc when
596 ;; cross-compiling, so we have to disable NIS
597 ;; support altogether.
598 ,@(if (%current-target-system)
602 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
605 (home-page "http://www.linux-pam.org/")
606 (synopsis "Pluggable authentication modules for Linux")
608 "A *Free* project to implement OSF's RFC 86.0.
609 Pluggable authentication modules are small shared object files that can
610 be used through the PAM API to perform tasks, like authenticating a user
611 at login. Local and dynamic reconfiguration are its key features.")
612 (license license:bsd-3)))
614 (define-public linux-pam-1.2
622 "http://www.linux-pam.org/library/"
623 "Linux-PAM-" version ".tar.bz2"))
626 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
627 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
634 (define-public psmisc
641 (uri (string-append "mirror://sourceforge/psmisc/psmisc devel/psmisc-"
645 "0s1kjhrik0wzqbm7hv4gkhywhjrwhp9ajw0ad05fwharikk6ah49"))))
646 (build-system gnu-build-system)
647 (inputs `(("ncurses" ,ncurses)))
648 (home-page "https://gitlab.com/psmisc/psmisc")
650 "Small utilities that use the proc file system")
652 "This PSmisc package is a set of some small useful utilities that
653 use the proc file system. We're not about changing the world, but
654 providing the system administrator with some help in common tasks.")
655 (license license:gpl2+)))
657 (define-public util-linux
663 (uri (string-append "mirror://kernel.org/linux/utils/"
664 name "/v" (version-major+minor version) "/"
665 name "-" version ".tar.xz"))
668 "1ck7d8srw5szpjq7v0gpmjahnjs6wgqzm311ki4gazww6xx71rl6"))
669 (patches (search-patches "util-linux-tests.patch"))
670 (modules '((guix build utils)))
672 ;; We take 'nologin' from Shadow, the 'logger' program from
673 ;; GNU Inetutils and 'kill' from GNU Coreutils.
675 (substitute* "configure"
676 (("build_nologin=yes") "build_nologin=no")
677 (("build_logger=yes") "build_logger=no")
678 (("build_kill=yes") "build_kill=no"))
680 (build-system gnu-build-system)
682 "static")) ; >2 MiB of static .a libraries
684 `(#:configure-flags (list "--disable-use-tty-group"
685 "--enable-fs-paths-default=/run/current-system/profile/sbin"
686 ;; Don't try to chown root:root mount and umount
687 "--disable-makeinstall-chown"
688 ;; Install completions where our
689 ;; bash-completion package expects them.
690 (string-append "--with-bashcompletiondir="
691 (assoc-ref %outputs "out")
692 "/etc/bash_completion.d"))
693 #:phases (modify-phases %standard-phases
695 'build 'set-umount-file-name
696 (lambda* (#:key outputs #:allow-other-keys)
697 ;; Tell 'eject' the right file name of 'umount'.
698 (let ((out (assoc-ref outputs "out")))
699 (substitute* "sys-utils/eject.c"
701 (string-append "\"" out "/bin/umount\"")))
705 (lambda* (#:key inputs outputs #:allow-other-keys)
706 (let ((out (assoc-ref outputs "out"))
707 (net (assoc-ref inputs "net-base")))
708 ;; Change the test to refer to the right file.
709 (substitute* "tests/ts/misc/mcookie"
711 (string-append net "/etc/services")))
714 'install 'move-static-libraries
715 (lambda* (#:key outputs #:allow-other-keys)
716 (let ((out (assoc-ref outputs "out"))
717 (static (assoc-ref outputs "static")))
718 (mkdir-p (string-append static "/lib"))
719 (with-directory-excursion out
720 (for-each (lambda (file)
722 (string-append static "/"
724 (find-files "lib" "\\.a$"))
726 ;; Remove references to the static library from the '.la'
727 ;; files so that Libtool does the right thing when both
728 ;; the shared and static library is available.
729 (substitute* (find-files "lib" "\\.la$")
730 (("old_library=.*") "old_library=''\n")))
733 (inputs `(("zlib" ,zlib)
736 ;; XXX: This is so that the 'pre-check' phase can find it.
737 ,@(if (%current-target-system)
738 `(("net-base" ,net-base))
742 ("net-base" ,net-base))) ;for tests
743 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
744 (synopsis "Collection of utilities for the Linux kernel")
745 (description "Util-linux is a diverse collection of Linux kernel
746 utilities. It provides dmesg and includes tools for working with file systems,
747 block devices, UUIDs, TTYs, and many other tools.")
749 ;; Note that util-linux doesn't use the same license for all the
750 ;; code. GPLv2+ is the default license for a code without an
751 ;; explicitly defined license.
752 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
753 license:bsd-4 license:public-domain))))
761 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
763 (file-name (string-append name "-" version ".tar.gz"))
765 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
766 (build-system cmake-build-system)
767 (arguments '(#:tests? #f))
768 (home-page "https://github.com/bo0ts/ddate")
769 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
771 "ddate displays the Discordian date and holidays of a given date.
772 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
773 by Robert Shea and Robert Anton Wilson.")
774 (license license:public-domain)))
776 (define-public procps
782 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
783 "procps-ng-" version ".tar.xz"))
786 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
787 (build-system gnu-build-system)
789 '(#:modules ((guix build utils)
790 (guix build gnu-build-system)
794 (modify-phases %standard-phases
796 'install 'post-install
797 ;; Remove commands and man pages redudant with
799 (lambda* (#:key outputs #:allow-other-keys)
800 (let* ((out (assoc-ref outputs "out"))
801 (dup (append-map (cut find-files out <>)
802 '("^kill" "^uptime"))))
803 (for-each delete-file dup)
805 (inputs `(("ncurses" ,ncurses)))
806 (home-page "https://gitlab.com/procps-ng/procps/")
807 (synopsis "Utilities that give information about processes")
809 "Procps is the package that has a bunch of small useful utilities
810 that give information about processes using the Linux /proc file system.
811 The package includes the programs ps, top, vmstat, w, kill, free,
812 slabtop, and skill.")
813 (license license:gpl2)))
815 (define-public usbutils
822 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
823 "usbutils-" version ".tar.xz"))
825 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
826 (build-system gnu-build-system)
827 (outputs (list "out" "python"))
830 (modify-phases %standard-phases
831 (add-before 'bootstrap 'patch-bootstrap-scripts
833 (substitute* "usbhid-dump/bootstrap"
834 (("/bin/bash") (which "bash")))
836 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
837 (substitute* "autogen.sh"
838 (("^\\./configure.*") ""))
840 (add-after 'install 'separate-python-output
841 ;; Separating one Python script shaves more than 106 MiB from :out.
842 (lambda* (#:key outputs #:allow-other-keys)
843 (let ((out (assoc-ref outputs "out"))
844 (out:python (assoc-ref outputs "python")))
845 (for-each (lambda (file)
846 (let ((old (string-append out "/" file))
847 (new (string-append out:python "/" file)))
848 (mkdir-p (dirname new))
849 (rename-file old new)))
850 (list "bin/lsusb.py"))
857 `(("autoconf" ,autoconf)
858 ("automake" ,automake)
860 ("pkg-config" ,pkg-config)))
861 (home-page "http://www.linux-usb.org/")
863 "Tools for working with USB devices, such as lsusb")
865 "Tools for working with USB devices, such as lsusb.")
866 (license license:gpl2+)))
868 (define-public e2fsprogs
875 "mirror://kernel.org/linux/kernel/people/tytso/"
876 name "/v" version "/"
877 name "-" version ".tar.xz"))
880 "1ff56h6h1h17sj2zvlddv5c88nmbx46p1fcbh6b0s5k9kl3b6pms"))))
881 (build-system gnu-build-system)
882 (inputs `(("util-linux" ,util-linux)))
883 (native-inputs `(("pkg-config" ,pkg-config)
884 ("texinfo" ,texinfo) ;for the libext2fs Info manual
890 '(;; util-linux is the preferred source for some of the libraries and
891 ;; commands, so disable them (see, e.g.,
892 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
893 #:configure-flags (list "--disable-libblkid"
894 "--disable-libuuid" "--disable-uuidd"
897 ;; Use symlinks instead of hard links for
898 ;; 'fsck.extN' etc. This makes the resulting nar
899 ;; smaller and is preserved across copies.
900 "--enable-symlink-install"
902 (string-append "LDFLAGS=-Wl,-rpath="
903 (assoc-ref %outputs "out")
906 ;; Install libext2fs et al.
907 "--enable-elf-shlibs")
910 (modify-phases %standard-phases
911 (add-before 'configure 'patch-shells
913 (substitute* "configure"
914 (("/bin/sh (.*)parse-types.sh" _ dir)
915 (string-append (which "sh") " " dir
917 (substitute* "MCONFIG.in"
918 (("INSTALL_SYMLINK = /bin/sh")
919 "INSTALL_SYMLINK = sh"))
920 (substitute* (find-files "." "^Makefile.in$")
922 (string-append "#!" (which "sh"))))
924 (add-after 'install 'install-libs
925 (lambda* (#:key outputs #:allow-other-keys)
926 (let* ((out (assoc-ref outputs "out"))
927 (lib (string-append out "/lib")))
928 (invoke "make" "install-libs")
930 ;; Make the .a writable so that 'strip' works.
931 ;; Failing to do that, due to debug symbols, we
932 ;; retain a reference to the final
933 ;; linux-libre-headers, which refer to the
934 ;; bootstrap binaries.
935 (let ((archives (find-files lib "\\.a$")))
936 (for-each (lambda (file)
940 (home-page "http://e2fsprogs.sourceforge.net/")
941 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
943 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
944 (license (list license:gpl2 ;programs
945 license:lgpl2.0 ;libext2fs
946 license:x11)))) ;libuuid
948 (define e2fsprogs/static
950 (package (inherit e2fsprogs)
952 ;; Do not build shared libraries.
953 (substitute-keyword-arguments (package-arguments e2fsprogs)
954 ((#:configure-flags _)
955 '(list "--disable-blkid"))
959 (define-public e2fsck/static
961 (name "e2fsck-static")
962 (version (package-version e2fsprogs))
963 (build-system trivial-build-system)
966 `(("e2fsprogs" ,e2fsprogs/static)))
968 `(#:modules ((guix build utils))
971 (use-modules (guix build utils)
975 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
977 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
979 (with-directory-excursion bin
980 (copy-file e2fsck "e2fsck")
981 (remove-store-references "e2fsck")
982 (chmod "e2fsck" #o555))
984 (home-page (package-home-page e2fsprogs))
985 (synopsis "Statically-linked e2fsck command from e2fsprogs")
986 (description "This package provides statically-linked e2fsck command taken
987 from the e2fsprogs package. It is meant to be used in initrds.")
988 (license (package-license e2fsprogs))))
990 (define-public extundelete
997 (uri (string-append "mirror://sourceforge/extundelete/"
998 "extundelete/" version "/extundelete-"
1002 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1003 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1004 (build-system gnu-build-system)
1005 (inputs `(("e2fsprogs" ,e2fsprogs)))
1006 (home-page "http://extundelete.sourceforge.net/")
1007 (synopsis "Recover deleted files from ext2/3/4 partitions")
1009 "Extundelete is a set of tools that can recover deleted files from an
1010 ext3 or ext4 partition.")
1011 (license license:gpl2)))
1013 (define-public zerofree
1017 (home-page "https://frippery.org/uml/")
1020 (uri (string-append home-page name "-" version
1024 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1025 (build-system gnu-build-system)
1028 (modify-phases %standard-phases
1029 (delete 'configure) ; no configure script
1031 ;; The Makefile lacks an ‘install’ target.
1032 (lambda* (#:key outputs #:allow-other-keys)
1033 (let* ((out (assoc-ref outputs "out"))
1034 (bin (string-append out "/bin")))
1035 (chmod "zerofree" #o555)
1036 (install-file "zerofree" bin)
1038 #:tests? #f)) ; no tests
1039 (inputs `(("libext2fs" ,e2fsprogs)))
1040 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1042 "Zerofree finds the unallocated blocks with non-zero value content in an
1043 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1044 This is a simple way to make disk images more compressible.
1045 Zerofree requires the file system to be unmounted or mounted read-only.")
1046 (license license:gpl2)))
1048 (define-public strace
1052 (home-page "https://strace.io")
1055 (uri (string-append home-page "/files/" version
1056 "/strace-" version ".tar.xz"))
1059 "1nj7wvsdmhpp53yffj1pnrkjn96mxrbcraa6h03wc7dqn9zdfyiv"))))
1060 (build-system gnu-build-system)
1063 (modify-phases %standard-phases
1064 (add-after 'unpack 'patch-/bin/sh
1066 (substitute* "strace.c"
1067 (("/bin/sh") (which "sh")))
1069 ;; Don't fail if the architecture doesn't support different personalities.
1070 #:configure-flags '("--enable-mpers=check")
1071 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1072 #:parallel-tests? #f)) ; undeterministic failures
1073 (native-inputs `(("perl" ,perl)))
1074 (synopsis "System call tracer for Linux")
1076 "strace is a system call tracer, i.e. a debugging tool which prints out a
1077 trace of all the system calls made by a another process/program.")
1078 (license license:lgpl2.1+)))
1080 (define-public ltrace
1086 (uri (string-append "http://www.ltrace.org/ltrace_" version
1090 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1091 (build-system gnu-build-system)
1092 (inputs `(("libelf" ,libelf)))
1094 ;; Compilation uses -Werror by default, but it fails.
1095 '(#:configure-flags '("--disable-werror")))
1096 (home-page "https://www.ltrace.org/")
1097 (synopsis "Library call tracer for Linux")
1099 "ltrace intercepts and records dynamic library calls which are called by
1100 an executed process and the signals received by that process. It can also
1101 intercept and print the system calls executed by the program.")
1102 (license license:gpl2+)))
1104 (define-public alsa-lib
1111 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1112 version ".tar.bz2"))
1115 "1pxf0zkmps03l3zzd0fr828xhkg6a8hxljmbxzc2cyj2ls9kmp1w"))))
1116 (build-system gnu-build-system)
1117 (home-page "https://www.alsa-project.org/")
1118 (synopsis "The Advanced Linux Sound Architecture libraries")
1120 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1121 MIDI functionality to the Linux-based operating system.")
1122 (license license:lgpl2.1+)))
1124 (define-public alsa-utils
1130 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1131 name "-" version ".tar.bz2"))
1134 "1kx45yhrxai3k595yyqs4wj0p2n5b0c9mf0k36ljjf1bj8lgb6zx"))))
1135 (build-system gnu-build-system)
1137 ;; XXX: Disable man page creation until we have DocBook.
1138 '(#:configure-flags (list "--disable-xmlto"
1140 ;; The udev rule is responsible for restoring
1142 (string-append "--with-udev-rules-dir="
1143 (assoc-ref %outputs "out")
1144 "/lib/udev/rules.d"))
1146 (modify-phases %standard-phases
1147 (add-before 'check 'disable-broken-test
1149 ;; XXX: The 1.1.8 release tarball is missing a header that's
1150 ;; required for this test to work. Fixed in 1.1.9.
1151 (substitute* "axfer/test/Makefile"
1152 ((".*container-test.*") ""))
1155 'install 'pre-install
1157 ;; Don't try to mkdir /var/lib/alsa.
1158 (substitute* "Makefile"
1159 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1163 `(("libsamplerate" ,libsamplerate)
1164 ("ncurses" ,ncurses)
1165 ("alsa-lib" ,alsa-lib)
1167 ("gettext" ,gettext-minimal)))
1168 (home-page "http://www.alsa-project.org/")
1169 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1171 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1172 MIDI functionality to the Linux-based operating system.")
1174 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1176 (license license:gpl2)))
1178 (define-public alsa-plugins
1180 (name "alsa-plugins")
1184 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1185 name "-" version ".tar.bz2"))
1188 "152r82i6f97gfilfgiax5prxkd4xlcipciv8ha8yrk452qbxyxvz"))))
1189 (build-system gnu-build-system)
1190 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1191 ;; be split, there are references to both in files.
1192 ;; TODO: Remove OSS related plugins, they add support to run native
1193 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1195 (outputs '("out" "pulseaudio" "jack"))
1197 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1198 ;; for /etc/alsa. On Guix System plugins are loaded from
1199 ;; the ALSA service, and other distributions likely
1200 ;; won't use these files.
1201 "--with-alsalconfdir=/tmp/noop")
1203 (modify-phases %standard-phases
1204 (add-after 'install 'split
1205 (lambda* (#:key inputs outputs #:allow-other-keys)
1206 ;; Distribute the binaries to the various outputs.
1207 (let* ((out (assoc-ref outputs "out"))
1208 (jack (assoc-ref outputs "jack"))
1209 (jacklib (string-append jack "/lib/alsa-lib"))
1210 (pua (assoc-ref outputs "pulseaudio"))
1211 (pualib (string-append pua "/lib/alsa-lib")))
1214 (for-each (lambda (file)
1215 (rename-file file (string-append jacklib "/" (basename file))))
1216 (find-files out ".*jack\\.(la|so)"))
1219 (for-each (lambda (file)
1220 (rename-file file (string-append pualib "/" (basename file))))
1221 (find-files out ".*pulse\\.(la|so)"))
1224 `(("alsa-lib" ,alsa-lib)
1226 ("speex" ,speex) ; libspeexdsp resampling plugin
1227 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1228 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1229 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1231 `(("pkg-config" ,pkg-config)))
1232 (home-page "http://www.alsa-project.org/")
1233 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1235 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1236 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1237 by providing additional plugins which include: upmixing, downmixing, jackd and
1238 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1239 external rate conversion.")
1240 (license (list license:gpl2+
1241 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1242 license:lgpl2.1+))))
1244 (define-public iptables
1251 "mirror://netfilter.org/iptables/iptables-"
1252 version ".tar.bz2"))
1255 "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
1256 (build-system gnu-build-system)
1258 `(("pkg-config" ,pkg-config)
1262 `(("libmnl" ,libmnl)
1263 ("libnftnl" ,libnftnl)))
1265 '(#:tests? #f ; no test suite
1266 #:configure-flags ; add $libdir to the RUNPATH of executables
1267 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1268 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1269 (synopsis "Programs to configure Linux IP packet filtering rules")
1271 "@command{iptables} is the user-space command line program used to
1272 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1273 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1275 This package also includes @command{ip6tables}, which is used to configure the
1278 Both commands are targeted at system administrators.")
1279 (license license:gpl2+)))
1281 (define-public ebtables
1284 (version "2.0.10-4")
1288 "mirror://netfilter.org/ebtables/ebtables-v"
1292 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1293 (build-system gnu-build-system)
1295 '(#:tests? #f ; no test suite
1297 (let* ((out (assoc-ref %outputs "out"))
1298 (bin (string-append out "/sbin"))
1299 (lib (string-append out "/lib"))
1300 (man (string-append out "/share/man"))
1301 (iptables (assoc-ref %build-inputs "iptables"))
1302 (ethertypes (string-append iptables "/etc/ethertypes")))
1303 (list (string-append "LIBDIR=" lib)
1304 (string-append "MANDIR=" man)
1305 (string-append "BINDIR=" bin)
1306 (string-append "ETHERTYPESFILE=" ethertypes)
1307 ;; With the default CFLAGS, it falis with:
1308 ;; communication.c:259:58: error: variable ‘ret’ set but not
1309 ;; used [-Werror=unused-but-set-variable]
1312 (modify-phases %standard-phases
1314 ;; no configure script
1316 (substitute* "Makefile"
1317 ;; Remove user and group options from install commands,
1318 ;; otherwise it fails with: invalid user 'root'.
1319 (("-o root -g root") "")
1320 ;; Remove 'ethertypes' from the install target.
1322 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1326 ("iptables" ,iptables)))
1327 (synopsis "Ethernet bridge frame table administration")
1328 (home-page "http://ebtables.netfilter.org/")
1330 "ebtables is an application program used to set up and maintain the
1331 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1332 analogous to the iptables application, but less complicated, due to the fact
1333 that the Ethernet protocol is much simpler than the IP protocol.")
1334 (license license:gpl2+)))
1336 (define-public iproute
1343 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1347 "1kvvrz5mlpjxqcm7vl6i8w6l1cb2amp6p5xyq006pgzafc49hnnw"))))
1348 (build-system gnu-build-system)
1350 `( ;; There is a test suite, but it wants network namespaces and sudo.
1352 #:make-flags (let ((out (assoc-ref %outputs "out")))
1354 (string-append "BASH_COMPDIR=" out
1355 "/etc/bash_completion.d")
1356 (string-append "LIBDIR=" out "/lib")
1357 (string-append "HDRDIR=" out "/include")
1358 (string-append "SBINDIR=" out "/sbin")
1359 (string-append "CONFDIR=" out "/etc")
1360 (string-append "DOCDIR=" out "/share/doc/"
1362 (string-append "MANDIR=" out "/share/man")))
1363 #:phases (modify-phases %standard-phases
1364 (add-before 'install 'pre-install
1366 ;; Don't attempt to create /var/lib/arpd.
1367 (substitute* "Makefile"
1368 (("^.*ARPDDIR.*$") ""))
1372 ("iptables" ,iptables)))
1376 ("pkg-config" ,pkg-config)))
1378 ;; ("libmnl" ,libmnl)
1379 ;; ("util-linux" ,util-linux)
1381 "https://wiki.linuxfoundation.org/networking/iproute2")
1383 "Utilities for controlling TCP/IP networking and traffic in Linux")
1385 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1386 and traffic with the Linux kernel. The most important of these are
1387 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1390 Most network configuration manuals still refer to ifconfig and route as the
1391 primary network configuration tools, but ifconfig is known to behave
1392 inadequately in modern network environments, and both should be deprecated.")
1393 (license license:gpl2+)))
1395 (define-public net-tools
1396 ;; XXX: This package is basically unmaintained, but it provides a few
1397 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1399 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1403 (version (string-append "1.60-" revision "." (string-take commit 7)))
1406 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1407 "n/ne/net-tools/code.git/net-tools-code-"
1409 (file-name (string-append name "-" version ".zip"))
1412 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1413 (home-page "http://net-tools.sourceforge.net/")
1414 (build-system gnu-build-system)
1416 '(#:modules ((guix build gnu-build-system)
1421 (modify-phases %standard-phases
1423 (lambda* (#:key outputs #:allow-other-keys)
1424 (let ((out (assoc-ref outputs "out")))
1425 (mkdir-p (string-append out "/bin"))
1426 (mkdir-p (string-append out "/sbin"))
1428 ;; Pretend we have everything...
1429 (system "yes | make config")
1431 ;; ... except for the things we don't have.
1432 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1433 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1434 ;; that have been removed.
1435 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1436 ;; think about adding them later.
1437 (substitute* '("config.make" "config.h")
1438 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1441 (add-after 'install 'remove-redundant-commands
1442 (lambda* (#:key outputs #:allow-other-keys)
1443 ;; Remove commands and man pages redundant with Inetutils.
1444 (let* ((out (assoc-ref outputs "out"))
1445 (dup (append-map (cut find-files out <>)
1447 "^(yp|nis|dns)?domainname"))))
1448 (for-each delete-file dup)
1450 ;; Binaries that depend on libnet-tools.a don't declare that
1451 ;; dependency, making it parallel-unsafe.
1452 #:parallel-build? #f
1454 #:tests? #f ; no test suite
1455 #:make-flags (let ((out (assoc-ref %outputs "out")))
1457 (string-append "BASEDIR=" out)
1458 (string-append "INSTALLNLSDIR=" out "/share/locale")
1459 (string-append "mandir=/share/man")))))
1460 (native-inputs `(("gettext" ,gettext-minimal)
1462 (synopsis "Tools for controlling the network subsystem in Linux")
1464 "This package includes the important tools for controlling the network
1465 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1466 route. Additionally, this package contains utilities relating to particular
1467 network hardware types (plipconfig, slattach) and advanced aspects of IP
1468 configuration (iptunnel, ipmaddr).")
1469 (license license:gpl2+))))
1471 (define-public libcap
1478 "mirror://kernel.org/linux/libs/security/linux-privs/"
1479 "libcap2/libcap-" version ".tar.xz"))
1482 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1483 (build-system gnu-build-system)
1484 (arguments '(#:phases
1485 (modify-phases %standard-phases
1487 ;; Add $libdir to the RUNPATH of executables.
1489 (substitute* "Make.Rules"
1491 (string-append "LDFLAGS := -Wl,-rpath="
1494 #:tests? #f ; no 'check' target
1495 #:make-flags (list "lib=lib"
1496 (string-append "prefix="
1497 (assoc-ref %outputs "out"))
1498 "RAISE_SETFCAP=no")))
1499 (native-inputs `(("perl" ,perl)))
1500 (inputs `(("attr" ,attr)))
1501 (home-page "https://sites.google.com/site/fullycapable/")
1502 (synopsis "Library for working with POSIX capabilities")
1504 "Libcap2 provides a programming interface to POSIX capabilities on
1505 Linux-based operating systems.")
1507 ;; License is BSD-3 or GPLv2, at the user's choice.
1508 (license license:gpl2)))
1510 (define-public bridge-utils
1512 (name "bridge-utils")
1517 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
1518 "bridge-utils-" version ".tar.xz"))
1520 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
1521 (build-system gnu-build-system)
1523 ;; The tarball lacks all the generated files.
1524 (native-inputs `(("autoconf" ,autoconf)
1525 ("automake" ,automake)))
1528 (modify-phases %standard-phases
1529 (add-before 'bootstrap 'patch-stuff
1531 ;; Fix "field ‘ip6’ has incomplete type" errors.
1532 (substitute* "libbridge/libbridge.h"
1533 (("#include <linux/if_bridge.h>")
1534 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1536 ;; Ensure that the entire build fails if one of the
1537 ;; sub-Makefiles fails.
1538 (substitute* "Makefile.in"
1539 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1540 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1543 #:tests? #f)) ; no 'check' target
1546 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1547 (synopsis "Manipulate Ethernet bridges")
1549 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1550 to connect two Ethernet segments together in a protocol independent way.
1551 Packets are forwarded based on Ethernet address, rather than IP address (like
1552 a router). Since forwarding is done at Layer 2, all protocols can go
1553 transparently through a bridge.")
1554 (license license:gpl2+)))
1556 (define-public libnl
1563 "https://github.com/thom311/libnl/releases/download/"
1564 "libnl" (string-join (string-split version #\.) "_")
1565 "/libnl-" version ".tar.gz"))
1568 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
1569 (build-system gnu-build-system)
1573 ("pkg-config" ,pkg-config)
1579 "https://github.com/thom311/libnl/releases/download/libnl"
1580 (string-join (string-split version #\.) "_")
1581 "/libnl-doc-" version ".tar.gz"))
1583 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
1585 `(("python-2" ,python-2)
1586 ("python-3" ,python-3)))
1587 (outputs '("out" "doc" "python2" "python3"))
1589 `(#:modules ((guix build gnu-build-system)
1593 (modify-phases %standard-phases
1594 (add-after 'install 'install-python
1595 (lambda* (#:key outputs #:allow-other-keys)
1596 (define (python-inst python)
1597 (invoke python "setup.py" "build")
1598 (invoke python "setup.py" "install"
1599 (string-append "--prefix="
1600 (assoc-ref %outputs python)))
1601 (invoke python "setup.py" "clean"))
1602 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
1603 (assoc-ref %outputs "out")))
1604 (with-directory-excursion "./python"
1605 (for-each python-inst '("python2" "python3")))
1607 (add-after 'install 'install-doc
1608 (lambda* (#:key inputs outputs #:allow-other-keys)
1609 (let ((dest (string-append (assoc-ref outputs "doc")
1610 "/share/doc/libnl")))
1612 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
1613 "--strip-components=1" "-C" dest)))))))
1614 (home-page "https://www.infradead.org/~tgr/libnl/")
1615 (synopsis "NetLink protocol library suite")
1617 "The libnl suite is a collection of libraries providing APIs to netlink
1618 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1619 between the kernel and user space processes. It was designed to be a more
1620 flexible successor to ioctl to provide mainly networking related kernel
1621 configuration and monitoring interfaces.")
1623 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1624 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1625 (license license:gpl2)))
1634 "mirror://kernel.org/software/network/iw/iw-"
1638 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
1639 (build-system gnu-build-system)
1640 (native-inputs `(("pkg-config" ,pkg-config)))
1641 (inputs `(("libnl" ,libnl)))
1643 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1645 #:phases (modify-phases %standard-phases (delete 'configure))))
1646 (home-page "https://wireless.wiki.kernel.org/")
1647 (synopsis "Tool for configuring wireless devices")
1649 "iw is a new nl80211 based CLI configuration utility for wireless
1650 devices. It replaces @code{iwconfig}, which is deprecated.")
1651 (license license:isc)))
1653 (define-public powertop
1660 (uri (string-append "https://01.org/sites/default/files/downloads/"
1661 "powertop-v" version ".tar.gz"))
1663 (base32 "0xaazqccyd42v2q532dxx40nqhb9sfsa6cyx8641rl57mfg4bdyk"))))
1664 (build-system gnu-build-system)
1667 (modify-phases %standard-phases
1668 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1669 ;; allow calibrating the network interface in Guix System.
1670 (add-after 'unpack 'patch-absolute-file-names
1671 (lambda* (#:key inputs #:allow-other-keys)
1672 (let ((kmod (assoc-ref inputs "kmod")))
1673 (substitute* (find-files "src" "\\.cpp$")
1674 ;; Give the right 'modprobe' file name so that essential
1675 ;; modules such as msr.ko can be loaded.
1676 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1677 ;; These programs are only needed to calibrate, so using
1678 ;; relative file names avoids adding extra inputs. When they
1679 ;; are missing powertop gracefully handles it.
1680 (("/usr/bin/hcitool") "hcitool")
1681 (("/usr/bin/xset") "xset")
1682 (("/usr/sbin/hciconfig") "hciconfig"))
1687 ("ncurses" ,ncurses)
1688 ("pciutils" ,pciutils)
1691 `(("pkg-config" ,pkg-config)))
1692 (home-page "https://01.org/powertop/")
1693 (synopsis "Analyze power consumption on Intel-based laptops")
1695 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1696 power management. In addition to being a diagnostic tool, PowerTOP also has
1697 an interactive mode where the user can experiment various power management
1698 settings for cases where the operating system has not enabled these
1700 (license license:gpl2)))
1702 (define-public aumix
1709 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1710 version ".tar.bz2"))
1713 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1714 (build-system gnu-build-system)
1715 (inputs `(("ncurses" ,ncurses)))
1716 (home-page "http://www.jpj.net/~trevor/aumix.html")
1717 (synopsis "Audio mixer for X and the console")
1719 "Aumix adjusts an audio mixer from X, the console, a terminal,
1720 the command line or a script.")
1721 (license license:gpl2+)))
1723 (define-public iotop
1730 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1733 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1734 (build-system python-build-system)
1736 ;; The setup.py script expects python-2.
1737 `(#:python ,python-2
1738 ;; There are currently no checks in the package.
1740 (native-inputs `(("python" ,python-2)))
1741 (home-page "http://guichaz.free.fr/iotop/")
1743 "Displays the IO activity of running processes")
1745 "Iotop is a Python program with a top like user interface to show the
1746 processes currently causing I/O.")
1747 (license license:gpl2+)))
1755 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1756 "download/fuse-" version
1757 "/fuse-" version ".tar.gz"))
1760 "1qxg1r1mgysfq6qakmvid2njph3lr00w0swvydsfl9ymilfzi12y"))
1761 (patches (search-patches "fuse-overlapping-headers.patch"))))
1762 (build-system gnu-build-system)
1763 (inputs `(("util-linux" ,util-linux)))
1765 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1766 (assoc-ref %outputs "out")
1768 (string-append "INIT_D_PATH="
1769 (assoc-ref %outputs "out")
1772 ;; The rule makes /dev/fuse 666.
1773 (string-append "UDEV_RULES_PATH="
1774 (assoc-ref %outputs "out")
1775 "/lib/udev/rules.d"))
1777 (modify-phases %standard-phases
1778 (add-before 'build 'set-file-names
1779 (lambda* (#:key inputs #:allow-other-keys)
1780 ;; libfuse calls out to mount(8) and umount(8). Make sure
1781 ;; it refers to the right ones.
1782 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1783 (("/bin/(u?)mount" _ maybe-u)
1784 (string-append (assoc-ref inputs "util-linux")
1785 "/bin/" maybe-u "mount")))
1786 (substitute* '("util/mount.fuse.c")
1790 ;; This hack leads libfuse to search for 'fusermount' in
1791 ;; $PATH, where it may find a setuid-root binary, instead of
1792 ;; trying solely $out/sbin/fusermount and failing because
1794 (substitute* "lib/Makefile"
1795 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1796 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
1798 (home-page "https://github.com/libfuse/libfuse")
1799 (synopsis "Support file systems implemented in user space")
1801 "As a consequence of its monolithic design, file system code for Linux
1802 normally goes into the kernel itself---which is not only a robustness issue,
1803 but also an impediment to system extensibility. FUSE, for \"file systems in
1804 user space\", is a kernel module and user-space library that tries to address
1805 part of this problem by allowing users to run file system implementations as
1806 user-space processes.")
1807 (license (list license:lgpl2.1 ;library
1808 license:gpl2+)))) ;command-line utilities
1810 (define-public unionfs-fuse
1812 (name "unionfs-fuse")
1817 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1819 (file-name (string-append name "-" version ".tar.gz"))
1822 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1823 (build-system cmake-build-system)
1825 `(("python" ,python)))
1826 (inputs `(("fuse" ,fuse)))
1828 ;; The tests were never actually run ("collected 0 items"), but in recent
1829 ;; versions of pytest that causes an error.
1831 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1832 (synopsis "User-space union file system")
1834 "UnionFS-FUSE is a flexible union file system implementation in user
1835 space, using the FUSE library. Mounting a union file system allows you to
1836 \"aggregate\" the contents of several directories into a single mount point.
1837 UnionFS-FUSE additionally supports copy-on-write.")
1838 (license license:bsd-3)))
1841 (package (inherit fuse)
1842 (name "fuse-static")
1843 (source (origin (inherit (package-source fuse))
1844 (modules '((guix build utils)))
1847 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1848 ;; updated. Change calls to 'mtab_needs_update' to 0 so
1849 ;; that it doesn't do that, allowing us to remove the
1850 ;; dependency on util-linux (something that is useful in
1852 (substitute* '("lib/mount_util.c"
1853 "util/mount_util.c")
1854 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1860 (define-public unionfs-fuse/static
1861 (package (inherit unionfs-fuse)
1862 (synopsis "User-space union file system (statically linked)")
1863 (name (string-append (package-name unionfs-fuse) "-static"))
1864 (source (origin (inherit (package-source unionfs-fuse))
1865 (modules '((guix build utils)))
1868 ;; Add -ldl to the libraries, because libfuse.a needs that.
1869 (substitute* "src/CMakeLists.txt"
1870 (("target_link_libraries(.*)\\)" _ libs)
1871 (string-append "target_link_libraries"
1876 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1878 (modify-phases %standard-phases
1879 (add-after 'install 'post-install
1880 (lambda* (#:key outputs #:allow-other-keys)
1881 (let* ((out (assoc-ref outputs "out"))
1882 (exe (string-append out "/bin/unionfs")))
1883 ;; By default, 'unionfs' keeps references to
1884 ;; $glibc/share/locale and similar stuff. Remove them.
1885 (remove-store-references exe)
1887 ;; 'unionfsctl' has references to glibc as well. Since
1888 ;; we don't need it, remove it.
1889 (delete-file (string-append out "/bin/unionfsctl"))
1891 (inputs `(("fuse" ,fuse-static)))))
1893 (define-public sshfs
1899 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1900 "download/sshfs-" version "/sshfs-" version
1904 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
1905 (build-system gnu-build-system)
1910 `(("pkg-config" ,pkg-config)))
1911 (home-page "https://github.com/libfuse/sshfs")
1912 (synopsis "Mount remote file systems over SSH")
1914 "This is a file system client based on the SSH File Transfer Protocol.
1915 Since most SSH servers already support this protocol it is very easy to set
1916 up: on the server side there's nothing to do; on the client side mounting the
1917 file system is as easy as logging into the server with an SSH client.")
1918 (license license:gpl2+)))
1920 (define-public sshfs-fuse
1921 (package (inherit sshfs)
1923 (properties `((superseded . ,sshfs)))))
1925 (define-public archivemount
1927 (name "archivemount")
1932 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
1933 "archivemount-" version ".tar.gz"))
1935 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
1936 (build-system gnu-build-system)
1937 (inputs `(("fuse" ,fuse)
1938 ("libarchive" ,libarchive)))
1939 (native-inputs `(("pkg-config" ,pkg-config)))
1940 (home-page "https://www.cybernoia.de/software/archivemount.html")
1941 (synopsis "Tool for mounting archive files with FUSE")
1942 (description "archivemount is a FUSE-based file system for Unix variants,
1943 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1944 mount point where it can be read from or written to as with any other file
1945 system. This makes accessing the contents of the archive, which may be
1946 compressed, transparent to other programs, without decompressing them.")
1947 (license license:lgpl2.0+)))
1949 (define-public numactl
1956 "https://github.com/numactl/numactl/releases/download/v"
1957 version "/" name "-" version ".tar.gz"))
1960 "0ad7mpi3vacbfnx3aqxnvgsj64yp3mav9yxnaz8ancjv7wvdmfsm"))))
1961 (build-system gnu-build-system)
1963 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1964 ;; to run, which we can't assume to have.
1967 ;; NUMA is apparently not supported on armhf, see
1968 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1969 (supported-systems (delete "armhf-linux" %supported-systems))
1970 (home-page "https://github.com/numactl/numactl")
1971 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1973 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1974 memory is not all in one place. The numactl program allows you to run your
1975 application program on specific CPU's and memory nodes. It does this by
1976 supplying a NUMA memory policy to the operating system before running your
1979 The package contains other commands, such as numademo, numastat and memhog.
1980 The numademo command provides a quick overview of NUMA performance on your
1982 (license (list license:gpl2 ;programs
1983 license:lgpl2.1)))) ;library
1985 (define-public kbd-neo
1992 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1993 version "/linux/console/neo.map"))
1994 (file-name (string-append name "-" version ".map"))
1997 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1998 (build-system trivial-build-system)
2000 `(#:modules ((guix build utils))
2002 (use-modules (guix build utils))
2003 (let ((out (string-append %output "/share/keymaps"))
2004 (source (assoc-ref %build-inputs "source")))
2006 (copy-file source (string-append out "/neo.map"))
2008 (home-page "https://neo-layout.org")
2009 (synopsis "Neo2 console layout")
2011 "Kbd-neo provides the Neo2 keyboard layout for use with
2012 @command{loadkeys(1)} from @code{kbd(4)}.")
2013 ;; The file is located in an svn directory, the entire content of
2014 ;; the directory is licensed as GPL3.
2015 (license license:gpl3+)))
2023 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2027 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2028 (modules '((guix build utils)))
2031 (substitute* "tests/Makefile.in"
2032 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2035 (substitute* '("src/unicode_start" "src/unicode_stop")
2036 ;; Assume the Coreutils are in $PATH.
2040 (build-system gnu-build-system)
2043 (modify-phases %standard-phases
2044 (add-before 'build 'pre-build
2045 (lambda* (#:key inputs #:allow-other-keys)
2046 (let ((gzip (assoc-ref %build-inputs "gzip"))
2047 (bzip2 (assoc-ref %build-inputs "bzip2")))
2048 (substitute* "src/libkeymap/findfile.c"
2050 (string-append gzip "/bin/gzip"))
2052 (string-append bzip2 "/bin/bzip2")))
2054 (add-after 'install 'post-install
2055 (lambda* (#:key outputs #:allow-other-keys)
2056 ;; Make sure these programs find their comrades.
2057 (let* ((out (assoc-ref outputs "out"))
2058 (bin (string-append out "/bin")))
2059 (for-each (lambda (prog)
2060 (wrap-program (string-append bin "/" prog)
2061 `("PATH" ":" prefix (,bin))))
2062 '("unicode_start" "unicode_stop"))
2064 (inputs `(("check" ,check)
2067 ("pam" ,linux-pam)))
2068 (native-search-paths
2069 (list (search-path-specification
2070 (variable "LOADKEYS_KEYMAP_PATH")
2071 ;; Append ‘/**’ to recursively search all directories. One can then
2072 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2073 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2074 (files (list "share/keymaps/**")))))
2075 (native-inputs `(("pkg-config" ,pkg-config)))
2076 (home-page "http://kbd-project.org/")
2077 (synopsis "Linux keyboard utilities and keyboard maps")
2079 "This package contains keytable files and keyboard utilities compatible
2080 for systems using the Linux kernel. This includes commands such as
2081 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2082 (license license:gpl2+)))
2084 (define-public loadkeys-static
2087 (name "loadkeys-static")
2089 (substitute-keyword-arguments (package-arguments kbd)
2090 ((#:configure-flags flags ''())
2091 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2092 "--disable-vlock" ;so we don't need libpam
2093 "--disable-libkeymap")
2095 ((#:make-flags flags ''())
2096 `(cons "LDFLAGS=-all-static" ,flags))
2097 ((#:phases phases '%standard-phases)
2098 `(modify-phases ,phases
2100 (lambda* (#:key outputs #:allow-other-keys)
2101 (let ((out (assoc-ref outputs "out")))
2102 ;; The binary keeps references to gzip, among other things,
2103 ;; which we don't need in the initrd, so strip references.
2104 (remove-store-references "src/loadkeys")
2106 (install-file "src/loadkeys"
2107 (string-append out "/bin"))
2109 (delete 'post-install)))
2110 ((#:strip-flags _ '())
2112 ((#:allowed-references _ '())
2115 (synopsis "Statically-linked @command{loadkeys} program")
2117 ;; This package is meant to be used internally in the initrd so don't
2119 (properties '((hidden? . #t)))))
2121 (define-public inotify-tools
2123 (name "inotify-tools")
2128 (url "https://github.com/rvoicilas/inotify-tools.git")
2130 (file-name (git-file-name name version))
2133 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2134 (build-system gnu-build-system)
2136 `(("autoconf" ,autoconf)
2137 ("automake" ,automake)
2138 ("libtool" ,libtool)))
2139 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2140 (synopsis "Monitor file accesses")
2142 "The inotify-tools packages provides a C library and command-line tools
2143 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2144 (license license:gpl2+)))
2153 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2154 "kmod-" version ".tar.xz"))
2157 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2158 (patches (search-patches "kmod-module-directory.patch"))))
2159 (build-system gnu-build-system)
2161 `(("pkg-config" ,pkg-config)))
2166 `(#:tests? #f ; FIXME: Investigate test failures
2167 #:configure-flags '("--with-xz" "--with-zlib")
2169 (modify-phases %standard-phases
2170 (add-after 'install 'install-modprobe&co
2171 (lambda* (#:key outputs #:allow-other-keys)
2172 (let* ((out (assoc-ref outputs "out"))
2173 (bin (string-append out "/bin")))
2174 (for-each (lambda (tool)
2176 (string-append bin "/" tool)))
2177 '("insmod" "rmmod" "lsmod" "modprobe"
2178 "modinfo" "depmod"))
2180 (home-page "https://www.kernel.org/")
2181 (synopsis "Kernel module tools")
2182 (description "Kmod is a set of tools to handle common tasks with Linux
2183 kernel modules like insert, remove, list, check properties, resolve
2184 dependencies and aliases.
2186 These tools are designed on top of libkmod, a library that is shipped with
2187 kmod. The aim is to be compatible with tools, configurations and indices
2188 from the module-init-tools project.")
2189 (license license:gpl2+))) ; library under lgpl2.1+
2191 (define-public eudev
2192 ;; The post-systemd fork, maintained by Gentoo.
2198 (uri (git-reference (url "https://github.com/gentoo/eudev")
2199 (commit (string-append "v" version))))
2200 (file-name (git-file-name name version))
2203 "1la7x7v7yqb84wnc7w0kj53sa0an0m9xp6wn01ypi8drh02wjjy2"))
2204 (patches (search-patches "eudev-rules-directory.patch"))))
2205 (build-system gnu-build-system)
2208 (modify-phases %standard-phases
2209 (add-after 'unpack 'make-source-writable
2211 ;; XXX: Git checkouts are read-only, but this package needs to
2212 ;; modify some of its files.
2213 (for-each make-file-writable (find-files "."))
2215 (add-before 'bootstrap 'patch-file-names
2216 (lambda* (#:key inputs #:allow-other-keys)
2217 (substitute* "man/make.sh"
2218 (("/usr/bin/xsltproc")
2219 (string-append (assoc-ref inputs "xsltproc")
2222 (add-after 'install 'build-hwdb
2223 (lambda* (#:key outputs #:allow-other-keys)
2224 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2225 ;; similar tools to display product names.
2226 (let ((out (assoc-ref outputs "out")))
2227 (invoke (string-append out "/bin/udevadm")
2228 "hwdb" "--update")))))
2229 #:configure-flags (list "--enable-manpages")))
2231 `(("autoconf" ,autoconf)
2232 ("automake" ,automake)
2234 ("libtool" ,libtool)
2235 ("pkg-config" ,pkg-config)
2238 ("python" ,python-wrapper)
2239 ;; For documentation.
2240 ("docbook-xml" ,docbook-xml-4.2)
2241 ("docbook-xsl" ,docbook-xsl)
2242 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2243 ("xsltproc" ,libxslt)))
2245 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2246 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2247 ;; which contains the rules to do that.
2248 `(("util-linux" ,util-linux) ;for blkid
2250 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2251 (synopsis "Userspace device management")
2252 (description "Udev is a daemon which dynamically creates and removes
2253 device nodes from /dev/, handles hotplug events and loads drivers at boot
2255 (license license:gpl2+)))
2257 (define-public eudev-with-hwdb
2258 (deprecated-package "eudev-with-hwdb" eudev))
2263 (version "2.02.177")
2266 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2270 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2271 (modules '((guix build utils)))
2274 (use-modules (guix build utils))
2276 ;; Honor sysconfdir.
2277 (substitute* "make.tmpl.in"
2279 "confdir = @sysconfdir@\n")
2280 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2281 "DEFAULT_SYS_DIR = @sysconfdir@"))
2283 (patches (search-patches "lvm2-static-link.patch"))))
2284 (build-system gnu-build-system)
2286 `(("pkg-config" ,pkg-config)
2287 ("procps" ,procps))) ;tests use 'pgrep'
2292 (modify-phases %standard-phases
2293 (add-after 'configure 'set-makefile-shell
2295 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2297 (setenv "SHELL" (which "sh"))
2299 ;; Replace /bin/sh with the right file name.
2300 (patch-makefile-SHELL "make.tmpl")
2303 #:configure-flags (list (string-append "--sysconfdir="
2304 (assoc-ref %outputs "out")
2306 "--enable-udev_sync"
2307 "--enable-udev_rules"
2308 "--enable-pkgconfig"
2310 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2312 ;; Make sure programs such as 'dmsetup' can
2313 ;; find libdevmapper.so.
2314 (string-append "LDFLAGS=-Wl,-rpath="
2315 (assoc-ref %outputs "out")
2317 (assoc-ref %outputs "out")
2318 "/lib/device-mapper")
2319 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2320 ;; into account so that we don't need to also
2322 (string-append "CLDFLAGS=-Wl,-rpath="
2323 (assoc-ref %outputs "out")
2325 (assoc-ref %outputs "out")
2326 "/lib/device-mapper"))
2328 ;; The tests use 'mknod', which requires root access.
2330 (home-page "https://sourceware.org/lvm2/")
2331 (synopsis "Logical volume management for Linux")
2333 "LVM2 is the logical volume management tool set for Linux-based systems.
2334 This package includes the user-space libraries and tools, including the device
2335 mapper. Kernel components are part of Linux-libre.")
2337 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2338 ;; Command-line tools are GPLv2.
2339 (license (list license:gpl2 license:lgpl2.1))))
2341 (define-public lvm2-static
2344 (name "lvm2-static")
2346 ;; Propagate udev because libdevmapper.a depends on libudev.
2347 (inputs (alist-delete "udev" (package-inputs lvm2)))
2348 (propagated-inputs `(("udev" ,eudev)))
2351 (substitute-keyword-arguments (package-arguments lvm2)
2352 ((#:configure-flags flags '())
2353 ;; LVM2 doesn't use Libtool, hence the custom option.
2354 `(cons "--enable-static_link" ,flags))))
2355 (synopsis "Logical volume management for Linux (statically linked)")))
2357 (define-public wireless-tools
2359 (name "wireless-tools")
2363 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2367 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2370 ;; Remove the older header files that are not free software.
2371 (for-each (lambda (n)
2372 (delete-file (format #f "wireless.~a.h" n)))
2373 '(10 11 12 13 14 15 16 17 18 19 20))
2375 (build-system gnu-build-system)
2378 (list (string-append "PREFIX=" %output)
2379 (string-append "INSTALL_MAN=" %output "/share/man")
2380 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2382 #:phases (modify-phases %standard-phases
2383 (delete 'configure))
2385 (synopsis "Tools for manipulating Linux Wireless Extensions")
2386 (description "Wireless Tools are used to manipulate the now-deprecated
2387 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
2388 Extension was an interface allowing you to set Wireless LAN specific
2389 parameters and get the specific stats. It is deprecated in favor the nl80211
2391 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2392 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2393 ;; other files are distributed under gpl2.
2394 (license (list license:gpl2 license:lgpl2.1+))))
2402 (uri (string-append "mirror://kernel.org/software/network/crda/"
2403 "crda-" version ".tar.xz"))
2406 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2407 (patches (search-patches "crda-optional-gcrypt.patch"))))
2408 (build-system gnu-build-system)
2410 '(#:phases (modify-phases %standard-phases
2412 (add-after 'unpack 'gzip-determinism
2414 (substitute* "Makefile"
2415 (("gzip") "gzip --no-name"))
2418 'build 'no-werror-no-ldconfig
2420 (substitute* "Makefile"
2422 (("ldconfig") "true"))
2425 'build 'set-regulator-db-file-name
2426 (lambda* (#:key inputs #:allow-other-keys)
2427 ;; Tell CRDA where to find our database.
2428 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2429 (substitute* "crda.c"
2430 (("\"/lib/crda/regulatory.bin\"")
2431 (string-append "\"" regdb
2432 "/lib/crda/regulatory.bin\"")))
2434 #:test-target "verify"
2435 #:make-flags (let ((out (assoc-ref %outputs "out"))
2436 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2437 (list "CC=gcc" "V=1"
2439 ;; Disable signature-checking on 'regulatory.bin'.
2440 ;; The reason is that this simplifies maintenance
2441 ;; on our side (no need to manage a distro key
2442 ;; pair), and we can guarantee integrity of
2443 ;; 'regulatory.bin' by other means anyway, such as
2444 ;; 'guix gc --verify'. See
2445 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2449 (string-append "PREFIX=" out)
2450 (string-append "SBINDIR=" out "/sbin/")
2451 (string-append "UDEV_RULE_DIR="
2452 out "/lib/udev/rules.d")
2453 (string-append "LDFLAGS=-Wl,-rpath="
2455 (string-append "REG_BIN=" regdb
2456 "/lib/crda/regulatory.bin")))))
2457 (native-inputs `(("pkg-config" ,pkg-config)
2458 ("python" ,python-2)
2459 ("wireless-regdb" ,wireless-regdb)))
2460 (inputs `(("libnl" ,libnl)))
2462 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2463 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2465 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2466 communication between the kernel Linux and user space for regulatory
2468 (license license:copyleft-next)))
2470 (define-public wireless-regdb
2472 (name "wireless-regdb")
2473 (version "2017.03.07")
2477 "mirror://kernel.org/software/network/wireless-regdb/"
2478 "wireless-regdb-" version ".tar.xz"))
2481 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2483 ;; We're building 'regulatory.bin' by ourselves.
2485 (delete-file "regulatory.bin")
2487 (build-system gnu-build-system)
2489 '(#:phases (modify-phases %standard-phases
2490 (add-after 'unpack 'gzip-determinism
2492 (substitute* "Makefile"
2493 (("gzip") "gzip --no-name"))
2495 (delete 'configure))
2497 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2498 ;; is computed and can be equal to 'maintainer-clean'; when that
2499 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2500 ;; just built. Thus, build things sequentially.
2501 #:parallel-build? #f
2503 #:tests? #f ;no tests
2504 #:make-flags (let ((out (assoc-ref %outputs "out")))
2505 (list (string-append "PREFIX=" out)
2506 (string-append "LSB_ID=Guix")
2507 (string-append "DISTRO_PUBKEY=/dev/null")
2508 (string-append "DISTRO_PRIVKEY=/dev/null")
2509 (string-append "REGDB_PUBKEY=/dev/null")
2511 ;; Leave that empty so that db2bin.py doesn't try
2512 ;; to sign 'regulatory.bin'. This allows us to
2513 ;; avoid managing a key pair for the whole distro.
2514 (string-append "REGDB_PRIVKEY=")))))
2515 (native-inputs `(("python" ,python-2)))
2517 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2518 (synopsis "Wireless regulatory database")
2520 "This package contains the wireless regulatory database Central
2521 Regulatory Database Agent (CRDA) daemon. The database contains information on
2522 country-specific regulations for the wireless spectrum.")
2523 (license license:isc)))
2525 (define-public lm-sensors
2533 (url "https://github.com/groeck/lm-sensors.git")
2534 (commit (string-append "V" (string-join
2535 (string-split version #\.) "-")))))
2536 (file-name (git-file-name name version))
2538 (base32 "1mdrnb9r01z1xfdm6dpkywvf9yy9a4yzb59paih9sijwmigv19fj"))
2539 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2540 (build-system gnu-build-system)
2541 (inputs `(("rrdtool" ,rrdtool)
2544 ("gnuplot" ,gnuplot)))
2545 (native-inputs `(("pkg-config" ,pkg-config)
2549 (outputs '("lib" ;avoid perl in closure
2552 `(#:tests? #f ; no 'check' target
2553 #:make-flags (list (string-append "PREFIX=" %output)
2554 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2555 (string-append "INCLUDEDIR="
2556 (assoc-ref %outputs "lib") "/include")
2557 (string-append "MANDIR=" %output "/share/man")
2558 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2560 (modify-phases %standard-phases
2562 (add-before 'build 'patch-exec-paths
2563 (lambda* (#:key inputs outputs #:allow-other-keys)
2564 (substitute* "prog/detect/sensors-detect"
2566 (string-append "`" (assoc-ref inputs "coreutils")
2568 (("(`|\")modprobe" all open-quote)
2569 (string-append open-quote
2570 (assoc-ref inputs "kmod")
2572 (substitute* '("prog/pwm/pwmconfig"
2573 "prog/pwm/fancontrol")
2575 (string-append (assoc-ref inputs "gnuplot")
2578 (string-append (assoc-ref inputs "coreutils")
2581 (string-append (assoc-ref inputs "grep")
2584 (string-append (assoc-ref inputs "sed")
2587 (string-append (assoc-ref inputs "coreutils")
2590 (string-append (assoc-ref inputs "coreutils")
2593 (string-append (assoc-ref inputs "coreutils")
2594 "/bin/readlink -f")))
2596 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
2597 (synopsis "Utilities to read temperature/voltage/fan sensors")
2599 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2600 you to access information from temperature, voltage, and fan speed sensors.
2601 It works with most newer systems.")
2602 (license license:gpl2+)))
2604 (define-public iucode-tool
2606 (name "iucode-tool")
2610 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2611 "/raw/latest/iucode-tool_" version ".tar.xz"))
2614 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
2615 (build-system gnu-build-system)
2616 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2617 (synopsis "Manipulate Intel microcode bundles")
2619 "@command{iucode_tool} is a utility to work with microcode packages for
2620 Intel processors. It can convert between formats, extract specific versions,
2621 create a firmware image suitable for the Linux kernel, and more.")
2622 ;; cpuid.h is available for i686, x86_64, and ia64.
2623 (supported-systems '("i686-linux" "x86_64-linux"))
2624 (license license:gpl2+)))
2626 (define-public i2c-tools
2633 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2634 version ".tar.bz2"))
2637 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2638 (build-system gnu-build-system)
2640 `(#:tests? #f ; no 'check' target
2641 #:make-flags (list (string-append "prefix=" %output)
2643 ;; no configure script
2644 #:phases (modify-phases %standard-phases (delete 'configure))))
2647 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2648 (synopsis "I2C tools for Linux")
2650 "The i2c-tools package contains a heterogeneous set of I2C tools for
2651 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2652 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2654 (license license:gpl2+)))
2656 (define-public xsensors
2663 "http://www.linuxhardware.org/xsensors/xsensors-"
2667 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2668 (build-system gnu-build-system)
2669 (inputs `(("lm-sensors" ,lm-sensors "lib")
2671 (native-inputs `(("pkg-config" ,pkg-config)))
2674 (modify-phases %standard-phases
2675 (add-before 'configure 'enable-deprecated
2677 (substitute* "src/Makefile.in"
2678 (("-DGDK_DISABLE_DEPRECATED") "")
2679 (("-DGTK_DISABLE_DEPRECATED") ""))
2681 (add-before 'configure 'remove-Werror
2683 (substitute* '("configure" "src/Makefile.in")
2686 (home-page "http://www.linuxhardware.org/xsensors/")
2687 (synopsis "Hardware health information viewer")
2689 "Xsensors reads data from the libsensors library regarding hardware
2690 health such as temperature, voltage and fan speed and displays the information
2691 in a digital read-out.")
2692 (license license:gpl2+)))
2697 (version (package-version linux-libre))
2698 (source (package-source linux-libre))
2699 (build-system gnu-build-system)
2702 (modify-phases %standard-phases
2704 (lambda* (#:key inputs #:allow-other-keys)
2705 (setenv "SHELL_PATH" (which "bash"))
2706 (chdir "tools/perf")
2708 #:make-flags (list (string-append "prefix="
2709 (assoc-ref %outputs "out"))
2712 ;; By default, 'config/Makefile' uses lib64 on
2713 ;; x86_64. Work around that.
2715 #:tests? #f)) ;no tests
2717 `(("pkg-config" ,pkg-config)
2721 ;; There are build scripts written in these languages.
2723 ("python" ,python-2)))
2725 `(("slang" ,slang) ;for the interactive TUI
2727 ("python" ,python-2) ;'perf' links against libpython
2728 ("elfutils" ,elfutils)
2729 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2730 ("libunwind" ,libunwind) ;better stack walking
2731 ("numactl" ,numactl) ;for 'perf bench numa mem'
2734 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2735 ("docbook-xsl" ,docbook-xsl)
2737 ("asciidoc" ,asciidoc)))
2738 (home-page "https://perf.wiki.kernel.org/")
2739 (synopsis "Linux profiling with performance counters")
2741 "perf is a tool suite for profiling using hardware performance counters,
2742 with support in the Linux kernel. perf can instrument CPU performance
2743 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2744 of lightweight profiling. This package contains the user-land tools and in
2745 particular the @code{perf} command.")
2746 (license (package-license linux-libre))))
2748 (define-public pflask
2754 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2756 (file-name (string-append name "-" version ".tar.gz"))
2759 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2760 (build-system cmake-build-system)
2762 '(#:tests? #f)) ; no tests
2763 (home-page "https://ghedo.github.io/pflask/")
2764 (synopsis "Simple tool for creating Linux namespace containers")
2765 (description "pflask is a simple tool for creating Linux namespace
2766 containers. It can be used for running a command or even booting an OS inside
2767 an isolated container, created with the help of Linux namespaces. It is
2768 similar in functionality to chroot, although pflask provides better isolation
2769 thanks to the use of namespaces.")
2770 (license license:bsd-2)))
2772 (define-public singularity
2774 (name "singularity")
2778 (uri (string-append "https://github.com/singularityware/singularity/"
2779 "releases/download/" version
2780 "/singularity-" version ".tar.gz"))
2783 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
2784 (modules '((guix build utils)))
2787 ;; Do not create directories in /var.
2788 (substitute* "Makefile.in"
2789 (("\\$\\(MAKE\\) .*install-data-hook") ""))
2791 ;; The original source overrides PATH so that it points to
2792 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
2793 ;; on Guix System. Leave PATH unchanged so we refer to the
2794 ;; installed Coreutils, grep, etc.
2795 (substitute* "bin/singularity.in"
2797 (string-append "#" all "\n")))
2799 (build-system gnu-build-system)
2802 (list "--disable-suid"
2803 "--localstatedir=/var")
2805 (modify-phases %standard-phases
2806 (add-after 'unpack 'patch-reference-to-squashfs-tools
2808 (substitute* "libexec/cli/build.exec"
2809 (("if ! singularity_which mksquashfs") "if 0")
2810 (("if ! mksquashfs")
2811 (string-append "if ! " (which "mksquashfs"))))
2814 `(("libarchive" ,libarchive)
2815 ("python" ,python-wrapper)
2818 ("squashfs-tools" ,squashfs-tools)))
2819 (home-page "https://singularity.lbl.gov/")
2820 (synopsis "Container platform")
2821 (description "Singularity is a container platform supporting a number of
2822 container image formats. It can build SquashFS container images or import
2823 existing Docker images. Singularity requires kernel support for container
2824 isolation or root privileges.")
2825 (license license:bsd-3)))
2827 (define-public hdparm
2833 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
2834 "hdparm-" version ".tar.gz"))
2837 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
2838 (build-system gnu-build-system)
2840 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2841 (list (string-append "binprefix=" out)
2842 (string-append "manprefix=" out)
2845 (modify-phases %standard-phases
2846 (delete 'configure)) ; no configure script
2847 #:tests? #f)) ; no test suite
2848 (home-page "https://sourceforge.net/projects/hdparm/")
2849 (synopsis "View and tune ATA disk drive parameters")
2851 "@command{hdparm} is a command-line utility to control ATA controllers and
2852 disk drives. It can increase performance and/or reliability by careful tuning
2853 of hardware settings like power and acoustic management, DMA modes, and caching.
2854 It can also display detailed device information, or be used as a simple
2855 performance benchmarking tool.
2857 @command{hdparm} provides a command line interface to various Linux kernel
2858 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2859 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2860 Translation (@dfn{SAT}) are also supported.")
2861 (license (license:non-copyleft "file://LICENSE.TXT"))))
2863 (define-public rfkill
2869 (uri (string-append "mirror://kernel.org/software/network/"
2870 name "/" name "-" version ".tar.xz"))
2873 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2874 (build-system gnu-build-system)
2876 `(#:make-flags (list "CC=gcc"
2877 (string-append "PREFIX=" %output))
2878 #:phases (modify-phases %standard-phases
2879 (delete 'configure))
2881 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2882 (synopsis "Tool for enabling and disabling wireless devices")
2884 "rfkill is a simple tool for accessing the rfkill device interface,
2885 which is used to enable and disable wireless networking devices, typically
2886 WLAN, Bluetooth and mobile broadband.")
2887 (license (license:non-copyleft "file://COPYING"
2888 "See COPYING in the distribution."))
2889 ;; rfkill is part of util-linux as of 2.31.
2890 (properties `((superseded . ,util-linux)))))
2898 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2899 version "/" name "-" version ".tar.gz"))
2902 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2903 (build-system gnu-build-system)
2904 (home-page "http://acpiclient.sourceforge.net")
2905 (synopsis "Display information on ACPI devices")
2906 (description "@code{acpi} attempts to replicate the functionality of the
2907 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2908 information. It does not support ACPI suspending, only displays information
2909 about ACPI devices.")
2910 (license license:gpl2+)))
2912 (define-public acpid
2918 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2922 "1hrc0xm6q12knbgzhq0i8g2rfrkwcvh1asd7k9rs3nc5xmlwd7gw"))))
2923 (build-system gnu-build-system)
2924 (home-page "https://sourceforge.net/projects/acpid2/")
2925 (synopsis "Daemon for delivering ACPI events to user-space programs")
2927 "acpid is designed to notify user-space programs of Advanced
2928 Configuration and Power Interface (ACPI) events. acpid should be started
2929 during the system boot, and will run as a background process. When an ACPI
2930 event is received from the kernel, acpid will examine the list of rules
2931 specified in /etc/acpi/events and execute the rules that match the event.")
2932 (license license:gpl2+)))
2934 (define-public sysfsutils
2943 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2946 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2947 (build-system gnu-build-system)
2948 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2949 (synopsis "System utilities based on Linux sysfs")
2951 "These are a set of utilities built upon sysfs, a virtual file system in
2952 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2953 also contains the libsysfs library.")
2954 ;; The library is under lgpl2.1+ (all files say "or any later version").
2955 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2956 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2958 (define-public sysfsutils-1
2960 (inherit sysfsutils)
2967 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2968 "/sysfsutils-" version ".tar.gz"))
2970 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2971 (modules '((guix build utils)))
2974 (substitute* "Makefile.in"
2975 (("includedir = /usr/include/sysfs")
2976 "includedir = @includedir@"))
2977 (substitute* "configure"
2978 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2979 (string-append "includedir='" orig "/sysfs'")))
2981 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2983 (define-public cpufrequtils
2985 (name "cpufrequtils")
2990 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
2991 "cpufrequtils-" version ".tar.gz"))
2993 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2994 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2995 (build-system gnu-build-system)
2997 `(("sysfsutils" ,sysfsutils-1)))
2999 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3000 (assoc-ref %outputs "out") "/lib"))))
3001 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3002 (synopsis "Utilities to get and set CPU frequency on Linux")
3004 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3005 information, and set the CPU frequency if supported, using the cpufreq
3006 capabilities of the Linux kernel.")
3007 (license license:gpl2)))
3009 (define-public libraw1394
3016 "mirror://kernel.org/linux/libs/ieee1394/"
3017 name "-" version ".tar.xz"))
3020 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3021 (build-system gnu-build-system)
3022 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3023 (synopsis "Interface library for the Linux IEEE1394 drivers")
3025 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3026 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3027 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3028 send to and receive from other nodes without requiring a kernel driver for the
3029 protocol in question.")
3030 (license license:lgpl2.1+)))
3032 (define-public libavc1394
3038 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3039 name "-" version ".tar.gz"))
3042 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3043 (build-system gnu-build-system)
3045 `(("pkg-config" ,pkg-config)))
3047 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3048 (home-page "https://sourceforge.net/projects/libavc1394/")
3049 (synopsis "AV/C protocol library for IEEE 1394")
3051 "Libavc1394 is a programming interface to the AV/C specification from
3052 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3053 (license license:lgpl2.1+)))
3055 (define-public libiec61883
3057 (name "libiec61883")
3062 "mirror://kernel.org/linux/libs/ieee1394/"
3063 name "-" version ".tar.xz"))
3066 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3067 (build-system gnu-build-system)
3069 `(("pkg-config" ,pkg-config)))
3071 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3072 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3073 (synopsis "Isochronous streaming media library for IEEE 1394")
3075 "The libiec61883 library provides a higher level API for streaming DV,
3076 MPEG-2 and audio over Linux IEEE 1394.")
3077 (license license:lgpl2.1+)))
3079 (define-public mdadm
3086 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3090 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3091 (build-system gnu-build-system)
3095 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3099 ;; TODO: tell it where to find 'sendmail'
3100 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3101 (string-append "BINDIR=" out "/sbin")
3102 (string-append "MANDIR=" out "/share/man")
3103 (string-append "UDEVDIR=" out "/lib/udev")))
3105 (modify-phases %standard-phases
3106 (add-before 'build 'patch-program-paths
3107 (lambda* (#:key inputs #:allow-other-keys)
3108 (let ((coreutils (assoc-ref inputs "coreutils")))
3109 (substitute* "udev-md-raid-arrays.rules"
3110 (("/usr/bin/(readlink|basename)" all program)
3111 (string-append coreutils "/bin/" program))))
3113 (add-before 'build 'remove-W-error
3115 ;; We cannot build with -Werror on i686 due to a
3116 ;; 'sign-compare' warning in util.c.
3117 (substitute* "Makefile"
3120 (delete 'configure))
3121 ;;tests must be done as root
3123 (home-page "http://neil.brown.name/blog/mdadm")
3124 (synopsis "Tool for managing Linux Software RAID arrays")
3126 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3127 assemble, report on, and monitor arrays. It can also move spares between raid
3128 arrays when needed.")
3129 (license license:gpl2+)))
3131 (define-public mdadm-static
3134 (name "mdadm-static")
3136 (substitute-keyword-arguments (package-arguments mdadm)
3137 ((#:make-flags flags)
3138 `(cons "LDFLAGS = -static" ,flags))
3140 `(modify-phases ,phases
3141 (add-after 'install 'remove-cruft
3142 (lambda* (#:key outputs #:allow-other-keys)
3143 (let* ((out (assoc-ref outputs "out"))
3144 (precious? (lambda (file)
3145 (member file '("." ".." "sbin"))))
3146 (directories (scandir out (negate precious?))))
3147 (with-directory-excursion out
3148 (for-each delete-file-recursively directories)
3149 (remove-store-references "sbin/mdadm")
3150 (delete-file "sbin/mdmon")
3152 ((#:modules modules %gnu-build-system-modules)
3153 `((ice-9 ftw) ,@modules))
3154 ((#:strip-flags _ '())
3155 ''("--strip-all")) ;strip a few extra KiB
3156 ((#:allowed-references _ '("out"))
3157 '("out")))) ;refer only self
3158 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3160 (define-public multipath-tools
3162 (name "multipath-tools")
3166 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3167 ".git;a=snapshot;h=" version ";sf=tgz"))
3168 (file-name (string-append name "-" version ".tar.gz"))
3171 "1jhi6bhl4ih75rfmyyjxd35ghgch5ls1gw40cjxwy9d6bd41z6q1"))
3172 (modules '((guix build utils)))
3175 ;; Drop bundled valgrind headers.
3176 (delete-file-recursively "third-party")
3177 (substitute* '("multipathd/main.c"
3178 "libmultipath/debug.c")
3179 (("#include \"../third-party/")
3182 (build-system gnu-build-system)
3184 '(#:tests? #f ; no tests
3185 #:make-flags (list "CC=gcc"
3186 (string-append "DESTDIR="
3187 (assoc-ref %outputs "out"))
3189 (string-append "LDFLAGS=-Wl,-rpath="
3190 (assoc-ref %outputs "out")
3193 (modify-phases %standard-phases
3194 (add-after 'unpack 'patch-source
3195 (lambda* (#:key inputs #:allow-other-keys)
3196 (let ((lvm2 (assoc-ref inputs "lvm2"))
3197 (udev (assoc-ref inputs "udev")))
3198 (substitute* "Makefile.inc"
3199 (("\\$\\(prefix\\)/usr") "$(prefix)")
3200 ;; Do not save timestamp to avoid gzip "timestamp
3201 ;; out-of-range" warnings.
3202 (("gzip -9") "gzip -9n"))
3203 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3204 (("/usr/include/libdevmapper.h")
3205 (string-append lvm2 "/include/libdevmapper.h"))
3206 (("/usr/include/libudev.h")
3207 (string-append udev "/include/libudev.h")))
3209 (delete 'configure)))) ; no configure script
3212 ("pkg-config" ,pkg-config)
3213 ("valgrind" ,valgrind)))
3215 `(("ceph:lib" ,ceph "lib")
3218 ("liburcu" ,liburcu)
3220 ("readline" ,readline)
3222 (home-page "http://christophe.varoqui.free.fr/")
3223 (synopsis "Access block devices through multiple paths")
3225 "This package provides the following binaries to drive the
3226 Linux Device Mapper multipathing driver:
3228 @item @command{multipath} - Device mapper target autoconfig.
3229 @item @command{multipathd} - Multipath daemon.
3230 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3231 @code{dm} multipath devices.
3232 @item @command{kpartx} - Create device maps from partition tables.
3234 (license (list license:gpl2+ ; main distribution
3235 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3237 (define-public libaio
3244 (string-append "https://releases.pagure.org/libaio/"
3245 name "-" version ".tar.gz")))
3248 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3249 (build-system gnu-build-system)
3252 (list "CC=gcc" (string-append "prefix=" %output))
3253 #:test-target "partcheck" ; need root for a full 'check'
3255 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3256 (home-page "https://pagure.io/libaio")
3257 (synopsis "Linux-native asynchronous I/O access library")
3259 "This library enables userspace to use Linux kernel asynchronous I/O
3260 system calls, important for the performance of databases and other advanced
3262 (license license:lgpl2.1+)))
3270 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3274 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
3275 (build-system gnu-build-system)
3277 `(("libsndfile" ,libsndfile)))
3279 `(("pkg-config" ,pkg-config)))
3280 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3281 (synopsis "Bluetooth subband audio codec")
3283 "The SBC is a digital audio encoder and decoder used to transfer data to
3284 Bluetooth audio output devices like headphones or loudspeakers.")
3285 (license license:gpl2+)))
3287 (define-public bluez
3294 "mirror://kernel.org/linux/bluetooth/bluez-"
3298 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
3299 (build-system gnu-build-system)
3302 (let ((out (assoc-ref %outputs "out")))
3303 (list "--sysconfdir=/etc"
3304 "--localstatedir=/var"
3307 ;; Install dbus/udev files to the correct location.
3308 (string-append "--with-dbusconfdir=" out "/etc")
3309 (string-append "--with-udevdir=" out "/lib/udev")))
3311 (modify-phases %standard-phases
3312 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3313 ;; issue (discussion on upstream mailing list:
3314 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3315 (add-before 'check 'skip-wonky-test
3317 (substitute* "unit/test-gatt.c"
3318 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3320 (add-after 'install 'post-install
3321 (lambda* (#:key inputs outputs #:allow-other-keys)
3322 (let* ((out (assoc-ref outputs "out"))
3323 (servicedir (string-append out "/share/dbus-1/services"))
3324 (service "obexd/src/org.bluez.obex.service")
3325 (rule (string-append
3326 out "/lib/udev/rules.d/97-hid2hci.rules")))
3327 ;; Install the obex dbus service file.
3328 (substitute* service
3330 (string-append out "/libexec/bluetooth/obexd")))
3331 (install-file service servicedir)
3332 ;; Fix paths in the udev rule.
3334 (("hid2hci --method")
3335 (string-append out "/lib/udev/hid2hci --method"))
3337 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3340 `(("pkg-config" ,pkg-config)
3341 ("gettext" ,gettext-minimal)))
3346 ("libical" ,libical)
3347 ("readline" ,readline)))
3348 (home-page "http://www.bluez.org/")
3349 (synopsis "Linux Bluetooth protocol stack")
3351 "BlueZ provides support for the core Bluetooth layers and protocols. It
3352 is flexible, efficient and uses a modular implementation.")
3353 (license license:gpl2+)))
3355 (define-public fuse-exfat
3362 "https://github.com/relan/exfat/releases/download/v"
3363 version "/" name "-" version ".tar.gz"))
3366 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3367 (build-system gnu-build-system)
3369 `(("pkg-config" ,pkg-config)))
3372 (home-page "https://github.com/relan/exfat")
3373 (synopsis "Mount exFAT file systems")
3375 "This package provides a FUSE-based file system that provides read and
3376 write access to exFAT devices.")
3377 (license license:gpl2+)))
3379 (define-public fuseiso
3382 (version "20070708")
3385 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3386 version "/fuseiso-" version ".tar.bz2"))
3389 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3390 (build-system gnu-build-system)
3392 `(("pkg-config" ,pkg-config)))
3397 (home-page "https://sourceforge.net/projects/fuseiso/")
3398 (synopsis "Mount ISO file system images")
3400 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
3401 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3402 Ridge, Joliet, and zisofs.")
3403 (license license:gpl2)))
3412 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3413 version ".tar.bz2"))
3414 (patches (search-patches "gpm-glibc-2.26.patch"))
3417 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3418 (build-system gnu-build-system)
3420 '(#:phases (modify-phases %standard-phases
3423 ;; The tarball was not generated with 'make dist' so we
3424 ;; need to bootstrap things ourselves.
3425 (substitute* "autogen.sh"
3426 (("/bin/sh") (which "sh")))
3427 (invoke "./autogen.sh")
3428 (patch-makefile-SHELL "Makefile.include.in")
3431 ;; Make sure programs find libgpm.so.
3432 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3433 (assoc-ref %outputs "out")
3436 `(("texinfo" ,texinfo)
3439 ("autoconf" ,autoconf)
3440 ("automake" ,automake)
3441 ("libtool" ,libtool)))
3442 (home-page "http://www.nico.schottelius.org/software/gpm/")
3443 (synopsis "Mouse support for the Linux console")
3445 "The GPM (general-purpose mouse) daemon is a mouse server for
3446 applications running on the Linux console. It allows users to select items
3447 and copy/paste text in the console and in xterm.")
3448 (license license:gpl2+)))
3450 (define-public btrfs-progs
3452 (name "btrfs-progs")
3456 (uri (string-append "mirror://kernel.org/linux/kernel/"
3457 "people/kdave/btrfs-progs/"
3458 "btrfs-progs-v" version ".tar.xz"))
3461 "0z0fm3j4ajzsf445381ra8r3zzciyyvfh8vvbjmbyarg2rz8n3w9"))))
3462 (build-system gnu-build-system)
3464 "static")) ; static versions of the binaries in "out"
3466 '(#:phases (modify-phases %standard-phases
3467 (add-after 'build 'build-static
3468 (lambda _ (invoke "make" "static")))
3469 (add-after 'install 'install-bash-completion
3470 (lambda* (#:key outputs #:allow-other-keys)
3471 (let* ((out (assoc-ref outputs "out"))
3472 (bashcomp (string-append out "/etc/bash_completion.d")))
3474 (copy-file "btrfs-completion"
3475 (string-append bashcomp "/btrfs"))
3477 (add-after 'install 'install-static
3478 (let ((staticbin (string-append (assoc-ref %outputs "static")
3482 (string-append "bindir=" staticbin)
3483 "install-static")))))
3484 #:tests? #f ; XXX: require the 'btrfs' kernel module.
3485 #:test-target "test"
3486 #:parallel-tests? #f)) ; tests fail when run in parallel
3487 (inputs `(("e2fsprogs" ,e2fsprogs)
3488 ("libblkid" ,util-linux)
3489 ("libblkid:static" ,util-linux "static")
3490 ("libuuid" ,util-linux)
3491 ("libuuid:static" ,util-linux "static")
3494 ("zlib:static" ,zlib "static")
3496 (native-inputs `(("pkg-config" ,pkg-config)
3497 ("asciidoc" ,asciidoc)
3500 ;; For building documentation.
3501 ("libxml2" ,libxml2)
3502 ("docbook-xsl" ,docbook-xsl)
3506 ;; The tests need 'grep' with perl regexp support.
3508 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
3509 (synopsis "Create and manage btrfs copy-on-write file systems")
3510 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3511 aimed at implementing advanced features while focusing on fault tolerance,
3512 repair and easy administration.")
3513 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3514 ;; GPL2: Everything else.
3515 (license (list license:gpl2 license:gpl2+))))
3517 (define-public btrfs-progs/static
3519 (name "btrfs-progs-static")
3520 (version (package-version btrfs-progs))
3522 (build-system trivial-build-system)
3524 `(("btrfs-progs:static" ,btrfs-progs "static")))
3526 `(#:modules ((guix build utils))
3529 (use-modules (guix build utils)
3533 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3534 (out (assoc-ref %outputs "out"))
3535 (source (string-append btrfs "/bin/btrfs.static"))
3536 (target (string-append out "/bin/btrfs")))
3537 (mkdir-p (dirname target))
3538 (copy-file source target)
3539 (remove-store-references target)
3540 (chmod target #o555)
3542 (home-page (package-home-page btrfs-progs))
3543 (synopsis "Statically-linked btrfs command from btrfs-progs")
3544 (description "This package provides the statically-linked @command{btrfs}
3545 from the btrfs-progs package. It is meant to be used in initrds.")
3546 (license (package-license btrfs-progs))))
3548 (define-public f2fs-tools-1.7
3555 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3556 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
3559 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
3561 (build-system gnu-build-system)
3564 (modify-phases %standard-phases
3565 (add-after 'install 'install-headers
3566 (lambda* (#:key outputs #:allow-other-keys)
3567 (let* ((out (assoc-ref outputs "out"))
3568 (out-include (string-append out "/include")))
3569 (install-file "include/f2fs_fs.h" out-include)
3570 (install-file "mkfs/f2fs_format_utils.h" out-include)
3573 `(("autoconf" ,autoconf)
3574 ("automake" ,automake)
3575 ("libtool" ,libtool)
3576 ("pkg-config" ,pkg-config)))
3578 `(("libuuid" ,util-linux)
3579 ("libselinux" ,libselinux)))
3580 (home-page "https://f2fs.wiki.kernel.org/")
3581 (synopsis "Userland tools for f2fs")
3583 "F2FS, the Flash-Friendly File System, is a modern file system
3584 designed to be fast and durable on flash devices such as solid-state
3585 disks and SD cards. This package provides the userland utilities.")
3586 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3587 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3588 (license (list license:gpl2 license:lgpl2.1))))
3590 (define-public f2fs-tools
3592 (inherit f2fs-tools-1.7)
3598 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3599 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
3602 "15pn2fm9knn7p1vzfzy6msnrdl14p6y1gn4m2ka6ba5bzx6lw4p2"))))
3604 `(("libuuid" ,util-linux)))))
3606 (define-public freefall
3609 (version (package-version linux-libre))
3610 (source (package-source linux-libre))
3611 (build-system gnu-build-system)
3613 '(#:phases (modify-phases %standard-phases
3614 (add-after 'unpack 'enter-subdirectory
3616 (chdir "tools/laptop/freefall")
3619 (add-before 'build 'increase-timeout
3621 ;; The default of 2 seconds is too low: it assumes an
3622 ;; open lid and AC power without actually checking.
3623 (substitute* "freefall.c"
3624 (("alarm\\(2\\)") "alarm(5)"))
3626 #:make-flags (list (string-append "PREFIX="
3627 (assoc-ref %outputs "out"))
3629 #:tests? #f)) ;no tests
3630 (home-page (package-home-page linux-libre))
3631 (synopsis "Free-fall protection for spinning laptop hard drives")
3633 "Prevents shock damage to the internal spinning hard drive(s) of some
3634 HP and Dell laptops. When sudden movement is detected, all input/output
3635 operations on the drive are suspended and its heads are parked on the ramp,
3636 where they are less likely to cause damage to the spinning disc. Requires a
3637 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3638 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3639 (license license:gpl2)))
3641 (define-public thinkfan
3649 (url "https://github.com/vmatare/thinkfan.git")
3651 (file-name (git-file-name name version))
3653 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
3654 (build-system cmake-build-system)
3656 `(#:modules ((guix build cmake-build-system)
3659 #:tests? #f ; no test target
3661 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3662 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
3664 `("-DUSE_ATASMART:BOOL=ON")
3666 (modify-phases %standard-phases
3667 (add-after 'unpack 'create-init-scripts
3668 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
3669 ;; systemd to patch and install their service files. Fake their
3670 ;; presence rather than duplicating the build system below. Leave
3671 ;; things like ‘/bin/kill’ because they're not worth a dependency.
3672 ;; The sysvinit needs manual patching, but since upstream doesn't
3673 ;; even provide the option to install it: don't.
3674 (lambda* (#:key outputs #:allow-other-keys)
3675 (let* ((out (assoc-ref outputs "out"))
3676 (share (string-append out "/share/" ,name)))
3677 (substitute* "CMakeLists.txt"
3678 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
3679 (format "option(~a_FOUND \"Faked\" ON)\n" package))
3680 ;; That was easy! Now we just need to fix the destinations.
3682 (string-append out directory)))
3685 `(("pkg-config" ,pkg-config)))
3687 `(("libatasmart" ,libatasmart)
3688 ("yaml-cpp" ,yaml-cpp)))
3689 (home-page "http://thinkfan.sourceforge.net/")
3690 (synopsis "Simple fan control program")
3692 "Thinkfan is a simple fan control program. It reads temperatures,
3693 checks them against configured limits and switches to appropriate (also
3694 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3695 other @code{hwmon} driver that enables temperature reading and fan control
3697 (license license:gpl3+)))
3699 (define-public ntfs-3g
3702 (version "2017.3.23")
3705 (uri (string-append "https://tuxera.com/opensource/"
3706 "ntfs-3g_ntfsprogs-" version ".tgz"))
3707 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
3710 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
3711 (modules '((guix build utils)))
3713 ;; Install under $prefix.
3714 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3718 (build-system gnu-build-system)
3719 (inputs `(("util-linux" ,util-linux)
3720 ("fuse" ,fuse))) ;libuuid
3721 (native-inputs `(("pkg-config" ,pkg-config)))
3723 '(#:configure-flags (list "--exec-prefix=${prefix}"
3724 "--with-fuse=external" ;use our own FUSE
3725 "--enable-mount-helper"
3726 "--enable-posix-acls"
3727 "--enable-xattr-mappings")
3729 (modify-phases %standard-phases
3730 ;; If users install ntfs-3g, they probably want to make it the
3731 ;; default driver as well, so we opt for sensible defaults and link
3732 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
3733 ;; mount NTFS file systems.)
3734 (add-after 'install 'install-link
3735 (lambda* (#:key outputs #:allow-other-keys)
3736 (let* ((out (assoc-ref outputs "out"))
3737 (sbin (string-append out "/sbin")))
3738 (symlink "mount.ntfs-3g"
3739 (string-append sbin "/mount.ntfs")))
3741 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
3742 (synopsis "Read-write access to NTFS file systems")
3744 "NTFS-3G provides read-write access to NTFS file systems, which are
3745 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3746 The package provides additional NTFS tools.")
3747 (license license:gpl2+)))
3749 (define-public rdma-core
3755 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3756 "/releases/download/v" version "/rdma-core-"
3760 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
3761 (build-system cmake-build-system)
3763 '(#:tests? #f ; no tests
3764 ;; Upstream uses the "ninja" build system and encourage distros
3765 ;; to do the same for consistency. They also recommend using the
3766 ;; "Release" build type.
3767 #:build-type "Release"
3768 #:configure-flags (list "-GNinja")
3770 (modify-phases %standard-phases
3774 "-j" (number->string (parallel-job-count)))))
3777 (invoke "ninja" "install"))))))
3780 ("pkg-config" ,pkg-config)
3781 ("python" ,python-wrapper)))
3785 (home-page "https://github.com/linux-rdma/rdma-core")
3786 (synopsis "Utilities and libraries for working with RDMA devices")
3788 "This package provides userspace components for the InfiniBand
3789 subsystem of the Linux kernel. Specifically it contains userspace
3790 libraries for the following device nodes:
3793 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3794 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3795 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3798 The following service daemons are also provided:
3800 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3801 @item @code{iwpmd} (for iWARP kernel providers)
3802 @item @code{ibacm} (for InfiniBand communication management assistant)
3804 ;; All library code is dual licensed under GPL2 and a custom MIT
3805 ;; variant. The package also includes some components covered by
3806 ;; other licenses. Consult COPYING.md for full details.
3809 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3810 license:bsd-2 ; Files referring to COPYING.BSD_FB
3811 license:cc0 ; most files in ccan/
3812 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3814 (define-public perftest
3821 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
3822 version "/perftest-" version ".g0927198.tar.gz"))
3824 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
3825 (build-system gnu-build-system)
3828 (modify-phases %standard-phases
3829 (add-after 'unpack 'patch-header-paths
3831 (substitute* '("src/raw_ethernet_fs_rate.c"
3832 "src/raw_ethernet_resources.c"
3833 "src/raw_ethernet_resources.h"
3834 "src/raw_ethernet_send_burst_lat.c"
3835 "src/raw_ethernet_send_bw.c"
3836 "src/raw_ethernet_send_lat.c")
3837 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
3839 (inputs `(("rdma-core" ,rdma-core)))
3840 (home-page "https://github.com/linux-rdma/perftest/")
3841 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
3842 (description "This is a collection of tests written over uverbs intended for
3843 use as a performance micro-benchmark. The tests may be used for hardware or
3844 software tuning as well as for functional testing.
3846 The collection contains a set of bandwidth and latency benchmark such as:
3848 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
3849 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
3850 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
3851 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
3852 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
3854 (license license:gpl2)))
3856 (define-public rng-tools
3859 (home-page "https://github.com/nhorman/rng-tools")
3863 (uri (git-reference (url home-page)
3864 (commit (string-append "v" version))))
3865 (file-name (git-file-name name version))
3868 "19f75m6mzg8h7b4snzg7d6ypvkz6nq32lrpi9ja95gqz4wsd18a5"))))
3869 (build-system gnu-build-system)
3871 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
3872 #:configure-flags '("--without-nistbeacon"
3873 "--without-pkcs11")))
3875 `(("autoconf" ,autoconf)
3876 ("automake" ,automake)
3877 ("pkg-config" ,pkg-config)))
3879 `(("libsysfs" ,sysfsutils)))
3880 (synopsis "Random number generator daemon")
3882 "Monitor a hardware random number generator, and supply entropy
3883 from that to the system kernel's @file{/dev/random} machinery.")
3884 ;; The source package is offered under the GPL2+, but the files
3885 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3886 (license (list license:gpl2 license:gpl2+))))
3888 (define-public cpupower
3891 (version (package-version linux-libre))
3892 (source (package-source linux-libre))
3893 (build-system gnu-build-system)
3895 '(#:phases (modify-phases %standard-phases
3896 (add-after 'unpack 'enter-subdirectory
3898 (chdir "tools/power/cpupower")
3901 (add-before 'build 'fix-makefiles
3903 (substitute* "Makefile"
3905 (("/bin/(install|pwd)" _ command) command))
3906 (substitute* "bench/Makefile"
3907 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
3909 #:make-flags (let ((out (assoc-ref %outputs "out")))
3910 (list (string-append "DESTDIR=" out)
3911 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3912 "docdir=/share/doc/cpupower"
3913 "confdir=$(docdir)/examples"
3914 ;; The Makefile recommends the following changes
3916 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3917 #:tests? #f)) ;no tests
3918 (native-inputs `(("gettext" ,gettext-minimal)))
3919 (inputs `(("pciutils" ,pciutils)))
3920 (home-page (package-home-page linux-libre))
3921 (synopsis "CPU frequency and voltage scaling tools for Linux")
3923 "cpupower is a set of user-space tools that use the cpufreq feature of the
3924 Linux kernel to retrieve and control processor features related to power saving,
3925 such as frequency and voltage scaling.")
3926 (license license:gpl2)))
3928 (define-public haveged
3936 (url "https://github.com/jirka-h/haveged.git")
3938 (file-name (git-file-name name version))
3940 (base32 "1hrwzjd4byq4fdrg8svww3d8x449k80jxxrjy9v6jvzhfv19rvxr"))))
3941 (build-system gnu-build-system)
3942 (home-page "http://www.issihosts.com/haveged")
3943 (synopsis "Entropy source for the Linux random number generator")
3945 "haveged generates an unpredictable stream of random numbers for use by
3946 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3947 standard mechanisms for filling the entropy pool may not be sufficient for
3948 systems with high needs or limited user interaction, such as headless servers.
3950 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3951 indirect effects of hardware events on hidden processor state using the HArdware
3952 Volatile Entropy Gathering and Expansion (@dfn{HAVEGE}) algorithm. It tunes
3953 itself to its environment and provides the same built-in test suite for the
3954 output stream as used on certified hardware security devices.
3956 The quality of the randomness produced by this algorithm has not been proven.
3957 It is recommended to run it together with another entropy source like rngd, and
3958 not as a replacement for it.")
3959 (license (list (license:non-copyleft "file://nist/mconf.h")
3960 (license:non-copyleft "file://nist/packtest.c")
3961 license:public-domain ; nist/dfft.c
3962 license:gpl3+)))) ; everything else
3964 (define-public ecryptfs-utils
3966 (name "ecryptfs-utils")
3971 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3972 version "/+download/ecryptfs-utils_"
3973 version ".orig.tar.gz"))
3976 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3977 (build-system gnu-build-system)
3979 `(#:configure-flags (list "--disable-pywrap")
3981 (modify-phases %standard-phases
3982 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
3983 (lambda* (#:key inputs outputs #:allow-other-keys)
3984 (let ((out (assoc-ref outputs "out"))
3985 (utils-linux (assoc-ref inputs "utils-linux"))
3986 (cryptsetup (assoc-ref inputs "cryptsetup"))
3987 (linux-pam (assoc-ref inputs "linux-pam"))
3988 (lvm2 (assoc-ref inputs "lvm2")))
3989 (substitute* '("src/utils/ecryptfs-mount-private"
3990 "src/utils/ecryptfs-umount-private"
3991 "src/utils/ecryptfs-setup-private"
3992 "src/utils/ecryptfs-setup-swap"
3993 "src/utils/mount.ecryptfs.c"
3994 "src/utils/umount.ecryptfs.c"
3995 "src/pam_ecryptfs/pam_ecryptfs.c"
3996 "src/desktop/ecryptfs-mount-private.desktop.in"
3997 "src/desktop/ecryptfs-setup-private.desktop.in")
3999 (string-append utils-linux "/bin/mount"))
4001 (string-append utils-linux "/bin/umount"))
4002 (("/sbin/mount.ecryptfs_private")
4003 (string-append out "/sbin/mount.ecryptfs_private"))
4004 (("/sbin/umount.ecryptfs_private")
4005 (string-append out "/sbin/umount.ecryptfs_private"))
4006 (("/usr/bin/ecryptfs-mount-private")
4007 (string-append out "/bin/ecryptfs-mount-private"))
4008 (("/usr/bin/ecryptfs-rewrite-file")
4009 (string-append out "/bin/ecryptfs-rewrite-file"))
4010 (("/usr/bin/ecryptfs-setup-private")
4011 (string-append out "/bin/ecryptfs-setup-private"))
4012 (("/sbin/cryptsetup")
4013 (string-append cryptsetup "/sbin/cryptsetup"))
4014 (("/sbin/unix_chkpwd")
4015 (string-append linux-pam "/sbin/unix_chkpwd"))
4017 (string-append lvm2 "/sbin/dmsetup")))))))))
4019 `(("intltool" ,intltool)
4020 ("perl" ,perl) ; for pod2man
4021 ("pkg-config" ,pkg-config)))
4023 `(("keyutils" ,keyutils)
4024 ("linux-pam" ,linux-pam)
4025 ("utils-linux" ,util-linux)
4026 ("cryptsetup" ,cryptsetup)
4029 (home-page "http://ecryptfs.org/")
4030 (synopsis "eCryptfs cryptographic file system utilities")
4032 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4033 Each file's cryptographic meta-data is stored inside the file itself, along
4034 with the encrypted contents. This allows individual encrypted files to be
4035 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4036 native Linux file system, and has been part of the Linux kernel since version
4037 2.6.19. This package contains the userland utilities to manage it.")
4038 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4039 ;; grant additional permission to link with OpenSSL.
4040 (license license:gpl2+)))
4042 (define-public libnfsidmap
4044 (name "libnfsidmap")
4049 (uri (string-append "https://fedorapeople.org/~steved/"
4050 name "/" version "/" name "-" version ".tar.bz2"))
4052 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4053 (build-system gnu-build-system)
4055 `(#:configure-flags (list
4056 (string-append "--with-pluginpath="
4057 (assoc-ref %outputs "out")
4058 "/lib/libnfsidmap"))))
4060 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4062 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4063 (synopsis "NFSv4 support library for name/ID mapping")
4064 (description "Libnfsidmap is a library holding mulitiple methods of
4065 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4066 extensible array of mapping functions, currently consisting of two choices:
4067 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4068 (license (license:non-copyleft "file://COPYING"
4069 "See COPYING in the distribution."))))
4071 (define-public module-init-tools
4073 (name "module-init-tools")
4078 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4079 "module-init-tools-" version ".tar.bz2"))
4082 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4083 (patches (search-patches "module-init-tools-moduledir.patch"))))
4084 (build-system gnu-build-system)
4086 ;; FIXME: The upstream tarball lacks man pages, and building them would
4087 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4088 ;; but they vanished. In the meantime, fake it.
4090 (modify-phases %standard-phases
4091 (add-before 'configure 'fake-docbook
4093 (substitute* "Makefile.in"
4094 (("^DOCBOOKTOMAN.*$")
4095 "DOCBOOKTOMAN = true\n"))
4097 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
4098 (synopsis "Tools for loading and managing Linux kernel modules")
4100 "Tools for loading and managing Linux kernel modules, such as
4101 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
4102 (license license:gpl2+)))
4104 (define-public mcelog
4110 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4111 "mcelog.git/snapshot/v" version ".tar.gz"))
4114 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
4115 (file-name (string-append name "-" version ".tar.gz"))
4116 (modules '((guix build utils)))
4119 ;; The snapshots lack a .git directory,
4120 ;; breaking ‘git describe’.
4121 (substitute* "Makefile"
4122 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4124 (build-system gnu-build-system)
4126 `(#:phases (modify-phases %standard-phases
4127 (delete 'configure)) ; no configure script
4128 #:make-flags (let ((out (assoc-ref %outputs "out")))
4130 (string-append "prefix=" out)
4131 (string-append "DOCDIR=" out "/share/doc/mcelog")
4132 "etcprefix=$(DOCDIR)/examples"))
4133 ;; The tests will only run as root on certain supported CPU models.
4135 (supported-systems (list "i686-linux" "x86_64-linux"))
4136 (home-page "https://mcelog.org/")
4137 (synopsis "Machine check monitor for x86 Linux systems")
4139 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4140 and other hardware errors on x86 systems. It can also perform user-defined
4141 tasks, such as bringing bad pages off-line, when configurable error thresholds
4143 (license license:gpl2)))
4145 (define-public mtd-utils
4152 "ftp://ftp.infradead.org/pub/mtd-utils/"
4153 "mtd-utils-" version ".tar.bz2"))
4156 "1f30jszknc5v6ykmil8ajxgksmcg54q3rsp84jsancp9x0dycggv"))))
4158 '(#:configure-flags '("--enable-unit-tests")))
4160 `(("cmocka" ,cmocka)
4161 ("pkg-config" ,pkg-config)))
4163 `(("acl" ,acl) ; for XATTR
4164 ("libuuid" ,util-linux)
4167 (build-system gnu-build-system)
4168 (synopsis "MTD Flash Storage Utilities")
4169 (description "This package provides utilities for testing, partitioning, etc
4171 (home-page "http://www.linux-mtd.infradead.org/")
4173 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4174 license:mpl1.1 ; All ftl* files
4175 license:expat)))) ; libiniparser
4177 (define-public libseccomp
4183 (uri (string-append "https://github.com/seccomp/libseccomp/"
4184 "releases/download/v" version
4185 "/libseccomp-" version ".tar.gz"))
4188 "1s06h2cgk0xxwmhwj72z33bllafc1xqnxzk2yyra2rmg959778qw"))))
4189 (build-system gnu-build-system)
4191 `(("which" ,which)))
4192 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4193 (description "The libseccomp library provides an easy to use, platform
4194 independent, interface to the Linux Kernel's syscall filtering mechanism. The
4195 libseccomp API is designed to abstract away the underlying BPF based syscall
4196 filter language and present a more conventional function-call based filtering
4197 interface that should be familiar to, and easily adopted by, application
4199 (home-page "https://github.com/seccomp/libseccomp")
4200 (license license:lgpl2.1)))
4202 (define-public radeontop
4206 (home-page "https://github.com/clbr/radeontop/")
4209 (uri (string-append home-page "archive/v" version ".tar.gz"))
4210 (file-name (string-append name "-" version ".tar.gz"))
4213 "1fv06j5c99imvzkac3j40lgjhr5b2i77fnyffhlvj92bli1fm1c6"))))
4214 (build-system gnu-build-system)
4216 `(#:phases (modify-phases %standard-phases
4217 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4218 ;; dependency, and doesn't even work on release(!) tarballs.
4219 (add-after 'unpack 'report-correct-version
4221 (substitute* "getver.sh"
4223 (string-append "ver=" ,version)))
4225 (delete 'configure)) ; no configure script
4226 #:make-flags (list "CC=gcc"
4227 (string-append "PREFIX=" %output))
4228 #:tests? #f)) ; no tests
4230 `(("gettext" ,gettext-minimal)
4231 ("pkg-config" ,pkg-config)))
4233 `(("libdrm" ,libdrm)
4234 ("libpciaccess" ,libpciaccess)
4236 ("ncurses" ,ncurses)))
4237 (synopsis "Usage monitor for AMD Radeon graphics")
4238 (description "RadeonTop monitors resource consumption on supported AMD
4239 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4240 a terminal or saved to a file for further processing. It measures both the
4241 activity of the GPU as a whole, which is also accurate during OpenCL
4242 computations, as well as separate component statistics that are only meaningful
4243 under OpenGL graphics workloads.")
4244 (license license:gpl3)))
4246 (define-public efivar
4252 (uri (string-append "https://github.com/rhboot/" name
4253 "/releases/download/" version "/" name
4254 "-" version ".tar.bz2"))
4257 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
4258 (build-system gnu-build-system)
4260 `(;; Tests require a UEFI system and is not detected in the chroot.
4262 #:make-flags (list (string-append "prefix=" %output)
4263 (string-append "libdir=" %output "/lib")
4265 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4267 (modify-phases %standard-phases
4268 (delete 'configure))))
4270 `(("pkg-config" ,pkg-config)))
4273 (home-page "https://github.com/rhboot/efivar")
4274 (synopsis "Tool and library to manipulate EFI variables")
4275 (description "This package provides a library and a command line
4276 interface to the variable facility of UEFI boot firmware.")
4277 (license license:lgpl2.1+)))
4279 (define-public efibootmgr
4285 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4286 "/releases/download/" version "/efibootmgr"
4287 "-" version ".tar.bz2"))
4290 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
4291 (build-system gnu-build-system)
4293 `(#:tests? #f ;no tests
4294 #:make-flags (list (string-append "prefix=" %output)
4295 (string-append "libdir=" %output "/lib")
4296 ;; EFIDIR denotes a subdirectory relative to the
4297 ;; EFI System Partition where the loader will be
4298 ;; installed (known as OS_VENDOR in the code).
4299 ;; GRUB overrides this, as such it's only used if
4300 ;; nothing else is specified on the command line.
4302 #:phases (modify-phases %standard-phases (delete 'configure))))
4304 `(("pkg-config" ,pkg-config)))
4306 `(("efivar" ,efivar)
4308 (home-page "https://github.com/rhinstaller/efibootmgr")
4309 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4311 "@code{efibootmgr} is a user-space application to modify the Intel
4312 Extensible Firmware Interface (EFI) Boot Manager. This application can
4313 create and destroy boot entries, change the boot order, change the next
4314 running boot option, and more.")
4315 (license license:gpl2+)))
4317 (define-public sysstat
4323 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
4324 "sysstat-" version ".tar.xz"))
4327 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
4328 (build-system gnu-build-system)
4330 `(#:tests? #f ; No test suite.
4331 ;; Without this flag, it tries to install the man pages with group 'root'
4332 ;; and fails because /etc/passwd lacks an entry for the root user.
4334 (list "--disable-file-attr"
4335 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4337 (modify-phases %standard-phases
4338 ;; The build process tries to create '/var/lib/sa', so we skip that
4340 (add-after 'build 'skip-touching-var
4342 (substitute* "Makefile"
4343 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4346 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4347 (synopsis "Performance monitoring tools for Linux")
4348 (description "The sysstat utilities are a collection of performance
4349 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4350 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4351 @code{sadf} and @code{sa}.")
4352 (license license:gpl2+)))
4354 (define-public light
4361 "https://github.com/haikarainen/light/archive/v"
4365 "1gfvsw7gh5pis733l7j54vzp272pvjyzbg8a0pvapfmg0s7mip97"))
4366 (file-name (string-append name "-" version ".tar.gz"))))
4367 (build-system gnu-build-system)
4369 `(("autoconf" ,autoconf)
4370 ("automake" ,automake)))
4371 (home-page "https://haikarainen.github.io/light/")
4372 (synopsis "GNU/Linux application to control backlights")
4374 "Light is a program to send commands to screen backlight controllers
4375 under GNU/Linux. Features include:
4378 @item It does not rely on X.
4379 @item Light can automatically figure out the best controller to use, making
4380 full use of underlying hardware.
4381 @item It is possible to set a minimum brightness value, as some controllers
4382 set the screen to be pitch black at a vaĺue of 0 (or higher).
4385 Light is the successor of lightscript.")
4386 (license license:gpl3+)))
4388 (define-public brightnessctl
4389 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
4391 (name "brightnessctl")
4392 (version (git-version "0.4" "0" commit))
4396 (url "https://github.com/Hummer12007/brightnessctl/")
4398 (file-name (git-file-name name version))
4401 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
4402 (build-system gnu-build-system)
4404 '(#:tests? #f ; no tests
4405 #:make-flags (list "CC=gcc"
4406 (string-append "PREFIX=" %output)
4407 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
4409 (modify-phases %standard-phases
4411 (add-after 'unpack 'adjust-udev-rules
4413 (substitute* "90-brightnessctl.rules"
4414 (("/bin/") "/run/current-system/profile/bin/"))
4416 (home-page "https://github.com/Hummer12007/brightnessctl")
4417 (synopsis "Backlight and LED brightness control")
4419 "This program allows you read and control device brightness. Devices
4420 include backlight and LEDs. It can also preserve current brightness before
4421 applying the operation, such as on lid close.
4423 The appropriate permissions must be set on the backlight or LED control
4424 interface in sysfs, which can be accomplished with the included udev rules.")
4425 (license license:expat))))
4434 "https://github.com/linrunner/"
4435 (string-upcase name)
4436 "/archive/" version ".tar.gz"))
4437 (file-name (string-append name "-" version ".tar.gz"))
4440 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
4441 (inputs `(("bash" ,bash)
4443 ("ethtool" ,ethtool)
4447 ("inetutils" ,inetutils)
4450 ("pciutils" ,pciutils)
4454 ("usbutils" ,usbutils)
4455 ("util-linux" ,util-linux)
4456 ("wireless-tools" ,wireless-tools)))
4457 (build-system gnu-build-system)
4460 (modify-phases %standard-phases
4461 (delete 'configure) ; no configure script
4462 (add-before 'build 'setenv
4463 (lambda* (#:key outputs #:allow-other-keys)
4464 (let ((out (assoc-ref outputs "out")))
4465 (setenv "TLP_WITH_SYSTEMD" "0")
4466 (setenv "TLP_NO_INIT" "1")
4467 (setenv "TLP_NO_PMUTILS" "1")
4468 (setenv "TLP_SBIN" (string-append out "/bin"))
4469 (setenv "TLP_BIN" (string-append out "/bin"))
4470 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
4471 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
4472 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
4473 (setenv "TLP_CONF" "/etc/tlp")
4475 (string-append out "/lib/elogind/system-sleep"))
4477 (string-append out "/share/bash-completion/completions"))
4478 (setenv "TLP_MAN" (string-append out "/share/man"))
4479 (setenv "TLP_META" (string-append out "/share/metainfo"))
4481 (delete 'check) ; no tests
4482 (add-before 'install 'fix-installation
4484 ;; Stop the Makefile from trying to create system directories.
4485 (substitute* "Makefile"
4486 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
4487 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
4491 (invoke "make" "install-tlp" "install-man")))
4492 (add-after 'install 'wrap
4493 (lambda* (#:key inputs outputs #:allow-other-keys)
4494 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4495 (bin-files (find-files bin ".*")))
4496 (define (bin-directory input-name)
4497 (string-append (assoc-ref inputs input-name) "/bin"))
4498 (define (sbin-directory input-name)
4499 (string-append (assoc-ref inputs input-name) "/sbin"))
4500 (for-each (lambda (program)
4501 (wrap-program program
4504 (map bin-directory '("bash"
4515 (map sbin-directory '("ethtool"
4520 "wireless-tools"))))))
4523 (home-page "http://linrunner.de/en/tlp/tlp.html")
4524 (synopsis "Power management tool for Linux")
4525 (description "TLP is a power management tool for Linux. It comes with
4526 a default configuration already optimized for battery life. Nevertheless,
4527 TLP is customizable to fulfil system requirements. TLP settings are applied
4528 every time the power supply source is changed.")
4529 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4531 (license (list license:gpl2+ license:gpl3+))))
4539 (uri (string-append "https://www.ezix.org/software/"
4540 "files/lshw-" version
4544 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4545 (build-system gnu-build-system)
4547 `(#:phases (modify-phases %standard-phases (delete 'configure))
4548 #:tests? #f ; no tests
4550 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4551 (synopsis "List hardware information")
4553 "@command{lshw} (Hardware Lister) is a small tool to provide
4554 detailed information on the hardware configuration of the machine.
4555 It can report exact memory configuration, firmware version, mainboard
4556 configuration, CPU version and speed, cache configuration, bus speed,
4557 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4558 machines (PowerMac G4 is known to work).")
4559 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4560 (license license:gpl2+)))
4562 (define-public libmnl
4569 (uri (string-append "mirror://netfilter.org/libmnl/"
4570 "libmnl-" version ".tar.bz2"))
4573 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4574 (build-system gnu-build-system)
4575 (home-page "https://www.netfilter.org/projects/libmnl/")
4576 (synopsis "Netlink utility library")
4577 (description "Libmnl is a minimalistic user-space library oriented to
4578 Netlink developers. There are a lot of common tasks in parsing, validating,
4579 constructing of both the Netlink header and TLVs that are repetitive and easy to
4580 get wrong. This library aims to provide simple helpers that allows you to
4581 re-use code and to avoid re-inventing the wheel.")
4582 (license license:lgpl2.1+)))
4584 (define-public libnftnl
4591 (uri (string-append "mirror://netfilter.org/libnftnl/"
4592 "libnftnl-" version ".tar.bz2"))
4594 (base32 "0pffmsv41alsn5ac7mwnb9fh3qpwzqk13jrzn6c5i71wq6kbgix5"))))
4595 (build-system gnu-build-system)
4597 `(("pkg-config" ,pkg-config)))
4599 `(("libmnl" ,libmnl)))
4600 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4601 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4602 (description "Libnftnl is a userspace library providing a low-level netlink
4603 programming interface to the in-kernel nf_tables subsystem. The library
4604 libnftnl has been previously known as libnftables. This library is currently
4606 (license license:gpl2+)))
4608 (define-public nftables
4615 (uri (string-append "http://www.nftables.org/projects/nftables"
4616 "/files/nftables-" version ".tar.bz2"))
4619 "14bygs6vg2v448cw5r4pxqi8an29hw0m9vab8hpmgjmrzjsq30dd"))))
4620 (build-system gnu-build-system)
4621 (arguments `(#:configure-flags
4622 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
4623 (inputs `(("bison" ,bison)
4627 ("libnftnl" ,libnftnl)
4628 ("readline" ,readline)))
4629 (native-inputs `(("pkg-config" ,pkg-config)))
4630 (home-page "http://www.nftables.org")
4631 (synopsis "Userspace utility for Linux packet filtering")
4632 (description "nftables is the project that aims to replace the existing
4633 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4634 filtering framework, a new userspace utility and also a compatibility layer for
4635 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4636 infrastructure such as the existing hooks, the connection tracking system, the
4637 userspace queueing component and the logging subsystem.")
4638 (license license:gpl2)))
4640 (define-public proot
4648 (url "https://github.com/proot-me/PRoot.git")
4649 (commit (string-append "v" version))))
4650 (file-name (git-file-name name version))
4652 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
4653 (patches (search-patches "proot-test-fhs.patch"))))
4654 (build-system gnu-build-system)
4656 '(#:make-flags '("-C" "src")
4658 #:phases (modify-phases %standard-phases
4660 (add-before 'build 'set-shell-file-name
4661 (lambda* (#:key inputs #:allow-other-keys)
4662 (substitute* (find-files "src" "\\.[ch]$")
4665 (assoc-ref inputs "bash")
4668 (add-before 'check 'fix-fhs-assumptions-in-tests
4670 (substitute* "tests/test-c6b77b77.mk"
4671 (("/bin/bash") (which "bash"))
4672 (("/usr/bin/test") (which "test")))
4673 (substitute* '("tests/test-16573e73.c")
4674 (("/bin/([a-z-]+)" _ program)
4677 (substitute* (find-files "tests" "\\.sh$")
4678 ;; Some of the tests try to "bind-mount" /bin/true.
4680 (string-append "-b " (which "true") ":"))
4681 ;; Likewise for /bin.
4682 (("-b /bin:") "-b /gnu:")
4683 ;; Others try to run /bin/sh.
4684 (("/bin/sh") (which "sh"))
4685 ;; Others assume /etc/fstab exists.
4686 (("/etc/fstab") "/etc/passwd"))
4688 (substitute* "tests/GNUmakefile"
4689 (("-b /bin:") "-b /gnu:"))
4691 ;; XXX: This test fails in an obscure corner case, just
4693 (delete-file "tests/test-kkkkkkkk.c")
4698 (let ((n (parallel-job-count)))
4699 ;; For some reason we get lots of segfaults with
4700 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4701 (setenv "PROOT_NO_SECCOMP" "1")
4703 ;; Most of the tests expect "/bin" to be in $PATH so
4704 ;; they can run things that live in $ROOTFS/bin.
4706 (string-append (getenv "PATH") ":/bin"))
4708 (invoke "make" "check" "-C" "tests"
4710 "-j" (number->string n)))))
4712 (lambda* (#:key outputs #:allow-other-keys)
4713 ;; The 'install' rule does nearly nothing.
4714 (let* ((out (assoc-ref outputs "out"))
4715 (man1 (string-append out "/share/man/man1")))
4716 ;; TODO: 'make install-care' (does not even
4717 ;; build currently.)
4718 (invoke "make" "-C" "src" "install"
4719 (string-append "PREFIX=" out))
4722 (copy-file "doc/proot/man.1"
4723 (string-append man1 "/proot.1"))
4725 (native-inputs `(("which" ,which)
4727 ;; For 'mcookie', used by some of the tests.
4728 ("util-linux" ,util-linux)))
4729 (inputs `(("talloc" ,talloc)))
4730 (home-page "https://github.com/proot-me/PRoot")
4731 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4733 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4734 and @code{binfmt_misc}. This means that users don't need any privileges or
4735 setup to do things like using an arbitrary directory as the new root
4736 file system, making files accessible somewhere else in the file system
4737 hierarchy, or executing programs built for another CPU architecture
4738 transparently through QEMU user-mode. Also, developers can use PRoot as a
4739 generic process instrumentation engine thanks to its extension mechanism.
4740 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4741 available in the kernel Linux.")
4742 (license license:gpl2+)))
4744 (define-public proot-static
4747 (name "proot-static")
4749 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4750 (inputs `(("talloc" ,talloc/static)))
4752 (substitute-keyword-arguments (package-arguments proot)
4753 ((#:make-flags flags)
4754 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4756 `(modify-phases ,phases
4757 (add-after 'strip 'remove-store-references
4758 (lambda* (#:key outputs #:allow-other-keys)
4759 (let* ((out (assoc-ref outputs "out")))
4760 (with-directory-excursion out
4761 (remove-store-references "bin/proot")
4763 ((#:allowed-references _ '("out"))
4766 (define-public cpuid
4769 (version "20180519")
4772 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4773 version ".src.tar.gz"))
4776 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
4777 (build-system gnu-build-system)
4779 '(#:make-flags '("CC=gcc")
4780 #:tests? #f ; no tests
4781 #:phases (modify-phases %standard-phases
4782 (delete 'configure) ; no configure script
4783 (add-before 'install 'fix-makefile
4784 (lambda* (#:key outputs #:allow-other-keys)
4785 (substitute* "Makefile"
4786 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4787 ;; Make the compressed manpages writable so that the
4788 ;; reset-gzip-timestamps phase does not error out.
4789 (substitute* "Makefile"
4790 (("-m 444") "-m 644"))
4792 (inputs `(("perl" ,perl)))
4793 (supported-systems '("i686-linux" "x86_64-linux"))
4794 (home-page "http://www.etallen.com/cpuid.html")
4795 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4796 (description "cpuid dumps detailed information about the CPU(s) gathered
4797 from the CPUID instruction, and also determines the exact model of CPU(s). It
4798 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4799 NexGen, Rise, and SiS CPUs.")
4800 (license license:gpl2+)))
4802 (define-public jmtpfs
4809 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4811 (file-name (string-append name "-" version ".tar.gz"))
4814 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4815 (build-system gnu-build-system)
4819 ("libmtp" ,libmtp)))
4821 `(("pkg-config" ,pkg-config)))
4822 (home-page "https://github.com/JasonFerrara/jmtpfs")
4823 (synopsis "Use a FUSE file system to access data over MTP")
4824 (description "jmtpfs uses FUSE (file system in userspace) to provide access
4825 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4826 the MTP device as a file system.")
4827 (license license:gpl3)))
4829 (define-public procenv
4836 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4838 (file-name (string-append name "-" version ".tar.gz"))
4840 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
4841 (build-system gnu-build-system)
4842 (arguments `(#:configure-flags '("--disable-silent-rules")))
4843 (native-inputs `(("pkg-config" ,pkg-config)))
4844 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4845 ("groff" ,groff) ; for tests
4846 ("libselinux" ,libselinux)))
4847 (synopsis "Utility to show process environment")
4848 (description "Procenv is a command-line tool that displays as much detail about
4849 itself and its environment as possible. It can be used as a test
4850 tool, to understand the type of environment a process runs in, and for
4851 comparing system environments.")
4852 (home-page "http://github.com/jamesodhunt/procenv/")
4853 (license license:gpl3+)))
4855 (define-public libfabric
4863 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4864 version "/libfabric-" version ".tar.bz2"))
4866 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4867 (build-system gnu-build-system)
4868 (inputs `(("rdma-core" ,rdma-core)
4869 ,@(match (%current-system)
4870 ((member (package-supported-systems psm))
4874 (home-page "https://ofiwg.github.io/libfabric/")
4875 (synopsis "Open Fabric Interfaces")
4877 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4878 communication services to applications. OFI is best described as a collection
4879 of libraries and applications used to export fabric services. The key
4880 components of OFI are: application interfaces, provider libraries, kernel
4881 services, daemons, and test applications.
4883 Libfabric is a core component of OFI. It is the library that defines and
4884 exports the user-space API of OFI, and is typically the only software that
4885 applications deal with directly. It works in conjunction with provider
4886 libraries, which are often integrated directly into libfabric.")
4887 (license (list license:bsd-2 license:gpl2)))) ;dual
4892 (version "3.3.20170428")
4893 (home-page "https://github.com/intel/psm")
4897 (uri (git-reference (url home-page)
4898 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
4899 (file-name (string-append "psm-" version ".tar.gz"))
4901 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
4902 (patches (search-patches
4903 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
4904 "psm-ldflags.patch" ; build shared lib with LDFLAGS
4905 "psm-repro.patch")))) ; reproducibility
4906 (build-system gnu-build-system)
4907 (inputs `(("libuuid" ,util-linux)))
4909 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
4910 ,(string-append "INSTALL_PREFIX=" %output)
4911 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4913 #:phases (modify-phases %standard-phases
4915 (add-after 'unpack 'patch-/usr/include
4917 (substitute* "Makefile"
4918 (("\\$\\{DESTDIR}/usr/include")
4919 (string-append %output "/include")))
4920 (substitute* "Makefile"
4921 (("/lib64") "/lib"))
4923 (add-after 'unpack 'patch-sysmacros
4925 (substitute* "ipath/ipath_proto.c"
4926 (("#include <sys/poll.h>" m)
4927 (string-append m "\n"
4928 "#include <sys/sysmacros.h>")))
4930 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
4932 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
4933 communications interface for the True Scale family of products. PSM users are
4934 enabled with mechanisms necessary to implement higher level communications
4935 interfaces in parallel environments.")
4936 ;; Only Intel-compatable processors are supported.
4937 (supported-systems '("i686-linux" "x86_64-linux"))
4938 (license (list license:bsd-2 license:gpl2)))) ;dual
4940 (define-public snapscreenshot
4942 (name "snapscreenshot")
4943 (version "1.0.14.3")
4947 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
4948 name "-" version ".tar.bz2"))
4950 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
4951 (build-system gnu-build-system)
4954 (let ((out (assoc-ref %outputs "out")))
4955 (list (string-append "BINDIR=" out "/bin")
4956 (string-append "MANDIR=" out "/share/man")))
4957 #:tests? #f ; no test suite
4959 (modify-phases %standard-phases
4960 (delete 'configure) ; ./configure is a snarky no-op
4961 (add-before 'install 'fix-ownership
4962 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
4964 (substitute* "depfun.mak"
4965 ((" -o bin -g bin ") " "))
4967 (add-before 'install 'create-output-directories
4968 (lambda* (#:key outputs #:allow-other-keys)
4969 (let ((out (assoc-ref outputs "out")))
4970 (mkdir-p (string-append out "/share/man/man1"))
4972 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
4973 (synopsis "Take screenshots of one or more Linux text consoles")
4975 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
4976 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
4977 relevant @file{/dev/vcs*} file(s).")
4978 (license license:gpl2)))
4980 (define-public fbcat
4987 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
4988 version "/" name "-" version ".tar.gz"))
4990 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
4991 (build-system gnu-build-system)
4993 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
4994 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
4995 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
4996 `(("pnmtopng" ,netpbm)))
4997 (outputs (list "out" "fbgrab"))
5001 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5002 #:tests? #f ; no tests
5004 (modify-phases %standard-phases
5005 (delete 'configure) ; no configure script
5006 (add-after 'build 'qualify-references
5007 (lambda* (#:key inputs outputs #:allow-other-keys)
5008 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5009 (out (assoc-ref outputs "out")))
5010 (substitute* "fbgrab"
5012 (string-append out "/bin/" all))
5014 (string-append pnmtopng "/bin/" all)))
5016 (add-after 'install 'split-fbgrab-output
5017 (lambda* (#:key outputs #:allow-other-keys)
5018 (let* ((out (assoc-ref outputs "out"))
5019 (out:fbgrab (assoc-ref outputs "fbgrab")))
5020 (for-each (lambda (file)
5021 (let ((old (string-append out "/" file))
5022 (new (string-append out:fbgrab "/" file)))
5023 (mkdir-p (dirname new))
5024 (rename-file old new)))
5026 "share/man/man1/fbgrab.1"))
5028 (home-page "https://jwilk.net/software/fbcat")
5029 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5031 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5032 a dump therof. It supports a wide range of drivers and pixel formats.
5033 @command{fbcat} can take screenshots of virtually any application that can be
5034 made to write its output to the framebuffer, including (but not limited to)
5035 text-mode or graphical applications that don't use a display server.
5037 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5038 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5039 (license license:gpl2)))
5041 (define-public libcgroup
5049 "mirror://sourceforge/libcg/" name "/"
5050 version "/" name "-" version ".tar.bz2"))
5052 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5053 (build-system gnu-build-system)
5060 `(("linux-pam" ,linux-pam)))
5061 (home-page "https://sourceforge.net/projects/libcg/")
5062 (synopsis "Control groups management tools")
5063 (description "Control groups is Linux kernel method for process resource
5064 restriction, permission handling and more. This package provides userspace
5065 interface to this kernel feature.")
5066 (license license:lgpl2.1)))
5068 (define-public mbpfan
5076 (url "https://github.com/dgraziotin/mbpfan.git")
5077 (commit (string-append "v" version))))
5078 (file-name (git-file-name name version))
5080 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5081 (build-system gnu-build-system)
5083 '(#:tests? #f ; tests ask to be run as root
5084 #:make-flags (let ((out (assoc-ref %outputs "out")))
5085 (list (string-append "DESTDIR=" out)
5088 (modify-phases %standard-phases
5089 (add-after 'unpack 'patch-paths
5091 (substitute* "Makefile"
5094 (delete 'configure)))) ; there's no configure phase
5095 (home-page "https://github.com/dgraziotin/mbpfan")
5096 (synopsis "Control fan speed on Macbooks")
5098 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5099 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5100 module. It can be executed as a daemon or in the foreground with root
5102 (license license:gpl3+)))
5111 (url "https://github.com/intel/opa-psm2.git")
5112 (commit (string-append "PSM2_" version))))
5113 (file-name (git-file-name name version))
5116 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
5117 (build-system gnu-build-system)
5120 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5122 #:phases (modify-phases %standard-phases
5124 (add-after 'unpack 'patch-Makefiles
5126 (substitute* "Makefile"
5129 (substitute* "compat/Makefile"
5135 (setenv "DESTDIR" %output)
5136 (invoke "make" "install")
5139 `(("rdma-core" ,rdma-core)
5140 ("numactl" ,numactl)))
5141 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5143 "This package is low-level user-level Intel's communications interface.
5144 The PSM2 API is a high-performance vendor-specific protocol that provides a
5145 low-level communications interface for the Intel Omni-Path family of
5146 high-speed networking devices.")
5147 (home-page "https://github.com/intel/opa-psm2")
5148 ;; Only the x86_64 architecure is supported.
5149 (supported-systems '("x86_64-linux"))
5150 (license (list license:bsd-3 license:gpl2)))) ; dual
5152 (define-public libpfm4
5158 (uri (string-append "mirror://sourceforge/perfmon2/"
5159 name "/libpfm-" version ".tar.gz"))
5162 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5163 (build-system gnu-build-system)
5165 '(#:modules ((guix build utils)
5166 (guix build gnu-build-system))
5167 #:phases (modify-phases %standard-phases
5171 (lambda* (#:key inputs outputs #:allow-other-keys)
5172 (let* ((out (assoc-ref outputs "out")))
5177 (lambda* (#:key outputs #:allow-other-keys)
5178 (let* ((out (assoc-ref outputs "out")))
5180 (string-append "PREFIX=" out)
5183 (synopsis "Performance event monitoring library")
5185 "This package provides a library called libpfm4, which is used to develop
5186 monitoring tools exploiting the performance monitoring events such as those
5187 provided by the Performance Monitoring Unit (PMU) of modern processors.
5189 Libpfm4 helps convert from an event name, expressed as a string, to the event
5190 encoding that is either the raw event as documented by the hardware vendor or
5191 the OS-specific encoding. In the latter case, the library is able to prepare
5192 the OS-specific data structures needed by the kernel to setup the event.
5194 libpfm4 provides support for the @code{perf_events} interface, which was
5195 introduced in Linux 2.6.31.")
5196 (home-page "http://perfmon2.sourceforge.net/")
5197 (license license:expat)))
5199 (define-public libnfnetlink
5201 (name "libnfnetlink")
5206 "https://www.netfilter.org/projects/libnfnetlink/files/"
5207 "libnfnetlink-" version ".tar.bz2"))
5210 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5211 (build-system gnu-build-system)
5212 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5213 (synopsis "Low-level netfilter netlink communication library")
5215 "@code{libnfnetlink} is the low-level library for netfilter related
5216 kernel/userspace communication. It provides a generic messaging
5217 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5218 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5219 management tools in userspace.")
5220 (license license:gpl2)))
5222 (define-public go-netlink
5229 (url "https://github.com/vishvananda/netlink.git")
5230 (commit (string-append "v" version))))
5231 (file-name (git-file-name name version))
5234 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5235 (build-system go-build-system)
5237 `(#:import-path "github.com/vishvananda/netlink"))
5239 `(("go-golang-org-x-sys-unix" ,go-golang-org-x-sys-unix)
5240 ("go-netns" ,go-netns)))
5241 (home-page "https://github.com/vishvananda/netlink")
5242 (synopsis "Simple netlink library for Go")
5243 (description "The netlink package provides a simple netlink library for
5244 Go. Netlink is the interface a user-space program in Linux uses to
5245 communicate with the kernel. It can be used to add and remove interfaces, set
5246 IP addresses and routes, and configure IPsec.")
5247 (license license:asl2.0)))
5249 (define-public xfsprogs
5256 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5257 "xfsprogs-" version ".tar.gz"))
5260 "0ss0r6jlxxinf9fhpc0fgf7b89n9mzirpa85xxjmi1ix9l6cls6x"))))
5261 (build-system gnu-build-system)
5263 `(#:tests? #f ;kernel/user integration tests are in package "xfstests"
5264 #:phases (modify-phases %standard-phases
5265 (add-after 'install 'install-headers
5267 (invoke "make" "install-dev"))))))
5269 `(("gettext" ,gettext-minimal)
5270 ("util-linux" ,util-linux)))
5271 (home-page "https://xfs.wiki.kernel.org/")
5272 (synopsis "XFS file system tools")
5273 (description "This package provides commands to create and check XFS
5275 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5276 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5277 (license (list license:gpl2 license:lgpl2.1))))
5279 (define-public genext2fs
5286 (url "https://github.com/jeremie-koenig/genext2fs.git")
5287 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5288 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
5289 (file-name (git-file-name name version))
5291 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
5292 (build-system gnu-build-system)
5295 (modify-phases %standard-phases
5296 (add-after 'unpack 'apply-debian-patches
5297 ;; Debian changes (the revision after ‘-’ in VERSION) are
5298 ;; maintained as separate patches. Apply those relevant to us.
5302 (invoke "patch" "-p1" "-i"
5303 (string-append "debian/patches/" file-name)))
5304 (list "blocksize+creator.diff" ; add -B/-o options
5305 "byteswap_fix.diff"))
5308 `(("autoconf" ,autoconf)
5309 ("automake" ,automake)))
5310 (home-page "https://github.com/jeremie-koenig/genext2fs")
5311 (synopsis "Generate ext2 file system as a normal user")
5312 (description "This package provides a program to generate an ext2
5313 file system as a normal (non-root) user. It does not require you to mount
5314 the image file to copy files on it, nor does it require that you become
5315 the superuser to make device nodes.")
5316 (license license:gpl2)))
5318 (define-public fakeroot
5324 (uri (string-append "http://ftp.debian.org/debian/pool/main/f/"
5325 "fakeroot/fakeroot_" version ".orig.tar.xz"))
5326 (file-name (string-append name "-" version ".tar.gz"))
5329 "1xpl0s2yjyjwlf832b6kbkaa5921liybaar13k7n45ckd9lxd700"))))
5330 (build-system gnu-build-system)
5333 (modify-phases %standard-phases
5334 (add-after 'configure 'patch-Makefile
5336 ;; Note: The root of the problem is already in "Makefile.am".
5337 (substitute* "Makefile"
5338 (("/bin/sh") (which "sh")))
5340 (add-after 'unpack 'patch-getopt
5341 (lambda* (#:key inputs #:allow-other-keys)
5342 (substitute* "scripts/fakeroot.in"
5344 (string-append (assoc-ref inputs "util-linux")
5347 (add-before 'configure 'setenv
5349 (setenv "LIBS" "-lacl")
5351 (add-before 'check 'prepare-check
5353 (setenv "SHELL" (which "bash"))
5354 (setenv "VERBOSE" "1")
5355 (substitute* "test/t.touchinstall"
5356 ;; We don't have the name of the root user, so use ID=0.
5357 (("grep root") "grep \"\\<0\\>\""))
5358 (substitute* "test/tartest"
5359 ;; We don't have the name of the root group, so use ID=0.
5360 (("ROOTGROUP=root") "ROOTGROUP=0")
5361 ;; We don't have the name of the daemon user, so use IDs.
5362 (("daemon:sys") "1:3")
5364 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
5365 (substitute* "test/compare-tar"
5366 (("tar -tvf") "tar --numeric-owner -tvf"))
5370 ("sharutils" ,sharutils) ; for the tests
5371 ("xz" ,xz))) ; for the tests
5373 `(("libcap" ,libcap)
5374 ("util-linux" ,util-linux)))
5375 (synopsis "Provides a fake root environment")
5376 (description "@command{fakeroot} runs a command in an environment where
5377 it appears to have root privileges for file manipulation. This is useful
5378 for allowing users to create archives (tar, ar, .deb etc.) with files in
5379 them with root permissions/ownership. Without fakeroot one would have to
5380 have root privileges to create the constituent files of the archives with
5381 the correct permissions and ownership, and then pack them up, or one would
5382 have to construct the archives directly, without using the archiver.")
5383 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
5384 (license license:gpl3+)))
5386 (define-public inputattach
5388 (name "inputattach")
5393 (url "https://github.com/linuxwacom/input-wacom.git")
5394 (commit (string-append "input-wacom-" version))))
5395 (file-name (git-file-name name version))
5397 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
5398 (build-system gnu-build-system)
5401 (modify-phases %standard-phases
5405 (lambda* (#:key inputs #:allow-other-keys)
5406 (with-directory-excursion "inputattach"
5407 (invoke (string-append (assoc-ref inputs "gcc")
5409 "-O2" "-o" "inputattach" "inputattach.c"))
5413 (lambda* (#:key outputs #:allow-other-keys)
5414 (let ((target-dir (string-append
5415 (assoc-ref outputs "out")
5417 (mkdir-p target-dir)
5418 (copy-file "inputattach/inputattach"
5419 (string-append target-dir
5422 (home-page "https://linuxwacom.github.io/")
5423 (synopsis "Dispatch input peripherals events to a device file")
5424 (description "inputattach dispatches input events from several device
5425 types and interfaces and translates so that the X server can use them.")
5426 (license license:gpl2+)))