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>
37 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
38 ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com>
40 ;;; This file is part of GNU Guix.
42 ;;; GNU Guix is free software; you can redistribute it and/or modify it
43 ;;; under the terms of the GNU General Public License as published by
44 ;;; the Free Software Foundation; either version 3 of the License, or (at
45 ;;; your option) any later version.
47 ;;; GNU Guix is distributed in the hope that it will be useful, but
48 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
49 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50 ;;; GNU General Public License for more details.
52 ;;; You should have received a copy of the GNU General Public License
53 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
55 (define-module (gnu packages linux)
56 #:use-module (gnu packages)
57 #:use-module (gnu packages acl)
58 #:use-module (gnu packages admin)
59 #:use-module (gnu packages algebra)
60 #:use-module (gnu packages attr)
61 #:use-module (gnu packages audio)
62 #:use-module (gnu packages autotools)
63 #:use-module (gnu packages backup)
64 #:use-module (gnu packages base)
65 #:use-module (gnu packages bash)
66 #:use-module (gnu packages bison)
67 #:use-module (gnu packages calendar)
68 #:use-module (gnu packages check)
69 #:use-module (gnu packages crypto)
70 #:use-module (gnu packages cryptsetup)
71 #:use-module (gnu packages compression)
72 #:use-module (gnu packages dbm)
73 #:use-module (gnu packages datastructures)
74 #:use-module (gnu packages docbook)
75 #:use-module (gnu packages documentation)
76 #:use-module (gnu packages elf)
77 #:use-module (gnu packages flex)
78 #:use-module (gnu packages file)
79 #:use-module (gnu packages freedesktop)
80 #:use-module (gnu packages gcc)
81 #:use-module (gnu packages gettext)
82 #:use-module (gnu packages glib)
83 #:use-module (gnu packages golang)
84 #:use-module (gnu packages gperf)
85 #:use-module (gnu packages gtk)
86 #:use-module (gnu packages libunwind)
87 #:use-module (gnu packages libusb)
88 #:use-module (gnu packages man)
89 #:use-module (gnu packages maths)
90 #:use-module (gnu packages multiprecision)
91 #:use-module (gnu packages ncurses)
92 #:use-module (gnu packages netpbm)
93 #:use-module (gnu packages nettle)
94 #:use-module (gnu packages networking)
95 #:use-module (gnu packages ninja)
96 #:use-module (gnu packages nss)
97 #:use-module (gnu packages perl)
98 #:use-module (gnu packages pciutils)
99 #:use-module (gnu packages pkg-config)
100 #:use-module (gnu packages popt)
101 #:use-module (gnu packages pulseaudio)
102 #:use-module (gnu packages python)
103 #:use-module (gnu packages readline)
104 #:use-module (gnu packages rrdtool)
105 #:use-module (gnu packages samba)
106 #:use-module (gnu packages serialization)
107 #:use-module (gnu packages slang)
108 #:use-module (gnu packages texinfo)
109 #:use-module (gnu packages tls)
110 #:use-module (gnu packages valgrind)
111 #:use-module (gnu packages video)
112 #:use-module (gnu packages web)
113 #:use-module (gnu packages xiph)
114 #:use-module (gnu packages xml)
115 #:use-module (gnu packages xdisorg)
116 #:use-module (gnu packages xorg)
117 #:use-module (gnu packages groff)
118 #:use-module (gnu packages selinux)
119 #:use-module (gnu packages swig)
120 #:use-module (guix build-system cmake)
121 #:use-module (guix build-system gnu)
122 #:use-module (guix build-system go)
123 #:use-module (guix build-system python)
124 #:use-module (guix build-system trivial)
125 #:use-module (guix build-system linux-module)
126 #:use-module (guix download)
127 #:use-module (guix git-download)
128 #:use-module ((guix licenses) #:prefix license:)
129 #:use-module (guix packages)
130 #:use-module (guix gexp)
131 #:use-module (guix store)
132 #:use-module (guix monads)
133 #:use-module (guix utils)
134 #:use-module (srfi srfi-1)
135 #:use-module (srfi srfi-2)
136 #:use-module (srfi srfi-26)
137 #:use-module (ice-9 match))
139 (define-public (system->linux-architecture arch)
140 "Return the Linux architecture name for ARCH, a Guix system name such as
141 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
142 (let ((arch (car (string-split arch #\-))))
143 (cond ((string=? arch "i686") "i386")
144 ((string-prefix? "mips" arch) "mips")
145 ((string-prefix? "arm" arch) "arm")
146 ((string-prefix? "aarch64" arch) "arm64")
147 ((string-prefix? "alpha" arch) "alpha")
148 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
149 ((string-prefix? "s390" arch) "s390")
150 ((string-prefix? "riscv" arch) "riscv")
153 (define-public (system->defconfig system)
154 "Some systems (notably powerpc-linux) require a special target for kernel
155 defconfig. Return the appropriate make target if applicable, otherwise return
157 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
158 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
163 ;;; Kernel source code deblobbing.
166 (define (linux-libre-deblob-scripts version
169 (list (version-major+minor version)
172 (uri (string-append "https://linux-libre.fsfla.org"
173 "/pub/linux-libre/releases/" version "-gnu/"
174 "deblob-" (version-major+minor version)))
175 (sha256 deblob-hash))
178 (uri (string-append "https://linux-libre.fsfla.org"
179 "/pub/linux-libre/releases/" version "-gnu/"
181 (sha256 deblob-check-hash))))
183 (define deblob-scripts-5.2
184 (linux-libre-deblob-scripts
186 (base32 "076fwxlm6jq6z4vg1xq3kr474zz7qk71r90sf9dnfia3rw2pb4fa")
187 (base32 "0d3pp1bqchqc7vnxr1a56km5r0hzjiiipzz2xc3wgjwfi51k9kxc")))
189 (define deblob-scripts-4.19
190 (linux-libre-deblob-scripts
192 (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy")
193 (base32 "1fyacg28aym6virxyn7wk99qil2fjbks3iwm7p3hxy51pccn34za")))
195 (define deblob-scripts-4.14
196 (linux-libre-deblob-scripts
198 (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6")
199 (base32 "0x9nd3hnyrm753cbgdqmy92mbnyw86w64g4hvyibnkpq5n7s3z9n")))
201 (define deblob-scripts-4.9
202 (linux-libre-deblob-scripts
204 (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg")
205 (base32 "1gmjn5cwxydg6qb47wcmahwkv37npsjx4papynzkkdxyidmrccya")))
207 (define deblob-scripts-4.4
208 (linux-libre-deblob-scripts
210 (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw")
211 (base32 "1x40lbiaizksy8z38ax7wpqr9ldgq7qvkxbb0ca98vd1axpklb10")))
213 (define* (computed-origin-method gexp-promise hash-algo hash
214 #:optional (name "source")
215 #:key (system (%current-system))
216 (guile (default-guile)))
217 "Return a derivation that executes the G-expression that results
218 from forcing GEXP-PROMISE."
219 (mlet %store-monad ((guile (package->derivation guile system)))
220 (gexp->derivation (or name "computed-origin")
222 #:graft? #f ;nothing to graft
224 #:guile-for-build guile)))
226 (define (make-linux-libre-source version
229 "Return a 'computed' origin that generates a Linux-libre tarball from the
230 corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS."
231 (match deblob-scripts
232 ((deblob-version (? origin? deblob) (? origin? deblob-check))
233 (unless (string=? deblob-version (version-major+minor version))
234 ;; The deblob script cannot be expected to work properly on a
235 ;; different version (major+minor) of Linux, even if no errors
236 ;; are signaled during execution.
237 (error "deblob major+minor version mismatch"))
239 (method computed-origin-method)
240 (file-name (string-append "linux-libre-" version "-guix.tar.xz"))
244 (with-imported-modules '((guix build utils))
246 (use-modules (guix build utils)
250 (let ((dir (string-append "linux-" #$version)))
253 (set-path-environment-variable
256 #+(canonical-package bash)
257 #+(canonical-package coreutils)
258 #+(canonical-package diffutils)
259 #+(canonical-package findutils)
260 #+(canonical-package patch)
261 #+(canonical-package xz)
262 #+(canonical-package sed)
263 #+(canonical-package grep)
264 #+(canonical-package bzip2)
265 #+(canonical-package gzip)
266 #+(canonical-package tar)
267 ;; The comments in the 'deblob-check' script
268 ;; claim that it supports Python 2 and 3, but
269 ;; in fact it fails when run in Python 3 as
273 (with-directory-excursion "/tmp/bin"
275 (copy-file #+deblob "deblob")
276 (chmod "deblob" #o755)
277 (substitute* "deblob"
278 (("/bin/sh") (which "sh")))
280 (copy-file #+deblob-check "deblob-check")
281 (chmod "deblob-check" #o755)
282 (substitute* "deblob-check"
283 (("/bin/sh") (which "sh"))
284 (("/bin/sed") (which "sed"))
285 (("/usr/bin/python") (which "python"))))
287 (if (file-is-directory? #+upstream-source)
289 (format #t "Copying upstream linux source...~%")
291 (invoke "cp" "--archive" #+upstream-source dir)
292 (invoke "chmod" "--recursive" "u+w" dir))
294 (format #t "Unpacking upstream linux tarball...~%")
296 (invoke "tar" "xf" #$upstream-source)
299 (and (not (member name '("." "..")))
300 (file-is-directory? name))))
302 (unless (string=? dir unpacked-dir)
303 (rename-file unpacked-dir dir)))
305 (error "multiple directories found" dirs)))))
307 (with-directory-excursion dir
308 (setenv "PYTHON" (which "python"))
309 (format #t "Running deblob script...~%")
311 (invoke "/tmp/bin/deblob"))
313 (format #t "~%Packing new Linux-libre tarball...~%")
315 (invoke "tar" "cvfa" #$output
316 ;; Avoid non-determinism in the archive.
329 (define (linux-libre-urls version)
330 "Return a list of URLs for Linux-Libre VERSION."
332 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
333 version "-gnu/linux-libre-" version "-gnu.tar.xz")
335 ;; XXX: Work around <http://bugs.gnu.org/14851>.
337 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
338 version "-gnu.tar.xz")
340 ;; Maybe this URL will become valid eventually.
342 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
343 version "-gnu.tar.xz")))
345 (define (%upstream-linux-source version hash)
348 (uri (string-append "mirror://kernel.org"
349 "/linux/kernel/v" (version-major version) ".x/"
350 "linux-" version ".tar.xz"))
353 (define-public linux-libre-5.2-version "5.2.2")
354 (define-public linux-libre-5.2-pristine-source
355 (let ((version linux-libre-5.2-version)
356 (hash (base32 "173da67d51qcjwrczqsfd6g9phzazqzr11xfxwlf54ckd6117ng5")))
357 (make-linux-libre-source version
358 (%upstream-linux-source version hash)
359 deblob-scripts-5.2)))
361 (define-public linux-libre-4.19-version "4.19.60")
362 (define-public linux-libre-4.19-pristine-source
363 (let ((version linux-libre-4.19-version)
364 (hash (base32 "0ibayrvrnw2lw7si78vdqnr20mm1d3z0g6a0ykndvgn5vdax5x9a")))
365 (make-linux-libre-source version
366 (%upstream-linux-source version hash)
367 deblob-scripts-4.19)))
369 (define-public linux-libre-4.14-version "4.14.134")
370 (define-public linux-libre-4.14-pristine-source
371 (let ((version linux-libre-4.14-version)
372 (hash (base32 "0b9xj1rwr5fpw2giirfghzxxc0wp1hwf4nqvalx314pxxysyf88b")))
373 (make-linux-libre-source version
374 (%upstream-linux-source version hash)
375 deblob-scripts-4.14)))
377 (define-public linux-libre-4.9-version "4.9.186")
378 (define-public linux-libre-4.9-pristine-source
379 (let ((version linux-libre-4.9-version)
380 (hash (base32 "0sjbp7m6d625rw06wv34a0805d1lgldii4pxiqfpja871m1q8914")))
381 (make-linux-libre-source version
382 (%upstream-linux-source version hash)
383 deblob-scripts-4.9)))
385 (define-public linux-libre-4.4-version "4.4.186")
386 (define-public linux-libre-4.4-pristine-source
387 (let ((version linux-libre-4.4-version)
388 (hash (base32 "113rjf8842glzi23y1g1yrwncihv2saah6wz0r726r06bk9p64hb")))
389 (make-linux-libre-source version
390 (%upstream-linux-source version hash)
391 deblob-scripts-4.4)))
393 (define %boot-logo-patch
394 ;; Linux-Libre boot logo featuring Freedo and a gnu.
397 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
398 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
401 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
403 (define %linux-libre-arm-export-__sync_icache_dcache-patch
407 "https://salsa.debian.org/kernel-team/linux"
408 "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0"
409 "/debian/patches/bugfix/arm/"
410 "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch"))
411 (file-name "linux-libre-arm-export-__sync_icache_dcache.patch")
413 (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f"))))
415 (define (source-with-patches source patches)
418 (patches (append (origin-patches source)
421 (define-public linux-libre-5.2-source
422 (source-with-patches linux-libre-5.2-pristine-source
423 (list %boot-logo-patch
424 %linux-libre-arm-export-__sync_icache_dcache-patch)))
426 (define-public linux-libre-4.19-source
427 (source-with-patches linux-libre-4.19-pristine-source
428 (list %boot-logo-patch
429 %linux-libre-arm-export-__sync_icache_dcache-patch)))
431 (define-public linux-libre-4.14-source
432 (source-with-patches linux-libre-4.14-pristine-source
433 (list %boot-logo-patch)))
435 (define-public linux-libre-4.9-source
436 (source-with-patches linux-libre-4.9-pristine-source
437 (list %boot-logo-patch)))
439 (define-public linux-libre-4.4-source
440 (source-with-patches linux-libre-4.4-pristine-source
441 (list %boot-logo-patch)))
448 (define (make-linux-libre-headers version hash-string)
449 (make-linux-libre-headers* version
452 (uri (linux-libre-urls version))
453 (sha256 (base32 hash-string)))))
455 (define (make-linux-libre-headers* version source)
457 (name "linux-libre-headers")
460 (build-system gnu-build-system)
461 (native-inputs `(("perl" ,perl)
462 ,@(if (version>=? version "4.16")
467 `(#:modules ((guix build gnu-build-system)
471 (modify-phases %standard-phases
475 (let ((arch ,(system->linux-architecture
476 (or (%current-target-system)
478 (defconfig ,(system->defconfig
479 (or (%current-target-system)
480 (%current-system)))))
482 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
483 (invoke "make" defconfig)
484 (invoke "make" "mrproper" "headers_check"))))
486 (lambda* (#:key outputs #:allow-other-keys)
487 (let ((out (assoc-ref outputs "out")))
489 (string-append "INSTALL_HDR_PATH=" out)
492 (mkdir (string-append out "/include/config"))
493 (call-with-output-file
495 "/include/config/kernel.release")
497 (format p "~a-default~%" ,version)))
499 ;; Remove the '.install' and '..install.cmd' files; the
500 ;; latter contains store paths, which pulls in bootstrap
501 ;; binaries in the build environment, and prevents bit
502 ;; reproducibility for the bootstrap binaries.
503 (for-each delete-file (find-files out "\\.install"))
506 #:allowed-references ()
508 (home-page "https://www.gnu.org/software/linux-libre/")
509 (synopsis "GNU Linux-Libre kernel headers")
510 (description "Headers of the Linux-Libre kernel.")
511 (license license:gpl2)))
513 (define-public linux-libre-headers-5.2
514 (make-linux-libre-headers* linux-libre-5.2-version
515 linux-libre-5.2-source))
517 (define-public linux-libre-headers-4.19
518 (make-linux-libre-headers* linux-libre-4.19-version
519 linux-libre-4.19-source))
521 (define-public linux-libre-headers-4.14
522 (make-linux-libre-headers* linux-libre-4.14-version
523 linux-libre-4.14-source))
525 (define-public linux-libre-headers-4.9
526 (make-linux-libre-headers* linux-libre-4.9-version
527 linux-libre-4.9-source))
529 (define-public linux-libre-headers-4.4
530 (make-linux-libre-headers* linux-libre-4.4-version
531 linux-libre-4.4-source))
533 ;; The following package is used in the early bootstrap, and thus must be kept
534 ;; stable and with minimal build requirements.
535 (define-public linux-libre-headers-4.14.67
536 (make-linux-libre-headers "4.14.67"
537 "050zvdxjy6sc64q75pr1gxsmh49chwav2pwxz8xlif39bvahnrpg"))
539 (define-public linux-libre-headers linux-libre-headers-4.14.67)
543 ;;; Kernel configurations.
546 (define* (kernel-config arch #:key variant)
547 "Return the absolute file name of the Linux-Libre build configuration file
548 for ARCH and optionally VARIANT, or #f if there is no such configuration."
549 (let* ((name (string-append (if variant (string-append variant "-") "")
550 (if (string=? "i386" arch) "i686" arch) ".conf"))
551 (file (string-append "linux-libre/" name)))
552 (search-auxiliary-file file)))
554 ;; FIXME: merge into kernel-config
555 (define* (kernel-config-veyron arch #:key variant)
556 "Return the absolute file name of the Linux-Libre build configuration file
557 for ARCH and optionally VARIANT, or #f if there is no such configuration."
558 (let* ((name (string-append (if variant (string-append variant "-") "")
559 (if (string=? "i386" arch) "i686" arch) "-veyron.conf"))
560 (file (string-append "linux-libre/" name)))
561 (search-auxiliary-file file)))
563 (define %default-extra-linux-options
564 `(;; Some very mild hardening.
565 ("CONFIG_SECURITY_DMESG_RESTRICT" . #t)
566 ;; Modules required for initrd:
567 ("CONFIG_NET_9P" . m)
568 ("CONFIG_NET_9P_VIRTIO" . m)
569 ("CONFIG_VIRTIO_BLK" . m)
570 ("CONFIG_VIRTIO_NET" . m)
571 ("CONFIG_VIRTIO_PCI" . m)
572 ("CONFIG_VIRTIO_BALLOON" . m)
573 ("CONFIG_VIRTIO_MMIO" . m)
574 ("CONFIG_FUSE_FS" . m)
576 ("CONFIG_9P_FS" . m)))
578 (define (config->string options)
579 (string-join (map (match-lambda
581 (string-append option "=m"))
583 (string-append option "=y"))
585 (string-append option "=n")))
591 ;;; Kernel package utilities.
594 (define* (make-linux-libre version hash-string supported-systems
596 ;; A function that takes an arch and a variant.
597 ;; See kernel-config for an example.
599 (configuration-file #f)
600 (defconfig "defconfig")
601 (extra-options %default-extra-linux-options)
602 (patches (list %boot-logo-patch)))
603 (make-linux-libre* version
606 (uri (linux-libre-urls version))
607 (sha256 (base32 hash-string))
610 #:extra-version extra-version
611 #:configuration-file configuration-file
612 #:defconfig defconfig
613 #:extra-options extra-options))
615 (define* (make-linux-libre* version source supported-systems
617 ;; A function that takes an arch and a variant.
618 ;; See kernel-config for an example.
620 (configuration-file #f)
621 (defconfig "defconfig")
622 (extra-options %default-extra-linux-options))
624 (name (if extra-version
625 (string-append "linux-libre-" extra-version)
629 (supported-systems supported-systems)
630 (build-system gnu-build-system)
636 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
640 ;; Build with GCC-7 for full retpoline support.
641 ;; FIXME: Remove this when our default compiler has retpoline support.
644 ;; These are needed to compile the GCC plugins.
649 ,@(match (and configuration-file
651 (system->linux-architecture
652 (or (%current-target-system) (%current-system)))
653 #:variant (version-major+minor version)))
654 (#f ;no config for this platform
657 `(("kconfig" ,config))))))
659 `(#:modules ((guix build gnu-build-system)
664 (modify-phases %standard-phases
665 (add-after 'unpack 'patch-/bin/pwd
667 (substitute* (find-files "." "^Makefile(\\.include)?$")
668 (("/bin/pwd") "pwd"))
671 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
672 ;; Avoid introducing timestamps
673 (setenv "KCONFIG_NOTIMESTAMP" "1")
674 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
676 ;; Set ARCH and CROSS_COMPILE
677 (let ((arch ,(system->linux-architecture
678 (or (%current-target-system)
679 (%current-system)))))
681 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
684 (setenv "CROSS_COMPILE" (string-append target "-"))
685 (format #t "`CROSS_COMPILE' set to `~a'~%"
686 (getenv "CROSS_COMPILE"))))
688 (setenv "EXTRA_VERSION" ,extra-version)
690 (let ((build (assoc-ref %standard-phases 'build))
691 (config (assoc-ref (or native-inputs inputs) "kconfig")))
693 ;; Use a custom kernel configuration file or a default
694 ;; configuration file.
697 (copy-file config ".config")
698 (chmod ".config" #o666))
699 (invoke "make" ,defconfig))
701 ;; Appending works even when the option wasn't in the
702 ;; file. The last one prevails if duplicated.
703 (let ((port (open-file ".config" "a"))
704 (extra-configuration ,(config->string extra-options)))
705 (display extra-configuration port)
708 (invoke "make" "oldconfig"))))
710 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
711 (let* ((out (assoc-ref outputs "out"))
712 (moddir (string-append out "/lib/modules"))
713 (dtbdir (string-append out "/lib/dtbs"))
714 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
715 ;; Install kernel image, kernel configuration and link map.
716 (for-each (lambda (file) (install-file file out))
717 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$"))
718 ;; Install device tree files
719 (unless (null? (find-files "." "\\.dtb$"))
721 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
723 ;; Install kernel modules
726 (string-append "DEPMOD=" kmod "/bin/depmod")
727 (string-append "MODULE_DIR=" moddir)
728 (string-append "INSTALL_PATH=" out)
729 (string-append "INSTALL_MOD_PATH=" out)
730 "INSTALL_MOD_STRIP=1"
731 "modules_install")))))
733 (home-page "https://www.gnu.org/software/linux-libre/")
734 (synopsis "100% free redistribution of a cleaned Linux kernel")
736 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
737 It has been modified to remove all non-free binary blobs.")
738 (license license:gpl2)))
742 ;;; Generic kernel packages.
745 (define-public linux-libre-5.2
746 (make-linux-libre* linux-libre-5.2-version
747 linux-libre-5.2-source
748 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
749 #:configuration-file kernel-config))
751 (define-public linux-libre-version linux-libre-5.2-version)
752 (define-public linux-libre-pristine-source linux-libre-5.2-pristine-source)
753 (define-public linux-libre-source linux-libre-5.2-source)
754 (define-public linux-libre linux-libre-5.2)
756 (define-public linux-libre-4.19
757 (make-linux-libre* linux-libre-4.19-version
758 linux-libre-4.19-source
759 '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux")
760 #:configuration-file kernel-config))
762 (define-public linux-libre-4.14
763 (make-linux-libre* linux-libre-4.14-version
764 linux-libre-4.14-source
765 '("x86_64-linux" "i686-linux" "armhf-linux")
766 #:configuration-file kernel-config))
768 (define-public linux-libre-4.9
769 (make-linux-libre* linux-libre-4.9-version
770 linux-libre-4.9-source
771 '("x86_64-linux" "i686-linux")
772 #:configuration-file kernel-config))
774 (define-public linux-libre-4.4
775 (make-linux-libre* linux-libre-4.4-version
776 linux-libre-4.4-source
777 '("x86_64-linux" "i686-linux")
778 #:configuration-file kernel-config
781 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
782 ;; This option was removed upstream in version 4.7.
783 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t))
784 %default-extra-linux-options)))
788 ;;; Specialized kernel variants.
791 (define-public linux-libre-arm-veyron
792 (make-linux-libre* linux-libre-version
795 #:configuration-file kernel-config-veyron
796 #:extra-version "arm-veyron"))
798 (define-public linux-libre-arm-generic
799 (make-linux-libre* linux-libre-version
802 #:defconfig "multi_v7_defconfig"
803 #:extra-version "arm-generic"))
805 (define-public linux-libre-arm-generic-4.19
806 (make-linux-libre* linux-libre-4.19-version
807 linux-libre-4.19-source
809 #:defconfig "multi_v7_defconfig"
810 #:extra-version "arm-generic"))
812 (define-public linux-libre-arm-generic-4.14
813 (make-linux-libre* linux-libre-4.14-version
814 linux-libre-4.14-source
816 #:defconfig "multi_v7_defconfig"
817 #:extra-version "arm-generic"))
819 (define-public linux-libre-arm-omap2plus
820 (make-linux-libre* linux-libre-version
823 #:defconfig "omap2plus_defconfig"
824 #:extra-version "arm-omap2plus"))
826 (define-public linux-libre-arm-omap2plus-4.19
827 (make-linux-libre* linux-libre-4.19-version
828 linux-libre-4.19-source
830 #:defconfig "omap2plus_defconfig"
831 #:extra-version "arm-omap2plus"))
833 (define-public linux-libre-arm-omap2plus-4.14
834 (make-linux-libre* linux-libre-4.14-version
835 linux-libre-4.14-source
837 #:defconfig "omap2plus_defconfig"
838 #:extra-version "arm-omap2plus"))
842 ;;; Linux kernel modules.
845 (define-public acpi-call-linux-module
847 (name "acpi-call-linux-module")
853 (url "https://github.com/teleshoes/acpi_call.git")
855 (file-name (git-file-name name version))
857 (base32 "04mbv4lasm3vv1j4ndxhnz4hvp5wg8f5fc9q6qxv0nhvwjynmsl3"))))
858 (build-system linux-module-build-system)
860 `(#:tests? #f ; no tests
862 (modify-phases %standard-phases
863 (add-after 'unpack 'fix-for-linux-4.12
865 (substitute* "acpi_call.c"
869 (add-after 'install 'install-documentation
870 (lambda* (#:key outputs #:allow-other-keys)
871 (let* ((out (assoc-ref outputs "out"))
872 (doc (string-append out "/share/doc/" ,name "-" ,version)))
873 (for-each (lambda (file)
874 (let ((target (string-append doc "/" file)))
875 (mkdir-p (dirname target))
876 (copy-recursively file target)))
877 (list "README.md" "examples"))
879 (home-page "https://github.com/teleshoes/acpi_call")
880 (synopsis "Linux kernel module to perform ACPI method calls")
882 "This simple Linux kernel module allows calls from user space to any
883 @acronym{ACPI, Advanced Configuration and Power Interface} method provided by
884 your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass
885 any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING},
886 and @code{ACPI_BUFFER}.
888 It grants direct and undocumented access to your hardware that may cause damage
889 and should be used with caution, especially on untested models.")
890 (license license:gpl3+))) ; see README.md (no licence headers)
892 (define-public vhba-module
899 "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-"
903 "1513hq130raxp9z5grj54cwfjfxj05apipxg425j0zicii59a60c"))))
904 (build-system linux-module-build-system)
908 (home-page "https://cdemu.sourceforge.io/")
909 (synopsis "Kernel module that emulates SCSI devices")
910 (description "VHBA module provides a Virtual (SCSI) HBA, which is the link
911 between the CDemu userspace daemon and linux kernel.")
912 (license license:gpl2+)))
916 ;;; Pluggable authentication modules (PAM).
919 (define-public linux-pam
927 "https://github.com/linux-pam/linux-pam/releases/download/v"
928 version "/Linux-PAM-" version ".tar.xz"))
931 "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g"))
932 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
934 (build-system gnu-build-system)
938 ;; TODO: optional dependencies
939 ;; ("libxcrypt" ,libxcrypt)
940 ;; ("cracklib" ,cracklib)
943 `(;; Most users, such as `shadow', expect the headers to be under
945 #:configure-flags (list (string-append "--includedir="
946 (assoc-ref %outputs "out")
949 ;; XXX: <rpc/rpc.h> is missing from glibc when
950 ;; cross-compiling, so we have to disable NIS
951 ;; support altogether.
952 ,@(if (%current-target-system)
956 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
959 (home-page "http://www.linux-pam.org/")
960 (synopsis "Pluggable authentication modules for Linux")
962 "A *Free* project to implement OSF's RFC 86.0.
963 Pluggable authentication modules are small shared object files that can
964 be used through the PAM API to perform tasks, like authenticating a user
965 at login. Local and dynamic reconfiguration are its key features.")
966 (license license:bsd-3)))
968 (define-public linux-pam-1.2
976 "http://www.linux-pam.org/library/"
977 "Linux-PAM-" version ".tar.bz2"))
980 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
981 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
988 (define-public psmisc
995 (uri (string-append "mirror://sourceforge/psmisc/psmisc devel/psmisc-"
999 "0s1kjhrik0wzqbm7hv4gkhywhjrwhp9ajw0ad05fwharikk6ah49"))))
1000 (build-system gnu-build-system)
1001 (inputs `(("ncurses" ,ncurses)))
1002 (home-page "https://gitlab.com/psmisc/psmisc")
1004 "Small utilities that use the proc file system")
1006 "This PSmisc package is a set of some small useful utilities that
1007 use the proc file system. We're not about changing the world, but
1008 providing the system administrator with some help in common tasks.")
1009 (license license:gpl2+)))
1011 (define-public util-linux
1017 (uri (string-append "mirror://kernel.org/linux/utils/"
1018 name "/v" (version-major+minor version) "/"
1019 name "-" version ".tar.xz"))
1022 "1ck7d8srw5szpjq7v0gpmjahnjs6wgqzm311ki4gazww6xx71rl6"))
1023 (patches (search-patches "util-linux-tests.patch"))
1024 (modules '((guix build utils)))
1026 ;; We take 'nologin' from Shadow, the 'logger' program from
1027 ;; GNU Inetutils and 'kill' from GNU Coreutils.
1029 (substitute* "configure"
1030 (("build_nologin=yes") "build_nologin=no")
1031 (("build_logger=yes") "build_logger=no")
1032 (("build_kill=yes") "build_kill=no"))
1034 (build-system gnu-build-system)
1036 "static")) ; >2 MiB of static .a libraries
1038 `(#:configure-flags (list "--disable-use-tty-group"
1039 "--enable-fs-paths-default=/run/current-system/profile/sbin"
1040 ;; Don't try to chown root:root mount and umount
1041 "--disable-makeinstall-chown"
1042 ;; Install completions where our
1043 ;; bash-completion package expects them.
1044 (string-append "--with-bashcompletiondir="
1045 (assoc-ref %outputs "out")
1046 "/etc/bash_completion.d"))
1047 #:phases (modify-phases %standard-phases
1049 'build 'set-umount-file-name
1050 (lambda* (#:key outputs #:allow-other-keys)
1051 ;; Tell 'eject' the right file name of 'umount'.
1052 (let ((out (assoc-ref outputs "out")))
1053 (substitute* "sys-utils/eject.c"
1054 (("\"/bin/umount\"")
1055 (string-append "\"" out "/bin/umount\"")))
1059 (lambda* (#:key inputs outputs #:allow-other-keys)
1060 (let ((out (assoc-ref outputs "out"))
1061 (net (assoc-ref inputs "net-base")))
1062 ;; Change the test to refer to the right file.
1063 (substitute* "tests/ts/misc/mcookie"
1065 (string-append net "/etc/services")))
1068 'install 'move-static-libraries
1069 (lambda* (#:key outputs #:allow-other-keys)
1070 (let ((out (assoc-ref outputs "out"))
1071 (static (assoc-ref outputs "static")))
1072 (mkdir-p (string-append static "/lib"))
1073 (with-directory-excursion out
1074 (for-each (lambda (file)
1076 (string-append static "/"
1078 (find-files "lib" "\\.a$"))
1080 ;; Remove references to the static library from the '.la'
1081 ;; files so that Libtool does the right thing when both
1082 ;; the shared and static library is available.
1083 (substitute* (find-files "lib" "\\.la$")
1084 (("old_library=.*") "old_library=''\n")))
1087 (inputs `(("zlib" ,zlib)
1088 ("ncurses" ,ncurses)
1090 ;; XXX: This is so that the 'pre-check' phase can find it.
1091 ,@(if (%current-target-system)
1092 `(("net-base" ,net-base))
1096 ("net-base" ,net-base))) ;for tests
1097 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
1098 (synopsis "Collection of utilities for the Linux kernel")
1099 (description "Util-linux is a diverse collection of Linux kernel
1100 utilities. It provides dmesg and includes tools for working with file systems,
1101 block devices, UUIDs, TTYs, and many other tools.")
1103 ;; Note that util-linux doesn't use the same license for all the
1104 ;; code. GPLv2+ is the default license for a code without an
1105 ;; explicitly defined license.
1106 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
1107 license:bsd-4 license:public-domain))))
1109 (define-public ddate
1115 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
1117 (file-name (string-append name "-" version ".tar.gz"))
1119 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
1120 (build-system cmake-build-system)
1121 (arguments '(#:tests? #f))
1122 (home-page "https://github.com/bo0ts/ddate")
1123 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
1125 "ddate displays the Discordian date and holidays of a given date.
1126 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
1127 by Robert Shea and Robert Anton Wilson.")
1128 (license license:public-domain)))
1130 (define-public procps
1136 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
1137 "procps-ng-" version ".tar.xz"))
1140 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
1141 (build-system gnu-build-system)
1143 '(#:modules ((guix build utils)
1144 (guix build gnu-build-system)
1148 (modify-phases %standard-phases
1150 'install 'post-install
1151 ;; Remove commands and man pages redudant with
1153 (lambda* (#:key outputs #:allow-other-keys)
1154 (let* ((out (assoc-ref outputs "out"))
1155 (dup (append-map (cut find-files out <>)
1156 '("^kill" "^uptime"))))
1157 (for-each delete-file dup)
1159 (inputs `(("ncurses" ,ncurses)))
1160 (home-page "https://gitlab.com/procps-ng/procps/")
1161 (synopsis "Utilities that give information about processes")
1163 "Procps is the package that has a bunch of small useful utilities
1164 that give information about processes using the Linux /proc file system.
1165 The package includes the programs ps, top, vmstat, w, kill, free,
1166 slabtop, and skill.")
1167 (license license:gpl2)))
1169 (define-public usbutils
1176 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
1177 "usbutils-" version ".tar.xz"))
1179 (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8"))))
1180 (build-system gnu-build-system)
1181 (outputs (list "out" "python"))
1184 (modify-phases %standard-phases
1185 (add-before 'bootstrap 'patch-bootstrap-scripts
1187 (substitute* "usbhid-dump/bootstrap"
1188 (("/bin/bash") (which "bash")))
1190 ;; Don't let autogen.sh run configure with bogus options & CFLAGS.
1191 (substitute* "autogen.sh"
1192 (("^\\./configure.*") ""))
1194 (add-after 'install 'separate-python-output
1195 ;; Separating one Python script shaves more than 106 MiB from :out.
1196 (lambda* (#:key outputs #:allow-other-keys)
1197 (let ((out (assoc-ref outputs "out"))
1198 (out:python (assoc-ref outputs "python")))
1199 (for-each (lambda (file)
1200 (let ((old (string-append out "/" file))
1201 (new (string-append out:python "/" file)))
1202 (mkdir-p (dirname new))
1203 (rename-file old new)))
1204 (list "bin/lsusb.py"))
1209 ("python" ,python)))
1211 `(("autoconf" ,autoconf)
1212 ("automake" ,automake)
1213 ("libtool" ,libtool)
1214 ("pkg-config" ,pkg-config)))
1215 (home-page "http://www.linux-usb.org/")
1217 "Tools for working with USB devices, such as lsusb")
1219 "Tools for working with USB devices, such as lsusb.")
1220 (license license:gpl2+)))
1222 (define-public e2fsprogs
1229 "mirror://kernel.org/linux/kernel/people/tytso/"
1230 name "/v" version "/"
1231 name "-" version ".tar.xz"))
1234 "02g0cm72sgz709s9pkg4mvj56m7bgs7rwnyc2cp7cvg3j6pcjlj9"))))
1235 (build-system gnu-build-system)
1236 (inputs `(("util-linux" ,util-linux)))
1237 (native-inputs `(("pkg-config" ,pkg-config)
1238 ("texinfo" ,texinfo) ;for the libext2fs Info manual
1242 ("procps" ,procps)))
1244 '(;; util-linux is the preferred source for some of the libraries and
1245 ;; commands, so disable them (see, e.g.,
1246 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
1247 #:configure-flags (list "--disable-libblkid"
1248 "--disable-libuuid" "--disable-uuidd"
1251 ;; Use symlinks instead of hard links for
1252 ;; 'fsck.extN' etc. This makes the resulting nar
1253 ;; smaller and is preserved across copies.
1254 "--enable-symlink-install"
1256 (string-append "LDFLAGS=-Wl,-rpath="
1257 (assoc-ref %outputs "out")
1260 ;; Install libext2fs et al.
1261 "--enable-elf-shlibs")
1264 (modify-phases %standard-phases
1265 (add-before 'configure 'patch-shells
1267 (substitute* "configure"
1268 (("/bin/sh (.*)parse-types.sh" _ dir)
1269 (string-append (which "sh") " " dir
1271 (substitute* "MCONFIG.in"
1272 (("INSTALL_SYMLINK = /bin/sh")
1273 "INSTALL_SYMLINK = sh"))
1274 (substitute* (find-files "." "^Makefile.in$")
1276 (string-append "#!" (which "sh"))))
1278 (add-after 'install 'install-libs
1279 (lambda* (#:key outputs #:allow-other-keys)
1280 (let* ((out (assoc-ref outputs "out"))
1281 (lib (string-append out "/lib")))
1282 (invoke "make" "install-libs")
1284 ;; Make the .a writable so that 'strip' works.
1285 ;; Failing to do that, due to debug symbols, we
1286 ;; retain a reference to the final
1287 ;; linux-libre-headers, which refer to the
1288 ;; bootstrap binaries.
1289 (let ((archives (find-files lib "\\.a$")))
1290 (for-each (lambda (file)
1294 (home-page "http://e2fsprogs.sourceforge.net/")
1295 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
1297 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
1298 (license (list license:gpl2 ;programs
1299 license:lgpl2.0 ;libext2fs
1300 license:x11)))) ;libuuid
1302 (define e2fsprogs/static
1304 (package (inherit e2fsprogs)
1306 ;; Do not build shared libraries.
1307 (substitute-keyword-arguments (package-arguments e2fsprogs)
1308 ((#:configure-flags _)
1309 '(list "--disable-blkid"))
1313 (define-public e2fsck/static
1315 (name "e2fsck-static")
1316 (version (package-version e2fsprogs))
1317 (build-system trivial-build-system)
1320 `(("e2fsprogs" ,e2fsprogs/static)))
1322 `(#:modules ((guix build utils))
1325 (use-modules (guix build utils)
1329 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
1331 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
1333 (with-directory-excursion bin
1334 (copy-file e2fsck "e2fsck")
1335 (remove-store-references "e2fsck")
1336 (chmod "e2fsck" #o555))
1338 (home-page (package-home-page e2fsprogs))
1339 (synopsis "Statically-linked e2fsck command from e2fsprogs")
1340 (description "This package provides statically-linked e2fsck command taken
1341 from the e2fsprogs package. It is meant to be used in initrds.")
1342 (license (package-license e2fsprogs))))
1344 (define-public extundelete
1346 (name "extundelete")
1351 (uri (string-append "mirror://sourceforge/extundelete/"
1352 "extundelete/" version "/extundelete-"
1353 version ".tar.bz2"))
1356 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))
1357 (patches (search-patches "extundelete-e2fsprogs-1.44.patch"))))
1358 (build-system gnu-build-system)
1359 (inputs `(("e2fsprogs" ,e2fsprogs)))
1360 (home-page "http://extundelete.sourceforge.net/")
1361 (synopsis "Recover deleted files from ext2/3/4 partitions")
1363 "Extundelete is a set of tools that can recover deleted files from an
1364 ext3 or ext4 partition.")
1365 (license license:gpl2)))
1367 (define-public zerofree
1371 (home-page "https://frippery.org/uml/")
1374 (uri (string-append home-page name "-" version
1378 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1379 (build-system gnu-build-system)
1382 (modify-phases %standard-phases
1383 (delete 'configure) ; no configure script
1385 ;; The Makefile lacks an ‘install’ target.
1386 (lambda* (#:key outputs #:allow-other-keys)
1387 (let* ((out (assoc-ref outputs "out"))
1388 (bin (string-append out "/bin")))
1389 (chmod "zerofree" #o555)
1390 (install-file "zerofree" bin)
1392 #:tests? #f)) ; no tests
1393 (inputs `(("libext2fs" ,e2fsprogs)))
1394 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
1396 "Zerofree finds the unallocated blocks with non-zero value content in an
1397 ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
1398 This is a simple way to make disk images more compressible.
1399 Zerofree requires the file system to be unmounted or mounted read-only.")
1400 (license license:gpl2)))
1402 (define-public strace
1406 (home-page "https://strace.io")
1409 (uri (string-append home-page "/files/" version
1410 "/strace-" version ".tar.xz"))
1413 "12wsga1v3rab24gr0mpfip7j7gwr90m8f9h6fviqxa3xgnwl38zm"))))
1414 (build-system gnu-build-system)
1417 (modify-phases %standard-phases
1418 (add-after 'unpack 'patch-/bin/sh
1420 (substitute* "strace.c"
1421 (("/bin/sh") (which "sh")))
1423 ;; Don't fail if the architecture doesn't support different personalities.
1424 #:configure-flags '("--enable-mpers=check")
1425 ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>.
1426 #:parallel-tests? #f)) ; undeterministic failures
1427 (native-inputs `(("perl" ,perl)))
1428 (synopsis "System call tracer for Linux")
1430 "strace is a system call tracer, i.e. a debugging tool which prints out a
1431 trace of all the system calls made by a another process/program.")
1432 (license license:lgpl2.1+)))
1434 (define-public ltrace
1440 (uri (string-append "http://www.ltrace.org/ltrace_" version
1444 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
1445 (build-system gnu-build-system)
1446 (inputs `(("libelf" ,libelf)))
1448 ;; Compilation uses -Werror by default, but it fails.
1449 '(#:configure-flags '("--disable-werror")))
1450 (home-page "https://www.ltrace.org/")
1451 (synopsis "Library call tracer for Linux")
1453 "ltrace intercepts and records dynamic library calls which are called by
1454 an executed process and the signals received by that process. It can also
1455 intercept and print the system calls executed by the program.")
1456 (license license:gpl2+)))
1458 (define-public alsa-lib
1465 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
1466 version ".tar.bz2"))
1469 "0jwr9g4yxg9gj6xx0sb2r6wrdl8amrjd19hilkrq4rirynp770s8"))))
1470 (build-system gnu-build-system)
1471 (home-page "https://www.alsa-project.org/")
1472 (synopsis "The Advanced Linux Sound Architecture libraries")
1474 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1475 MIDI functionality to the Linux-based operating system.")
1476 (license license:lgpl2.1+)))
1478 (define-public alsa-utils
1484 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
1485 name "-" version ".tar.bz2"))
1488 "0fi11b7r8hg1bdjw74s8sqx8rc4qb310jaj9lsia9labvfyjrpsx"))))
1489 (build-system gnu-build-system)
1491 ;; XXX: Disable man page creation until we have DocBook.
1492 '(#:configure-flags (list "--disable-xmlto"
1494 ;; The udev rule is responsible for restoring
1496 (string-append "--with-udev-rules-dir="
1497 (assoc-ref %outputs "out")
1498 "/lib/udev/rules.d"))
1500 (modify-phases %standard-phases
1501 (add-before 'check 'disable-broken-test
1503 ;; XXX: The 1.1.8 release tarball is missing a header that's
1504 ;; required for this test to work. Fixed in 1.1.9.
1505 (substitute* "axfer/test/Makefile"
1506 ((".*container-test.*") ""))
1509 'install 'pre-install
1511 ;; Don't try to mkdir /var/lib/alsa.
1512 (substitute* "Makefile"
1513 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
1517 `(("libsamplerate" ,libsamplerate)
1518 ("ncurses" ,ncurses)
1519 ("alsa-lib" ,alsa-lib)
1521 ("gettext" ,gettext-minimal)))
1522 (home-page "http://www.alsa-project.org/")
1523 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1525 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1526 MIDI functionality to the Linux-based operating system.")
1528 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1530 (license license:gpl2)))
1532 (define-public alsa-plugins
1534 (name "alsa-plugins")
1538 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1539 name "-" version ".tar.bz2"))
1542 "01zrg0h2jw9dlj9233vjsn916yf4f2s667yry6xsn8d57lq745qn"))))
1543 (build-system gnu-build-system)
1544 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1545 ;; be split, there are references to both in files.
1546 ;; TODO: Remove OSS related plugins, they add support to run native
1547 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1549 (outputs '("out" "pulseaudio" "jack"))
1551 `(#:configure-flags '(;; Do not install a "local" configuration targeted
1552 ;; for /etc/alsa. On Guix System plugins are loaded from
1553 ;; the ALSA service, and other distributions likely
1554 ;; won't use these files.
1555 "--with-alsalconfdir=/tmp/noop")
1557 (modify-phases %standard-phases
1558 (add-after 'install 'split
1559 (lambda* (#:key inputs outputs #:allow-other-keys)
1560 ;; Distribute the binaries to the various outputs.
1561 (let* ((out (assoc-ref outputs "out"))
1562 (jack (assoc-ref outputs "jack"))
1563 (jacklib (string-append jack "/lib/alsa-lib"))
1564 (pua (assoc-ref outputs "pulseaudio"))
1565 (pualib (string-append pua "/lib/alsa-lib")))
1568 (for-each (lambda (file)
1569 (rename-file file (string-append jacklib "/" (basename file))))
1570 (find-files out ".*jack\\.(la|so)"))
1573 (for-each (lambda (file)
1574 (rename-file file (string-append pualib "/" (basename file))))
1575 (find-files out ".*pulse\\.(la|so)"))
1578 `(("alsa-lib" ,alsa-lib)
1580 ("speex" ,speex) ; libspeexdsp resampling plugin
1581 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1582 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1583 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1585 `(("pkg-config" ,pkg-config)))
1586 (home-page "http://www.alsa-project.org/")
1587 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1589 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1590 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1591 by providing additional plugins which include: upmixing, downmixing, jackd and
1592 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1593 external rate conversion.")
1594 (license (list license:gpl2+
1595 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1596 license:lgpl2.1+))))
1598 (define-public iptables
1605 "mirror://netfilter.org/iptables/iptables-"
1606 version ".tar.bz2"))
1609 "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
1610 (build-system gnu-build-system)
1612 `(("pkg-config" ,pkg-config)
1616 `(("libmnl" ,libmnl)
1617 ("libnftnl" ,libnftnl)))
1619 '(#:tests? #f ; no test suite
1620 #:configure-flags ; add $libdir to the RUNPATH of executables
1621 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1622 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1623 (synopsis "Programs to configure Linux IP packet filtering rules")
1625 "@command{iptables} is the user-space command line program used to
1626 configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1627 (@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1629 This package also includes @command{ip6tables}, which is used to configure the
1632 Both commands are targeted at system administrators.")
1633 (license license:gpl2+)))
1635 (define-public ebtables
1638 (version "2.0.10-4")
1642 "mirror://netfilter.org/ebtables/ebtables-v"
1646 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1647 (build-system gnu-build-system)
1649 '(#:tests? #f ; no test suite
1651 (let* ((out (assoc-ref %outputs "out"))
1652 (bin (string-append out "/sbin"))
1653 (lib (string-append out "/lib"))
1654 (man (string-append out "/share/man"))
1655 (iptables (assoc-ref %build-inputs "iptables"))
1656 (ethertypes (string-append iptables "/etc/ethertypes")))
1657 (list (string-append "LIBDIR=" lib)
1658 (string-append "MANDIR=" man)
1659 (string-append "BINDIR=" bin)
1660 (string-append "ETHERTYPESFILE=" ethertypes)
1661 ;; With the default CFLAGS, it falis with:
1662 ;; communication.c:259:58: error: variable ‘ret’ set but not
1663 ;; used [-Werror=unused-but-set-variable]
1666 (modify-phases %standard-phases
1668 ;; no configure script
1670 (substitute* "Makefile"
1671 ;; Remove user and group options from install commands,
1672 ;; otherwise it fails with: invalid user 'root'.
1673 (("-o root -g root") "")
1674 ;; Remove 'ethertypes' from the install target.
1676 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1680 ("iptables" ,iptables)))
1681 (synopsis "Ethernet bridge frame table administration")
1682 (home-page "http://ebtables.netfilter.org/")
1684 "ebtables is an application program used to set up and maintain the
1685 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1686 analogous to the iptables application, but less complicated, due to the fact
1687 that the Ethernet protocol is much simpler than the IP protocol.")
1688 (license license:gpl2+)))
1690 (define-public iproute
1697 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1701 "1a2dywa2kam24951byv9pl32mb9z6klh7d4vp8fwfgrm4vn5vfd5"))))
1702 (build-system gnu-build-system)
1704 `( ;; There is a test suite, but it wants network namespaces and sudo.
1706 #:make-flags (let ((out (assoc-ref %outputs "out")))
1708 (string-append "BASH_COMPDIR=" out
1709 "/etc/bash_completion.d")
1710 (string-append "LIBDIR=" out "/lib")
1711 (string-append "HDRDIR=" out "/include")
1712 (string-append "SBINDIR=" out "/sbin")
1713 (string-append "CONFDIR=" out "/etc")
1714 (string-append "DOCDIR=" out "/share/doc/"
1716 (string-append "MANDIR=" out "/share/man")))
1717 #:phases (modify-phases %standard-phases
1718 (add-before 'install 'pre-install
1720 ;; Don't attempt to create /var/lib/arpd.
1721 (substitute* "Makefile"
1722 (("^.*ARPDDIR.*$") ""))
1726 ("iptables" ,iptables)))
1730 ("pkg-config" ,pkg-config)))
1732 ;; ("libmnl" ,libmnl)
1733 ;; ("util-linux" ,util-linux)
1735 "https://wiki.linuxfoundation.org/networking/iproute2")
1737 "Utilities for controlling TCP/IP networking and traffic in Linux")
1739 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1740 and traffic with the Linux kernel. The most important of these are
1741 @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1744 Most network configuration manuals still refer to ifconfig and route as the
1745 primary network configuration tools, but ifconfig is known to behave
1746 inadequately in modern network environments, and both should be deprecated.")
1747 (license license:gpl2+)))
1749 (define-public net-tools
1750 ;; XXX: This package is basically unmaintained, but it provides a few
1751 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1753 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1757 (version (string-append "1.60-" revision "." (string-take commit 7)))
1760 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1761 "n/ne/net-tools/code.git/net-tools-code-"
1763 (file-name (string-append name "-" version ".zip"))
1766 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
1767 (home-page "http://net-tools.sourceforge.net/")
1768 (build-system gnu-build-system)
1770 '(#:modules ((guix build gnu-build-system)
1775 (modify-phases %standard-phases
1777 (lambda* (#:key outputs #:allow-other-keys)
1778 (let ((out (assoc-ref outputs "out")))
1779 (mkdir-p (string-append out "/bin"))
1780 (mkdir-p (string-append out "/sbin"))
1782 ;; Pretend we have everything...
1783 (system "yes | make config")
1785 ;; ... except for the things we don't have.
1786 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1787 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1788 ;; that have been removed.
1789 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1790 ;; think about adding them later.
1791 (substitute* '("config.make" "config.h")
1792 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
1795 (add-after 'install 'remove-redundant-commands
1796 (lambda* (#:key outputs #:allow-other-keys)
1797 ;; Remove commands and man pages redundant with Inetutils.
1798 (let* ((out (assoc-ref outputs "out"))
1799 (dup (append-map (cut find-files out <>)
1801 "^(yp|nis|dns)?domainname"))))
1802 (for-each delete-file dup)
1804 ;; Binaries that depend on libnet-tools.a don't declare that
1805 ;; dependency, making it parallel-unsafe.
1806 #:parallel-build? #f
1808 #:tests? #f ; no test suite
1809 #:make-flags (let ((out (assoc-ref %outputs "out")))
1811 (string-append "BASEDIR=" out)
1812 (string-append "INSTALLNLSDIR=" out "/share/locale")
1813 (string-append "mandir=/share/man")))))
1814 (native-inputs `(("gettext" ,gettext-minimal)
1816 (synopsis "Tools for controlling the network subsystem in Linux")
1818 "This package includes the important tools for controlling the network
1819 subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1820 route. Additionally, this package contains utilities relating to particular
1821 network hardware types (plipconfig, slattach) and advanced aspects of IP
1822 configuration (iptunnel, ipmaddr).")
1823 (license license:gpl2+))))
1825 (define-public libcap
1832 "mirror://kernel.org/linux/libs/security/linux-privs/"
1833 "libcap2/libcap-" version ".tar.xz"))
1836 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1837 (build-system gnu-build-system)
1838 (arguments '(#:phases
1839 (modify-phases %standard-phases
1841 ;; Add $libdir to the RUNPATH of executables.
1843 (substitute* "Make.Rules"
1845 (string-append "LDFLAGS := -Wl,-rpath="
1848 #:tests? #f ; no 'check' target
1849 #:make-flags (list "lib=lib"
1850 (string-append "prefix="
1851 (assoc-ref %outputs "out"))
1852 "RAISE_SETFCAP=no")))
1853 (native-inputs `(("perl" ,perl)))
1854 (inputs `(("attr" ,attr)))
1855 (home-page "https://sites.google.com/site/fullycapable/")
1856 (synopsis "Library for working with POSIX capabilities")
1858 "Libcap2 provides a programming interface to POSIX capabilities on
1859 Linux-based operating systems.")
1861 ;; License is BSD-3 or GPLv2, at the user's choice.
1862 (license license:gpl2)))
1864 (define-public bridge-utils
1866 (name "bridge-utils")
1871 (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/"
1872 "bridge-utils-" version ".tar.xz"))
1874 (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc"))))
1875 (build-system gnu-build-system)
1877 ;; The tarball lacks all the generated files.
1878 (native-inputs `(("autoconf" ,autoconf)
1879 ("automake" ,automake)))
1882 (modify-phases %standard-phases
1883 (add-before 'bootstrap 'patch-stuff
1885 ;; Fix "field ‘ip6’ has incomplete type" errors.
1886 (substitute* "libbridge/libbridge.h"
1887 (("#include <linux/if_bridge.h>")
1888 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1890 ;; Ensure that the entire build fails if one of the
1891 ;; sub-Makefiles fails.
1892 (substitute* "Makefile.in"
1893 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1894 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1897 #:tests? #f)) ; no 'check' target
1900 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1901 (synopsis "Manipulate Ethernet bridges")
1903 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1904 to connect two Ethernet segments together in a protocol independent way.
1905 Packets are forwarded based on Ethernet address, rather than IP address (like
1906 a router). Since forwarding is done at Layer 2, all protocols can go
1907 transparently through a bridge.")
1908 (license license:gpl2+)))
1910 (define-public libnl
1917 "https://github.com/thom311/libnl/releases/download/"
1918 "libnl" (string-join (string-split version #\.) "_")
1919 "/libnl-" version ".tar.gz"))
1922 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
1923 (build-system gnu-build-system)
1927 ("pkg-config" ,pkg-config)
1933 "https://github.com/thom311/libnl/releases/download/libnl"
1934 (string-join (string-split version #\.) "_")
1935 "/libnl-doc-" version ".tar.gz"))
1937 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
1939 `(("python-2" ,python-2)
1940 ("python-3" ,python-3)))
1941 (outputs '("out" "doc" "python2" "python3"))
1943 `(#:modules ((guix build gnu-build-system)
1947 (modify-phases %standard-phases
1948 (add-after 'install 'install-python
1949 (lambda* (#:key outputs #:allow-other-keys)
1950 (define (python-inst python)
1951 (invoke python "setup.py" "build")
1952 (invoke python "setup.py" "install"
1953 (string-append "--prefix="
1954 (assoc-ref %outputs python)))
1955 (invoke python "setup.py" "clean"))
1956 (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib"
1957 (assoc-ref %outputs "out")))
1958 (with-directory-excursion "./python"
1959 (for-each python-inst '("python2" "python3")))
1961 (add-after 'install 'install-doc
1962 (lambda* (#:key inputs outputs #:allow-other-keys)
1963 (let ((dest (string-append (assoc-ref outputs "doc")
1964 "/share/doc/libnl")))
1966 (invoke "tar" "xf" (assoc-ref inputs "libnl3-doc")
1967 "--strip-components=1" "-C" dest)))))))
1968 (home-page "https://www.infradead.org/~tgr/libnl/")
1969 (synopsis "NetLink protocol library suite")
1971 "The libnl suite is a collection of libraries providing APIs to netlink
1972 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1973 between the kernel and user space processes. It was designed to be a more
1974 flexible successor to ioctl to provide mainly networking related kernel
1975 configuration and monitoring interfaces.")
1977 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1978 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1979 (license license:gpl2)))
1988 "mirror://kernel.org/software/network/iw/iw-"
1992 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
1993 (build-system gnu-build-system)
1994 (native-inputs `(("pkg-config" ,pkg-config)))
1995 (inputs `(("libnl" ,libnl)))
1997 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1999 #:phases (modify-phases %standard-phases (delete 'configure))))
2000 (home-page "https://wireless.wiki.kernel.org/")
2001 (synopsis "Tool for configuring wireless devices")
2003 "iw is a new nl80211 based CLI configuration utility for wireless
2004 devices. It replaces @code{iwconfig}, which is deprecated.")
2005 (license license:isc)))
2007 (define-public powertop
2014 (uri (string-append "https://01.org/sites/default/files/downloads/"
2015 "powertop-v" version ".tar.gz"))
2017 (base32 "0xaazqccyd42v2q532dxx40nqhb9sfsa6cyx8641rl57mfg4bdyk"))))
2018 (build-system gnu-build-system)
2021 (modify-phases %standard-phases
2022 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
2023 ;; allow calibrating the network interface in Guix System.
2024 (add-after 'unpack 'patch-absolute-file-names
2025 (lambda* (#:key inputs #:allow-other-keys)
2026 (let ((kmod (assoc-ref inputs "kmod")))
2027 (substitute* (find-files "src" "\\.cpp$")
2028 ;; Give the right 'modprobe' file name so that essential
2029 ;; modules such as msr.ko can be loaded.
2030 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
2031 ;; These programs are only needed to calibrate, so using
2032 ;; relative file names avoids adding extra inputs. When they
2033 ;; are missing powertop gracefully handles it.
2034 (("/usr/bin/hcitool") "hcitool")
2035 (("/usr/bin/xset") "xset")
2036 (("/usr/sbin/hciconfig") "hciconfig"))
2041 ("ncurses" ,ncurses)
2042 ("pciutils" ,pciutils)
2045 `(("pkg-config" ,pkg-config)))
2046 (home-page "https://01.org/powertop/")
2047 (synopsis "Analyze power consumption on Intel-based laptops")
2049 "PowerTOP is a Linux tool to diagnose issues with power consumption and
2050 power management. In addition to being a diagnostic tool, PowerTOP also has
2051 an interactive mode where the user can experiment various power management
2052 settings for cases where the operating system has not enabled these
2054 (license license:gpl2)))
2056 (define-public aumix
2063 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
2064 version ".tar.bz2"))
2067 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
2068 (build-system gnu-build-system)
2069 (inputs `(("ncurses" ,ncurses)))
2070 (home-page "http://www.jpj.net/~trevor/aumix.html")
2071 (synopsis "Audio mixer for X and the console")
2073 "Aumix adjusts an audio mixer from X, the console, a terminal,
2074 the command line or a script.")
2075 (license license:gpl2+)))
2077 (define-public iotop
2084 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
2087 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
2088 (build-system python-build-system)
2090 ;; The setup.py script expects python-2.
2091 `(#:python ,python-2
2092 ;; There are currently no checks in the package.
2094 (native-inputs `(("python" ,python-2)))
2095 (home-page "http://guichaz.free.fr/iotop/")
2097 "Displays the IO activity of running processes")
2099 "Iotop is a Python program with a top like user interface to show the
2100 processes currently causing I/O.")
2101 (license license:gpl2+)))
2109 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
2110 "download/fuse-" version
2111 "/fuse-" version ".tar.gz"))
2114 "1qxg1r1mgysfq6qakmvid2njph3lr00w0swvydsfl9ymilfzi12y"))
2115 (patches (search-patches "fuse-overlapping-headers.patch"))))
2116 (build-system gnu-build-system)
2117 (inputs `(("util-linux" ,util-linux)))
2119 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
2120 (assoc-ref %outputs "out")
2122 (string-append "INIT_D_PATH="
2123 (assoc-ref %outputs "out")
2126 ;; The rule makes /dev/fuse 666.
2127 (string-append "UDEV_RULES_PATH="
2128 (assoc-ref %outputs "out")
2129 "/lib/udev/rules.d"))
2131 (modify-phases %standard-phases
2132 (add-before 'build 'set-file-names
2133 (lambda* (#:key inputs #:allow-other-keys)
2134 ;; libfuse calls out to mount(8) and umount(8). Make sure
2135 ;; it refers to the right ones.
2136 (substitute* '("lib/mount_util.c" "util/mount_util.c")
2137 (("/bin/(u?)mount" _ maybe-u)
2138 (string-append (assoc-ref inputs "util-linux")
2139 "/bin/" maybe-u "mount")))
2140 (substitute* '("util/mount.fuse.c")
2144 ;; This hack leads libfuse to search for 'fusermount' in
2145 ;; $PATH, where it may find a setuid-root binary, instead of
2146 ;; trying solely $out/sbin/fusermount and failing because
2148 (substitute* "lib/Makefile"
2149 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
2150 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
2152 (home-page "https://github.com/libfuse/libfuse")
2153 (synopsis "Support file systems implemented in user space")
2155 "As a consequence of its monolithic design, file system code for Linux
2156 normally goes into the kernel itself---which is not only a robustness issue,
2157 but also an impediment to system extensibility. FUSE, for \"file systems in
2158 user space\", is a kernel module and user-space library that tries to address
2159 part of this problem by allowing users to run file system implementations as
2160 user-space processes.")
2161 (license (list license:lgpl2.1 ;library
2162 license:gpl2+)))) ;command-line utilities
2164 (define-public unionfs-fuse
2166 (name "unionfs-fuse")
2171 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
2173 (file-name (string-append name "-" version ".tar.gz"))
2176 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
2177 (build-system cmake-build-system)
2179 `(("python" ,python)))
2180 (inputs `(("fuse" ,fuse)))
2182 ;; The tests were never actually run ("collected 0 items"), but in recent
2183 ;; versions of pytest that causes an error.
2185 (home-page "https://github.com/rpodgorny/unionfs-fuse")
2186 (synopsis "User-space union file system")
2188 "UnionFS-FUSE is a flexible union file system implementation in user
2189 space, using the FUSE library. Mounting a union file system allows you to
2190 \"aggregate\" the contents of several directories into a single mount point.
2191 UnionFS-FUSE additionally supports copy-on-write.")
2192 (license license:bsd-3)))
2195 (package (inherit fuse)
2196 (name "fuse-static")
2197 (source (origin (inherit (package-source fuse))
2198 (modules '((guix build utils)))
2201 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
2202 ;; updated. Change calls to 'mtab_needs_update' to 0 so
2203 ;; that it doesn't do that, allowing us to remove the
2204 ;; dependency on util-linux (something that is useful in
2206 (substitute* '("lib/mount_util.c"
2207 "util/mount_util.c")
2208 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
2214 (define-public unionfs-fuse/static
2215 (package (inherit unionfs-fuse)
2216 (synopsis "User-space union file system (statically linked)")
2217 (name (string-append (package-name unionfs-fuse) "-static"))
2218 (source (origin (inherit (package-source unionfs-fuse))
2219 (modules '((guix build utils)))
2222 ;; Add -ldl to the libraries, because libfuse.a needs that.
2223 (substitute* "src/CMakeLists.txt"
2224 (("target_link_libraries(.*)\\)" _ libs)
2225 (string-append "target_link_libraries"
2230 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
2232 (modify-phases %standard-phases
2233 (add-after 'install 'post-install
2234 (lambda* (#:key outputs #:allow-other-keys)
2235 (let* ((out (assoc-ref outputs "out"))
2236 (exe (string-append out "/bin/unionfs")))
2237 ;; By default, 'unionfs' keeps references to
2238 ;; $glibc/share/locale and similar stuff. Remove them.
2239 (remove-store-references exe)
2241 ;; 'unionfsctl' has references to glibc as well. Since
2242 ;; we don't need it, remove it.
2243 (delete-file (string-append out "/bin/unionfsctl"))
2245 (inputs `(("fuse" ,fuse-static)))))
2247 (define-public sshfs
2253 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
2254 "download/sshfs-" version "/sshfs-" version
2258 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
2259 (build-system gnu-build-system)
2264 `(("pkg-config" ,pkg-config)))
2265 (home-page "https://github.com/libfuse/sshfs")
2266 (synopsis "Mount remote file systems over SSH")
2268 "This is a file system client based on the SSH File Transfer Protocol.
2269 Since most SSH servers already support this protocol it is very easy to set
2270 up: on the server side there's nothing to do; on the client side mounting the
2271 file system is as easy as logging into the server with an SSH client.")
2272 (license license:gpl2+)))
2274 (define-public sshfs-fuse
2275 (package (inherit sshfs)
2277 (properties `((superseded . ,sshfs)))))
2279 (define-public archivemount
2281 (name "archivemount")
2286 (uri (string-append "https://www.cybernoia.de/software/archivemount/"
2287 "archivemount-" version ".tar.gz"))
2289 (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4"))))
2290 (build-system gnu-build-system)
2291 (inputs `(("fuse" ,fuse)
2292 ("libarchive" ,libarchive)))
2293 (native-inputs `(("pkg-config" ,pkg-config)))
2294 (home-page "https://www.cybernoia.de/software/archivemount.html")
2295 (synopsis "Tool for mounting archive files with FUSE")
2296 (description "archivemount is a FUSE-based file system for Unix variants,
2297 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
2298 mount point where it can be read from or written to as with any other file
2299 system. This makes accessing the contents of the archive, which may be
2300 compressed, transparent to other programs, without decompressing them.")
2301 (license license:lgpl2.0+)))
2303 (define-public numactl
2310 "https://github.com/numactl/numactl/releases/download/v"
2311 version "/" name "-" version ".tar.gz"))
2314 "0ad7mpi3vacbfnx3aqxnvgsj64yp3mav9yxnaz8ancjv7wvdmfsm"))))
2315 (build-system gnu-build-system)
2317 '(;; There's a 'test' target, but it requires NUMA support in the kernel
2318 ;; to run, which we can't assume to have.
2321 ;; NUMA is apparently not supported on armhf, see
2322 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
2323 (supported-systems (delete "armhf-linux" %supported-systems))
2324 (home-page "https://github.com/numactl/numactl")
2325 (synopsis "Tools for non-uniform memory access (NUMA) machines")
2327 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
2328 memory is not all in one place. The numactl program allows you to run your
2329 application program on specific CPU's and memory nodes. It does this by
2330 supplying a NUMA memory policy to the operating system before running your
2333 The package contains other commands, such as numademo, numastat and memhog.
2334 The numademo command provides a quick overview of NUMA performance on your
2336 (license (list license:gpl2 ;programs
2337 license:lgpl2.1)))) ;library
2339 (define-public kbd-neo
2346 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
2347 version "/linux/console/neo.map"))
2348 (file-name (string-append name "-" version ".map"))
2351 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
2352 (build-system trivial-build-system)
2354 `(#:modules ((guix build utils))
2356 (use-modules (guix build utils))
2357 (let ((out (string-append %output "/share/keymaps"))
2358 (source (assoc-ref %build-inputs "source")))
2360 (copy-file source (string-append out "/neo.map"))
2362 (home-page "https://neo-layout.org")
2363 (synopsis "Neo2 console layout")
2365 "Kbd-neo provides the Neo2 keyboard layout for use with
2366 @command{loadkeys(1)} from @code{kbd(4)}.")
2367 ;; The file is located in an svn directory, the entire content of
2368 ;; the directory is licensed as GPL3.
2369 (license license:gpl3+)))
2377 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
2381 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
2382 (modules '((guix build utils)))
2385 (substitute* "tests/Makefile.in"
2386 ;; The '%: %.in' rule incorrectly uses @VERSION@.
2389 (substitute* '("src/unicode_start" "src/unicode_stop")
2390 ;; Assume the Coreutils are in $PATH.
2394 (build-system gnu-build-system)
2397 (modify-phases %standard-phases
2398 (add-before 'build 'pre-build
2399 (lambda* (#:key inputs #:allow-other-keys)
2400 (let ((gzip (assoc-ref %build-inputs "gzip"))
2401 (bzip2 (assoc-ref %build-inputs "bzip2")))
2402 (substitute* "src/libkeymap/findfile.c"
2404 (string-append gzip "/bin/gzip"))
2406 (string-append bzip2 "/bin/bzip2")))
2408 (add-after 'install 'post-install
2409 (lambda* (#:key outputs #:allow-other-keys)
2410 ;; Make sure these programs find their comrades.
2411 (let* ((out (assoc-ref outputs "out"))
2412 (bin (string-append out "/bin")))
2413 (for-each (lambda (prog)
2414 (wrap-program (string-append bin "/" prog)
2415 `("PATH" ":" prefix (,bin))))
2416 '("unicode_start" "unicode_stop"))
2418 (inputs `(("check" ,check)
2421 ("pam" ,linux-pam)))
2422 (native-search-paths
2423 (list (search-path-specification
2424 (variable "LOADKEYS_KEYMAP_PATH")
2425 ;; Append ‘/**’ to recursively search all directories. One can then
2426 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
2427 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
2428 (files (list "share/keymaps/**")))))
2429 (native-inputs `(("pkg-config" ,pkg-config)))
2430 (home-page "http://kbd-project.org/")
2431 (synopsis "Linux keyboard utilities and keyboard maps")
2433 "This package contains keytable files and keyboard utilities compatible
2434 for systems using the Linux kernel. This includes commands such as
2435 @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.")
2436 (license license:gpl2+)))
2438 (define-public loadkeys-static
2441 (name "loadkeys-static")
2443 (substitute-keyword-arguments (package-arguments kbd)
2444 ((#:configure-flags flags ''())
2445 `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls"
2446 "--disable-vlock" ;so we don't need libpam
2447 "--disable-libkeymap")
2449 ((#:make-flags flags ''())
2450 `(cons "LDFLAGS=-all-static" ,flags))
2451 ((#:phases phases '%standard-phases)
2452 `(modify-phases ,phases
2454 (lambda* (#:key outputs #:allow-other-keys)
2455 (let ((out (assoc-ref outputs "out")))
2456 ;; The binary keeps references to gzip, among other things,
2457 ;; which we don't need in the initrd, so strip references.
2458 (remove-store-references "src/loadkeys")
2460 (install-file "src/loadkeys"
2461 (string-append out "/bin"))
2463 (delete 'post-install)))
2464 ((#:strip-flags _ '())
2466 ((#:allowed-references _ '())
2469 (synopsis "Statically-linked @command{loadkeys} program")
2471 ;; This package is meant to be used internally in the initrd so don't
2473 (properties '((hidden? . #t)))))
2475 (define-public inotify-tools
2477 (name "inotify-tools")
2482 (url "https://github.com/rvoicilas/inotify-tools.git")
2484 (file-name (git-file-name name version))
2487 "14dci1i4mhsd5sa33k8h3ayphk19kizynh5ql9ryibdpmcanfiyq"))))
2488 (build-system gnu-build-system)
2490 `(("autoconf" ,autoconf)
2491 ("automake" ,automake)
2492 ("libtool" ,libtool)))
2493 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
2494 (synopsis "Monitor file accesses")
2496 "The inotify-tools packages provides a C library and command-line tools
2497 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
2498 (license license:gpl2+)))
2507 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2508 "kmod-" version ".tar.xz"))
2511 "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
2512 (patches (search-patches "kmod-module-directory.patch"))))
2513 (build-system gnu-build-system)
2515 `(("pkg-config" ,pkg-config)))
2520 `(#:tests? #f ; FIXME: Investigate test failures
2521 #:configure-flags '("--with-xz" "--with-zlib")
2523 (modify-phases %standard-phases
2524 (add-after 'install 'install-modprobe&co
2525 (lambda* (#:key outputs #:allow-other-keys)
2526 (let* ((out (assoc-ref outputs "out"))
2527 (bin (string-append out "/bin")))
2528 (for-each (lambda (tool)
2530 (string-append bin "/" tool)))
2531 '("insmod" "rmmod" "lsmod" "modprobe"
2532 "modinfo" "depmod"))
2534 (home-page "https://www.kernel.org/")
2535 (synopsis "Kernel module tools")
2536 (description "Kmod is a set of tools to handle common tasks with Linux
2537 kernel modules like insert, remove, list, check properties, resolve
2538 dependencies and aliases.
2540 These tools are designed on top of libkmod, a library that is shipped with
2541 kmod. The aim is to be compatible with tools, configurations and indices
2542 from the module-init-tools project.")
2543 (license license:gpl2+))) ; library under lgpl2.1+
2545 (define-public eudev
2546 ;; The post-systemd fork, maintained by Gentoo.
2552 (uri (git-reference (url "https://github.com/gentoo/eudev")
2553 (commit (string-append "v" version))))
2554 (file-name (git-file-name name version))
2557 "1g95yzzx4qxm5qhhylbi930lrq4gsbz207n72018nkvswj6gmpjw"))
2558 (patches (search-patches "eudev-rules-directory.patch"))))
2559 (build-system gnu-build-system)
2562 (modify-phases %standard-phases
2563 (add-after 'unpack 'make-source-writable
2565 ;; XXX: Git checkouts are read-only, but this package needs to
2566 ;; modify some of its files.
2567 (for-each make-file-writable (find-files "."))
2569 (add-before 'bootstrap 'patch-file-names
2570 (lambda* (#:key inputs #:allow-other-keys)
2571 (substitute* "man/make.sh"
2572 (("/usr/bin/xsltproc")
2573 (string-append (assoc-ref inputs "xsltproc")
2576 (add-after 'install 'build-hwdb
2577 (lambda* (#:key outputs #:allow-other-keys)
2578 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2579 ;; similar tools to display product names.
2580 (let ((out (assoc-ref outputs "out")))
2581 (invoke (string-append out "/bin/udevadm")
2582 "hwdb" "--update")))))
2583 #:configure-flags (list "--enable-manpages")))
2585 `(("autoconf" ,autoconf)
2586 ("automake" ,automake)
2588 ("libtool" ,libtool)
2589 ("pkg-config" ,pkg-config)
2592 ("python" ,python-wrapper)
2593 ;; For documentation.
2594 ("docbook-xml" ,docbook-xml-4.2)
2595 ("docbook-xsl" ,docbook-xsl)
2596 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2597 ("xsltproc" ,libxslt)))
2599 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2600 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2601 ;; which contains the rules to do that.
2602 `(("util-linux" ,util-linux) ;for blkid
2604 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
2605 (synopsis "Userspace device management")
2606 (description "Udev is a daemon which dynamically creates and removes
2607 device nodes from /dev/, handles hotplug events and loads drivers at boot
2609 (license license:gpl2+)))
2611 (define-public eudev-with-hwdb
2612 (deprecated-package "eudev-with-hwdb" eudev))
2617 (version "2.02.177")
2620 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2624 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
2625 (modules '((guix build utils)))
2628 (use-modules (guix build utils))
2630 ;; Honor sysconfdir.
2631 (substitute* "make.tmpl.in"
2633 "confdir = @sysconfdir@\n")
2634 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
2635 "DEFAULT_SYS_DIR = @sysconfdir@"))
2637 (patches (search-patches "lvm2-static-link.patch"))))
2638 (build-system gnu-build-system)
2640 `(("pkg-config" ,pkg-config)
2641 ("procps" ,procps))) ;tests use 'pgrep'
2646 (modify-phases %standard-phases
2647 (add-after 'configure 'set-makefile-shell
2649 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2651 (setenv "SHELL" (which "sh"))
2653 ;; Replace /bin/sh with the right file name.
2654 (patch-makefile-SHELL "make.tmpl")
2657 #:configure-flags (list (string-append "--sysconfdir="
2658 (assoc-ref %outputs "out")
2660 "--enable-udev_sync"
2661 "--enable-udev_rules"
2662 "--enable-pkgconfig"
2664 "--enable-dmeventd" ; Requires '--enable-cmdlib'.
2666 ;; Make sure programs such as 'dmsetup' can
2667 ;; find libdevmapper.so.
2668 (string-append "LDFLAGS=-Wl,-rpath="
2669 (assoc-ref %outputs "out")
2671 (assoc-ref %outputs "out")
2672 "/lib/device-mapper")
2673 ;; TODO: Patch make.tmpl.in to take LDFLAGS
2674 ;; into account so that we don't need to also
2676 (string-append "CLDFLAGS=-Wl,-rpath="
2677 (assoc-ref %outputs "out")
2679 (assoc-ref %outputs "out")
2680 "/lib/device-mapper"))
2682 ;; The tests use 'mknod', which requires root access.
2684 (home-page "https://sourceware.org/lvm2/")
2685 (synopsis "Logical volume management for Linux")
2687 "LVM2 is the logical volume management tool set for Linux-based systems.
2688 This package includes the user-space libraries and tools, including the device
2689 mapper. Kernel components are part of Linux-libre.")
2691 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2692 ;; Command-line tools are GPLv2.
2693 (license (list license:gpl2 license:lgpl2.1))))
2695 (define-public lvm2-static
2698 (name "lvm2-static")
2700 ;; Propagate udev because libdevmapper.a depends on libudev.
2701 (inputs (alist-delete "udev" (package-inputs lvm2)))
2702 (propagated-inputs `(("udev" ,eudev)))
2705 (substitute-keyword-arguments (package-arguments lvm2)
2706 ((#:configure-flags flags '())
2707 ;; LVM2 doesn't use Libtool, hence the custom option.
2708 `(cons "--enable-static_link" ,flags))))
2709 (synopsis "Logical volume management for Linux (statically linked)")))
2711 (define-public wireless-tools
2713 (name "wireless-tools")
2717 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2721 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2724 ;; Remove the older header files that are not free software.
2725 (for-each (lambda (n)
2726 (delete-file (format #f "wireless.~a.h" n)))
2727 '(10 11 12 13 14 15 16 17 18 19 20))
2729 (build-system gnu-build-system)
2732 (list (string-append "PREFIX=" %output)
2733 (string-append "INSTALL_MAN=" %output "/share/man")
2734 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2736 #:phases (modify-phases %standard-phases
2737 (delete 'configure))
2739 (synopsis "Tools for manipulating Linux Wireless Extensions")
2740 (description "Wireless Tools are used to manipulate the now-deprecated
2741 Linux Wireless Extensions; consider using @code{iw} instead. The Wireless
2742 Extension was an interface allowing you to set Wireless LAN specific
2743 parameters and get the specific stats. It is deprecated in favor the nl80211
2745 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2746 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2747 ;; other files are distributed under gpl2.
2748 (license (list license:gpl2 license:lgpl2.1+))))
2756 (uri (string-append "mirror://kernel.org/software/network/crda/"
2757 "crda-" version ".tar.xz"))
2760 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2761 (patches (search-patches "crda-optional-gcrypt.patch"))))
2762 (build-system gnu-build-system)
2764 '(#:phases (modify-phases %standard-phases
2766 (add-after 'unpack 'gzip-determinism
2768 (substitute* "Makefile"
2769 (("gzip") "gzip --no-name"))
2772 'build 'no-werror-no-ldconfig
2774 (substitute* "Makefile"
2776 (("ldconfig") "true"))
2779 'build 'set-regulator-db-file-name
2780 (lambda* (#:key inputs #:allow-other-keys)
2781 ;; Tell CRDA where to find our database.
2782 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2783 (substitute* "crda.c"
2784 (("\"/lib/crda/regulatory.bin\"")
2785 (string-append "\"" regdb
2786 "/lib/crda/regulatory.bin\"")))
2788 #:test-target "verify"
2789 #:make-flags (let ((out (assoc-ref %outputs "out"))
2790 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2791 (list "CC=gcc" "V=1"
2793 ;; Disable signature-checking on 'regulatory.bin'.
2794 ;; The reason is that this simplifies maintenance
2795 ;; on our side (no need to manage a distro key
2796 ;; pair), and we can guarantee integrity of
2797 ;; 'regulatory.bin' by other means anyway, such as
2798 ;; 'guix gc --verify'. See
2799 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2803 (string-append "PREFIX=" out)
2804 (string-append "SBINDIR=" out "/sbin/")
2805 (string-append "UDEV_RULE_DIR="
2806 out "/lib/udev/rules.d")
2807 (string-append "LDFLAGS=-Wl,-rpath="
2809 (string-append "REG_BIN=" regdb
2810 "/lib/crda/regulatory.bin")))))
2811 (native-inputs `(("pkg-config" ,pkg-config)
2812 ("python" ,python-2)
2813 ("wireless-regdb" ,wireless-regdb)))
2814 (inputs `(("libnl" ,libnl)))
2816 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2817 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2819 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2820 communication between the kernel Linux and user space for regulatory
2822 (license license:copyleft-next)))
2824 (define-public wireless-regdb
2826 (name "wireless-regdb")
2827 (version "2019.06.03")
2831 "mirror://kernel.org/software/network/wireless-regdb/"
2832 "wireless-regdb-" version ".tar.xz"))
2835 "1gslvh0aqdkv48jyr2ddq153mw28i7qz2ybrjj9qvkk3dgc7x4fd"))
2837 ;; We're building 'regulatory.bin' by ourselves.
2839 (delete-file "regulatory.bin")
2841 (build-system gnu-build-system)
2844 (modify-phases %standard-phases
2845 (add-after 'unpack 'gzip-determinism
2847 (substitute* "Makefile"
2848 (("gzip") "gzip --no-name"))
2850 (add-after 'unpack 'omit-signature
2852 (substitute* "Makefile"
2853 ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we
2854 ;; don't provide (see below). Disable it.
2855 ((" regulatory\\.db\\.p7s") "")
2856 ;; regulatory.db is built as a dependency of regulatory.db.p7s,
2857 ;; but ‘make install’ depends only on the latter while installing
2858 ;; both (and failing). Depend on it explicitly.
2859 (("^install: " all) (string-append all "regulatory.db ")))
2861 (delete 'configure)) ; no configure script
2863 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2864 ;; is computed and can be equal to 'maintainer-clean'; when that
2865 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2866 ;; just built. Thus, build things sequentially.
2867 #:parallel-build? #f
2869 #:tests? #f ; no tests
2871 (let ((out (assoc-ref %outputs "out")))
2872 (list (string-append "PREFIX=" out)
2873 (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware")
2875 ;; Leave this empty so that db2bin.py doesn't try to sign
2876 ;; ‘regulatory.bin’. This allows us to avoid managing a key
2877 ;; pair for the whole distribution.
2878 (string-append "REGDB_PRIVKEY=")
2879 ;; Don't generate a public key for the same reason. These are
2880 ;; used as Makefile targets and can't be the empty string.
2881 (string-append "REGDB_PUBCERT=/dev/null")
2882 (string-append "REGDB_PUBKEY=/dev/null")))))
2884 `(("python" ,python-wrapper)))
2886 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2887 (synopsis "Wireless regulatory database")
2889 "This package contains the wireless regulatory database Central
2890 Regulatory Database Agent (CRDA) daemon. The database contains information on
2891 country-specific regulations for the wireless spectrum.")
2892 (license license:isc)))
2894 (define-public lm-sensors
2902 (url "https://github.com/groeck/lm-sensors.git")
2903 (commit (string-append "V" (string-join
2904 (string-split version #\.) "-")))))
2905 (file-name (git-file-name name version))
2907 (base32 "1mdrnb9r01z1xfdm6dpkywvf9yy9a4yzb59paih9sijwmigv19fj"))
2908 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2909 (build-system gnu-build-system)
2910 (inputs `(("rrdtool" ,rrdtool)
2913 ("gnuplot" ,gnuplot)))
2914 (native-inputs `(("pkg-config" ,pkg-config)
2918 (outputs '("lib" ;avoid perl in closure
2921 `(#:tests? #f ; no 'check' target
2922 #:make-flags (list (string-append "PREFIX=" %output)
2923 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2924 (string-append "INCLUDEDIR="
2925 (assoc-ref %outputs "lib") "/include")
2926 (string-append "MANDIR=" %output "/share/man")
2927 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
2929 (modify-phases %standard-phases
2931 (add-before 'build 'patch-exec-paths
2932 (lambda* (#:key inputs outputs #:allow-other-keys)
2933 (substitute* "prog/detect/sensors-detect"
2935 (string-append "`" (assoc-ref inputs "coreutils")
2937 (("(`|\")modprobe" all open-quote)
2938 (string-append open-quote
2939 (assoc-ref inputs "kmod")
2941 (substitute* '("prog/pwm/pwmconfig"
2942 "prog/pwm/fancontrol")
2944 (string-append (assoc-ref inputs "gnuplot")
2947 (string-append (assoc-ref inputs "coreutils")
2950 (string-append (assoc-ref inputs "grep")
2953 (string-append (assoc-ref inputs "sed")
2956 (string-append (assoc-ref inputs "coreutils")
2959 (string-append (assoc-ref inputs "coreutils")
2962 (string-append (assoc-ref inputs "coreutils")
2963 "/bin/readlink -f")))
2965 (home-page "https://hwmon.wiki.kernel.org/lm_sensors")
2966 (synopsis "Utilities to read temperature/voltage/fan sensors")
2968 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2969 you to access information from temperature, voltage, and fan speed sensors.
2970 It works with most newer systems.")
2971 (license license:gpl2+)))
2973 (define-public iucode-tool
2975 (name "iucode-tool")
2979 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2980 "/raw/latest/iucode-tool_" version ".tar.xz"))
2983 "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j"))))
2984 (build-system gnu-build-system)
2985 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2986 (synopsis "Manipulate Intel microcode bundles")
2988 "@command{iucode_tool} is a utility to work with microcode packages for
2989 Intel processors. It can convert between formats, extract specific versions,
2990 create a firmware image suitable for the Linux kernel, and more.")
2991 ;; cpuid.h is available for i686, x86_64, and ia64.
2992 (supported-systems '("i686-linux" "x86_64-linux"))
2993 (license license:gpl2+)))
2995 (define-public i2c-tools
3002 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
3003 version ".tar.bz2"))
3006 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
3007 (build-system gnu-build-system)
3009 `(#:tests? #f ; no 'check' target
3010 #:make-flags (list (string-append "prefix=" %output)
3012 ;; no configure script
3013 #:phases (modify-phases %standard-phases (delete 'configure))))
3016 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
3017 (synopsis "I2C tools for Linux")
3019 "The i2c-tools package contains a heterogeneous set of I2C tools for
3020 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
3021 EEPROM decoding scripts, EEPROM programming tools, and a python module for
3023 (license license:gpl2+)))
3025 (define-public xsensors
3032 "http://www.linuxhardware.org/xsensors/xsensors-"
3036 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
3037 (build-system gnu-build-system)
3038 (inputs `(("lm-sensors" ,lm-sensors "lib")
3040 (native-inputs `(("pkg-config" ,pkg-config)))
3043 (modify-phases %standard-phases
3044 (add-before 'configure 'enable-deprecated
3046 (substitute* "src/Makefile.in"
3047 (("-DGDK_DISABLE_DEPRECATED") "")
3048 (("-DGTK_DISABLE_DEPRECATED") ""))
3050 (add-before 'configure 'remove-Werror
3052 (substitute* '("configure" "src/Makefile.in")
3055 (home-page "http://www.linuxhardware.org/xsensors/")
3056 (synopsis "Hardware health information viewer")
3058 "Xsensors reads data from the libsensors library regarding hardware
3059 health such as temperature, voltage and fan speed and displays the information
3060 in a digital read-out.")
3061 (license license:gpl2+)))
3066 (version (package-version linux-libre))
3067 (source (package-source linux-libre))
3068 (build-system gnu-build-system)
3071 (modify-phases %standard-phases
3073 (lambda* (#:key inputs #:allow-other-keys)
3074 (setenv "SHELL_PATH" (which "bash"))
3075 (chdir "tools/perf")
3077 #:make-flags (list (string-append "prefix="
3078 (assoc-ref %outputs "out"))
3081 ;; By default, 'config/Makefile' uses lib64 on
3082 ;; x86_64. Work around that.
3084 #:tests? #f)) ;no tests
3086 `(("pkg-config" ,pkg-config)
3090 ;; There are build scripts written in these languages.
3092 ("python" ,python-2)))
3094 `(("slang" ,slang) ;for the interactive TUI
3096 ("python" ,python-2) ;'perf' links against libpython
3097 ("elfutils" ,elfutils)
3098 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
3099 ("libunwind" ,libunwind) ;better stack walking
3100 ("numactl" ,numactl) ;for 'perf bench numa mem'
3103 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
3104 ("docbook-xsl" ,docbook-xsl)
3106 ("asciidoc" ,asciidoc)))
3107 (home-page "https://perf.wiki.kernel.org/")
3108 (synopsis "Linux profiling with performance counters")
3110 "perf is a tool suite for profiling using hardware performance counters,
3111 with support in the Linux kernel. perf can instrument CPU performance
3112 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
3113 of lightweight profiling. This package contains the user-land tools and in
3114 particular the @code{perf} command.")
3115 (license (package-license linux-libre))))
3117 (define-public pflask
3123 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
3125 (file-name (string-append name "-" version ".tar.gz"))
3128 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
3129 (build-system cmake-build-system)
3131 '(#:tests? #f)) ; no tests
3132 (home-page "https://ghedo.github.io/pflask/")
3133 (synopsis "Simple tool for creating Linux namespace containers")
3134 (description "pflask is a simple tool for creating Linux namespace
3135 containers. It can be used for running a command or even booting an OS inside
3136 an isolated container, created with the help of Linux namespaces. It is
3137 similar in functionality to chroot, although pflask provides better isolation
3138 thanks to the use of namespaces.")
3139 (license license:bsd-2)))
3141 (define-public singularity
3143 (name "singularity")
3147 (uri (string-append "https://github.com/singularityware/singularity/"
3148 "releases/download/" version
3149 "/singularity-" version ".tar.gz"))
3152 "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk"))
3153 (modules '((guix build utils)))
3156 ;; Do not create directories in /var.
3157 (substitute* "Makefile.in"
3158 (("\\$\\(MAKE\\) .*install-data-hook") ""))
3160 ;; The original source overrides PATH so that it points to
3161 ;; /bin, /usr/local/bin, etc., which obviously doesn't work
3162 ;; on Guix System. Leave PATH unchanged so we refer to the
3163 ;; installed Coreutils, grep, etc.
3164 (substitute* "bin/singularity.in"
3166 (string-append "#" all "\n")))
3168 (substitute* (find-files "libexec/cli" "\\.exec$")
3169 (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid"
3171 (string-append "/run/setuid-programs/singularity-"
3172 program "-helper")))
3174 (build-system gnu-build-system)
3176 `(#:configure-flags '("--localstatedir=/var")
3178 (modify-phases %standard-phases
3179 (add-after 'unpack 'patch-reference-to-squashfs-tools
3181 (substitute* "libexec/cli/build.exec"
3182 (("if ! singularity_which mksquashfs") "if 0")
3183 (("if ! mksquashfs")
3184 (string-append "if ! " (which "mksquashfs"))))
3187 `(("libarchive" ,libarchive)
3188 ("python" ,python-wrapper)
3191 ("squashfs-tools" ,squashfs-tools)))
3192 (home-page "https://singularity.lbl.gov/")
3193 (synopsis "Container platform")
3194 (description "Singularity is a container platform supporting a number of
3195 container image formats. It can build SquashFS container images or import
3196 existing Docker images. Singularity requires kernel support for container
3197 isolation or root privileges.")
3198 (license license:bsd-3)))
3200 (define-public hdparm
3206 (uri (string-append "mirror://sourceforge/hdparm/hdparm/"
3207 "hdparm-" version ".tar.gz"))
3210 "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws"))))
3211 (build-system gnu-build-system)
3213 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3214 (list (string-append "binprefix=" out)
3215 (string-append "manprefix=" out)
3218 (modify-phases %standard-phases
3219 (delete 'configure)) ; no configure script
3220 #:tests? #f)) ; no test suite
3221 (home-page "https://sourceforge.net/projects/hdparm/")
3222 (synopsis "View and tune ATA disk drive parameters")
3224 "@command{hdparm} is a command-line utility to control ATA controllers and
3225 disk drives. It can increase performance and/or reliability by careful tuning
3226 of hardware settings like power and acoustic management, DMA modes, and caching.
3227 It can also display detailed device information, or be used as a simple
3228 performance benchmarking tool.
3230 @command{hdparm} provides a command line interface to various Linux kernel
3231 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
3232 IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
3233 Translation (@dfn{SAT}) are also supported.")
3234 (license (license:non-copyleft "file://LICENSE.TXT"))))
3236 (define-public rfkill
3242 (uri (string-append "mirror://kernel.org/software/network/"
3243 name "/" name "-" version ".tar.xz"))
3246 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
3247 (build-system gnu-build-system)
3249 `(#:make-flags (list "CC=gcc"
3250 (string-append "PREFIX=" %output))
3251 #:phases (modify-phases %standard-phases
3252 (delete 'configure))
3254 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
3255 (synopsis "Tool for enabling and disabling wireless devices")
3257 "rfkill is a simple tool for accessing the rfkill device interface,
3258 which is used to enable and disable wireless networking devices, typically
3259 WLAN, Bluetooth and mobile broadband.")
3260 (license (license:non-copyleft "file://COPYING"
3261 "See COPYING in the distribution."))
3262 ;; rfkill is part of util-linux as of 2.31.
3263 (properties `((superseded . ,util-linux)))))
3271 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
3272 version "/" name "-" version ".tar.gz"))
3275 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
3276 (build-system gnu-build-system)
3277 (home-page "http://acpiclient.sourceforge.net")
3278 (synopsis "Display information on ACPI devices")
3279 (description "@code{acpi} attempts to replicate the functionality of the
3280 \"old\" @code{apm} command on ACPI systems, including battery and thermal
3281 information. It does not support ACPI suspending, only displays information
3282 about ACPI devices.")
3283 (license license:gpl2+)))
3285 (define-public acpid
3291 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
3295 "1hrc0xm6q12knbgzhq0i8g2rfrkwcvh1asd7k9rs3nc5xmlwd7gw"))))
3296 (build-system gnu-build-system)
3297 (home-page "https://sourceforge.net/projects/acpid2/")
3298 (synopsis "Daemon for delivering ACPI events to user-space programs")
3300 "acpid is designed to notify user-space programs of Advanced
3301 Configuration and Power Interface (ACPI) events. acpid should be started
3302 during the system boot, and will run as a background process. When an ACPI
3303 event is received from the kernel, acpid will examine the list of rules
3304 specified in /etc/acpi/events and execute the rules that match the event.")
3305 (license license:gpl2+)))
3307 (define-public sysfsutils
3316 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
3319 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
3320 (build-system gnu-build-system)
3321 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
3322 (synopsis "System utilities based on Linux sysfs")
3324 "These are a set of utilities built upon sysfs, a virtual file system in
3325 Linux kernel versions 2.5+ that exposes a system's device tree. The package
3326 also contains the libsysfs library.")
3327 ;; The library is under lgpl2.1+ (all files say "or any later version").
3328 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3329 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
3331 (define-public sysfsutils-1
3333 (inherit sysfsutils)
3340 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
3341 "/sysfsutils-" version ".tar.gz"))
3343 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
3344 (modules '((guix build utils)))
3347 (substitute* "Makefile.in"
3348 (("includedir = /usr/include/sysfs")
3349 "includedir = @includedir@"))
3350 (substitute* "configure"
3351 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
3352 (string-append "includedir='" orig "/sysfs'")))
3354 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
3356 (define-public cpufrequtils
3358 (name "cpufrequtils")
3363 (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/"
3364 "cpufrequtils-" version ".tar.gz"))
3366 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
3367 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
3368 (build-system gnu-build-system)
3370 `(("sysfsutils" ,sysfsutils-1)))
3372 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3373 (assoc-ref %outputs "out") "/lib"))))
3374 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
3375 (synopsis "Utilities to get and set CPU frequency on Linux")
3377 "The cpufrequtils suite contains utilities to retrieve CPU frequency
3378 information, and set the CPU frequency if supported, using the cpufreq
3379 capabilities of the Linux kernel.")
3380 (license license:gpl2)))
3382 (define-public libraw1394
3389 "mirror://kernel.org/linux/libs/ieee1394/"
3390 name "-" version ".tar.xz"))
3393 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
3394 (build-system gnu-build-system)
3395 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3396 (synopsis "Interface library for the Linux IEEE1394 drivers")
3398 "Libraw1394 is the only supported interface to the kernel side raw1394 of
3399 the Linux IEEE-1394 subsystem, which provides direct access to the connected
3400 1394 buses to user space. Through libraw1394/raw1394, applications can directly
3401 send to and receive from other nodes without requiring a kernel driver for the
3402 protocol in question.")
3403 (license license:lgpl2.1+)))
3405 (define-public libavc1394
3411 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
3412 name "-" version ".tar.gz"))
3415 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
3416 (build-system gnu-build-system)
3418 `(("pkg-config" ,pkg-config)))
3420 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3421 (home-page "https://sourceforge.net/projects/libavc1394/")
3422 (synopsis "AV/C protocol library for IEEE 1394")
3424 "Libavc1394 is a programming interface to the AV/C specification from
3425 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3426 (license license:lgpl2.1+)))
3428 (define-public libiec61883
3430 (name "libiec61883")
3435 "mirror://kernel.org/linux/libs/ieee1394/"
3436 name "-" version ".tar.xz"))
3439 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
3440 (build-system gnu-build-system)
3442 `(("pkg-config" ,pkg-config)))
3444 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
3445 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
3446 (synopsis "Isochronous streaming media library for IEEE 1394")
3448 "The libiec61883 library provides a higher level API for streaming DV,
3449 MPEG-2 and audio over Linux IEEE 1394.")
3450 (license license:lgpl2.1+)))
3452 (define-public mdadm
3459 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
3463 "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb"))))
3464 (build-system gnu-build-system)
3468 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
3472 ;; TODO: tell it where to find 'sendmail'
3473 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
3474 (string-append "BINDIR=" out "/sbin")
3475 (string-append "MANDIR=" out "/share/man")
3476 (string-append "UDEVDIR=" out "/lib/udev")))
3478 (modify-phases %standard-phases
3479 (add-before 'build 'patch-program-paths
3480 (lambda* (#:key inputs #:allow-other-keys)
3481 (let ((coreutils (assoc-ref inputs "coreutils")))
3482 (substitute* "udev-md-raid-arrays.rules"
3483 (("/usr/bin/(readlink|basename)" all program)
3484 (string-append coreutils "/bin/" program))))
3486 (add-before 'build 'remove-W-error
3488 ;; We cannot build with -Werror on i686 due to a
3489 ;; 'sign-compare' warning in util.c.
3490 (substitute* "Makefile"
3493 (delete 'configure))
3494 ;;tests must be done as root
3496 (home-page "http://neil.brown.name/blog/mdadm")
3497 (synopsis "Tool for managing Linux Software RAID arrays")
3499 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
3500 assemble, report on, and monitor arrays. It can also move spares between raid
3501 arrays when needed.")
3502 (license license:gpl2+)))
3504 (define-public mdadm-static
3507 (name "mdadm-static")
3509 (substitute-keyword-arguments (package-arguments mdadm)
3510 ((#:make-flags flags)
3511 `(cons "LDFLAGS = -static" ,flags))
3513 `(modify-phases ,phases
3514 (add-after 'install 'remove-cruft
3515 (lambda* (#:key outputs #:allow-other-keys)
3516 (let* ((out (assoc-ref outputs "out"))
3517 (precious? (lambda (file)
3518 (member file '("." ".." "sbin"))))
3519 (directories (scandir out (negate precious?))))
3520 (with-directory-excursion out
3521 (for-each delete-file-recursively directories)
3522 (remove-store-references "sbin/mdadm")
3523 (delete-file "sbin/mdmon")
3525 ((#:modules modules %gnu-build-system-modules)
3526 `((ice-9 ftw) ,@modules))
3527 ((#:strip-flags _ '())
3528 ''("--strip-all")) ;strip a few extra KiB
3529 ((#:allowed-references _ '("out"))
3530 '("out")))) ;refer only self
3531 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
3533 (define-public multipath-tools
3535 (name "multipath-tools")
3539 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
3540 ".git;a=snapshot;h=" version ";sf=tgz"))
3541 (file-name (string-append name "-" version ".tar.gz"))
3544 "0kb4mhzwyygdbikikmby6hj39pb3nrzv05v526c75wnycwnpxg31"))
3545 (modules '((guix build utils)))
3548 ;; Drop bundled valgrind headers.
3549 (delete-file-recursively "third-party")
3550 (substitute* '("multipathd/main.c"
3551 "libmultipath/debug.c")
3552 (("#include \"../third-party/")
3555 (build-system gnu-build-system)
3557 '(#:tests? #f ; no tests
3558 #:make-flags (list "CC=gcc"
3559 (string-append "DESTDIR="
3560 (assoc-ref %outputs "out"))
3562 (string-append "LDFLAGS=-Wl,-rpath="
3563 (assoc-ref %outputs "out")
3566 (modify-phases %standard-phases
3567 (add-after 'unpack 'patch-source
3568 (lambda* (#:key inputs #:allow-other-keys)
3569 (let ((lvm2 (assoc-ref inputs "lvm2"))
3570 (udev (assoc-ref inputs "udev")))
3571 (substitute* "Makefile.inc"
3572 (("\\$\\(prefix\\)/usr") "$(prefix)")
3573 ;; Do not save timestamp to avoid gzip "timestamp
3574 ;; out-of-range" warnings.
3575 (("gzip -9") "gzip -9n"))
3576 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3577 (("/usr/include/libdevmapper.h")
3578 (string-append lvm2 "/include/libdevmapper.h"))
3579 (("/usr/include/libudev.h")
3580 (string-append udev "/include/libudev.h")))
3582 (delete 'configure)))) ; no configure script
3585 ("pkg-config" ,pkg-config)
3586 ("valgrind" ,valgrind)))
3588 `(("json-c" ,json-c)
3590 ("liburcu" ,liburcu)
3592 ("readline" ,readline)
3594 (home-page "http://christophe.varoqui.free.fr/")
3595 (synopsis "Access block devices through multiple paths")
3597 "This package provides the following binaries to drive the
3598 Linux Device Mapper multipathing driver:
3600 @item @command{multipath} - Device mapper target autoconfig.
3601 @item @command{multipathd} - Multipath daemon.
3602 @item @command{mpathpersist} - Manages SCSI persistent reservations on
3603 @code{dm} multipath devices.
3604 @item @command{kpartx} - Create device maps from partition tables.
3606 (license (list license:gpl2+ ; main distribution
3607 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3609 (define-public libaio
3616 (string-append "https://releases.pagure.org/libaio/"
3617 name "-" version ".tar.gz")))
3620 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
3621 (build-system gnu-build-system)
3624 (list "CC=gcc" (string-append "prefix=" %output))
3625 #:test-target "partcheck" ; need root for a full 'check'
3627 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
3628 (home-page "https://pagure.io/libaio")
3629 (synopsis "Linux-native asynchronous I/O access library")
3631 "This library enables userspace to use Linux kernel asynchronous I/O
3632 system calls, important for the performance of databases and other advanced
3634 (license license:lgpl2.1+)))
3642 (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-"
3646 "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si"))))
3647 (build-system gnu-build-system)
3649 `(("libsndfile" ,libsndfile)))
3651 `(("pkg-config" ,pkg-config)))
3652 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3653 (synopsis "Bluetooth subband audio codec")
3655 "The SBC is a digital audio encoder and decoder used to transfer data to
3656 Bluetooth audio output devices like headphones or loudspeakers.")
3657 (license license:gpl2+)))
3659 (define-public bluez
3666 "mirror://kernel.org/linux/bluetooth/bluez-"
3670 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
3671 (build-system gnu-build-system)
3674 (let ((out (assoc-ref %outputs "out")))
3675 (list "--sysconfdir=/etc"
3676 "--localstatedir=/var"
3679 ;; Install dbus/udev files to the correct location.
3680 (string-append "--with-dbusconfdir=" out "/etc")
3681 (string-append "--with-udevdir=" out "/lib/udev")))
3683 (modify-phases %standard-phases
3684 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3685 ;; issue (discussion on upstream mailing list:
3686 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3687 (add-before 'check 'skip-wonky-test
3689 (substitute* "unit/test-gatt.c"
3690 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3692 (add-after 'install 'post-install
3693 (lambda* (#:key inputs outputs #:allow-other-keys)
3694 (let* ((out (assoc-ref outputs "out"))
3695 (servicedir (string-append out "/share/dbus-1/services"))
3696 (service "obexd/src/org.bluez.obex.service")
3697 (rule (string-append
3698 out "/lib/udev/rules.d/97-hid2hci.rules")))
3699 ;; Install the obex dbus service file.
3700 (substitute* service
3702 (string-append out "/libexec/bluetooth/obexd")))
3703 (install-file service servicedir)
3704 ;; Fix paths in the udev rule.
3706 (("hid2hci --method")
3707 (string-append out "/lib/udev/hid2hci --method"))
3709 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
3712 `(("pkg-config" ,pkg-config)
3713 ("gettext" ,gettext-minimal)))
3718 ("libical" ,libical)
3719 ("readline" ,readline)))
3720 (home-page "http://www.bluez.org/")
3721 (synopsis "Linux Bluetooth protocol stack")
3723 "BlueZ provides support for the core Bluetooth layers and protocols. It
3724 is flexible, efficient and uses a modular implementation.")
3725 (license license:gpl2+)))
3727 (define-public fuse-exfat
3734 "https://github.com/relan/exfat/releases/download/v"
3735 version "/" name "-" version ".tar.gz"))
3738 "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87"))))
3739 (build-system gnu-build-system)
3741 `(("pkg-config" ,pkg-config)))
3744 (home-page "https://github.com/relan/exfat")
3745 (synopsis "Mount exFAT file systems")
3747 "This package provides a FUSE-based file system that provides read and
3748 write access to exFAT devices.")
3749 (license license:gpl2+)))
3751 (define-public fuseiso
3754 (version "20070708")
3757 (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/"
3758 version "/fuseiso-" version ".tar.bz2"))
3761 "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b"))))
3762 (build-system gnu-build-system)
3764 `(("pkg-config" ,pkg-config)))
3769 (home-page "https://sourceforge.net/projects/fuseiso/")
3770 (synopsis "Mount ISO file system images")
3772 "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg,
3773 .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock
3774 Ridge, Joliet, and zisofs.")
3775 (license license:gpl2)))
3784 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3785 version ".tar.bz2"))
3786 (patches (search-patches "gpm-glibc-2.26.patch"))
3789 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3790 (build-system gnu-build-system)
3792 '(#:phases (modify-phases %standard-phases
3795 ;; The tarball was not generated with 'make dist' so we
3796 ;; need to bootstrap things ourselves.
3797 (substitute* "autogen.sh"
3798 (("/bin/sh") (which "sh")))
3799 (invoke "./autogen.sh")
3800 (patch-makefile-SHELL "Makefile.include.in")
3803 ;; Make sure programs find libgpm.so.
3804 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3805 (assoc-ref %outputs "out")
3808 `(("texinfo" ,texinfo)
3811 ("autoconf" ,autoconf)
3812 ("automake" ,automake)
3813 ("libtool" ,libtool)))
3814 (home-page "http://www.nico.schottelius.org/software/gpm/")
3815 (synopsis "Mouse support for the Linux console")
3817 "The GPM (general-purpose mouse) daemon is a mouse server for
3818 applications running on the Linux console. It allows users to select items
3819 and copy/paste text in the console and in xterm.")
3820 (license license:gpl2+)))
3822 (define-public btrfs-progs
3824 (name "btrfs-progs")
3828 (uri (string-append "mirror://kernel.org/linux/kernel/"
3829 "people/kdave/btrfs-progs/"
3830 "btrfs-progs-v" version ".tar.xz"))
3833 "06xybs7rglxjqkbzl2409acb3rgmnc5zc0xhyaxsc2p1x5yipfcw"))))
3834 (build-system gnu-build-system)
3836 "static")) ; static versions of the binaries in "out"
3838 '(#:phases (modify-phases %standard-phases
3839 (add-after 'build 'build-static
3840 (lambda _ (invoke "make" "static")))
3841 (add-after 'install 'install-bash-completion
3842 (lambda* (#:key outputs #:allow-other-keys)
3843 (let* ((out (assoc-ref outputs "out"))
3844 (bashcomp (string-append out "/etc/bash_completion.d")))
3846 (copy-file "btrfs-completion"
3847 (string-append bashcomp "/btrfs"))
3849 (add-after 'install 'install-static
3850 (let ((staticbin (string-append (assoc-ref %outputs "static")
3854 (string-append "bindir=" staticbin)
3855 "install-static")))))
3856 #:tests? #f ; XXX: require the 'btrfs' kernel module.
3857 #:test-target "test"
3858 #:parallel-tests? #f)) ; tests fail when run in parallel
3859 (inputs `(("e2fsprogs" ,e2fsprogs)
3860 ("libblkid" ,util-linux)
3861 ("libblkid:static" ,util-linux "static")
3862 ("libuuid" ,util-linux)
3863 ("libuuid:static" ,util-linux "static")
3866 ("zlib:static" ,zlib "static")
3867 ("zstd" ,zstd "lib")
3868 ("zstd:static" ,zstd "static")))
3869 (native-inputs `(("pkg-config" ,pkg-config)
3870 ("asciidoc" ,asciidoc)
3873 ;; For building documentation.
3874 ("libxml2" ,libxml2)
3875 ("docbook-xsl" ,docbook-xsl)
3879 ;; The tests need 'grep' with perl regexp support.
3881 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
3882 (synopsis "Create and manage btrfs copy-on-write file systems")
3883 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3884 aimed at implementing advanced features while focusing on fault tolerance,
3885 repair and easy administration.")
3886 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3887 ;; GPL2: Everything else.
3888 (license (list license:gpl2 license:gpl2+))))
3890 (define-public btrfs-progs/static
3892 (name "btrfs-progs-static")
3893 (version (package-version btrfs-progs))
3895 (build-system trivial-build-system)
3897 `(("btrfs-progs:static" ,btrfs-progs "static")))
3899 `(#:modules ((guix build utils))
3902 (use-modules (guix build utils)
3906 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3907 (out (assoc-ref %outputs "out"))
3908 (source (string-append btrfs "/bin/btrfs.static"))
3909 (target (string-append out "/bin/btrfs")))
3910 (mkdir-p (dirname target))
3911 (copy-file source target)
3912 (remove-store-references target)
3913 (chmod target #o555)
3915 (home-page (package-home-page btrfs-progs))
3916 (synopsis "Statically-linked btrfs command from btrfs-progs")
3917 (description "This package provides the statically-linked @command{btrfs}
3918 from the btrfs-progs package. It is meant to be used in initrds.")
3919 (license (package-license btrfs-progs))))
3921 (define-public f2fs-tools-1.7
3928 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3929 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
3932 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
3934 (build-system gnu-build-system)
3937 (modify-phases %standard-phases
3938 (add-after 'install 'install-headers
3939 (lambda* (#:key outputs #:allow-other-keys)
3940 (let* ((out (assoc-ref outputs "out"))
3941 (out-include (string-append out "/include")))
3942 (install-file "include/f2fs_fs.h" out-include)
3943 (install-file "mkfs/f2fs_format_utils.h" out-include)
3946 `(("autoconf" ,autoconf)
3947 ("automake" ,automake)
3948 ("libtool" ,libtool)
3949 ("pkg-config" ,pkg-config)))
3951 `(("libuuid" ,util-linux)
3952 ("libselinux" ,libselinux)))
3953 (home-page "https://f2fs.wiki.kernel.org/")
3954 (synopsis "Userland tools for f2fs")
3956 "F2FS, the Flash-Friendly File System, is a modern file system
3957 designed to be fast and durable on flash devices such as solid-state
3958 disks and SD cards. This package provides the userland utilities.")
3959 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3960 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3961 (license (list license:gpl2 license:lgpl2.1))))
3963 (define-public f2fs-tools
3965 (inherit f2fs-tools-1.7)
3971 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3972 "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz"))
3975 "15pn2fm9knn7p1vzfzy6msnrdl14p6y1gn4m2ka6ba5bzx6lw4p2"))))
3977 `(("libuuid" ,util-linux)))))
3979 (define-public freefall
3982 (version (package-version linux-libre))
3983 (source (package-source linux-libre))
3984 (build-system gnu-build-system)
3986 '(#:phases (modify-phases %standard-phases
3987 (add-after 'unpack 'enter-subdirectory
3989 (chdir "tools/laptop/freefall")
3992 (add-before 'build 'increase-timeout
3994 ;; The default of 2 seconds is too low: it assumes an
3995 ;; open lid and AC power without actually checking.
3996 (substitute* "freefall.c"
3997 (("alarm\\(2\\)") "alarm(5)"))
3999 #:make-flags (list (string-append "PREFIX="
4000 (assoc-ref %outputs "out"))
4002 #:tests? #f)) ;no tests
4003 (home-page (package-home-page linux-libre))
4004 (synopsis "Free-fall protection for spinning laptop hard drives")
4006 "Prevents shock damage to the internal spinning hard drive(s) of some
4007 HP and Dell laptops. When sudden movement is detected, all input/output
4008 operations on the drive are suspended and its heads are parked on the ramp,
4009 where they are less likely to cause damage to the spinning disc. Requires a
4010 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
4011 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
4012 (license license:gpl2)))
4014 (define-public thinkfan
4022 (url "https://github.com/vmatare/thinkfan.git")
4024 (file-name (git-file-name name version))
4026 (base32 "107vw0962hrwva3wra9n3hxlbfzg82ldc10qssv3dspja88g8psr"))))
4027 (build-system cmake-build-system)
4029 `(#:modules ((guix build cmake-build-system)
4032 #:tests? #f ; no test target
4034 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
4035 ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly
4037 `("-DUSE_ATASMART:BOOL=ON")
4039 (modify-phases %standard-phases
4040 (add-after 'unpack 'create-init-scripts
4041 ;; CMakeLists.txt relies on build-time symptoms of OpenRC and
4042 ;; systemd to patch and install their service files. Fake their
4043 ;; presence rather than duplicating the build system below. Leave
4044 ;; things like ‘/bin/kill’ because they're not worth a dependency.
4045 ;; The sysvinit needs manual patching, but since upstream doesn't
4046 ;; even provide the option to install it: don't.
4047 (lambda* (#:key outputs #:allow-other-keys)
4048 (let* ((out (assoc-ref outputs "out"))
4049 (share (string-append out "/share/" ,name)))
4050 (substitute* "CMakeLists.txt"
4051 (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package)
4052 (format "option(~a_FOUND \"Faked\" ON)\n" package))
4053 ;; That was easy! Now we just need to fix the destinations.
4055 (string-append out directory)))
4058 `(("pkg-config" ,pkg-config)))
4060 `(("libatasmart" ,libatasmart)
4061 ("yaml-cpp" ,yaml-cpp)))
4062 (home-page "http://thinkfan.sourceforge.net/")
4063 (synopsis "Simple fan control program")
4065 "Thinkfan is a simple fan control program. It reads temperatures,
4066 checks them against configured limits and switches to appropriate (also
4067 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
4068 other @code{hwmon} driver that enables temperature reading and fan control
4070 (license license:gpl3+)))
4072 (define-public tpacpi-bat
4080 (url "https://github.com/teleshoes/tpacpi-bat.git")
4081 (commit (string-append "v" version))))
4082 (file-name (git-file-name name version))
4084 (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
4085 (build-system gnu-build-system)
4087 `(#:tests? #f ; no test target
4089 (modify-phases %standard-phases
4090 (add-after 'unpack 'refer-to-inputs
4092 (substitute* "tpacpi-bat"
4094 (format "~a " (which "cat")))
4095 ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
4096 ;; loaded. That's the administrator's prerogative; disable it.
4097 (("system \"(modprobe .*)\"" _ match)
4098 (format "die \"Please run ‘~a’ first.\\n\"" match)))
4100 (delete 'configure) ; nothing to configure
4101 (delete 'build) ; nothing to build
4103 (lambda* (#:key outputs #:allow-other-keys)
4104 (let* ((out (assoc-ref outputs "out"))
4105 (bin (string-append out "/bin"))
4106 (doc (string-append out "/share/doc/" ,name "-" ,version)))
4107 (install-file "tpacpi-bat" bin)
4109 ;; There's no man page. Install other forms of documentation.
4110 (for-each (lambda (file)
4111 (let ((target (string-append doc "/" file)))
4112 (mkdir-p (dirname target))
4113 (copy-recursively file target)))
4114 (list "battery_asl" "examples" "README.md"))
4118 (home-page "https://github.com/teleshoes/tpacpi-bat")
4119 (synopsis "ThinkPad battery charge controller")
4121 "Tpacpi-bat is a command-line interface to control battery charging on
4122 @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
4123 ThinkPad models released after 2011}, starting with the xx20 series. It can
4124 query and set the thresholds at which one or both batteries will start and stop
4125 charging, inhibit charging batteries for a set period of time, or force them to
4126 discharge when they otherwise would not.
4128 This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
4129 kernel module provided by the @code{acpi-call-linux-module} package, which must
4130 be installed and loaded separately. Only the original vendor firmware is
4132 (license license:gpl3+)))
4134 (define-public ntfs-3g
4137 (version "2017.3.23")
4140 (uri (string-append "https://tuxera.com/opensource/"
4141 "ntfs-3g_ntfsprogs-" version ".tgz"))
4142 (patches (search-patches "ntfs-3g-CVE-2019-9755.patch"))
4145 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
4146 (modules '((guix build utils)))
4148 ;; Install under $prefix.
4149 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
4153 (build-system gnu-build-system)
4154 (inputs `(("util-linux" ,util-linux)
4155 ("fuse" ,fuse))) ;libuuid
4156 (native-inputs `(("pkg-config" ,pkg-config)))
4158 '(#:configure-flags (list "--exec-prefix=${prefix}"
4159 "--with-fuse=external" ;use our own FUSE
4160 "--enable-mount-helper"
4161 "--enable-posix-acls"
4162 "--enable-xattr-mappings")
4164 (modify-phases %standard-phases
4165 ;; If users install ntfs-3g, they probably want to make it the
4166 ;; default driver as well, so we opt for sensible defaults and link
4167 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
4168 ;; mount NTFS file systems.)
4169 (add-after 'install 'install-link
4170 (lambda* (#:key outputs #:allow-other-keys)
4171 (let* ((out (assoc-ref outputs "out"))
4172 (sbin (string-append out "/sbin")))
4173 (symlink "mount.ntfs-3g"
4174 (string-append sbin "/mount.ntfs")))
4176 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
4177 (synopsis "Read-write access to NTFS file systems")
4179 "NTFS-3G provides read-write access to NTFS file systems, which are
4180 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
4181 The package provides additional NTFS tools.")
4182 (license license:gpl2+)))
4184 (define-public rdma-core
4190 (uri (string-append "https://github.com/linux-rdma/rdma-core"
4191 "/releases/download/v" version "/rdma-core-"
4195 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
4196 (build-system cmake-build-system)
4198 '(#:tests? #f ; no tests
4199 ;; Upstream uses the "ninja" build system and encourage distros
4200 ;; to do the same for consistency. They also recommend using the
4201 ;; "Release" build type.
4202 #:build-type "Release"
4203 #:configure-flags (list "-GNinja")
4205 (modify-phases %standard-phases
4209 "-j" (number->string (parallel-job-count)))))
4212 (invoke "ninja" "install"))))))
4215 ("pkg-config" ,pkg-config)
4216 ("python" ,python-wrapper)))
4220 (home-page "https://github.com/linux-rdma/rdma-core")
4221 (synopsis "Utilities and libraries for working with RDMA devices")
4223 "This package provides userspace components for the InfiniBand
4224 subsystem of the Linux kernel. Specifically it contains userspace
4225 libraries for the following device nodes:
4228 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
4229 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
4230 @item @file{/dev/infiniband/umadX} (@code{libibumad})
4233 The following service daemons are also provided:
4235 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
4236 @item @code{iwpmd} (for iWARP kernel providers)
4237 @item @code{ibacm} (for InfiniBand communication management assistant)
4239 ;; All library code is dual licensed under GPL2 and a custom MIT
4240 ;; variant. The package also includes some components covered by
4241 ;; other licenses. Consult COPYING.md for full details.
4244 (license:x11-style "See COPYING.BSD_MIT in the distribution")
4245 license:bsd-2 ; Files referring to COPYING.BSD_FB
4246 license:cc0 ; most files in ccan/
4247 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
4249 (define-public perftest
4256 (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v"
4257 version "/perftest-" version ".g0927198.tar.gz"))
4259 (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq"))))
4260 (build-system gnu-build-system)
4263 (modify-phases %standard-phases
4264 (add-after 'unpack 'patch-header-paths
4266 (substitute* '("src/raw_ethernet_fs_rate.c"
4267 "src/raw_ethernet_resources.c"
4268 "src/raw_ethernet_resources.h"
4269 "src/raw_ethernet_send_burst_lat.c"
4270 "src/raw_ethernet_send_bw.c"
4271 "src/raw_ethernet_send_lat.c")
4272 (("/usr/include/netinet/ip.h") "netinet/ip.h"))
4274 (inputs `(("rdma-core" ,rdma-core)))
4275 (home-page "https://github.com/linux-rdma/perftest/")
4276 (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests")
4277 (description "This is a collection of tests written over uverbs intended for
4278 use as a performance micro-benchmark. The tests may be used for hardware or
4279 software tuning as well as for functional testing.
4281 The collection contains a set of bandwidth and latency benchmark such as:
4283 @item Send - @code{ib_send_bw} and @code{ib_send_lat}
4284 @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat}
4285 @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat}
4286 @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat}
4287 @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat}
4289 (license license:gpl2)))
4291 (define-public rng-tools
4294 (home-page "https://github.com/nhorman/rng-tools")
4298 (uri (git-reference (url home-page)
4299 (commit (string-append "v" version))))
4300 (file-name (git-file-name name version))
4303 "19f75m6mzg8h7b4snzg7d6ypvkz6nq32lrpi9ja95gqz4wsd18a5"))))
4304 (build-system gnu-build-system)
4306 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
4307 #:configure-flags '("--without-nistbeacon"
4308 "--without-pkcs11")))
4310 `(("autoconf" ,autoconf)
4311 ("automake" ,automake)
4312 ("pkg-config" ,pkg-config)))
4314 `(("libsysfs" ,sysfsutils)))
4315 (synopsis "Random number generator daemon")
4317 "Monitor a hardware random number generator, and supply entropy
4318 from that to the system kernel's @file{/dev/random} machinery.")
4319 ;; The source package is offered under the GPL2+, but the files
4320 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
4321 (license (list license:gpl2 license:gpl2+))))
4323 (define-public cpupower
4326 (version (package-version linux-libre))
4327 (source (package-source linux-libre))
4328 (build-system gnu-build-system)
4330 '(#:phases (modify-phases %standard-phases
4331 (add-after 'unpack 'enter-subdirectory
4333 (chdir "tools/power/cpupower")
4336 (add-before 'build 'fix-makefiles
4338 (substitute* "Makefile"
4340 (("/bin/(install|pwd)" _ command) command))
4341 (substitute* "bench/Makefile"
4342 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o"))
4344 #:make-flags (let ((out (assoc-ref %outputs "out")))
4345 (list (string-append "DESTDIR=" out)
4346 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
4347 "docdir=/share/doc/cpupower"
4348 "confdir=$(docdir)/examples"
4349 ;; The Makefile recommends the following changes
4351 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
4352 #:tests? #f)) ;no tests
4353 (native-inputs `(("gettext" ,gettext-minimal)))
4354 (inputs `(("pciutils" ,pciutils)))
4355 (home-page (package-home-page linux-libre))
4356 (synopsis "CPU frequency and voltage scaling tools for Linux")
4358 "cpupower is a set of user-space tools that use the cpufreq feature of the
4359 Linux kernel to retrieve and control processor features related to power saving,
4360 such as frequency and voltage scaling.")
4361 (license license:gpl2)))
4363 (define-public x86-energy-perf-policy
4365 (name "x86-energy-perf-policy")
4366 (version (package-version linux-libre))
4367 (source (package-source linux-libre))
4368 (build-system gnu-build-system)
4372 (modify-phases %standard-phases
4373 (add-after 'unpack 'enter-subdirectory
4375 (chdir "tools/power/x86/x86_energy_perf_policy")
4378 (add-before 'build 'fix-makefile
4380 (substitute* "Makefile" (("/usr") ""))
4383 (let ((out (assoc-ref %outputs "out")))
4384 (list (string-append "DESTDIR=" out)
4385 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))))
4386 (supported-systems '("i686-linux" "x86_64-linux"))
4387 (home-page (package-home-page linux-libre))
4388 (synopsis "Display and update Intel-CPU energy-performance policy")
4390 "@command{x86_energy_perf_policy} displays and updates energy-performance
4391 policy settings specific to Intel Architecture Processors. Settings are
4392 accessed via Model Specific Register (MSR) updates, no matter if the Linux
4393 cpufreq sub-system is enabled or not.")
4394 (license license:gpl2)))
4396 (define-public haveged
4404 (url "https://github.com/jirka-h/haveged.git")
4406 (file-name (git-file-name name version))
4408 (base32 "1hrwzjd4byq4fdrg8svww3d8x449k80jxxrjy9v6jvzhfv19rvxr"))))
4409 (build-system gnu-build-system)
4410 (home-page "http://www.issihosts.com/haveged")
4411 (synopsis "Entropy source for the Linux random number generator")
4413 "haveged generates an unpredictable stream of random numbers for use by
4414 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
4415 standard mechanisms for filling the entropy pool may not be sufficient for
4416 systems with high needs or limited user interaction, such as headless servers.
4418 @command{haveged} runs as a privileged daemon, harvesting randomness from the
4419 indirect effects of hardware events on hidden processor state using the HArdware
4420 Volatile Entropy Gathering and Expansion (@dfn{HAVEGE}) algorithm. It tunes
4421 itself to its environment and provides the same built-in test suite for the
4422 output stream as used on certified hardware security devices.
4424 The quality of the randomness produced by this algorithm has not been proven.
4425 It is recommended to run it together with another entropy source like rngd, and
4426 not as a replacement for it.")
4427 (license (list (license:non-copyleft "file://nist/mconf.h")
4428 (license:non-copyleft "file://nist/packtest.c")
4429 license:public-domain ; nist/dfft.c
4430 license:gpl3+)))) ; everything else
4432 (define-public ecryptfs-utils
4434 (name "ecryptfs-utils")
4439 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
4440 version "/+download/ecryptfs-utils_"
4441 version ".orig.tar.gz"))
4444 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
4445 (build-system gnu-build-system)
4447 `(#:configure-flags (list "--disable-pywrap")
4449 (modify-phases %standard-phases
4450 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
4451 (lambda* (#:key inputs outputs #:allow-other-keys)
4452 (let ((out (assoc-ref outputs "out"))
4453 (utils-linux (assoc-ref inputs "utils-linux"))
4454 (cryptsetup (assoc-ref inputs "cryptsetup"))
4455 (linux-pam (assoc-ref inputs "linux-pam"))
4456 (lvm2 (assoc-ref inputs "lvm2")))
4457 (substitute* '("src/utils/ecryptfs-mount-private"
4458 "src/utils/ecryptfs-umount-private"
4459 "src/utils/ecryptfs-setup-private"
4460 "src/utils/ecryptfs-setup-swap"
4461 "src/utils/mount.ecryptfs.c"
4462 "src/utils/umount.ecryptfs.c"
4463 "src/pam_ecryptfs/pam_ecryptfs.c"
4464 "src/desktop/ecryptfs-mount-private.desktop.in"
4465 "src/desktop/ecryptfs-setup-private.desktop.in")
4467 (string-append utils-linux "/bin/mount"))
4469 (string-append utils-linux "/bin/umount"))
4470 (("/sbin/mount.ecryptfs_private")
4471 (string-append out "/sbin/mount.ecryptfs_private"))
4472 (("/sbin/umount.ecryptfs_private")
4473 (string-append out "/sbin/umount.ecryptfs_private"))
4474 (("/usr/bin/ecryptfs-mount-private")
4475 (string-append out "/bin/ecryptfs-mount-private"))
4476 (("/usr/bin/ecryptfs-rewrite-file")
4477 (string-append out "/bin/ecryptfs-rewrite-file"))
4478 (("/usr/bin/ecryptfs-setup-private")
4479 (string-append out "/bin/ecryptfs-setup-private"))
4480 (("/sbin/cryptsetup")
4481 (string-append cryptsetup "/sbin/cryptsetup"))
4482 (("/sbin/unix_chkpwd")
4483 (string-append linux-pam "/sbin/unix_chkpwd"))
4485 (string-append lvm2 "/sbin/dmsetup")))))))))
4487 `(("intltool" ,intltool)
4488 ("perl" ,perl) ; for pod2man
4489 ("pkg-config" ,pkg-config)))
4491 `(("keyutils" ,keyutils)
4492 ("linux-pam" ,linux-pam)
4493 ("utils-linux" ,util-linux)
4494 ("cryptsetup" ,cryptsetup)
4497 (home-page "http://ecryptfs.org/")
4498 (synopsis "eCryptfs cryptographic file system utilities")
4500 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
4501 Each file's cryptographic meta-data is stored inside the file itself, along
4502 with the encrypted contents. This allows individual encrypted files to be
4503 copied between hosts and still be decrypted with the proper key. eCryptfs is a
4504 native Linux file system, and has been part of the Linux kernel since version
4505 2.6.19. This package contains the userland utilities to manage it.")
4506 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
4507 ;; grant additional permission to link with OpenSSL.
4508 (license license:gpl2+)))
4510 (define-public libnfsidmap
4512 (name "libnfsidmap")
4517 (uri (string-append "https://fedorapeople.org/~steved/"
4518 name "/" version "/" name "-" version ".tar.bz2"))
4520 (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5"))))
4521 (build-system gnu-build-system)
4523 `(#:configure-flags (list
4524 (string-append "--with-pluginpath="
4525 (assoc-ref %outputs "out")
4526 "/lib/libnfsidmap"))))
4528 `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader
4530 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
4531 (synopsis "NFSv4 support library for name/ID mapping")
4532 (description "Libnfsidmap is a library holding mulitiple methods of
4533 mapping names to ids and visa versa, mainly for NFSv4. It provides an
4534 extensible array of mapping functions, currently consisting of two choices:
4535 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
4536 (license (license:non-copyleft "file://COPYING"
4537 "See COPYING in the distribution."))))
4539 (define-public module-init-tools
4541 (name "module-init-tools")
4546 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
4547 "module-init-tools-" version ".tar.bz2"))
4550 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
4551 (patches (search-patches "module-init-tools-moduledir.patch"))))
4552 (build-system gnu-build-system)
4554 ;; FIXME: The upstream tarball lacks man pages, and building them would
4555 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
4556 ;; but they vanished. In the meantime, fake it.
4558 (modify-phases %standard-phases
4559 (add-before 'configure 'fake-docbook
4561 (substitute* "Makefile.in"
4562 (("^DOCBOOKTOMAN.*$")
4563 "DOCBOOKTOMAN = true\n"))
4565 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
4566 (synopsis "Tools for loading and managing Linux kernel modules")
4568 "Tools for loading and managing Linux kernel modules, such as
4569 @code{modprobe}, @code{insmod}, @code{lsmod}, and more.")
4570 (license license:gpl2+)))
4572 (define-public mcelog
4578 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
4579 "mcelog.git/snapshot/v" version ".tar.gz"))
4582 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
4583 (file-name (string-append name "-" version ".tar.gz"))
4584 (modules '((guix build utils)))
4587 ;; The snapshots lack a .git directory,
4588 ;; breaking ‘git describe’.
4589 (substitute* "Makefile"
4590 (("\"unknown\"") (string-append "\"v" ,version "\"")))
4592 (build-system gnu-build-system)
4594 `(#:phases (modify-phases %standard-phases
4595 (delete 'configure)) ; no configure script
4596 #:make-flags (let ((out (assoc-ref %outputs "out")))
4598 (string-append "prefix=" out)
4599 (string-append "DOCDIR=" out "/share/doc/mcelog")
4600 "etcprefix=$(DOCDIR)/examples"))
4601 ;; The tests will only run as root on certain supported CPU models.
4603 (supported-systems (list "i686-linux" "x86_64-linux"))
4604 (home-page "https://mcelog.org/")
4605 (synopsis "Machine check monitor for x86 Linux systems")
4607 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
4608 and other hardware errors on x86 systems. It can also perform user-defined
4609 tasks, such as bringing bad pages off-line, when configurable error thresholds
4611 (license license:gpl2)))
4613 (define-public mtd-utils
4620 "ftp://ftp.infradead.org/pub/mtd-utils/"
4621 "mtd-utils-" version ".tar.bz2"))
4624 "1f30jszknc5v6ykmil8ajxgksmcg54q3rsp84jsancp9x0dycggv"))))
4626 '(#:configure-flags '("--enable-unit-tests")))
4628 `(("cmocka" ,cmocka)
4629 ("pkg-config" ,pkg-config)))
4631 `(("acl" ,acl) ; for XATTR
4632 ("libuuid" ,util-linux)
4635 (build-system gnu-build-system)
4636 (synopsis "MTD Flash Storage Utilities")
4637 (description "This package provides utilities for testing, partitioning, etc
4639 (home-page "http://www.linux-mtd.infradead.org/")
4641 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
4642 license:mpl1.1 ; All ftl* files
4643 license:expat)))) ; libiniparser
4645 (define-public libseccomp
4651 (uri (string-append "https://github.com/seccomp/libseccomp/"
4652 "releases/download/v" version
4653 "/libseccomp-" version ".tar.gz"))
4656 "1s06h2cgk0xxwmhwj72z33bllafc1xqnxzk2yyra2rmg959778qw"))))
4657 (build-system gnu-build-system)
4659 `(("which" ,which)))
4660 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
4661 (description "The libseccomp library provides an easy to use, platform
4662 independent, interface to the Linux Kernel's syscall filtering mechanism. The
4663 libseccomp API is designed to abstract away the underlying BPF based syscall
4664 filter language and present a more conventional function-call based filtering
4665 interface that should be familiar to, and easily adopted by, application
4667 (home-page "https://github.com/seccomp/libseccomp")
4668 (license license:lgpl2.1)))
4670 (define-public radeontop
4678 (url "https://github.com/clbr/radeontop.git")
4679 (commit (string-append "v" version))))
4680 (file-name (git-file-name name version))
4682 (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw"))))
4683 (build-system gnu-build-system)
4685 `(#:phases (modify-phases %standard-phases
4686 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
4687 ;; dependency, and doesn't even work on release(!) tarballs.
4688 (add-after 'unpack 'report-correct-version
4690 (substitute* "getver.sh"
4692 (string-append "ver=" ,version)))
4694 (delete 'configure)) ; no configure script
4695 #:make-flags (list "CC=gcc"
4696 (string-append "PREFIX=" %output))
4697 #:tests? #f)) ; no tests
4699 `(("gettext" ,gettext-minimal)
4700 ("pkg-config" ,pkg-config)))
4702 `(("libdrm" ,libdrm)
4703 ("libpciaccess" ,libpciaccess)
4705 ("ncurses" ,ncurses)))
4706 (home-page "https://github.com/clbr/radeontop/")
4707 (synopsis "Usage monitor for AMD Radeon graphics")
4708 (description "RadeonTop monitors resource consumption on supported AMD
4709 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
4710 a terminal or saved to a file for further processing. It measures both the
4711 activity of the GPU as a whole, which is also accurate during OpenCL
4712 computations, as well as separate component statistics that are only meaningful
4713 under OpenGL graphics workloads.")
4714 (license license:gpl3)))
4716 (define-public efivar
4722 (uri (string-append "https://github.com/rhboot/" name
4723 "/releases/download/" version "/" name
4724 "-" version ".tar.bz2"))
4727 "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw"))))
4728 (build-system gnu-build-system)
4730 `(;; Tests require a UEFI system and is not detected in the chroot.
4732 #:make-flags (list (string-append "prefix=" %output)
4733 (string-append "libdir=" %output "/lib")
4735 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4737 (modify-phases %standard-phases
4738 (delete 'configure))))
4740 `(("pkg-config" ,pkg-config)))
4743 (home-page "https://github.com/rhboot/efivar")
4744 (synopsis "Tool and library to manipulate EFI variables")
4745 (description "This package provides a library and a command line
4746 interface to the variable facility of UEFI boot firmware.")
4747 (license license:lgpl2.1+)))
4749 (define-public efibootmgr
4755 (uri (string-append "https://github.com/rhinstaller/efibootmgr"
4756 "/releases/download/" version "/efibootmgr"
4757 "-" version ".tar.bz2"))
4760 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
4761 (build-system gnu-build-system)
4763 `(#:tests? #f ;no tests
4764 #:make-flags (list (string-append "prefix=" %output)
4765 (string-append "libdir=" %output "/lib")
4766 ;; EFIDIR denotes a subdirectory relative to the
4767 ;; EFI System Partition where the loader will be
4768 ;; installed (known as OS_VENDOR in the code).
4769 ;; GRUB overrides this, as such it's only used if
4770 ;; nothing else is specified on the command line.
4772 #:phases (modify-phases %standard-phases (delete 'configure))))
4774 `(("pkg-config" ,pkg-config)))
4776 `(("efivar" ,efivar)
4778 (home-page "https://github.com/rhinstaller/efibootmgr")
4779 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4781 "@code{efibootmgr} is a user-space application to modify the Intel
4782 Extensible Firmware Interface (EFI) Boot Manager. This application can
4783 create and destroy boot entries, change the boot order, change the next
4784 running boot option, and more.")
4785 (license license:gpl2+)))
4787 (define-public sysstat
4793 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
4794 "sysstat-" version ".tar.xz"))
4797 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
4798 (build-system gnu-build-system)
4800 `(#:tests? #f ; No test suite.
4801 ;; Without this flag, it tries to install the man pages with group 'root'
4802 ;; and fails because /etc/passwd lacks an entry for the root user.
4804 (list "--disable-file-attr"
4805 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4807 (modify-phases %standard-phases
4808 ;; The build process tries to create '/var/lib/sa', so we skip that
4810 (add-after 'build 'skip-touching-var
4812 (substitute* "Makefile"
4813 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4816 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4817 (synopsis "Performance monitoring tools for Linux")
4818 (description "The sysstat utilities are a collection of performance
4819 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4820 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4821 @code{sadf} and @code{sa}.")
4822 (license license:gpl2+)))
4824 (define-public light
4831 "https://github.com/haikarainen/light/archive/v"
4835 "1gfvsw7gh5pis733l7j54vzp272pvjyzbg8a0pvapfmg0s7mip97"))
4836 (file-name (string-append name "-" version ".tar.gz"))))
4837 (build-system gnu-build-system)
4839 `(("autoconf" ,autoconf)
4840 ("automake" ,automake)))
4841 (home-page "https://haikarainen.github.io/light/")
4842 (synopsis "GNU/Linux application to control backlights")
4844 "Light is a program to send commands to screen backlight controllers
4845 under GNU/Linux. Features include:
4848 @item It does not rely on X.
4849 @item Light can automatically figure out the best controller to use, making
4850 full use of underlying hardware.
4851 @item It is possible to set a minimum brightness value, as some controllers
4852 set the screen to be pitch black at a vaĺue of 0 (or higher).
4855 Light is the successor of lightscript.")
4856 (license license:gpl3+)))
4858 (define-public brightnessctl
4859 (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c"))
4861 (name "brightnessctl")
4862 (version (git-version "0.4" "0" commit))
4866 (url "https://github.com/Hummer12007/brightnessctl/")
4868 (file-name (git-file-name name version))
4871 "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9"))))
4872 (build-system gnu-build-system)
4874 '(#:tests? #f ; no tests
4875 #:make-flags (list "CC=gcc"
4876 (string-append "PREFIX=" %output)
4877 (string-append "UDEVDIR=" %output "/lib/udev/rules.d/"))
4879 (modify-phases %standard-phases
4881 (add-after 'unpack 'adjust-udev-rules
4883 (substitute* "90-brightnessctl.rules"
4884 (("/bin/") "/run/current-system/profile/bin/"))
4886 (home-page "https://github.com/Hummer12007/brightnessctl")
4887 (synopsis "Backlight and LED brightness control")
4889 "This program allows you read and control device brightness. Devices
4890 include backlight and LEDs. It can also preserve current brightness before
4891 applying the operation, such as on lid close.
4893 The appropriate permissions must be set on the backlight or LED control
4894 interface in sysfs, which can be accomplished with the included udev rules.")
4895 (license license:expat))))
4904 "https://github.com/linrunner/"
4905 (string-upcase name)
4906 "/archive/" version ".tar.gz"))
4907 (file-name (string-append name "-" version ".tar.gz"))
4910 "059kxrpxx580mm6p0z2a421nxngszyh4yqqhbgvn04b6a7dbsa2w"))))
4911 (inputs `(("bash" ,bash)
4913 ("ethtool" ,ethtool)
4917 ("inetutils" ,inetutils)
4920 ("pciutils" ,pciutils)
4924 ("usbutils" ,usbutils)
4925 ("util-linux" ,util-linux)
4926 ("wireless-tools" ,wireless-tools)
4927 ,@(if (let ((system (or (%current-target-system)
4928 (%current-system))))
4929 (or (string-prefix? "i686-" system)
4930 (string-prefix? "x86_64-" system)))
4931 `(("x86-energy-perf-policy" ,x86-energy-perf-policy))
4933 (build-system gnu-build-system)
4935 `(#:modules ((guix build gnu-build-system)
4939 (modify-phases %standard-phases
4940 (delete 'configure) ; no configure script
4941 (add-before 'build 'setenv
4942 (lambda* (#:key outputs #:allow-other-keys)
4943 (let ((out (assoc-ref outputs "out")))
4944 (setenv "TLP_WITH_SYSTEMD" "0")
4945 (setenv "TLP_NO_INIT" "1")
4946 (setenv "TLP_NO_PMUTILS" "1")
4947 (setenv "TLP_SBIN" (string-append out "/bin"))
4948 (setenv "TLP_BIN" (string-append out "/bin"))
4949 (setenv "TLP_TLIB" (string-append out "/share/tlp"))
4950 (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d"))
4951 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
4952 (setenv "TLP_CONF" "/etc/tlp")
4954 (string-append out "/lib/elogind/system-sleep"))
4956 (string-append out "/share/bash-completion/completions"))
4957 (setenv "TLP_MAN" (string-append out "/share/man"))
4958 (setenv "TLP_META" (string-append out "/share/metainfo"))
4960 (delete 'check) ; no tests
4961 (add-before 'install 'fix-installation
4963 ;; Stop the Makefile from trying to create system directories.
4964 (substitute* "Makefile"
4965 (("\\[ -f \\$\\(_CONF\\) \\]") "#")
4966 (("install -d -m 755 \\$\\(_VAR\\)") "#"))
4970 (invoke "make" "install-tlp" "install-man")))
4971 (add-after 'install 'wrap
4972 (lambda* (#:key inputs outputs #:allow-other-keys)
4973 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4974 (bin-files (find-files bin ".*")))
4975 (define (bin-directory input-name)
4976 (let ((p (assoc-ref inputs input-name)))
4977 (and p (string-append p "/bin"))))
4978 (define (sbin-directory input-name)
4979 (string-append (assoc-ref inputs input-name) "/sbin"))
4980 (for-each (lambda (program)
4981 (wrap-program program
4984 (filter-map bin-directory
4996 "x86-energy-perf-policy"))
4997 (filter-map sbin-directory
5003 "wireless-tools"))))))
5006 (home-page "http://linrunner.de/en/tlp/tlp.html")
5007 (synopsis "Power management tool for Linux")
5008 (description "TLP is a power management tool for Linux. It comes with
5009 a default configuration already optimized for battery life. Nevertheless,
5010 TLP is customizable to fulfil system requirements. TLP settings are applied
5011 every time the power supply source is changed.")
5012 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
5014 (license (list license:gpl2+ license:gpl3+))))
5022 (uri (string-append "https://www.ezix.org/software/"
5023 "files/lshw-" version
5027 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
5028 (build-system gnu-build-system)
5030 `(#:phases (modify-phases %standard-phases (delete 'configure))
5031 #:tests? #f ; no tests
5033 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
5034 (synopsis "List hardware information")
5036 "@command{lshw} (Hardware Lister) is a small tool to provide
5037 detailed information on the hardware configuration of the machine.
5038 It can report exact memory configuration, firmware version, mainboard
5039 configuration, CPU version and speed, cache configuration, bus speed,
5040 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
5041 machines (PowerMac G4 is known to work).")
5042 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
5043 (license license:gpl2+)))
5045 (define-public libmnl
5052 (uri (string-append "mirror://netfilter.org/libmnl/"
5053 "libmnl-" version ".tar.bz2"))
5056 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
5057 (build-system gnu-build-system)
5058 (home-page "https://www.netfilter.org/projects/libmnl/")
5059 (synopsis "Netlink utility library")
5060 (description "Libmnl is a minimalistic user-space library oriented to
5061 Netlink developers. There are a lot of common tasks in parsing, validating,
5062 constructing of both the Netlink header and TLVs that are repetitive and easy to
5063 get wrong. This library aims to provide simple helpers that allows you to
5064 re-use code and to avoid re-inventing the wheel.")
5065 (license license:lgpl2.1+)))
5067 (define-public libnftnl
5074 (uri (string-append "mirror://netfilter.org/libnftnl/"
5075 "libnftnl-" version ".tar.bz2"))
5077 (base32 "03xszkcpqk3s1rqc6vh7g5j13kh3d3yjnvjhk5scds3an39rgp92"))))
5078 (build-system gnu-build-system)
5080 `(("pkg-config" ,pkg-config)))
5082 `(("libmnl" ,libmnl)))
5083 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
5084 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
5085 (description "Libnftnl is a userspace library providing a low-level netlink
5086 programming interface to the in-kernel nf_tables subsystem. The library
5087 libnftnl has been previously known as libnftables. This library is currently
5089 (license license:gpl2+)))
5091 (define-public nftables
5098 (uri (string-append "http://www.nftables.org/projects/nftables"
5099 "/files/nftables-" version ".tar.bz2"))
5102 "14bygs6vg2v448cw5r4pxqi8an29hw0m9vab8hpmgjmrzjsq30dd"))))
5103 (build-system gnu-build-system)
5104 (arguments `(#:configure-flags
5105 '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
5106 (inputs `(("bison" ,bison)
5110 ("libnftnl" ,libnftnl)
5111 ("readline" ,readline)))
5112 (native-inputs `(("pkg-config" ,pkg-config)))
5113 (home-page "http://www.nftables.org")
5114 (synopsis "Userspace utility for Linux packet filtering")
5115 (description "nftables is the project that aims to replace the existing
5116 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
5117 filtering framework, a new userspace utility and also a compatibility layer for
5118 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
5119 infrastructure such as the existing hooks, the connection tracking system, the
5120 userspace queueing component and the logging subsystem.")
5121 (license license:gpl2)))
5123 (define-public proot
5131 (url "https://github.com/proot-me/PRoot.git")
5132 (commit (string-append "v" version))))
5133 (file-name (git-file-name name version))
5135 (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz"))
5136 (patches (search-patches "proot-test-fhs.patch"))))
5137 (build-system gnu-build-system)
5139 '(#:make-flags '("-C" "src")
5141 #:phases (modify-phases %standard-phases
5143 (add-before 'build 'set-shell-file-name
5144 (lambda* (#:key inputs #:allow-other-keys)
5145 (substitute* (find-files "src" "\\.[ch]$")
5148 (assoc-ref inputs "bash")
5151 (add-before 'check 'fix-fhs-assumptions-in-tests
5153 (substitute* "tests/test-c6b77b77.mk"
5154 (("/bin/bash") (which "bash"))
5155 (("/usr/bin/test") (which "test")))
5156 (substitute* '("tests/test-16573e73.c")
5157 (("/bin/([a-z-]+)" _ program)
5160 (substitute* (find-files "tests" "\\.sh$")
5161 ;; Some of the tests try to "bind-mount" /bin/true.
5163 (string-append "-b " (which "true") ":"))
5164 ;; Likewise for /bin.
5165 (("-b /bin:") "-b /gnu:")
5166 ;; Others try to run /bin/sh.
5167 (("/bin/sh") (which "sh"))
5168 ;; Others assume /etc/fstab exists.
5169 (("/etc/fstab") "/etc/passwd"))
5171 (substitute* "tests/GNUmakefile"
5172 (("-b /bin:") "-b /gnu:"))
5174 ;; XXX: This test fails in an obscure corner case, just
5176 (delete-file "tests/test-kkkkkkkk.c")
5181 (let ((n (parallel-job-count)))
5182 ;; For some reason we get lots of segfaults with
5183 ;; seccomp support (x86_64, Linux-libre 4.11.0).
5184 (setenv "PROOT_NO_SECCOMP" "1")
5186 ;; Most of the tests expect "/bin" to be in $PATH so
5187 ;; they can run things that live in $ROOTFS/bin.
5189 (string-append (getenv "PATH") ":/bin"))
5191 (invoke "make" "check" "-C" "tests"
5193 "-j" (number->string n)))))
5195 (lambda* (#:key outputs #:allow-other-keys)
5196 ;; The 'install' rule does nearly nothing.
5197 (let* ((out (assoc-ref outputs "out"))
5198 (man1 (string-append out "/share/man/man1")))
5199 ;; TODO: 'make install-care' (does not even
5200 ;; build currently.)
5201 (invoke "make" "-C" "src" "install"
5202 (string-append "PREFIX=" out))
5205 (copy-file "doc/proot/man.1"
5206 (string-append man1 "/proot.1"))
5208 (native-inputs `(("which" ,which)
5210 ;; For 'mcookie', used by some of the tests.
5211 ("util-linux" ,util-linux)))
5212 (inputs `(("talloc" ,talloc)))
5213 (home-page "https://github.com/proot-me/PRoot")
5214 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
5216 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
5217 and @code{binfmt_misc}. This means that users don't need any privileges or
5218 setup to do things like using an arbitrary directory as the new root
5219 file system, making files accessible somewhere else in the file system
5220 hierarchy, or executing programs built for another CPU architecture
5221 transparently through QEMU user-mode. Also, developers can use PRoot as a
5222 generic process instrumentation engine thanks to its extension mechanism.
5223 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
5224 available in the kernel Linux.")
5225 (license license:gpl2+)))
5227 (define-public proot-static
5230 (name "proot-static")
5232 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
5233 (inputs `(("talloc" ,talloc/static)))
5235 (substitute-keyword-arguments (package-arguments proot)
5236 ((#:make-flags flags)
5237 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
5239 `(modify-phases ,phases
5240 (add-after 'strip 'remove-store-references
5241 (lambda* (#:key outputs #:allow-other-keys)
5242 (let* ((out (assoc-ref outputs "out")))
5243 (with-directory-excursion out
5244 (remove-store-references "bin/proot")
5246 ((#:allowed-references _ '("out"))
5249 (define-public cpuid
5252 (version "20180519")
5255 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
5256 version ".src.tar.gz"))
5259 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
5260 (build-system gnu-build-system)
5262 '(#:make-flags '("CC=gcc")
5263 #:tests? #f ; no tests
5264 #:phases (modify-phases %standard-phases
5265 (delete 'configure) ; no configure script
5266 (add-before 'install 'fix-makefile
5267 (lambda* (#:key outputs #:allow-other-keys)
5268 (substitute* "Makefile"
5269 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
5270 ;; Make the compressed manpages writable so that the
5271 ;; reset-gzip-timestamps phase does not error out.
5272 (substitute* "Makefile"
5273 (("-m 444") "-m 644"))
5275 (inputs `(("perl" ,perl)))
5276 (supported-systems '("i686-linux" "x86_64-linux"))
5277 (home-page "http://www.etallen.com/cpuid.html")
5278 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
5279 (description "cpuid dumps detailed information about the CPU(s) gathered
5280 from the CPUID instruction, and also determines the exact model of CPU(s). It
5281 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
5282 NexGen, Rise, and SiS CPUs.")
5283 (license license:gpl2+)))
5285 (define-public jmtpfs
5292 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
5294 (file-name (string-append name "-" version ".tar.gz"))
5297 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
5298 (build-system gnu-build-system)
5302 ("libmtp" ,libmtp)))
5304 `(("pkg-config" ,pkg-config)))
5305 (home-page "https://github.com/JasonFerrara/jmtpfs")
5306 (synopsis "Use a FUSE file system to access data over MTP")
5307 (description "jmtpfs uses FUSE (file system in userspace) to provide access
5308 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
5309 the MTP device as a file system.")
5310 (license license:gpl3)))
5312 (define-public procenv
5319 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
5321 (file-name (string-append name "-" version ".tar.gz"))
5323 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
5324 (build-system gnu-build-system)
5325 (arguments `(#:configure-flags '("--disable-silent-rules")))
5326 (native-inputs `(("pkg-config" ,pkg-config)))
5327 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
5328 ("groff" ,groff) ; for tests
5329 ("libselinux" ,libselinux)))
5330 (synopsis "Utility to show process environment")
5331 (description "Procenv is a command-line tool that displays as much detail about
5332 itself and its environment as possible. It can be used as a test
5333 tool, to understand the type of environment a process runs in, and for
5334 comparing system environments.")
5335 (home-page "http://github.com/jamesodhunt/procenv/")
5336 (license license:gpl3+)))
5338 (define-public libfabric
5346 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
5347 version "/libfabric-" version ".tar.bz2"))
5349 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
5350 (build-system gnu-build-system)
5351 (inputs `(("rdma-core" ,rdma-core)
5352 ,@(match (%current-system)
5353 ((member (package-supported-systems psm))
5357 (home-page "https://ofiwg.github.io/libfabric/")
5358 (synopsis "Open Fabric Interfaces")
5360 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
5361 communication services to applications. OFI is best described as a collection
5362 of libraries and applications used to export fabric services. The key
5363 components of OFI are: application interfaces, provider libraries, kernel
5364 services, daemons, and test applications.
5366 Libfabric is a core component of OFI. It is the library that defines and
5367 exports the user-space API of OFI, and is typically the only software that
5368 applications deal with directly. It works in conjunction with provider
5369 libraries, which are often integrated directly into libfabric.")
5370 (license (list license:bsd-2 license:gpl2)))) ;dual
5375 (version "3.3.20170428")
5376 (home-page "https://github.com/intel/psm")
5380 (uri (git-reference (url home-page)
5381 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
5382 (file-name (string-append "psm-" version ".tar.gz"))
5384 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
5385 (patches (search-patches
5386 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
5387 "psm-ldflags.patch" ; build shared lib with LDFLAGS
5388 "psm-repro.patch")))) ; reproducibility
5389 (build-system gnu-build-system)
5390 (inputs `(("libuuid" ,util-linux)))
5392 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
5393 ,(string-append "INSTALL_PREFIX=" %output)
5394 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5396 #:phases (modify-phases %standard-phases
5398 (add-after 'unpack 'patch-/usr/include
5400 (substitute* "Makefile"
5401 (("\\$\\{DESTDIR}/usr/include")
5402 (string-append %output "/include")))
5403 (substitute* "Makefile"
5404 (("/lib64") "/lib"))
5406 (add-after 'unpack 'patch-sysmacros
5408 (substitute* "ipath/ipath_proto.c"
5409 (("#include <sys/poll.h>" m)
5410 (string-append m "\n"
5411 "#include <sys/sysmacros.h>")))
5413 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
5415 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
5416 communications interface for the True Scale family of products. PSM users are
5417 enabled with mechanisms necessary to implement higher level communications
5418 interfaces in parallel environments.")
5419 ;; Only Intel-compatable processors are supported.
5420 (supported-systems '("i686-linux" "x86_64-linux"))
5421 (license (list license:bsd-2 license:gpl2)))) ;dual
5423 (define-public snapscreenshot
5425 (name "snapscreenshot")
5426 (version "1.0.14.3")
5430 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
5431 name "-" version ".tar.bz2"))
5433 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
5434 (build-system gnu-build-system)
5437 (let ((out (assoc-ref %outputs "out")))
5438 (list (string-append "BINDIR=" out "/bin")
5439 (string-append "MANDIR=" out "/share/man")))
5440 #:tests? #f ; no test suite
5442 (modify-phases %standard-phases
5443 (delete 'configure) ; ./configure is a snarky no-op
5444 (add-before 'install 'fix-ownership
5445 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
5447 (substitute* "depfun.mak"
5448 ((" -o bin -g bin ") " "))
5450 (add-before 'install 'create-output-directories
5451 (lambda* (#:key outputs #:allow-other-keys)
5452 (let ((out (assoc-ref outputs "out")))
5453 (mkdir-p (string-append out "/share/man/man1"))
5455 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
5456 (synopsis "Take screenshots of one or more Linux text consoles")
5458 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
5459 Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
5460 relevant @file{/dev/vcs*} file(s).")
5461 (license license:gpl2)))
5463 (define-public fbcat
5470 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
5471 version "/" name "-" version ".tar.gz"))
5473 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
5474 (build-system gnu-build-system)
5476 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
5477 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
5478 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
5479 `(("pnmtopng" ,netpbm)))
5480 (outputs (list "out" "fbgrab"))
5484 (string-append "PREFIX=" (assoc-ref %outputs "out")))
5485 #:tests? #f ; no tests
5487 (modify-phases %standard-phases
5488 (delete 'configure) ; no configure script
5489 (add-after 'build 'qualify-references
5490 (lambda* (#:key inputs outputs #:allow-other-keys)
5491 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
5492 (out (assoc-ref outputs "out")))
5493 (substitute* "fbgrab"
5495 (string-append out "/bin/" all))
5497 (string-append pnmtopng "/bin/" all)))
5499 (add-after 'install 'split-fbgrab-output
5500 (lambda* (#:key outputs #:allow-other-keys)
5501 (let* ((out (assoc-ref outputs "out"))
5502 (out:fbgrab (assoc-ref outputs "fbgrab")))
5503 (for-each (lambda (file)
5504 (let ((old (string-append out "/" file))
5505 (new (string-append out:fbgrab "/" file)))
5506 (mkdir-p (dirname new))
5507 (rename-file old new)))
5509 "share/man/man1/fbgrab.1"))
5511 (home-page "https://jwilk.net/software/fbcat")
5512 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
5514 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
5515 a dump therof. It supports a wide range of drivers and pixel formats.
5516 @command{fbcat} can take screenshots of virtually any application that can be
5517 made to write its output to the framebuffer, including (but not limited to)
5518 text-mode or graphical applications that don't use a display server.
5520 Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
5521 emulates the behaviour of Gunnar Monell's older fbgrab utility.")
5522 (license license:gpl2)))
5524 (define-public libcgroup
5532 "mirror://sourceforge/libcg/" name "/"
5533 version "/" name "-" version ".tar.bz2"))
5535 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
5536 (build-system gnu-build-system)
5543 `(("linux-pam" ,linux-pam)))
5544 (home-page "https://sourceforge.net/projects/libcg/")
5545 (synopsis "Control groups management tools")
5546 (description "Control groups is Linux kernel method for process resource
5547 restriction, permission handling and more. This package provides userspace
5548 interface to this kernel feature.")
5549 (license license:lgpl2.1)))
5551 (define-public mbpfan
5559 (url "https://github.com/dgraziotin/mbpfan.git")
5560 (commit (string-append "v" version))))
5561 (file-name (git-file-name name version))
5563 (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj"))))
5564 (build-system gnu-build-system)
5566 '(#:tests? #f ; tests ask to be run as root
5567 #:make-flags (let ((out (assoc-ref %outputs "out")))
5568 (list (string-append "DESTDIR=" out)
5571 (modify-phases %standard-phases
5572 (add-after 'unpack 'patch-paths
5574 (substitute* "Makefile"
5577 (delete 'configure)))) ; there's no configure phase
5578 (home-page "https://github.com/dgraziotin/mbpfan")
5579 (synopsis "Control fan speed on Macbooks")
5581 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
5582 the @code{coretemp} module and sets the fan speed using the @code{applesmc}
5583 module. It can be executed as a daemon or in the foreground with root
5585 (license license:gpl3+)))
5594 (url "https://github.com/intel/opa-psm2.git")
5595 (commit (string-append "PSM2_" version))))
5596 (file-name (git-file-name name version))
5599 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
5600 (build-system gnu-build-system)
5603 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
5605 #:phases (modify-phases %standard-phases
5607 (add-after 'unpack 'patch-Makefiles
5609 (substitute* "Makefile"
5612 (substitute* "compat/Makefile"
5618 (setenv "DESTDIR" %output)
5619 (invoke "make" "install")
5622 `(("rdma-core" ,rdma-core)
5623 ("numactl" ,numactl)))
5624 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
5626 "This package is low-level user-level Intel's communications interface.
5627 The PSM2 API is a high-performance vendor-specific protocol that provides a
5628 low-level communications interface for the Intel Omni-Path family of
5629 high-speed networking devices.")
5630 (home-page "https://github.com/intel/opa-psm2")
5631 ;; Only the x86_64 architecure is supported.
5632 (supported-systems '("x86_64-linux"))
5633 (license (list license:bsd-3 license:gpl2)))) ; dual
5635 (define-public libpfm4
5641 (uri (string-append "mirror://sourceforge/perfmon2/"
5642 name "/libpfm-" version ".tar.gz"))
5645 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
5646 (build-system gnu-build-system)
5648 '(#:modules ((guix build utils)
5649 (guix build gnu-build-system))
5650 #:phases (modify-phases %standard-phases
5654 (lambda* (#:key inputs outputs #:allow-other-keys)
5655 (let* ((out (assoc-ref outputs "out")))
5660 (lambda* (#:key outputs #:allow-other-keys)
5661 (let* ((out (assoc-ref outputs "out")))
5663 (string-append "PREFIX=" out)
5666 (synopsis "Performance event monitoring library")
5668 "This package provides a library called libpfm4, which is used to develop
5669 monitoring tools exploiting the performance monitoring events such as those
5670 provided by the Performance Monitoring Unit (PMU) of modern processors.
5672 Libpfm4 helps convert from an event name, expressed as a string, to the event
5673 encoding that is either the raw event as documented by the hardware vendor or
5674 the OS-specific encoding. In the latter case, the library is able to prepare
5675 the OS-specific data structures needed by the kernel to setup the event.
5677 libpfm4 provides support for the @code{perf_events} interface, which was
5678 introduced in Linux 2.6.31.")
5679 (home-page "http://perfmon2.sourceforge.net/")
5680 (license license:expat)))
5682 (define-public libnfnetlink
5684 (name "libnfnetlink")
5689 "https://www.netfilter.org/projects/libnfnetlink/files/"
5690 "libnfnetlink-" version ".tar.bz2"))
5693 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
5694 (build-system gnu-build-system)
5695 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
5696 (synopsis "Low-level netfilter netlink communication library")
5698 "@code{libnfnetlink} is the low-level library for netfilter related
5699 kernel/userspace communication. It provides a generic messaging
5700 infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
5701 nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
5702 management tools in userspace.")
5703 (license license:gpl2)))
5705 (define-public go-netlink
5712 (url "https://github.com/vishvananda/netlink.git")
5713 (commit (string-append "v" version))))
5714 (file-name (git-file-name name version))
5717 "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0"))))
5718 (build-system go-build-system)
5720 `(#:import-path "github.com/vishvananda/netlink"))
5722 `(("go-golang-org-x-sys-unix" ,go-golang-org-x-sys-unix)
5723 ("go-netns" ,go-netns)))
5724 (home-page "https://github.com/vishvananda/netlink")
5725 (synopsis "Simple netlink library for Go")
5726 (description "The netlink package provides a simple netlink library for
5727 Go. Netlink is the interface a user-space program in Linux uses to
5728 communicate with the kernel. It can be used to add and remove interfaces, set
5729 IP addresses and routes, and configure IPsec.")
5730 (license license:asl2.0)))
5732 (define-public xfsprogs
5739 "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/"
5740 "xfsprogs-" version ".tar.gz"))
5743 "0ss0r6jlxxinf9fhpc0fgf7b89n9mzirpa85xxjmi1ix9l6cls6x"))))
5744 (build-system gnu-build-system)
5746 `(#:tests? #f ;kernel/user integration tests are in package "xfstests"
5747 #:phases (modify-phases %standard-phases
5748 (add-after 'install 'install-headers
5750 (invoke "make" "install-dev"))))))
5752 `(("gettext" ,gettext-minimal)
5753 ("util-linux" ,util-linux)))
5754 (home-page "https://xfs.wiki.kernel.org/")
5755 (synopsis "XFS file system tools")
5756 (description "This package provides commands to create and check XFS
5758 ;; The library "libhandle" and the headers in "xfslibs-dev" are
5759 ;; licensed under lgpl2.1. the other stuff is licensed under gpl2.
5760 (license (list license:gpl2 license:lgpl2.1))))
5762 (define-public genext2fs
5769 (url "https://github.com/jeremie-koenig/genext2fs.git")
5770 ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't.
5771 (commit "9ee43894634998b0b2b309d636f25c64314c9421")))
5772 (file-name (git-file-name name version))
5774 (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq"))))
5775 (build-system gnu-build-system)
5778 (modify-phases %standard-phases
5779 (add-after 'unpack 'apply-debian-patches
5780 ;; Debian changes (the revision after ‘-’ in VERSION) are
5781 ;; maintained as separate patches. Apply those relevant to us.
5785 (invoke "patch" "-p1" "-i"
5786 (string-append "debian/patches/" file-name)))
5787 (list "blocksize+creator.diff" ; add -B/-o options
5788 "byteswap_fix.diff"))
5791 `(("autoconf" ,autoconf)
5792 ("automake" ,automake)))
5793 (home-page "https://github.com/jeremie-koenig/genext2fs")
5794 (synopsis "Generate ext2 file system as a normal user")
5795 (description "This package provides a program to generate an ext2
5796 file system as a normal (non-root) user. It does not require you to mount
5797 the image file to copy files on it, nor does it require that you become
5798 the superuser to make device nodes.")
5799 (license license:gpl2)))
5801 (define-public fakeroot
5807 (uri (string-append "http://ftp.debian.org/debian/pool/main/f/"
5808 "fakeroot/fakeroot_" version ".orig.tar.xz"))
5809 (file-name (string-append name "-" version ".tar.gz"))
5812 "1xpl0s2yjyjwlf832b6kbkaa5921liybaar13k7n45ckd9lxd700"))))
5813 (build-system gnu-build-system)
5816 (modify-phases %standard-phases
5817 (add-after 'configure 'patch-Makefile
5819 ;; Note: The root of the problem is already in "Makefile.am".
5820 (substitute* "Makefile"
5821 (("/bin/sh") (which "sh")))
5823 (add-after 'unpack 'patch-getopt
5824 (lambda* (#:key inputs #:allow-other-keys)
5825 (substitute* "scripts/fakeroot.in"
5827 (string-append (assoc-ref inputs "util-linux")
5830 (add-before 'configure 'setenv
5832 (setenv "LIBS" "-lacl")
5834 (add-before 'check 'prepare-check
5836 (setenv "SHELL" (which "bash"))
5837 (setenv "VERBOSE" "1")
5838 (substitute* "test/t.touchinstall"
5839 ;; We don't have the name of the root user, so use ID=0.
5840 (("grep root") "grep \"\\<0\\>\""))
5841 (substitute* "test/tartest"
5842 ;; We don't have the name of the root group, so use ID=0.
5843 (("ROOTGROUP=root") "ROOTGROUP=0")
5844 ;; We don't have the name of the daemon user, so use IDs.
5845 (("daemon:sys") "1:3")
5847 ;; We don't have an /etc/passwd entry for "root" - use numeric IDs.
5848 (substitute* "test/compare-tar"
5849 (("tar -tvf") "tar --numeric-owner -tvf"))
5853 ("sharutils" ,sharutils) ; for the tests
5854 ("xz" ,xz))) ; for the tests
5856 `(("libcap" ,libcap)
5857 ("util-linux" ,util-linux)))
5858 (synopsis "Provides a fake root environment")
5859 (description "@command{fakeroot} runs a command in an environment where
5860 it appears to have root privileges for file manipulation. This is useful
5861 for allowing users to create archives (tar, ar, .deb etc.) with files in
5862 them with root permissions/ownership. Without fakeroot one would have to
5863 have root privileges to create the constituent files of the archives with
5864 the correct permissions and ownership, and then pack them up, or one would
5865 have to construct the archives directly, without using the archiver.")
5866 (home-page "http://freshmeat.sourceforge.net/projects/fakeroot")
5867 (license license:gpl3+)))
5869 (define-public inputattach
5871 (name "inputattach")
5876 (url "https://github.com/linuxwacom/input-wacom.git")
5877 (commit (string-append "input-wacom-" version))))
5878 (file-name (git-file-name name version))
5880 (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j"))))
5881 (build-system gnu-build-system)
5884 (modify-phases %standard-phases
5888 (lambda* (#:key inputs #:allow-other-keys)
5889 (with-directory-excursion "inputattach"
5890 (invoke (string-append (assoc-ref inputs "gcc")
5892 "-O2" "-o" "inputattach" "inputattach.c"))
5896 (lambda* (#:key outputs #:allow-other-keys)
5897 (let ((target-dir (string-append
5898 (assoc-ref outputs "out")
5900 (mkdir-p target-dir)
5901 (copy-file "inputattach/inputattach"
5902 (string-append target-dir
5905 (home-page "https://linuxwacom.github.io/")
5906 (synopsis "Dispatch input peripherals events to a device file")
5907 (description "inputattach dispatches input events from several device
5908 types and interfaces and translates so that the X server can use them.")
5909 (license license:gpl2+)))