gnu: Add libbytesize.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
189be331 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
35dfcdd7 3;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
7e0ae2bc 5;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
31aa4379 6;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
e1e27737 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
513dc568 8;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
d08be77a 10;;; Copyright © 2016, 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
7994250f 11;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
96e9f097 12;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
dc9bdb1e 13;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
6db6c3a9 14;;; Copyright © 2016, 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
3ec07ced 15;;; Copyright © 2016, 2018 Ricardo Wurmus <rekado@elephly.net>
9b0942c1 16;;; Copyright © 2016 David Craven <david@craven.ch>
594d740d 17;;; Copyright © 2016 John Darrington <jmd@gnu.org>
55e1d39b 18;;; Copyright © 2016, 2017, 2018 Marius Bakke <mbakke@fastmail.com>
5849c68a 19;;; Copyright © 2016, 2018 Rene Saavedra <pacoon@protonmail.com>
440a3143 20;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
4a78fd46 21;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
af23710f 22;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
01be4f93 23;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
189d8422 24;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
c7adafa7 25;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
1113386b 26;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
ebcab70a 27;;; Copyright © 2017, 2018 Rutger Helling <rhelling@mykolab.com>
3116c8b5 28;;; Copyright © 2017 nee <nee-git@hidamari.blue>
a73e7dd3 29;;; Copyright © 2017 Dave Love <fx@gnu.org>
25637b77 30;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
17a21bcf 31;;; Copyright © 2018 Brendan Tildesley <brendan.tildesley@openmailbox.org>
fd76c904 32;;;
233e7676 33;;; This file is part of GNU Guix.
fd76c904 34;;;
233e7676 35;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
36;;; under the terms of the GNU General Public License as published by
37;;; the Free Software Foundation; either version 3 of the License, or (at
38;;; your option) any later version.
39;;;
233e7676 40;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
41;;; WITHOUT ANY WARRANTY; without even the implied warranty of
42;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43;;; GNU General Public License for more details.
44;;;
45;;; You should have received a copy of the GNU General Public License
233e7676 46;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 47
1ffa7090 48(define-module (gnu packages linux)
59a43334 49 #:use-module (gnu packages)
0c60cc53 50 #:use-module (gnu packages acl)
75750abb
DC
51 #:use-module (gnu packages admin)
52 #:use-module (gnu packages algebra)
53 #:use-module (gnu packages attr)
624ee211 54 #:use-module (gnu packages audio)
75750abb 55 #:use-module (gnu packages autotools)
1eacffb9 56 #:use-module (gnu packages backup)
75750abb 57 #:use-module (gnu packages base)
c7adafa7 58 #:use-module (gnu packages bash)
75750abb
DC
59 #:use-module (gnu packages bison)
60 #:use-module (gnu packages calendar)
61 #:use-module (gnu packages check)
e385e957 62 #:use-module (gnu packages crypto)
17a21bcf 63 #:use-module (gnu packages cryptsetup)
f61e0e79 64 #:use-module (gnu packages compression)
75750abb 65 #:use-module (gnu packages databases)
b3ed50e6 66 #:use-module (gnu packages datastructures)
75750abb
DC
67 #:use-module (gnu packages docbook)
68 #:use-module (gnu packages documentation)
69 #:use-module (gnu packages elf)
1ffa7090 70 #:use-module (gnu packages flex)
afc9d8ec 71 #:use-module (gnu packages file)
75750abb
DC
72 #:use-module (gnu packages freedesktop)
73 #:use-module (gnu packages gcc)
74 #:use-module (gnu packages gettext)
75 #:use-module (gnu packages glib)
e385e957 76 #:use-module (gnu packages gnuzilla)
d7d42d6b 77 #:use-module (gnu packages gperf)
75750abb 78 #:use-module (gnu packages gtk)
1d484507 79 #:use-module (gnu packages libunwind)
1ffa7090 80 #:use-module (gnu packages libusb)
01be4f93 81 #:use-module (gnu packages man)
75750abb 82 #:use-module (gnu packages maths)
dfe93c9a 83 #:use-module (gnu packages multiprecision)
1ffa7090 84 #:use-module (gnu packages ncurses)
8d8d227b 85 #:use-module (gnu packages netpbm)
3ec07ced 86 #:use-module (gnu packages nettle)
c7adafa7 87 #:use-module (gnu packages networking)
f8f44dd7 88 #:use-module (gnu packages ninja)
1ffa7090 89 #:use-module (gnu packages perl)
75750abb 90 #:use-module (gnu packages pciutils)
1ffa7090 91 #:use-module (gnu packages pkg-config)
0d74462a 92 #:use-module (gnu packages popt)
75750abb 93 #:use-module (gnu packages pulseaudio)
7c0dbe78 94 #:use-module (gnu packages python)
75750abb
DC
95 #:use-module (gnu packages readline)
96 #:use-module (gnu packages rrdtool)
62b28c0e 97 #:use-module (gnu packages samba)
b1fb4b23 98 #:use-module (gnu packages slang)
b3ed50e6 99 #:use-module (gnu packages storage)
f57d2639 100 #:use-module (gnu packages texinfo)
75343704 101 #:use-module (gnu packages tls)
b3ed50e6 102 #:use-module (gnu packages valgrind)
7d2511bc 103 #:use-module (gnu packages video)
7f412f33 104 #:use-module (gnu packages web)
7d2511bc 105 #:use-module (gnu packages xiph)
75750abb 106 #:use-module (gnu packages xml)
58c4f11e
TGR
107 #:use-module (gnu packages xdisorg)
108 #:use-module (gnu packages xorg)
a73e7dd3
DL
109 #:use-module (gnu packages groff)
110 #:use-module (gnu packages selinux)
3eb7c000 111 #:use-module (gnu packages swig)
220193ad 112 #:use-module (guix build-system cmake)
75750abb 113 #:use-module (guix build-system gnu)
e102f940 114 #:use-module (guix build-system python)
a94546ec 115 #:use-module (guix build-system trivial)
75750abb 116 #:use-module (guix download)
6d31c175 117 #:use-module (guix git-download)
75750abb
DC
118 #:use-module ((guix licenses) #:prefix license:)
119 #:use-module (guix packages)
120 #:use-module (guix utils)
adddd5ba 121 #:use-module (srfi srfi-1)
17db0706 122 #:use-module (srfi srfi-2)
a94546ec
LC
123 #:use-module (srfi srfi-26)
124 #:use-module (ice-9 match))
fd76c904 125
aaf4cb20
LC
126(define-public (system->linux-architecture arch)
127 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 128\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
129 (let ((arch (car (string-split arch #\-))))
130 (cond ((string=? arch "i686") "i386")
131 ((string-prefix? "mips" arch) "mips")
aaf4cb20 132 ((string-prefix? "arm" arch) "arm")
503275e9 133 ((string-prefix? "aarch64" arch) "arm64")
605fec78 134 ((string-prefix? "alpha" arch) "alpha")
c89e2107 135 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
b91004c2 136 ((string-prefix? "s390" arch) "s390")
618cea69
NK
137 (else arch))))
138
440a3143
CSLL
139(define-public (system->defconfig system)
140 "Some systems (notably powerpc-linux) require a special target for kernel
70c68ed5 141defconfig. Return the appropriate make target if applicable, otherwise return
440a3143
CSLL
142\"defconfig\"."
143 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
c89e2107 144 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
440a3143
CSLL
145 (else "defconfig")))
146
6023cc74
LC
147(define (linux-libre-urls version)
148 "Return a list of URLs for Linux-Libre VERSION."
149 (list (string-append
8420c7a3 150 "https://linux-libre.fsfla.org/pub/linux-libre/releases/"
6023cc74
LC
151 version "-gnu/linux-libre-" version "-gnu.tar.xz")
152
153 ;; XXX: Work around <http://bugs.gnu.org/14851>.
154 (string-append
155 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
156 version "-gnu.tar.xz")
157
158 ;; Maybe this URL will become valid eventually.
159 (string-append
160 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
161 version "-gnu.tar.xz")))
162
80fe5c60 163(define-public linux-libre-headers
b450d2b4
DC
164 (package
165 (name "linux-libre-headers")
d41ba524 166 (version "4.14.26")
b450d2b4
DC
167 (source (origin
168 (method url-fetch)
169 (uri (linux-libre-urls version))
170 (sha256
171 (base32
d41ba524 172 "1m2zr17wpasg5riysbaa4g5i492jzr93py2jm088ki818s4a9cm3"))))
b450d2b4
DC
173 (build-system gnu-build-system)
174 (native-inputs `(("perl" ,perl)))
175 (arguments
176 `(#:modules ((guix build gnu-build-system)
177 (guix build utils)
178 (srfi srfi-1))
179 #:phases
180 (modify-phases %standard-phases
181 (delete 'configure)
182 (replace 'build
183 (lambda _
184 (let ((arch ,(system->linux-architecture
185 (or (%current-target-system)
440a3143
CSLL
186 (%current-system))))
187 (defconfig ,(system->defconfig
188 (or (%current-target-system)
189 (%current-system)))))
b450d2b4 190 (setenv "ARCH" arch)
618cea69 191 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
5dc9ded1
MW
192 (invoke "make" defconfig)
193 (invoke "make" "mrproper" "headers_check"))))
b450d2b4
DC
194 (replace 'install
195 (lambda* (#:key outputs #:allow-other-keys)
80fe5c60 196 (let ((out (assoc-ref outputs "out")))
5dc9ded1
MW
197 (invoke "make"
198 (string-append "INSTALL_HDR_PATH=" out)
199 "headers_install")
b15389e1 200
5dc9ded1
MW
201 (mkdir (string-append out "/include/config"))
202 (call-with-output-file
203 (string-append out
204 "/include/config/kernel.release")
205 (lambda (p)
206 (format p "~a-default~%" ,version)))
b15389e1 207
5dc9ded1
MW
208 ;; Remove the '.install' and '..install.cmd' files; the
209 ;; latter contains store paths, which pulls in bootstrap
210 ;; binaries in the build environment, and prevents bit
211 ;; reproducibility for the bootstrap binaries.
212 (for-each delete-file (find-files out "\\.install"))
213
214 #t))))
b15389e1 215 #:allowed-references ()
80fe5c60 216 #:tests? #f))
6fd52309 217 (home-page "https://www.gnu.org/software/linux-libre/")
80fe5c60
LC
218 (synopsis "GNU Linux-Libre kernel headers")
219 (description "Headers of the Linux-Libre kernel.")
b450d2b4 220 (license license:gpl2)))
80fe5c60 221
ac47a7c2
LC
222(define %boot-logo-patch
223 ;; Linux-Libre boot logo featuring Freedo and a gnu.
224 (origin
225 (method url-fetch)
226 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 227 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
228 (sha256
229 (base32
230 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
231
c258807a 232(define* (kernel-config arch #:key variant)
a94546ec 233 "Return the absolute file name of the Linux-Libre build configuration file
c258807a 234for ARCH and optionally VARIANT, or #f if there is no such configuration."
7994250f 235 (let* ((name (string-append (if variant (string-append variant "-") "")
25847b32 236 (if (string=? "i386" arch) "i686" arch) ".conf"))
7994250f
AK
237 (file (string-append "linux-libre/" name)))
238 (search-auxiliary-file file)))
a94546ec 239
90c18c32 240(define %default-extra-linux-options
50dbc036 241 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
b9f7895d
DC
242 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
243 ;; Modules required for initrd:
244 ("CONFIG_NET_9P" . m)
245 ("CONFIG_NET_9P_VIRTIO" . m)
246 ("CONFIG_VIRTIO_BLK" . m)
247 ("CONFIG_VIRTIO_NET" . m)
248 ("CONFIG_VIRTIO_PCI" . m)
249 ("CONFIG_VIRTIO_BALLOON" . m)
250 ("CONFIG_VIRTIO_MMIO" . m)
251 ("CONFIG_FUSE_FS" . m)
252 ("CONFIG_CIFS" . m)
253 ("CONFIG_9P_FS" . m)))
90c18c32
DC
254
255(define (config->string options)
256 (string-join (map (match-lambda
257 ((option . 'm)
258 (string-append option "=m"))
259 ((option . #t)
260 (string-append option "=y"))
261 ((option . #f)
262 (string-append option "=n")))
263 options)
264 "\n"))
265
3129b9c2 266(define* (make-linux-libre version hash supported-systems
c258807a
DC
267 #:key
268 ;; A function that takes an arch and a variant.
269 ;; See kernel-config for an example.
a6d01325 270 (extra-version #f)
c258807a 271 (configuration-file #f)
90c18c32 272 (defconfig "defconfig")
64de7d1c
MW
273 (extra-options %default-extra-linux-options)
274 (patches (list %boot-logo-patch)))
614d1738 275 (package
a6d01325
DC
276 (name (if extra-version
277 (string-append "linux-libre-" extra-version)
278 "linux-libre"))
c258807a 279 (version version)
614d1738
DC
280 (source (origin
281 (method url-fetch)
282 (uri (linux-libre-urls version))
c258807a 283 (sha256 (base32 hash))
64de7d1c 284 (patches patches)))
3129b9c2 285 (supported-systems supported-systems)
614d1738 286 (build-system gnu-build-system)
614d1738
DC
287 (native-inputs
288 `(("perl" ,perl)
289 ("bc" ,bc)
290 ("openssl" ,openssl)
78edcccc 291 ("kmod" ,kmod)
78602fad 292 ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION
81d98d7e
MW
293 ("flex" ,flex)
294 ("bison" ,bison)
dbe64d10
MW
295 ;; On x86, build with GCC-7 for full retpoline support.
296 ;; FIXME: Remove this when our default compiler has retpoline support.
297 ,@(match (system->linux-architecture
298 (or (%current-target-system) (%current-system)))
299 ((or "x86_64" "i386")
300 `(("gcc" ,gcc-7)))
cdbcfc11
MB
301 ("arm64"
302 ;; Work around a binutils 2.30 bug where some kernel symbols would
303 ;; be incorrectly marked as relocatable:
304 ;; <https://sourceware.org/bugzilla/show_bug.cgi?id=22764>.
305 `(("ld-wrapper" ,(make-ld-wrapper "ld-wrapper"
306 #:binutils binutils/fixed))))
dbe64d10
MW
307 (_
308 '()))
64b5e413
LC
309 ,@(match (and configuration-file
310 (configuration-file
311 (system->linux-architecture
312 (or (%current-target-system) (%current-system)))
313 #:variant (version-major+minor version)))
314 (#f ;no config for this platform
315 '())
316 ((? string? config)
317 `(("kconfig" ,config))))))
614d1738
DC
318 (arguments
319 `(#:modules ((guix build gnu-build-system)
320 (guix build utils)
321 (srfi srfi-1)
322 (ice-9 match))
323 #:phases
324 (modify-phases %standard-phases
c5bd8753
MW
325 (add-after 'unpack 'patch-/bin/pwd
326 (lambda _
327 (substitute* (find-files "." "^Makefile(\\.include)?$")
328 (("/bin/pwd") "pwd"))
329 #t))
9416459b 330 (replace 'configure
4b42703e 331 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
96e9f097
RN
332 ;; Avoid introducing timestamps
333 (setenv "KCONFIG_NOTIMESTAMP" "1")
334 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
335
4b42703e 336 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
337 (let ((arch ,(system->linux-architecture
338 (or (%current-target-system)
339 (%current-system)))))
4b42703e
DC
340 (setenv "ARCH" arch)
341 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 342
4b42703e
DC
343 (when target
344 (setenv "CROSS_COMPILE" (string-append target "-"))
345 (format #t "`CROSS_COMPILE' set to `~a'~%"
346 (getenv "CROSS_COMPILE"))))
beacfcab 347
a6d01325
DC
348 (setenv "EXTRA_VERSION" ,extra-version)
349
a94546ec 350 (let ((build (assoc-ref %standard-phases 'build))
65416733 351 (config (assoc-ref (or native-inputs inputs) "kconfig")))
1650dd8a 352
e4e9c0a0
DC
353 ;; Use a custom kernel configuration file or a default
354 ;; configuration file.
1650dd8a
LC
355 (if config
356 (begin
357 (copy-file config ".config")
358 (chmod ".config" #o666))
fdd400d8 359 (invoke "make" ,defconfig))
a94546ec
LC
360
361 ;; Appending works even when the option wasn't in the
362 ;; file. The last one prevails if duplicated.
90c18c32
DC
363 (let ((port (open-file ".config" "a"))
364 (extra-configuration ,(config->string extra-options)))
365 (display extra-configuration port)
a94546ec
LC
366 (close-port port))
367
fdd400d8 368 (invoke "make" "oldconfig"))))
614d1738 369 (replace 'install
4b42703e 370 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
371 (let* ((out (assoc-ref outputs "out"))
372 (moddir (string-append out "/lib/modules"))
e4e9c0a0
DC
373 (dtbdir (string-append out "/lib/dtbs"))
374 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
375 ;; Install kernel image, kernel configuration and link map.
376 (for-each (lambda (file) (install-file file out))
fd900d68 377 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map)$"))
e4e9c0a0 378 ;; Install device tree files
a8e3fd5f
VC
379 (unless (null? (find-files "." "\\.dtb$"))
380 (mkdir-p dtbdir)
381 (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir)
382 "dtbs_install"))
e4e9c0a0 383 ;; Install kernel modules
beacfcab 384 (mkdir-p moddir)
fdd400d8
DM
385 (invoke "make"
386 (string-append "DEPMOD=" kmod "/bin/depmod")
387 (string-append "MODULE_DIR=" moddir)
388 (string-append "INSTALL_PATH=" out)
389 (string-append "INSTALL_MOD_PATH=" out)
390 "INSTALL_MOD_STRIP=1"
391 "modules_install")))))
beacfcab 392 #:tests? #f))
f8aa265e 393 (home-page "https://www.gnu.org/software/linux-libre/")
f50d2669 394 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 395 (description
79c311b8
LC
396 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
397It has been modified to remove all non-free binary blobs.")
614d1738 398 (license license:gpl2)))
beacfcab 399
3129b9c2 400(define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
5a9dc4a8 401(define %linux-compatible-systems '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux"))
3129b9c2 402
cfbe7b7f
MO
403;; linux-libre configuration for armhf-linux is derived from Debian armmp. It
404;; supports qemu "virt" machine and possibly a large number of ARM boards.
405;; See : https://wiki.debian.org/DebianKernel/ARMMP.
76e62ef7 406
f8e2df98
MW
407(define %linux-libre-version "4.17.11")
408(define %linux-libre-hash "0c0ryl8rnzizr0x2gj9kprj9wfjz536574fnn46r0ww3szrzdm78")
adbe6dea 409
c258807a 410(define-public linux-libre
76e62ef7
MW
411 (make-linux-libre %linux-libre-version
412 %linux-libre-hash
cfbe7b7f 413 %linux-compatible-systems
7da1db5b 414 #:configuration-file kernel-config))
c258807a 415
c85a76cc
MW
416(define %linux-libre-4.14-version "4.14.59")
417(define %linux-libre-4.14-hash "1mf22i8a71qs04x4wfqmm21clj4jnqia6rpk7jbh3r3vjfjjbd1d")
adbe6dea
MW
418
419(define-public linux-libre-4.14
420 (make-linux-libre %linux-libre-4.14-version
421 %linux-libre-4.14-hash
5a9dc4a8 422 '("x86_64-linux" "i686-linux" "armhf-linux")
adbe6dea
MW
423 #:configuration-file kernel-config))
424
52d901da 425(define-public linux-libre-4.9
8b30bc82
MW
426 (make-linux-libre "4.9.116"
427 "1v5138a5317ddrl0zvlip18586si68ccw6y5wdxgpkh8ixvcamy6"
52d901da 428 %intel-compatible-systems
c2ab0f89 429 #:configuration-file kernel-config))
52d901da 430
75b314a6 431(define-public linux-libre-4.4
4262a491
MW
432 (make-linux-libre "4.4.145"
433 "1c8lcibc6f8194ix3paip30jb9cqvn4lni6jjskyrmavcfy4rlbp"
3129b9c2 434 %intel-compatible-systems
d22a843f 435 #:configuration-file kernel-config))
75b314a6 436
cde7c23f
DC
437(define-public linux-libre-arm-generic
438 (make-linux-libre %linux-libre-version
439 %linux-libre-hash
440 '("armhf-linux")
441 #:defconfig "multi_v7_defconfig"
daca2ec4 442 #:extra-version "arm-generic"))
cde7c23f 443
adbe6dea
MW
444(define-public linux-libre-arm-generic-4.14
445 (make-linux-libre %linux-libre-4.14-version
446 %linux-libre-4.14-hash
447 '("armhf-linux")
448 #:defconfig "multi_v7_defconfig"
449 #:extra-version "arm-generic"))
450
f6948189
MO
451(define-public linux-libre-arm-omap2plus
452 (make-linux-libre %linux-libre-version
453 %linux-libre-hash
454 '("armhf-linux")
455 #:defconfig "omap2plus_defconfig"
456 #:extra-version "arm-omap2plus"))
457
adbe6dea
MW
458(define-public linux-libre-arm-omap2plus-4.14
459 (make-linux-libre %linux-libre-4.14-version
460 %linux-libre-4.14-hash
461 '("armhf-linux")
462 #:defconfig "omap2plus_defconfig"
463 #:extra-version "arm-omap2plus"))
464
97121c2a 465\f
c84d0eca
LC
466;;;
467;;; Pluggable authentication modules (PAM).
468;;;
469
fd76c904
LC
470(define-public linux-pam
471 (package
472 (name "linux-pam")
7483230f 473 (version "1.3.0")
fd76c904
LC
474 (source
475 (origin
476 (method url-fetch)
7483230f
DC
477 (uri (string-append
478 "http://www.linux-pam.org/library/"
479 "Linux-PAM-" version ".tar.bz2"))
fd76c904
LC
480 (sha256
481 (base32
411264c2
RS
482 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
483 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
484
fd76c904 485 (build-system gnu-build-system)
c4c4cc05 486 (native-inputs
fd76c904
LC
487 `(("flex" ,flex)
488
489 ;; TODO: optional dependencies
490 ;; ("libxcrypt" ,libxcrypt)
491 ;; ("cracklib" ,cracklib)
492 ))
493 (arguments
ed8111ea 494 `(;; Most users, such as `shadow', expect the headers to be under
c134056a
LC
495 ;; `security'.
496 #:configure-flags (list (string-append "--includedir="
497 (assoc-ref %outputs "out")
ed8111ea
LC
498 "/include/security")
499
500 ;; XXX: <rpc/rpc.h> is missing from glibc when
501 ;; cross-compiling, so we have to disable NIS
502 ;; support altogether.
503 ,@(if (%current-target-system)
504 '("--disable-nis")
505 '()))
c134056a
LC
506
507 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
508 ;; isn't available.
509 #:tests? #f))
fd76c904
LC
510 (home-page "http://www.linux-pam.org/")
511 (synopsis "Pluggable authentication modules for Linux")
512 (description
513 "A *Free* project to implement OSF's RFC 86.0.
514Pluggable authentication modules are small shared object files that can
515be used through the PAM API to perform tasks, like authenticating a user
e881752c 516at login. Local and dynamic reconfiguration are its key features.")
3ac73271 517 (license license:bsd-3)))
686f14e8 518
4c93ce42
EF
519(define-public linux-pam-1.2
520 (package
521 (inherit linux-pam)
4c93ce42
EF
522 (version "1.2.1")
523 (source
524 (origin
525 (method url-fetch)
526 (uri (string-append
527 "http://www.linux-pam.org/library/"
528 "Linux-PAM-" version ".tar.bz2"))
529 (sha256
530 (base32
411264c2
RS
531 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
532 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
4c93ce42 533
53142109 534
c84d0eca
LC
535;;;
536;;; Miscellaneous.
537;;;
538
686f14e8
LC
539(define-public psmisc
540 (package
541 (name "psmisc")
f42846b2 542 (version "23.1")
686f14e8
LC
543 (source
544 (origin
545 (method url-fetch)
546 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
f42846b2 547 version ".tar.xz"))
686f14e8
LC
548 (sha256
549 (base32
f42846b2 550 "0c5s94hqpwfmyswx2f96gifa6wdbpxxpkyxcrlzbxpvmrxsd911f"))))
686f14e8
LC
551 (build-system gnu-build-system)
552 (inputs `(("ncurses" ,ncurses)))
aa9c221f 553 (home-page "https://gitlab.com/psmisc/psmisc")
686f14e8 554 (synopsis
8f65585b 555 "Small utilities that use the proc file system")
686f14e8
LC
556 (description
557 "This PSmisc package is a set of some small useful utilities that
8f65585b 558use the proc file system. We're not about changing the world, but
686f14e8 559providing the system administrator with some help in common tasks.")
3ac73271 560 (license license:gpl2+)))
02b80c3f
NK
561
562(define-public util-linux
563 (package
564 (name "util-linux")
ab0bdd54 565 (version "2.32")
5a6a3ba4
LC
566 (source (origin
567 (method url-fetch)
568 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
569 name "/v" (version-major+minor version) "/"
570 name "-" version ".tar.xz"))
5a6a3ba4
LC
571 (sha256
572 (base32
ab0bdd54
MB
573 "0d2758kjll5xqm5fpp3sww1h66aahx161sf2b60jxqv4qymrfwvc"))
574 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
575 (modules '((guix build utils)))
576 (snippet
0223db58
MB
577 ;; We take 'nologin' from Shadow, the 'logger' program from
578 ;; GNU Inetutils and 'kill' from GNU Coreutils.
8338c241
MW
579 '(begin
580 (substitute* "configure"
0223db58 581 (("build_nologin=yes") "build_nologin=no")
8338c241
MW
582 (("build_logger=yes") "build_logger=no")
583 (("build_kill=yes") "build_kill=no"))
584 #t))))
02b80c3f 585 (build-system gnu-build-system)
dd581e9a
TGR
586 (outputs '("out"
587 "static")) ; >2 MiB of static .a libraries
02b80c3f 588 (arguments
29ec55ee 589 `(#:configure-flags (list "--disable-use-tty-group"
d9804e50 590 "--enable-fs-paths-default=/run/current-system/profile/sbin"
db9107b9
EF
591 ;; Don't try to chown root:root mount and umount
592 "--disable-makeinstall-chown"
29ec55ee
LC
593 ;; Install completions where our
594 ;; bash-completion package expects them.
595 (string-append "--with-bashcompletiondir="
596 (assoc-ref %outputs "out")
597 "/etc/bash_completion.d"))
1b9cf4ad 598 #:phases (modify-phases %standard-phases
7e512497
LC
599 (add-before
600 'build 'set-umount-file-name
601 (lambda* (#:key outputs #:allow-other-keys)
602 ;; Tell 'eject' the right file name of 'umount'.
603 (let ((out (assoc-ref outputs "out")))
604 (substitute* "sys-utils/eject.c"
605 (("\"/bin/umount\"")
606 (string-append "\"" out "/bin/umount\"")))
607 #t)))
1b9cf4ad
LC
608 (add-before
609 'check 'pre-check
610 (lambda* (#:key inputs outputs #:allow-other-keys)
611 (let ((out (assoc-ref outputs "out"))
612 (net (assoc-ref inputs "net-base")))
613 ;; Change the test to refer to the right file.
614 (substitute* "tests/ts/misc/mcookie"
615 (("/etc/services")
616 (string-append net "/etc/services")))
dd581e9a
TGR
617 #t)))
618 (add-after
619 'install 'move-static-libraries
620 (lambda* (#:key outputs #:allow-other-keys)
621 (let ((out (assoc-ref outputs "out"))
622 (static (assoc-ref outputs "static")))
623 (mkdir-p (string-append static "/lib"))
624 (with-directory-excursion out
625 (for-each (lambda (file)
626 (rename-file file
627 (string-append static "/"
628 file)))
629 (find-files "lib" "\\.a$")))
1b9cf4ad 630 #t))))))
f61e0e79 631 (inputs `(("zlib" ,zlib)
ba4aca3a
LC
632 ("ncurses" ,ncurses)
633
634 ;; XXX: This is so that the 'pre-check' phase can find it.
635 ,@(if (%current-target-system)
636 `(("net-base" ,net-base))
637 '())))
c4c4cc05 638 (native-inputs
9f533d60
LC
639 `(("perl" ,perl)
640 ("net-base" ,net-base))) ;for tests
02b80c3f 641 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 642 (synopsis "Collection of utilities for the Linux kernel")
437d7286 643 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 644utilities. It provides dmesg and includes tools for working with file systems,
437d7286 645block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 646
02b80c3f 647 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 648 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 649 ;; explicitly defined license.
3ac73271
LC
650 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
651 license:bsd-4 license:public-domain))))
5d5c4278 652
3116c8b5 653(define-public ddate
654 (package
655 (name "ddate")
656 (version "0.2.2")
657 (source (origin
658 (method url-fetch)
659 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
660 version ".tar.gz"))
661 (file-name (string-append name "-" version ".tar.gz"))
662 (sha256
663 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
664 (build-system cmake-build-system)
665 (arguments '(#:tests? #f))
666 (home-page "https://github.com/bo0ts/ddate")
667 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
668 (description
669 "ddate displays the Discordian date and holidays of a given date.
670The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
671by Robert Shea and Robert Anton Wilson.")
672 (license license:public-domain)))
673
e47e3eff
LC
674(define-public procps
675 (package
676 (name "procps")
ad3068b5 677 (version "3.3.15")
e47e3eff 678 (source (origin
0cc22848
SB
679 (method url-fetch)
680 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
681 "procps-ng-" version ".tar.xz"))
682 (sha256
683 (base32
ad3068b5 684 "0r84kwa5fl0sjdashcn4vh7hgfm7ahdcysig3mcjvpmkzi7p9g8h"))))
e47e3eff 685 (build-system gnu-build-system)
e47e3eff 686 (arguments
80393eed
LC
687 '(#:modules ((guix build utils)
688 (guix build gnu-build-system)
689 (srfi srfi-1)
690 (srfi srfi-26))
0cc22848
SB
691 #:phases
692 (modify-phases %standard-phases
693 (add-after
694 'install 'post-install
695 ;; Remove commands and man pages redudant with
696 ;; Coreutils.
697 (lambda* (#:key outputs #:allow-other-keys)
698 (let* ((out (assoc-ref outputs "out"))
699 (dup (append-map (cut find-files out <>)
700 '("^kill" "^uptime"))))
701 (for-each delete-file dup)
702 #t))))))
703 (inputs `(("ncurses" ,ncurses)))
704 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 705 (synopsis "Utilities that give information about processes")
e47e3eff 706 (description
35b9e423 707 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
708that give information about processes using the Linux /proc file system.
709The package includes the programs ps, top, vmstat, w, kill, free,
710slabtop, and skill.")
3ac73271 711 (license license:gpl2)))
e47e3eff 712
5d5c4278
NK
713(define-public usbutils
714 (package
715 (name "usbutils")
7c525581 716 (version "010")
5d5c4278
NK
717 (source
718 (origin
719 (method url-fetch)
720 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
721 "usbutils-" version ".tar.xz"))
722 (sha256
723 (base32
7c525581 724 "06aag4jfgsfjxk563xsp9ik9nadihmasrr37a1gb0vwqni5kdiv1"))))
5d5c4278
NK
725 (build-system gnu-build-system)
726 (inputs
e8a463e6 727 `(("libusb" ,libusb)
4e859e92 728 ("eudev" ,eudev)))
c4c4cc05
JD
729 (native-inputs
730 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
731 (home-page "http://www.linux-usb.org/")
732 (synopsis
733 "Tools for working with USB devices, such as lsusb")
734 (description
735 "Tools for working with USB devices, such as lsusb.")
3ac73271 736 (license license:gpl2+)))
0750452a
LC
737
738(define-public e2fsprogs
739 (package
740 (name "e2fsprogs")
29591fc4 741 (version "1.43.6")
0750452a
LC
742 (source (origin
743 (method url-fetch)
7409c8d4
MW
744 (uri (string-append
745 "mirror://kernel.org/linux/kernel/people/tytso/"
746 name "/v" version "/"
747 name "-" version ".tar.xz"))
0750452a
LC
748 (sha256
749 (base32
7d5adf01
RH
750 "00ilv65dzcgiap435j89xk86shf7rrav3wsik7cahy789qijdcn9"))
751 (patches (search-patches "e2fsprogs-glibc-2.27.patch"))))
0750452a 752 (build-system gnu-build-system)
c4c4cc05 753 (inputs `(("util-linux" ,util-linux)))
f57d2639 754 (native-inputs `(("pkg-config" ,pkg-config)
75f796bb
MB
755 ("texinfo" ,texinfo) ;for the libext2fs Info manual
756
757 ;; For tests.
758 ("perl" ,perl)
759 ("procps" ,procps)))
0750452a 760 (arguments
b047a86b 761 '(;; util-linux is the preferred source for some of the libraries and
c44ed26c 762 ;; commands, so disable them (see, e.g.,
a124bbd2 763 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
b047a86b
MB
764 #:configure-flags (list "--disable-libblkid"
765 "--disable-libuuid" "--disable-uuidd"
766 "--disable-fsck"
7c594a2c 767
b047a86b
MB
768 ;; Use symlinks instead of hard links for
769 ;; 'fsck.extN' etc. This makes the resulting nar
770 ;; smaller and is preserved across copies.
771 "--enable-symlink-install"
74d21291 772
b047a86b
MB
773 (string-append "LDFLAGS=-Wl,-rpath="
774 (assoc-ref %outputs "out")
775 "/lib")
7c594a2c 776
b047a86b
MB
777 ;; Install libext2fs et al.
778 "--enable-elf-shlibs")
ddfc2fd8 779
55acb372
MB
780 #:phases
781 (modify-phases %standard-phases
782 (add-before 'configure 'patch-shells
783 (lambda _
784 (substitute* "configure"
785 (("/bin/sh (.*)parse-types.sh" _ dir)
786 (string-append (which "sh") " " dir
787 "parse-types.sh")))
b047a86b
MB
788 (substitute* "MCONFIG.in"
789 (("INSTALL_SYMLINK = /bin/sh")
790 "INSTALL_SYMLINK = sh"))
55acb372
MB
791 (substitute* (find-files "." "^Makefile.in$")
792 (("#!/bin/sh")
793 (string-append "#!" (which "sh"))))
794 #t))
795 (add-after 'install 'install-libs
796 (lambda* (#:key outputs #:allow-other-keys)
797 (let* ((out (assoc-ref outputs "out"))
798 (lib (string-append out "/lib")))
b132ad3a
MW
799 (invoke "make" "install-libs")
800
801 ;; Make the .a writable so that 'strip' works.
802 ;; Failing to do that, due to debug symbols, we
803 ;; retain a reference to the final
804 ;; linux-libre-headers, which refer to the
805 ;; bootstrap binaries.
806 (let ((archives (find-files lib "\\.a$")))
807 (for-each (lambda (file)
808 (chmod file #o666))
809 archives))
810 #t))))))
0750452a 811 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 812 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
813 (description
814 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3ac73271
LC
815 (license (list license:gpl2 ;programs
816 license:lgpl2.0 ;libext2fs
817 license:x11)))) ;libuuid
d8482ad0 818
e48977e7
LC
819(define e2fsprogs/static
820 (static-package
821 (package (inherit e2fsprogs)
822 (arguments
823 ;; Do not build shared libraries.
824 (substitute-keyword-arguments (package-arguments e2fsprogs)
825 ((#:configure-flags _)
826 '(list "--disable-blkid"))
827 ((#:make-flags _)
828 '(list)))))))
829
e102f940
LC
830(define-public e2fsck/static
831 (package
832 (name "e2fsck-static")
0997771a 833 (version (package-version e2fsprogs))
e102f940
LC
834 (build-system trivial-build-system)
835 (source #f)
313880c7
DC
836 (inputs
837 `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
838 (arguments
839 `(#:modules ((guix build utils))
840 #:builder
841 (begin
842 (use-modules (guix build utils)
843 (ice-9 ftw)
844 (srfi srfi-26))
845
313880c7
DC
846 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
847 "/sbin/e2fsck"))
e102f940
LC
848 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
849 (mkdir-p bin)
850 (with-directory-excursion bin
313880c7
DC
851 (copy-file e2fsck "e2fsck")
852 (remove-store-references "e2fsck")
e3cfef22
MW
853 (chmod "e2fsck" #o555))
854 #t))))
0997771a 855 (home-page (package-home-page e2fsprogs))
313880c7
DC
856 (synopsis "Statically-linked e2fsck command from e2fsprogs")
857 (description "This package provides statically-linked e2fsck command taken
858from the e2fsprogs package. It is meant to be used in initrds.")
0997771a 859 (license (package-license e2fsprogs))))
e102f940 860
7c0a9104
LC
861(define-public extundelete
862 (package
863 (name "extundelete")
864 (version "0.2.4")
865 (source (origin
866 (method url-fetch)
867 (uri (string-append "mirror://sourceforge/extundelete/"
de67e922
LF
868 "extundelete/" version "/extundelete-"
869 version ".tar.bz2"))
7c0a9104
LC
870 (sha256
871 (base32
872 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
873 (build-system gnu-build-system)
874 (inputs `(("e2fsprogs" ,e2fsprogs)))
875 (home-page "http://extundelete.sourceforge.net/")
876 (synopsis "Recover deleted files from ext2/3/4 partitions")
877 (description
878 "Extundelete is a set of tools that can recover deleted files from an
879ext3 or ext4 partition.")
3ac73271 880 (license license:gpl2)))
7c0a9104 881
1c975f60
LC
882(define-public zerofree
883 (package
884 (name "zerofree")
5658b4ce 885 (version "1.1.1")
30ac4cc7 886 (home-page "https://frippery.org/uml/")
1c975f60
LC
887 (source (origin
888 (method url-fetch)
889 (uri (string-append home-page name "-" version
890 ".tgz"))
891 (sha256
892 (base32
5658b4ce 893 "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm"))))
1c975f60
LC
894 (build-system gnu-build-system)
895 (arguments
0f08917d
TGR
896 '(#:phases
897 (modify-phases %standard-phases
898 (delete 'configure) ; no configure script
899 (replace 'install
900 ;; The Makefile lacks an ‘install’ target.
901 (lambda* (#:key outputs #:allow-other-keys)
902 (let* ((out (assoc-ref outputs "out"))
903 (bin (string-append out "/bin")))
7a068459
TGR
904 (chmod "zerofree" #o555)
905 (install-file "zerofree" bin)
0f08917d
TGR
906 #t))))
907 #:tests? #f)) ; no tests
1c975f60
LC
908 (inputs `(("libext2fs" ,e2fsprogs)))
909 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
910 (description
4de4a1cf
TGR
911 "Zerofree finds the unallocated blocks with non-zero value content in an
912ext2, ext3, or ext4 file system and fills them with zeroes (or another value).
913This is a simple way to make disk images more compressible.
914Zerofree requires the file system to be unmounted or mounted read-only.")
3ac73271 915 (license license:gpl2)))
1c975f60 916
d8482ad0
LC
917(define-public strace
918 (package
919 (name "strace")
ed2ae0dc 920 (version "4.23")
426284d8 921 (home-page "https://strace.io")
d8482ad0
LC
922 (source (origin
923 (method url-fetch)
426284d8
MB
924 (uri (string-append home-page "/files/" version
925 "/strace-" version ".tar.xz"))
d8482ad0
LC
926 (sha256
927 (base32
ed2ae0dc 928 "1bcsq2gbpcb81ayryvn56a6kjx42fc21la6qgds35n0xbybacq3q"))))
d8482ad0 929 (build-system gnu-build-system)
6983b8a8
MB
930 (arguments
931 '(#:phases
932 (modify-phases %standard-phases
933 (add-after 'unpack 'patch-/bin/sh
934 (lambda _
935 (substitute* "strace.c"
936 (("/bin/sh") (which "sh")))
937 #t)))))
c4c4cc05 938 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
939 (synopsis "System call tracer for Linux")
940 (description
941 "strace is a system call tracer, i.e. a debugging tool which prints out a
942trace of all the system calls made by a another process/program.")
3ac73271 943 (license license:bsd-3)))
ba04571a 944
e1e27737
TUBK
945(define-public ltrace
946 (package
947 (name "ltrace")
948 (version "0.7.3")
949 (source (origin
950 (method url-fetch)
951 (uri (string-append "http://www.ltrace.org/ltrace_" version
952 ".orig.tar.bz2"))
953 (sha256
954 (base32
955 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
956 (build-system gnu-build-system)
957 (inputs `(("libelf" ,libelf)))
958 (arguments
959 ;; Compilation uses -Werror by default, but it fails.
960 '(#:configure-flags '("--disable-werror")))
81e59e41 961 (home-page "https://www.ltrace.org/")
e1e27737
TUBK
962 (synopsis "Library call tracer for Linux")
963 (description
964 "ltrace intercepts and records dynamic library calls which are called by
965an executed process and the signals received by that process. It can also
966intercept and print the system calls executed by the program.")
3ac73271 967 (license license:gpl2+)))
e1e27737 968
ba04571a
LC
969(define-public alsa-lib
970 (package
971 (name "alsa-lib")
45c053ac 972 (version "1.1.6")
ba04571a
LC
973 (source (origin
974 (method url-fetch)
975 (uri (string-append
976 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
977 version ".tar.bz2"))
978 (sha256
979 (base32
3272bcfd 980 "096pwrnhj36yndldvs2pj4r871zhcgisks0is78f1jkjn9sd4b2z"))))
ba04571a 981 (build-system gnu-build-system)
5f3070a5 982 (home-page "https://www.alsa-project.org/")
ba04571a
LC
983 (synopsis "The Advanced Linux Sound Architecture libraries")
984 (description
985 "The Advanced Linux Sound Architecture (ALSA) provides audio and
986MIDI functionality to the Linux-based operating system.")
3ac73271 987 (license license:lgpl2.1+)))
10afdf50 988
17b293a0
LC
989(define-public alsa-utils
990 (package
991 (name "alsa-utils")
7ff05770 992 (version "1.1.6")
17b293a0
LC
993 (source (origin
994 (method url-fetch)
992b527d
EF
995 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
996 name "-" version ".tar.bz2"))
17b293a0
LC
997 (sha256
998 (base32
7ff05770 999 "0vnkyymgwj9rfdb11nvab30dnfrylmakdfildxl0y8mj836awp0m"))))
17b293a0
LC
1000 (build-system gnu-build-system)
1001 (arguments
1002 ;; XXX: Disable man page creation until we have DocBook.
1003 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
1004
1005 ;; The udev rule is responsible for restoring
1006 ;; the volume.
17b293a0
LC
1007 (string-append "--with-udev-rules-dir="
1008 (assoc-ref %outputs "out")
1009 "/lib/udev/rules.d"))
49165145
EF
1010 #:phases
1011 (modify-phases %standard-phases
1012 (add-before
1013 'install 'pre-install
1014 (lambda _
1015 ;; Don't try to mkdir /var/lib/alsa.
1016 (substitute* "Makefile"
1017 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
457d154f
EF
1018 "true\n"))
1019 #t)))))
17b293a0
LC
1020 (inputs
1021 `(("libsamplerate" ,libsamplerate)
1022 ("ncurses" ,ncurses)
1023 ("alsa-lib" ,alsa-lib)
1024 ("xmlto" ,xmlto)
b94a6ca0 1025 ("gettext" ,gettext-minimal)))
17b293a0
LC
1026 (home-page "http://www.alsa-project.org/")
1027 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
1028 (description
1029 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1030MIDI functionality to the Linux-based operating system.")
1031
1032 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
1033 ;; GPLv2-only.
3ac73271 1034 (license license:gpl2)))
17b293a0 1035
7d2511bc 1036(define-public alsa-plugins
1037 (package
1038 (name "alsa-plugins")
6c69d24d 1039 (version "1.1.6")
7d2511bc 1040 (source (origin
1041 (method url-fetch)
1042 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
1043 name "-" version ".tar.bz2"))
1044 (sha256
1045 (base32
6c69d24d 1046 "04qcwkisbh0d6lnh0rw1k6n869fbs6zbfq6yvb41rymiwgmk27bg"))))
7d2511bc 1047 (build-system gnu-build-system)
1048 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
1049 ;; be split, there are references to both in files.
1050 ;; TODO: Remove OSS related plugins, they add support to run native
1051 ;; ALSA applications on OSS however we do not offer OSS and OSS is
1052 ;; obsolete.
624ee211 1053 (outputs '("out" "pulseaudio" "jack"))
7d2511bc 1054 (arguments
1055 `(#:phases
1056 (modify-phases %standard-phases
1057 (add-after 'install 'split
1058 (lambda* (#:key inputs outputs #:allow-other-keys)
1059 ;; Distribute the binaries to the various outputs.
1060 (let* ((out (assoc-ref outputs "out"))
624ee211
SB
1061 (jack (assoc-ref outputs "jack"))
1062 (jacklib (string-append jack "/lib/alsa-lib"))
7d2511bc 1063 (pua (assoc-ref outputs "pulseaudio"))
1064 (pualib (string-append pua "/lib/alsa-lib"))
1065 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
624ee211
SB
1066 ;; For jack.
1067 (mkdir-p jacklib)
1068 (for-each (lambda (file)
1069 (rename-file file (string-append jacklib "/" (basename file))))
1070 (find-files out ".*jack\\.(la|so)"))
1071 ;; For pluseaudio.
7d2511bc 1072 (mkdir-p puaconf)
1073 (mkdir-p pualib)
1074 (chdir (string-append out "/share"))
1075 (for-each (lambda (file)
1076 (rename-file file (string-append puaconf "/" (basename file))))
1077 (find-files out "\\.(conf|example)"))
1078 (for-each (lambda (file)
1079 (rename-file file (string-append pualib "/" (basename file))))
1080 (find-files out ".*pulse\\.(la|so)"))
1081 (chdir "..")
1082 ;; We have moved the files to output pulsaudio, the
1083 ;; directory is now empty.
1084 (delete-file-recursively (string-append out "/share"))
1085 #t))))))
1086 (inputs
1087 `(("alsa-lib" ,alsa-lib)
624ee211 1088 ("jack" ,jack-1)
7d2511bc 1089 ("speex" ,speex) ; libspeexdsp resampling plugin
1090 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1091 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1092 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1093 (native-inputs
1094 `(("pkg-config" ,pkg-config)))
1095 (home-page "http://www.alsa-project.org/")
1096 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1097 (description
1098 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1099MIDI functionality to the Linux-based operating system. This package enhances ALSA
1100by providing additional plugins which include: upmixing, downmixing, jackd and
1101pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1102external rate conversion.")
1103 (license (list license:gpl2+
1104 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1105 license:lgpl2.1+))))
1106
10afdf50
LC
1107(define-public iptables
1108 (package
1109 (name "iptables")
4f3bf205 1110 (version "1.6.2")
10afdf50
LC
1111 (source (origin
1112 (method url-fetch)
1113 (uri (string-append
f11ae44f 1114 "mirror://netfilter.org/iptables/iptables-"
10afdf50
LC
1115 version ".tar.bz2"))
1116 (sha256
1117 (base32
4f3bf205 1118 "0crp0lvh5m2f15pr8cw97h8yb8zjj10x95zj06j46cr68vx2vl2m"))))
10afdf50 1119 (build-system gnu-build-system)
13223c8e
LF
1120 (native-inputs
1121 `(("pkg-config" ,pkg-config)
1122 ("flex" ,flex)
1123 ("bison" ,bison)))
1124 (inputs
1125 `(("libmnl" ,libmnl)
1126 ("libnftnl" ,libnftnl)))
50c26d9e
SB
1127 (arguments
1128 '(#:tests? #f ; no test suite
1129 #:configure-flags ; add $libdir to the RUNPATH of executables
1130 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
13223c8e 1131 (home-page "https://www.netfilter.org/projects/iptables/index.html")
be5dc5fb 1132 (synopsis "Programs to configure Linux IP packet filtering rules")
10afdf50 1133 (description
be5dc5fb
TGR
1134 "@command{iptables} is the user-space command line program used to
1135configure the Linux 2.4.x and later IPv4 packet filtering ruleset
1136(@dfn{firewall}), including @dfn{NAT} (Network Address Translation).
1137
1138This package also includes @command{ip6tables}, which is used to configure the
1139IPv6 packet filter.
1140
fadc5533 1141Both commands are targeted at system administrators.")
3ac73271 1142 (license license:gpl2+)))
90a0048f 1143
6876a6fe
SB
1144(define-public ebtables
1145 (package
1146 (name "ebtables")
1147 (version "2.0.10-4")
1148 (source (origin
1149 (method url-fetch)
1150 (uri (string-append
1151 "mirror://netfilter.org/ebtables/ebtables-v"
1152 version ".tar.gz"))
1153 (sha256
1154 (base32
1155 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1156 (build-system gnu-build-system)
1157 (arguments
1158 '(#:tests? #f ; no test suite
1159 #:make-flags
1160 (let* ((out (assoc-ref %outputs "out"))
1161 (bin (string-append out "/sbin"))
1162 (lib (string-append out "/lib"))
1163 (man (string-append out "/share/man"))
1164 (iptables (assoc-ref %build-inputs "iptables"))
1165 (ethertypes (string-append iptables "/etc/ethertypes")))
1166 (list (string-append "LIBDIR=" lib)
1167 (string-append "MANDIR=" man)
1168 (string-append "BINDIR=" bin)
1169 (string-append "ETHERTYPESFILE=" ethertypes)
1170 ;; With the default CFLAGS, it falis with:
1171 ;; communication.c:259:58: error: variable ‘ret’ set but not
1172 ;; used [-Werror=unused-but-set-variable]
1173 "CFLAGS=-Wall"))
1174 #:phases
1175 (modify-phases %standard-phases
1176 (replace 'configure
1177 ;; no configure script
1178 (lambda _
1179 (substitute* "Makefile"
1180 ;; Remove user and group options from install commands,
1181 ;; otherwise it fails with: invalid user 'root'.
1182 (("-o root -g root") "")
1183 ;; Remove 'ethertypes' from the install target.
1184 (("install: .*")
1185 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1186 #t)))))
1187 (inputs
1188 `(("perl" ,perl)
1189 ("iptables" ,iptables)))
1190 (synopsis "Ethernet bridge frame table administration")
1191 (home-page "http://ebtables.netfilter.org/")
1192 (description
1193 "ebtables is an application program used to set up and maintain the
1194tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1195analogous to the iptables application, but less complicated, due to the fact
1196that the Ethernet protocol is much simpler than the IP protocol.")
1197 (license license:gpl2+)))
1198
90a0048f
LC
1199(define-public iproute
1200 (package
1201 (name "iproute2")
14299d21 1202 (version "4.17.0")
90a0048f 1203 (source (origin
75cd4b05
AK
1204 (method url-fetch)
1205 (uri (string-append
1206 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1207 version ".tar.xz"))
1208 (sha256
1209 (base32
14299d21 1210 "0vmynikcamfhakvwyk5dsffy0ymgi5mdqiwybdvqfn1ijaq93abg"))))
90a0048f
LC
1211 (build-system gnu-build-system)
1212 (arguments
1213 `(#:tests? #f ; no test suite
1214 #:make-flags (let ((out (assoc-ref %outputs "out")))
1215 (list "DESTDIR="
e777d07d
LF
1216 (string-append "BASH_COMPDIR=" out
1217 "/etc/bash_completion.d")
90a0048f 1218 (string-append "LIBDIR=" out "/lib")
61f78e72 1219 (string-append "HDRDIR=" out "/include")
90a0048f
LC
1220 (string-append "SBINDIR=" out "/sbin")
1221 (string-append "CONFDIR=" out "/etc")
1222 (string-append "DOCDIR=" out "/share/doc/"
1223 ,name "-" ,version)
1224 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
1225 #:phases (modify-phases %standard-phases
1226 (add-before 'install 'pre-install
1227 (lambda _
1228 ;; Don't attempt to create /var/lib/arpd.
1229 (substitute* "Makefile"
1230 (("^.*ARPDDIR.*$") "")))))))
90a0048f
LC
1231 (inputs
1232 `(("iptables" ,iptables)
c4c4cc05
JD
1233 ("db4" ,bdb)))
1234 (native-inputs
1235 `(("pkg-config" ,pkg-config)
90a0048f
LC
1236 ("flex" ,flex)
1237 ("bison" ,bison)))
1238 (home-page
d7f84eab 1239 "https://wiki.linuxfoundation.org/networking/iproute2")
90a0048f 1240 (synopsis
9e771e3b 1241 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f 1242 (description
35a4fefc
TGR
1243 "Iproute2 is a collection of utilities for controlling TCP/IP networking
1244and traffic with the Linux kernel. The most important of these are
1245@command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic
1246control.
90a0048f
LC
1247
1248Most network configuration manuals still refer to ifconfig and route as the
1249primary network configuration tools, but ifconfig is known to behave
35a4fefc 1250inadequately in modern network environments, and both should be deprecated.")
3ac73271 1251 (license license:gpl2+)))
85e0dc6a
LC
1252
1253(define-public net-tools
1254 ;; XXX: This package is basically unmaintained, but it provides a few
1255 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1256 ;; live with it.
6d31c175
LF
1257 (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b")
1258 (revision "0"))
1259 (package
1260 (name "net-tools")
1261 (version (string-append "1.60-" revision "." (string-take commit 7)))
1262 (source (origin
631c9f74
LF
1263 (method url-fetch)
1264 (uri (string-append "https://sourceforge.net/code-snapshots/git/"
1265 "n/ne/net-tools/code.git/net-tools-code-"
1266 commit ".zip"))
1267 (file-name (string-append name "-" version ".zip"))
6d31c175
LF
1268 (sha256
1269 (base32
631c9f74 1270 "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy"))))
6d31c175
LF
1271 (home-page "http://net-tools.sourceforge.net/")
1272 (build-system gnu-build-system)
1273 (arguments
1274 '(#:modules ((guix build gnu-build-system)
1275 (guix build utils)
1276 (srfi srfi-1)
1277 (srfi srfi-26))
1278 #:phases
1279 (modify-phases %standard-phases
1280 (replace 'configure
1281 (lambda* (#:key outputs #:allow-other-keys)
1282 (let ((out (assoc-ref outputs "out")))
1283 (mkdir-p (string-append out "/bin"))
1284 (mkdir-p (string-append out "/sbin"))
1285
1286 ;; Pretend we have everything...
1287 (system "yes | make config")
1288
1289 ;; ... except for the things we don't have.
1290 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1291 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1292 ;; that have been removed.
1293 ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should
1294 ;; think about adding them later.
1295 (substitute* '("config.make" "config.h")
1296 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$")
8ea5d868
MW
1297 ""))
1298 #t)))
6d31c175
LF
1299 (add-after 'install 'remove-redundant-commands
1300 (lambda* (#:key outputs #:allow-other-keys)
1301 ;; Remove commands and man pages redundant with Inetutils.
1302 (let* ((out (assoc-ref outputs "out"))
1303 (dup (append-map (cut find-files out <>)
1304 '("^hostname"
1305 "^(yp|nis|dns)?domainname"))))
1306 (for-each delete-file dup)
1307 #t))))
1308 ;; Binaries that depend on libnet-tools.a don't declare that
1309 ;; dependency, making it parallel-unsafe.
1310 #:parallel-build? #f
1311
1312 #:tests? #f ; no test suite
1313 #:make-flags (let ((out (assoc-ref %outputs "out")))
1314 (list "CC=gcc"
1315 (string-append "BASEDIR=" out)
1316 (string-append "INSTALLNLSDIR=" out "/share/locale")
1317 (string-append "mandir=/share/man")))))
631c9f74
LF
1318 (native-inputs `(("gettext" ,gettext-minimal)
1319 ("unzip" ,unzip)))
6d31c175
LF
1320 (synopsis "Tools for controlling the network subsystem in Linux")
1321 (description
1322 "This package includes the important tools for controlling the network
1323subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and
1324route. Additionally, this package contains utilities relating to particular
1325network hardware types (plipconfig, slattach) and advanced aspects of IP
1326configuration (iptunnel, ipmaddr).")
1327 (license license:gpl2+))))
1328
c762e82e
LC
1329(define-public libcap
1330 (package
1331 (name "libcap")
68ea090b 1332 (version "2.25")
c762e82e
LC
1333 (source (origin
1334 (method url-fetch)
c762e82e 1335 (uri (string-append
f6c2d05c
LC
1336 "mirror://kernel.org/linux/libs/security/linux-privs/"
1337 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
1338 (sha256
1339 (base32
68ea090b 1340 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
c762e82e 1341 (build-system gnu-build-system)
6d889daf
SB
1342 (arguments '(#:phases
1343 (modify-phases %standard-phases
1344 (replace 'configure
1345 ;; Add $libdir to the RUNPATH of executables.
1346 (lambda _
1347 (substitute* "Make.Rules"
1348 (("LDFLAGS := #-g")
1349 (string-append "LDFLAGS := -Wl,-rpath="
d70d59d6
MW
1350 %output "/lib")))
1351 #t)))
c762e82e
LC
1352 #:tests? #f ; no 'check' target
1353 #:make-flags (list "lib=lib"
1354 (string-append "prefix="
1355 (assoc-ref %outputs "out"))
1356 "RAISE_SETFCAP=no")))
1357 (native-inputs `(("perl" ,perl)))
1358 (inputs `(("attr" ,attr)))
1359 (home-page "https://sites.google.com/site/fullycapable/")
1360 (synopsis "Library for working with POSIX capabilities")
1361 (description
35b9e423 1362 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
1363Linux-based operating systems.")
1364
1365 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 1366 (license license:gpl2)))
215b6431
LC
1367
1368(define-public bridge-utils
1369 (package
1370 (name "bridge-utils")
1371 (version "1.5")
1372 (source (origin
1373 (method url-fetch)
de67e922
LF
1374 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1375 "bridge-utils-" version ".tar.gz"))
215b6431
LC
1376 (sha256
1377 (base32
1378 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1379 (build-system gnu-build-system)
1380
1381 ;; The tarball lacks all the generated files.
1382 (native-inputs `(("autoconf" ,autoconf)
1383 ("automake" ,automake)))
1384 (arguments
dc1d3cde
KK
1385 '(#:phases
1386 (modify-phases %standard-phases
189be331 1387 (add-before 'bootstrap 'patch-stuff
dc1d3cde
KK
1388 (lambda _
1389 ;; Fix "field ‘ip6’ has incomplete type" errors.
1390 (substitute* "libbridge/libbridge.h"
1391 (("#include <linux/if_bridge.h>")
1392 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1393
1394 ;; Ensure that the entire build fails if one of the
1395 ;; sub-Makefiles fails.
1396 (substitute* "Makefile.in"
1397 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1398 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1399
189be331 1400 #t)))
215b6431
LC
1401 #:tests? #f)) ; no 'check' target
1402
1403 (home-page
1404 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1405 (synopsis "Manipulate Ethernet bridges")
1406 (description
1407 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1408to connect two Ethernet segments together in a protocol independent way.
1409Packets are forwarded based on Ethernet address, rather than IP address (like
1410a router). Since forwarding is done at Layer 2, all protocols can go
1411transparently through a bridge.")
3ac73271 1412 (license license:gpl2+)))
3cc20675
LC
1413
1414(define-public libnl
1415 (package
1416 (name "libnl")
b84a8079 1417 (version "3.4.0")
3cc20675
LC
1418 (source (origin
1419 (method url-fetch)
1420 (uri (string-append
a2265ea3
MB
1421 "https://github.com/thom311/libnl/releases/download/"
1422 "libnl" (string-join (string-split version #\.) "_")
1423 "/libnl-" version ".tar.gz"))
3cc20675
LC
1424 (sha256
1425 (base32
b84a8079 1426 "1gzm444rnsib64dddv0cwlpzy1q4bycjqhp1i5pxpikimqvpca5p"))))
3cc20675 1427 (build-system gnu-build-system)
d80a47f2
DL
1428 (native-inputs
1429 `(("bison" ,bison)
1430 ("flex" ,flex)
3eb7c000
DL
1431 ("pkg-config" ,pkg-config)
1432 ("swig" ,swig)
d80a47f2
DL
1433 ("libnl3-doc"
1434 ,(origin
1435 (method url-fetch)
1436 (uri (string-append
1437 "https://github.com/thom311/libnl/releases/download/libnl"
1438 (string-join (string-split version #\.) "_")
1439 "/libnl-doc-" version ".tar.gz"))
1440 (sha256
b84a8079 1441 (base32 "1m5cnzviv31gjnz6fz5rgyl6ah4dbp2akm49j9973sgwl36gs8jx"))))))
3eb7c000
DL
1442 (inputs
1443 `(("python-2" ,python-2)
1444 ("python-3" ,python-3)))
1445 (outputs '("out" "doc" "python2" "python3"))
d80a47f2 1446 (arguments
3eb7c000
DL
1447 `(#:modules ((guix build gnu-build-system)
1448 (guix build utils)
1449 (srfi srfi-1))
1450 #:phases
d80a47f2 1451 (modify-phases %standard-phases
3eb7c000
DL
1452 (add-after 'install 'install-python
1453 (lambda* (#:key outputs #:allow-other-keys)
1454 (define (python-inst python)
1455 (let ((ldflags (format #f "LDFLAGS=-Wl,-rpath=~a/lib"
1456 (assoc-ref %outputs "out")))
1457 (pyout (assoc-ref %outputs python)))
1458 (and
1459 (zero? (system (format #f "~a ~a setup.py build"
1460 ldflags python pyout)))
1461 (zero?
1462 (system (format #f "~a ~a setup.py install --prefix=~a"
1463 ldflags python pyout)))
1464 (zero? (system* python "setup.py" "clean")))))
1465 (with-directory-excursion "./python"
1466 (every python-inst '("python2" "python3")))))
d80a47f2
DL
1467 (add-after 'install 'install-doc
1468 (lambda* (#:key inputs outputs #:allow-other-keys)
1469 (let ((dest (string-append (assoc-ref outputs "doc")
1470 "/share/doc/libnl")))
1471 (mkdir-p dest)
1472 (zero? (system* "tar" "xf" (assoc-ref inputs "libnl3-doc")
1473 "--strip-components=1" "-C" dest))))))))
81e59e41 1474 (home-page "https://www.infradead.org/~tgr/libnl/")
3cc20675
LC
1475 (synopsis "NetLink protocol library suite")
1476 (description
1477 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 1478protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
1479between the kernel and user space processes. It was designed to be a more
1480flexible successor to ioctl to provide mainly networking related kernel
1481configuration and monitoring interfaces.")
1482
1483 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1484 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 1485 (license license:gpl2)))
023fef7d 1486
65cd77db
MW
1487(define-public iw
1488 (package
1489 (name "iw")
4b0111a4 1490 (version "4.14")
65cd77db
MW
1491 (source (origin
1492 (method url-fetch)
1493 (uri (string-append
2f9e312a 1494 "mirror://kernel.org/software/network/iw/iw-"
65cd77db
MW
1495 version ".tar.xz"))
1496 (sha256
1497 (base32
4b0111a4 1498 "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph"))))
65cd77db
MW
1499 (build-system gnu-build-system)
1500 (native-inputs `(("pkg-config" ,pkg-config)))
1501 (inputs `(("libnl" ,libnl)))
1502 (arguments
1503 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1504 "CC=gcc")
dc1d3cde 1505 #:phases (modify-phases %standard-phases (delete 'configure))))
2f9e312a 1506 (home-page "https://wireless.wiki.kernel.org/")
65cd77db
MW
1507 (synopsis "Tool for configuring wireless devices")
1508 (description
1509 "iw is a new nl80211 based CLI configuration utility for wireless
2f9e312a 1510devices. It replaces @code{iwconfig}, which is deprecated.")
3ac73271 1511 (license license:isc)))
65cd77db 1512
023fef7d
LC
1513(define-public powertop
1514 (package
1515 (name "powertop")
a0604c21 1516 (version "2.9")
023fef7d
LC
1517 (source
1518 (origin
1519 (method url-fetch)
1520 (uri (string-append
a0604c21 1521 "https://01.org/sites/default/files/downloads/powertop/powertop-v"
023fef7d
LC
1522 version ".tar.gz"))
1523 (sha256
1524 (base32
a0604c21 1525 "0l4jjlf05li2mc6g8nrss3h435wjhmnqd8m7v3kha3x0x7cbfzxa"))))
023fef7d 1526 (build-system gnu-build-system)
4c48bf55
ML
1527 (arguments
1528 '(#:phases
1529 (modify-phases %standard-phases
1530 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1531 ;; allow calibrating the network interface in GuixSD.
1532 (add-after 'unpack 'patch-absolute-file-names
1533 (lambda* (#:key inputs #:allow-other-keys)
1534 (let ((kmod (assoc-ref inputs "kmod")))
1535 (substitute* (find-files "src" "\\.cpp$")
1536 ;; Give the right 'modprobe' file name so that essential
1537 ;; modules such as msr.ko can be loaded.
1538 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1539 ;; These programs are only needed to calibrate, so using
1540 ;; relative file names avoids adding extra inputs. When they
1541 ;; are missing powertop gracefully handles it.
1542 (("/usr/bin/hcitool") "hcitool")
1543 (("/usr/bin/xset") "xset")
1544 (("/usr/sbin/hciconfig") "hciconfig"))
1545 #t))))))
023fef7d 1546 (inputs
4c48bf55
ML
1547 `(("kmod" ,kmod)
1548 ("libnl" ,libnl)
023fef7d 1549 ("ncurses" ,ncurses)
4c48bf55
ML
1550 ("pciutils" ,pciutils)
1551 ("zlib" ,zlib)))
c4c4cc05 1552 (native-inputs
ebacb0de 1553 `(("pkg-config" ,pkg-config)))
023fef7d
LC
1554 (home-page "https://01.org/powertop/")
1555 (synopsis "Analyze power consumption on Intel-based laptops")
1556 (description
1557 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1558power management. In addition to being a diagnostic tool, PowerTOP also has
1559an interactive mode where the user can experiment various power management
1560settings for cases where the operating system has not enabled these
1561settings.")
3ac73271 1562 (license license:gpl2)))
6869e5c9
LC
1563
1564(define-public aumix
1565 (package
1566 (name "aumix")
1567 (version "2.9.1")
1568 (source (origin
1569 (method url-fetch)
1570 (uri (string-append
1571 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1572 version ".tar.bz2"))
1573 (sha256
1574 (base32
1575 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1576 (build-system gnu-build-system)
1577 (inputs `(("ncurses" ,ncurses)))
1578 (home-page "http://www.jpj.net/~trevor/aumix.html")
1579 (synopsis "Audio mixer for X and the console")
1580 (description
1581 "Aumix adjusts an audio mixer from X, the console, a terminal,
1582the command line or a script.")
3ac73271 1583 (license license:gpl2+)))
7c0dbe78
SHT
1584
1585(define-public iotop
1586 (package
1587 (name "iotop")
1588 (version "0.6")
1589 (source
1590 (origin
1591 (method url-fetch)
1592 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1593 version ".tar.gz"))
1594 (sha256 (base32
1595 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1596 (build-system python-build-system)
1597 (arguments
35cebf01 1598 ;; The setup.py script expects python-2.
7c0dbe78 1599 `(#:python ,python-2
35cebf01 1600 ;; There are currently no checks in the package.
7c0dbe78
SHT
1601 #:tests? #f))
1602 (native-inputs `(("python" ,python-2)))
1603 (home-page "http://guichaz.free.fr/iotop/")
1604 (synopsis
1605 "Displays the IO activity of running processes")
1606 (description
1607 "Iotop is a Python program with a top like user interface to show the
1608processes currently causing I/O.")
3ac73271 1609 (license license:gpl2+)))
e30835e2
LC
1610
1611(define-public fuse
1612 (package
1613 (name "fuse")
718f791f 1614 (version "2.9.8")
e30835e2
LC
1615 (source (origin
1616 (method url-fetch)
0e9bc883
LF
1617 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1618 "download/fuse-" version
1619 "/fuse-" version ".tar.gz"))
e30835e2
LC
1620 (sha256
1621 (base32
4bda2274 1622 "1qxg1r1mgysfq6qakmvid2njph3lr00w0swvydsfl9ymilfzi12y"))
cd48a549 1623 (patches (search-patches "fuse-overlapping-headers.patch"))))
e30835e2 1624 (build-system gnu-build-system)
b148bd71 1625 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1626 (arguments
1627 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1628 (assoc-ref %outputs "out")
1629 "/sbin")
1630 (string-append "INIT_D_PATH="
1631 (assoc-ref %outputs "out")
1632 "/etc/init.d")
9a4efac9
LC
1633
1634 ;; The rule makes /dev/fuse 666.
e30835e2
LC
1635 (string-append "UDEV_RULES_PATH="
1636 (assoc-ref %outputs "out")
9a4efac9 1637 "/lib/udev/rules.d"))
dc1d3cde
KK
1638 #:phases
1639 (modify-phases %standard-phases
1640 (add-before 'build 'set-file-names
1641 (lambda* (#:key inputs #:allow-other-keys)
1642 ;; libfuse calls out to mount(8) and umount(8). Make sure
1643 ;; it refers to the right ones.
1644 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1645 (("/bin/(u?)mount" _ maybe-u)
1646 (string-append (assoc-ref inputs "util-linux")
1647 "/bin/" maybe-u "mount")))
1648 (substitute* '("util/mount.fuse.c")
1649 (("/bin/sh")
1650 (which "sh")))
1651
1652 ;; This hack leads libfuse to search for 'fusermount' in
1653 ;; $PATH, where it may find a setuid-root binary, instead of
1654 ;; trying solely $out/sbin/fusermount and failing because
1655 ;; it's not setuid.
1656 (substitute* "lib/Makefile"
1657 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1658 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))
1659 #t)))))
0e9bc883 1660 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
1661 (synopsis "Support file systems implemented in user space")
1662 (description
1663 "As a consequence of its monolithic design, file system code for Linux
1664normally goes into the kernel itself---which is not only a robustness issue,
1665but also an impediment to system extensibility. FUSE, for \"file systems in
1666user space\", is a kernel module and user-space library that tries to address
1667part of this problem by allowing users to run file system implementations as
1668user-space processes.")
3ac73271
LC
1669 (license (list license:lgpl2.1 ;library
1670 license:gpl2+)))) ;command-line utilities
220193ad
LC
1671
1672(define-public unionfs-fuse
1673 (package
1674 (name "unionfs-fuse")
2f861edf 1675 (version "2.0")
220193ad
LC
1676 (source (origin
1677 (method url-fetch)
1678 (uri (string-append
2f861edf
EF
1679 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1680 version ".tar.gz"))
1681 (file-name (string-append name "-" version ".tar.gz"))
220193ad
LC
1682 (sha256
1683 (base32
2f861edf 1684 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
220193ad 1685 (build-system cmake-build-system)
094f4b53 1686 (native-inputs
3ef27337 1687 `(("python" ,python)))
220193ad 1688 (inputs `(("fuse" ,fuse)))
094f4b53 1689 (arguments
3ef27337
LF
1690 ;; The tests were never actually run ("collected 0 items"), but in recent
1691 ;; versions of pytest that causes an error.
1692 '(#:tests? #f))
2f861edf 1693 (home-page "https://github.com/rpodgorny/unionfs-fuse")
220193ad
LC
1694 (synopsis "User-space union file system")
1695 (description
1696 "UnionFS-FUSE is a flexible union file system implementation in user
1697space, using the FUSE library. Mounting a union file system allows you to
1698\"aggregate\" the contents of several directories into a single mount point.
1699UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 1700 (license license:bsd-3)))
ed748588 1701
0b7a0c20
LC
1702(define fuse-static
1703 (package (inherit fuse)
1704 (name "fuse-static")
1705 (source (origin (inherit (package-source fuse))
1706 (modules '((guix build utils)))
1707 (snippet
6cbee49d
MW
1708 '(begin
1709 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1710 ;; updated. Change calls to 'mtab_needs_update' to 0 so
1711 ;; that it doesn't do that, allowing us to remove the
1712 ;; dependency on util-linux (something that is useful in
1713 ;; initrds.)
1714 (substitute* '("lib/mount_util.c"
1715 "util/mount_util.c")
1716 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1717 "0")
1718 (("/bin/")
1719 ""))
1720 #t))))))
0b7a0c20 1721
ed748588
LC
1722(define-public unionfs-fuse/static
1723 (package (inherit unionfs-fuse)
1724 (synopsis "User-space union file system (statically linked)")
1725 (name (string-append (package-name unionfs-fuse) "-static"))
1726 (source (origin (inherit (package-source unionfs-fuse))
1727 (modules '((guix build utils)))
1728 (snippet
6cbee49d
MW
1729 '(begin
1730 ;; Add -ldl to the libraries, because libfuse.a needs that.
1731 (substitute* "src/CMakeLists.txt"
1732 (("target_link_libraries(.*)\\)" _ libs)
1733 (string-append "target_link_libraries"
1734 libs " dl)")))
1735 #t))))
ed748588
LC
1736 (arguments
1737 '(#:tests? #f
1456cff1 1738 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
dc1d3cde
KK
1739 #:phases
1740 (modify-phases %standard-phases
1741 (add-after 'install 'post-install
1742 (lambda* (#:key outputs #:allow-other-keys)
1743 (let* ((out (assoc-ref outputs "out"))
1744 (exe (string-append out "/bin/unionfs")))
1745 ;; By default, 'unionfs' keeps references to
1746 ;; $glibc/share/locale and similar stuff. Remove them.
1747 (remove-store-references exe)
1748
1749 ;; 'unionfsctl' has references to glibc as well. Since
1750 ;; we don't need it, remove it.
1751 (delete-file (string-append out "/bin/unionfsctl"))
1752 #t))))))
0b7a0c20 1753 (inputs `(("fuse" ,fuse-static)))))
67b66003 1754
db288efa
LC
1755(define-public sshfs-fuse
1756 (package
1757 (name "sshfs-fuse")
20f8d1dd 1758 (version "2.10")
db288efa
LC
1759 (source (origin
1760 (method url-fetch)
b58c1b2d 1761 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
f5c6edd6
TGR
1762 "download/sshfs-" version "/sshfs-" version
1763 ".tar.gz"))
db288efa
LC
1764 (sha256
1765 (base32
20f8d1dd 1766 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
db288efa
LC
1767 (build-system gnu-build-system)
1768 (inputs
1769 `(("fuse" ,fuse)
1770 ("glib" ,glib)))
1771 (native-inputs
1772 `(("pkg-config" ,pkg-config)))
f5c6edd6 1773 (home-page "https://github.com/libfuse/sshfs")
db288efa
LC
1774 (synopsis "Mount remote file systems over SSH")
1775 (description
1776 "This is a file system client based on the SSH File Transfer Protocol.
1777Since most SSH servers already support this protocol it is very easy to set
1778up: on the server side there's nothing to do; on the client side mounting the
1779file system is as easy as logging into the server with an SSH client.")
3ac73271 1780 (license license:gpl2+)))
db288efa 1781
1eacffb9
RH
1782(define-public archivemount
1783 (package
1784 (name "archivemount")
4f55b39f 1785 (version "0.8.9")
1eacffb9
RH
1786 (source
1787 (origin
1788 (method url-fetch)
1789 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1790 "archivemount-" version ".tar.gz"))
1791 (sha256
1792 (base32
4f55b39f 1793 "0v4si1ri6lhnq9q87gkx7fsh6lv6xz4bynknwndqncpvfp5cy1jg"))))
1eacffb9 1794 (build-system gnu-build-system)
c695fb76
TGR
1795 (inputs `(("fuse" ,fuse)
1796 ("libarchive" ,libarchive)))
1797 (native-inputs `(("pkg-config" ,pkg-config)))
1eacffb9
RH
1798 (home-page "http://www.cybernoia.de/software/archivemount")
1799 (synopsis "Tool for mounting archive files with FUSE")
1800 (description "archivemount is a FUSE-based file system for Unix variants,
1801including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1802mount point where it can be read from or written to as with any other file
1803system. This makes accessing the contents of the archive, which may be
1804compressed, transparent to other programs, without decompressing them.")
1805 (license license:lgpl2.0+)))
1806
67b66003
LC
1807(define-public numactl
1808 (package
1809 (name "numactl")
e35dff97 1810 (version "2.0.11")
67b66003
LC
1811 (source (origin
1812 (method url-fetch)
1813 (uri (string-append
1814 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1815 version
1816 ".tar.gz"))
1817 (sha256
1818 (base32
e35dff97 1819 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
67b66003
LC
1820 (build-system gnu-build-system)
1821 (arguments
e35dff97 1822 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
1823 ;; to run, which we can't assume to have.
1824 #:tests? #f))
b0015064 1825
35dfcdd7
AE
1826 ;; NUMA is apparently not supported on armhf, see
1827 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1828 (supported-systems (delete "armhf-linux" %supported-systems))
67b66003
LC
1829 (home-page "http://oss.sgi.com/projects/libnuma/")
1830 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1831 (description
1832 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1833memory is not all in one place. The numactl program allows you to run your
1834application program on specific CPU's and memory nodes. It does this by
1835supplying a NUMA memory policy to the operating system before running your
1836program.
1837
1838The package contains other commands, such as numademo, numastat and memhog.
1839The numademo command provides a quick overview of NUMA performance on your
1840system.")
3ac73271
LC
1841 (license (list license:gpl2 ;programs
1842 license:lgpl2.1)))) ;library
b10e9ff6 1843
103b7e79 1844(define-public kbd-neo
1845 (package
1846 (name "kbd-neo")
1847 (version "2486")
1848 (source
1849 (origin
1850 (method url-fetch)
1851 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1852 version "/linux/console/neo.map"))
1853 (file-name (string-append name "-" version ".map"))
1854 (sha256
1855 (base32
1856 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1857 (build-system trivial-build-system)
1858 (arguments
1859 `(#:modules ((guix build utils))
1860 #:builder (begin
1861 (use-modules (guix build utils))
1862 (let ((out (string-append %output "/share/keymaps"))
1863 (source (assoc-ref %build-inputs "source")))
1864 (mkdir-p out)
1865 (copy-file source (string-append out "/neo.map"))
1866 #t))))
1867 (home-page "https://neo-layout.org")
1868 (synopsis "Neo2 console layout")
1869 (description
1870 "Kbd-neo provides the Neo2 keyboard layout for use with
1871@command{loadkeys(1)} from @code{kbd(4)}.")
1872 ;; The file is located in an svn directory, the entire content of
1873 ;; the directory is licensed as GPL3.
1874 (license license:gpl3+)))
1875
b10e9ff6
LC
1876(define-public kbd
1877 (package
1878 (name "kbd")
8555a609 1879 (version "2.0.4")
b10e9ff6
LC
1880 (source (origin
1881 (method url-fetch)
1882 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 1883 version ".tar.xz"))
b10e9ff6
LC
1884 (sha256
1885 (base32
8555a609 1886 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
c8f60748
LC
1887 (modules '((guix build utils)))
1888 (snippet
f2cdcafb
LC
1889 '(begin
1890 (substitute* "tests/Makefile.in"
1891 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1892 (("@VERSION@")
1893 "[@]VERSION[@]"))
1894 (substitute* '("src/unicode_start" "src/unicode_stop")
1895 ;; Assume the Coreutils are in $PATH.
1896 (("/usr/bin/tty")
6cbee49d
MW
1897 "tty"))
1898 #t))))
b10e9ff6
LC
1899 (build-system gnu-build-system)
1900 (arguments
5953d2b7
AK
1901 '(#:phases
1902 (modify-phases %standard-phases
1903 (add-before 'build 'pre-build
1904 (lambda* (#:key inputs #:allow-other-keys)
1905 (let ((gzip (assoc-ref %build-inputs "gzip"))
1906 (bzip2 (assoc-ref %build-inputs "bzip2")))
1907 (substitute* "src/libkeymap/findfile.c"
1908 (("gzip")
1909 (string-append gzip "/bin/gzip"))
1910 (("bzip2")
0d47fdf8
MW
1911 (string-append bzip2 "/bin/bzip2")))
1912 #t)))
5953d2b7
AK
1913 (add-after 'install 'post-install
1914 (lambda* (#:key outputs #:allow-other-keys)
1915 ;; Make sure these programs find their comrades.
1916 (let* ((out (assoc-ref outputs "out"))
1917 (bin (string-append out "/bin")))
1918 (for-each (lambda (prog)
1919 (wrap-program (string-append bin "/" prog)
1920 `("PATH" ":" prefix (,bin))))
0d47fdf8
MW
1921 '("unicode_start" "unicode_stop"))
1922 #t))))))
b10e9ff6 1923 (inputs `(("check" ,check)
f61e0e79
LC
1924 ("gzip" ,gzip)
1925 ("bzip2" ,bzip2)
b10e9ff6 1926 ("pam" ,linux-pam)))
fd7000fe 1927 (native-search-paths
1928 (list (search-path-specification
1929 (variable "LOADKEYS_KEYMAP_PATH")
674d4e13
TGR
1930 ;; Append ‘/**’ to recursively search all directories. One can then
1931 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
1932 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
1933 (files (list "share/keymaps/**")))))
b10e9ff6 1934 (native-inputs `(("pkg-config" ,pkg-config)))
0ed81d04 1935 (home-page "http://kbd-project.org/")
b10e9ff6
LC
1936 (synopsis "Linux keyboard utilities and keyboard maps")
1937 (description
1938 "This package contains keytable files and keyboard utilities compatible
1939for systems using the Linux kernel. This includes commands such as
1940'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
3ac73271 1941 (license license:gpl2+)))
de0b620e
LC
1942
1943(define-public inotify-tools
1944 (package
1945 (name "inotify-tools")
fb5b359d 1946 (version "3.20.1")
de0b620e
LC
1947 (source (origin
1948 (method url-fetch)
1949 (uri (string-append
fb5b359d
MB
1950 "https://github.com/rvoicilas/inotify-tools/archive/"
1951 version ".tar.gz"))
1952 (file-name (string-append name "-" version ".tar.gz"))
de0b620e
LC
1953 (sha256
1954 (base32
fb5b359d 1955 "1b22c8x4pjnz3abx4dikpbj43zprjw79pdkd4xw111dsxlfwqcx4"))))
de0b620e 1956 (build-system gnu-build-system)
fb5b359d
MB
1957 (arguments
1958 `(#:phases (modify-phases %standard-phases
1959 (add-after 'unpack 'bootstrap
1960 (lambda _
1961 (invoke "autoreconf" "-vif"))))))
1962 (native-inputs
1963 `(("autoconf" ,autoconf)
1964 ("automake" ,automake)
1965 ("libtool" ,libtool)))
1966 (home-page "https://github.com/rvoicilas/inotify-tools/wiki")
de0b620e
LC
1967 (synopsis "Monitor file accesses")
1968 (description
1969 "The inotify-tools packages provides a C library and command-line tools
1970to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 1971 (license license:gpl2+)))
e062d542
AE
1972
1973(define-public kmod
1974 (package
1975 (name "kmod")
eb67a470 1976 (version "25")
e062d542
AE
1977 (source (origin
1978 (method url-fetch)
1979 (uri
1980 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1981 "kmod-" version ".tar.xz"))
1982 (sha256
1983 (base32
eb67a470 1984 "1kgixs4m3jvwk7fb3d18n6j77qhgi9qfv4csj35rs5ancr4ycrbi"))
fc1adab1 1985 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
1986 (build-system gnu-build-system)
1987 (native-inputs
1988 `(("pkg-config" ,pkg-config)))
1989 (inputs
f61e0e79
LC
1990 `(("xz" ,xz)
1991 ("zlib" ,zlib)))
e062d542 1992 (arguments
9f2eb4ff 1993 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25 1994 #:configure-flags '("--with-xz" "--with-zlib")
9f2eb4ff
TGR
1995 #:phases
1996 (modify-phases %standard-phases
1997 (add-after 'install 'install-modprobe&co
1998 (lambda* (#:key outputs #:allow-other-keys)
1999 (let* ((out (assoc-ref outputs "out"))
2000 (bin (string-append out "/bin")))
2001 (for-each (lambda (tool)
2002 (symlink "kmod"
2003 (string-append bin "/" tool)))
2004 '("insmod" "rmmod" "lsmod" "modprobe"
2005 "modinfo" "depmod"))
2006 #t))))))
e062d542
AE
2007 (home-page "https://www.kernel.org/")
2008 (synopsis "Kernel module tools")
35b9e423 2009 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
2010kernel modules like insert, remove, list, check properties, resolve
2011dependencies and aliases.
2012
2013These tools are designed on top of libkmod, a library that is shipped with
2014kmod. The aim is to be compatible with tools, configurations and indices
2015from the module-init-tools project.")
3ac73271 2016 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 2017
7fa715e7
LC
2018(define-public eudev
2019 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 2020 (package
7fa715e7 2021 (name "eudev")
e9190dd4 2022 (version "3.2.5")
7fa715e7
LC
2023 (source (origin
2024 (method url-fetch)
172a9b44 2025 (uri (string-append "https://github.com/gentoo/eudev/archive/v"
bab5f3a7
MB
2026 version ".tar.gz"))
2027 (file-name (string-append name "-" version ".tar.gz"))
7fa715e7
LC
2028 (sha256
2029 (base32
bab5f3a7 2030 "0dlkcgy7j4fdcksqrpc373zfybiif1bal3n6lpy1kfc5280j02c7"))
202342fd 2031 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7 2032 (build-system gnu-build-system)
4e859e92 2033 (arguments
172a9b44
MC
2034 '(#:phases
2035 (modify-phases %standard-phases
189be331 2036 (add-before 'bootstrap 'patch-file-names
172a9b44
MC
2037 (lambda* (#:key inputs #:allow-other-keys)
2038 (substitute* "man/make.sh"
2039 (("/usr/bin/xsltproc")
2040 (string-append (assoc-ref inputs "xsltproc")
2041 "/bin/xsltproc")))
189be331 2042 #t))
172a9b44
MC
2043 (add-after 'install 'build-hwdb
2044 (lambda* (#:key outputs #:allow-other-keys)
2045 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2046 ;; similar tools to display product names.
2047 (let ((out (assoc-ref outputs "out")))
957a99ab
MW
2048 (invoke (string-append out "/bin/udevadm")
2049 "hwdb" "--update")))))
172a9b44 2050 #:configure-flags (list "--enable-manpages")))
fe32c7f7 2051 (native-inputs
172a9b44
MC
2052 `(("autoconf" ,autoconf)
2053 ("automake" ,automake)
2054 ("gperf" ,gperf)
2055 ("libtool" ,libtool)
2056 ("pkg-config" ,pkg-config)
2057 ;; For tests.
e75230c1 2058 ("perl" ,perl)
172a9b44
MC
2059 ("python" ,python-wrapper)
2060 ;; For documentation.
2061 ("docbook-xml" ,docbook-xml-4.2)
2062 ("docbook-xsl" ,docbook-xsl)
2063 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
c695fb76 2064 ("xsltproc" ,libxslt)))
fe32c7f7 2065 (inputs
255f7308
LC
2066 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2067 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2068 ;; which contains the rules to do that.
2069 `(("util-linux" ,util-linux) ;for blkid
2070 ("kmod" ,kmod)))
e1921a38 2071 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
2072 (synopsis "Userspace device management")
2073 (description "Udev is a daemon which dynamically creates and removes
2074device nodes from /dev/, handles hotplug events and loads drivers at boot
2075time.")
3ac73271 2076 (license license:gpl2+)))
7fa715e7 2077
e5d861f3 2078(define-public eudev-with-hwdb
4e859e92 2079 (deprecated-package "eudev-with-hwdb" eudev))
e5d861f3 2080
66269d47
LC
2081(define-public lvm2
2082 (package
2083 (name "lvm2")
63899ca7 2084 (version "2.02.177")
66269d47
LC
2085 (source (origin
2086 (method url-fetch)
2087 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2088 version ".tgz"))
2089 (sha256
2090 (base32
63899ca7 2091 "1wl0isn0yz5wvglwylnlqkppafwmvhliq5bd92vjqp5ir4za49a0"))
66269d47
LC
2092 (modules '((guix build utils)))
2093 (snippet
2094 '(begin
2095 (use-modules (guix build utils))
2096
2097 ;; Honor sysconfdir.
2098 (substitute* "make.tmpl.in"
2099 (("confdir = .*$")
2100 "confdir = @sysconfdir@\n")
2101 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
6cbee49d
MW
2102 "DEFAULT_SYS_DIR = @sysconfdir@"))
2103 #t))
01f94cca 2104 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
2105 (build-system gnu-build-system)
2106 (native-inputs
2107 `(("pkg-config" ,pkg-config)
2108 ("procps" ,procps))) ;tests use 'pgrep'
2109 (inputs
8fcaf8b1 2110 `(("udev" ,eudev)))
66269d47 2111 (arguments
3afbc6b3
LF
2112 '(#:phases
2113 (modify-phases %standard-phases
2114 (add-after 'configure 'set-makefile-shell
2115 (lambda _
2116 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2117 ;; expected.
2118 (setenv "SHELL" (which "sh"))
66269d47 2119
3afbc6b3
LF
2120 ;; Replace /bin/sh with the right file name.
2121 (patch-makefile-SHELL "make.tmpl")
1ac18721 2122 #t)))
66269d47
LC
2123
2124 #:configure-flags (list (string-append "--sysconfdir="
2125 (assoc-ref %outputs "out")
2126 "/etc/lvm")
2127 "--enable-udev_sync"
f2817d43 2128 "--enable-udev_rules"
9324d92e 2129 "--enable-pkgconfig"
f2817d43
LC
2130
2131 ;; Make sure programs such as 'dmsetup' can
2132 ;; find libdevmapper.so.
2133 (string-append "LDFLAGS=-Wl,-rpath="
2134 (assoc-ref %outputs "out")
2135 "/lib"))
66269d47
LC
2136
2137 ;; The tests use 'mknod', which requires root access.
2138 #:tests? #f))
62ec02bf 2139 (home-page "https://sourceware.org/lvm2/")
66269d47
LC
2140 (synopsis "Logical volume management for Linux")
2141 (description
2142 "LVM2 is the logical volume management tool set for Linux-based systems.
2143This package includes the user-space libraries and tools, including the device
2144mapper. Kernel components are part of Linux-libre.")
2145
2146 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2147 ;; Command-line tools are GPLv2.
3ac73271 2148 (license (list license:gpl2 license:lgpl2.1))))
66269d47 2149
01f94cca
LC
2150(define-public lvm2-static
2151 (package
2152 (inherit lvm2)
2153 (name "lvm2-static")
2154
2155 ;; Propagate udev because libdevmapper.a depends on libudev.
2156 (inputs (alist-delete "udev" (package-inputs lvm2)))
2157 (propagated-inputs `(("udev" ,eudev)))
2158
2159 (arguments
2160 (substitute-keyword-arguments (package-arguments lvm2)
2161 ((#:configure-flags flags '())
2162 ;; LVM2 doesn't use Libtool, hence the custom option.
2163 `(cons "--enable-static_link" ,flags))))
2164 (synopsis "Logical volume management for Linux (statically linked)")))
2165
000f7559
DT
2166(define-public wireless-tools
2167 (package
2168 (name "wireless-tools")
2169 (version "30.pre9")
2170 (source (origin
2171 (method url-fetch)
2172 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2173 version ".tar.gz"))
2174 (sha256
2175 (base32
ec01f22d 2176 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 2177 (snippet
c2099a4c
MW
2178 '(begin
2179 ;; Remove the older header files that are not free software.
2180 (for-each (lambda (n)
2181 (delete-file (format #f "wireless.~a.h" n)))
2182 '(10 11 12 13 14 15 16 17 18 19 20))
2183 #t))))
000f7559
DT
2184 (build-system gnu-build-system)
2185 (arguments
c2099a4c
MW
2186 `(#:make-flags
2187 (list (string-append "PREFIX=" %output)
2188 (string-append "INSTALL_MAN=" %output "/share/man")
2189 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2190 "BUILD_STATIC=")
2191 #:phases (modify-phases %standard-phases
2192 (delete 'configure))
000f7559
DT
2193 #:tests? #f))
2194 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
2195 (description "Wireless Tools are used to manipulate the now-deprecated
2196Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2197Extension was an interface allowing you to set Wireless LAN specific
2198parameters and get the specific stats. It is deprecated in favor the nl80211
2199interface.")
000f7559 2200 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
2201 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2202 ;; other files are distributed under gpl2.
3ac73271 2203 (license (list license:gpl2 license:lgpl2.1+))))
30016044 2204
cc205dac
LC
2205(define-public crda
2206 (package
2207 (name "crda")
2208 (version "3.18")
2209 (source (origin
2210 (method url-fetch)
2211 (uri (string-append "mirror://kernel.org/software/network/crda/"
2212 "crda-" version ".tar.xz"))
2213 (sha256
2214 (base32
2215 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 2216 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
2217 (build-system gnu-build-system)
2218 (arguments
2219 '(#:phases (modify-phases %standard-phases
2220 (delete 'configure)
0bc7c2e4
MW
2221 (add-after 'unpack 'gzip-determinism
2222 (lambda _
2223 (substitute* "Makefile"
2224 (("gzip") "gzip --no-name"))
2225 #t))
cc205dac
LC
2226 (add-before
2227 'build 'no-werror-no-ldconfig
2228 (lambda _
2229 (substitute* "Makefile"
2230 (("-Werror") "")
2231 (("ldconfig") "true"))
2232 #t))
2233 (add-before
2234 'build 'set-regulator-db-file-name
2235 (lambda* (#:key inputs #:allow-other-keys)
2236 ;; Tell CRDA where to find our database.
2237 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2238 (substitute* "crda.c"
2239 (("\"/lib/crda/regulatory.bin\"")
2240 (string-append "\"" regdb
2241 "/lib/crda/regulatory.bin\"")))
2242 #t))))
2243 #:test-target "verify"
2244 #:make-flags (let ((out (assoc-ref %outputs "out"))
2245 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2246 (list "CC=gcc" "V=1"
2247
2248 ;; Disable signature-checking on 'regulatory.bin'.
2249 ;; The reason is that this simplifies maintenance
2250 ;; on our side (no need to manage a distro key
2251 ;; pair), and we can guarantee integrity of
2252 ;; 'regulatory.bin' by other means anyway, such as
2253 ;; 'guix gc --verify'. See
2254 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2255 ;; for a discssion.
2256 "USE_OPENSSL=0"
2257
2258 (string-append "PREFIX=" out)
2259 (string-append "SBINDIR=" out "/sbin/")
2260 (string-append "UDEV_RULE_DIR="
2261 out "/lib/udev/rules.d")
2262 (string-append "LDFLAGS=-Wl,-rpath="
2263 out "/lib -L.")
2264 (string-append "REG_BIN=" regdb
2265 "/lib/crda/regulatory.bin")))))
2266 (native-inputs `(("pkg-config" ,pkg-config)
2267 ("python" ,python-2)
2268 ("wireless-regdb" ,wireless-regdb)))
2269 (inputs `(("libnl" ,libnl)))
2270 (home-page
2271 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2272 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2273 (description
2274 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2275communication between the kernel Linux and user space for regulatory
2276compliance.")
3ac73271 2277 (license license:copyleft-next)))
cc205dac 2278
c80b4a3e
LC
2279(define-public wireless-regdb
2280 (package
2281 (name "wireless-regdb")
a70782d3 2282 (version "2017.03.07")
c80b4a3e
LC
2283 (source (origin
2284 (method url-fetch)
2285 (uri (string-append
2286 "mirror://kernel.org/software/network/wireless-regdb/"
2287 "wireless-regdb-" version ".tar.xz"))
2288 (sha256
2289 (base32
a70782d3 2290 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
5568151f
LC
2291
2292 ;; We're building 'regulatory.bin' by ourselves.
6cbee49d
MW
2293 (snippet '(begin
2294 (delete-file "regulatory.bin")
2295 #t))))
c80b4a3e
LC
2296 (build-system gnu-build-system)
2297 (arguments
2298 '(#:phases (modify-phases %standard-phases
5e6c882e
MW
2299 (add-after 'unpack 'gzip-determinism
2300 (lambda _
2301 (substitute* "Makefile"
2302 (("gzip") "gzip --no-name"))
2303 #t))
c80b4a3e 2304 (delete 'configure))
5568151f
LC
2305
2306 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2307 ;; is computed and can be equal to 'maintainer-clean'; when that
2308 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2309 ;; just built. Thus, build things sequentially.
2310 #:parallel-build? #f
2311
c80b4a3e
LC
2312 #:tests? #f ;no tests
2313 #:make-flags (let ((out (assoc-ref %outputs "out")))
2314 (list (string-append "PREFIX=" out)
2315 (string-append "LSB_ID=GuixSD")
2316 (string-append "DISTRO_PUBKEY=/dev/null")
2317 (string-append "DISTRO_PRIVKEY=/dev/null")
2318 (string-append "REGDB_PUBKEY=/dev/null")
2319
2320 ;; Leave that empty so that db2bin.py doesn't try
2321 ;; to sign 'regulatory.bin'. This allows us to
2322 ;; avoid managing a key pair for the whole distro.
2323 (string-append "REGDB_PRIVKEY=")))))
2324 (native-inputs `(("python" ,python-2)))
2325 (home-page
2326 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2327 (synopsis "Wireless regulatory database")
2328 (description
2329 "This package contains the wireless regulatory database Central
2330Regulatory Database Agent (CRDA) daemon. The database contains information on
2331country-specific regulations for the wireless spectrum.")
3ac73271 2332 (license license:isc)))
c80b4a3e 2333
30016044
MW
2334(define-public lm-sensors
2335 (package
2336 (name "lm-sensors")
171091a8 2337 (version "3.4.0")
30016044
MW
2338 (source (origin
2339 (method url-fetch)
ee6a5d0e 2340 (uri (list (string-append
171091a8
AE
2341 "https://github.com/groeck/lm-sensors/archive/V"
2342 (string-join (string-split version #\.) "-")
2343 ".tar.gz")))
bc4a2b85 2344 (file-name (string-append name "-" version ".tar.gz"))
30016044
MW
2345 (sha256
2346 (base32
171091a8 2347 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
fc1adab1 2348 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
2349 (build-system gnu-build-system)
2350 (inputs `(("rrdtool" ,rrdtool)
2351 ("perl" ,perl)
2352 ("kmod" ,kmod)
2353 ("gnuplot" ,gnuplot)))
2354 (native-inputs `(("pkg-config" ,pkg-config)
2355 ("flex" ,flex)
2356 ("bison" ,bison)
2357 ("which" ,which)))
8ddf20b2
DL
2358 (outputs '("lib" ;avoid perl in closure
2359 "out"))
30016044
MW
2360 (arguments
2361 `(#:tests? #f ; no 'check' target
2362 #:make-flags (list (string-append "PREFIX=" %output)
8ddf20b2
DL
2363 (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc")
2364 (string-append "INCLUDEDIR="
2365 (assoc-ref %outputs "lib") "/include")
2366 (string-append "MANDIR=" %output "/share/man")
2367 (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib"))
30016044 2368 #:phases
dc1d3cde
KK
2369 (modify-phases %standard-phases
2370 (delete 'configure)
2371 (add-before 'build 'patch-exec-paths
2372 (lambda* (#:key inputs outputs #:allow-other-keys)
2373 (substitute* "prog/detect/sensors-detect"
2374 (("`uname")
2375 (string-append "`" (assoc-ref inputs "coreutils")
2376 "/bin/uname"))
2377 (("(`|\")modprobe" all open-quote)
2378 (string-append open-quote
2379 (assoc-ref inputs "kmod")
2380 "/bin/modprobe")))
2381 (substitute* '("prog/pwm/pwmconfig"
2382 "prog/pwm/fancontrol")
2383 (("gnuplot")
2384 (string-append (assoc-ref inputs "gnuplot")
2385 "/bin/gnuplot"))
2386 (("cat ")
2387 (string-append (assoc-ref inputs "coreutils")
2388 "/bin/cat "))
2389 (("egrep ")
2390 (string-append (assoc-ref inputs "grep")
2391 "/bin/egrep "))
2392 (("sed -e")
2393 (string-append (assoc-ref inputs "sed")
2394 "/bin/sed -e"))
2395 (("cut -d")
2396 (string-append (assoc-ref inputs "coreutils")
2397 "/bin/cut -d"))
2398 (("sleep ")
2399 (string-append (assoc-ref inputs "coreutils")
2400 "/bin/sleep "))
2401 (("readlink -f")
2402 (string-append (assoc-ref inputs "coreutils")
2403 "/bin/readlink -f")))
2404 #t)))))
3a04d5d4 2405 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
2406 (synopsis "Utilities to read temperature/voltage/fan sensors")
2407 (description
35b9e423 2408 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
2409you to access information from temperature, voltage, and fan speed sensors.
2410It works with most newer systems.")
3ac73271 2411 (license license:gpl2+)))
b087d413 2412
55e1d39b
MB
2413(define-public iucode-tool
2414 (package
2415 (name "iucode-tool")
2416 (version "2.2")
2417 (source (origin
2418 (method url-fetch)
2419 (uri (string-append "https://gitlab.com/iucode-tool/releases"
2420 "/raw/latest/iucode-tool_" version ".tar.xz"))
2421 (sha256
2422 (base32
2423 "0w99k1aq1xw148ffk1xykqf60rdbphb1jknw98jcmadq4pwxl44q"))))
2424 (build-system gnu-build-system)
2425 (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home")
2426 (synopsis "Manipulate Intel microcode bundles")
2427 (description
2428 "@command{iucode_tool} is a utility to work with microcode packages for
2429Intel processors. It can convert between formats, extract specific versions,
2430create a firmware image suitable for the Linux kernel, and more.")
513dc568
EF
2431 ;; cpuid.h is available for i686, x86_64, and ia64.
2432 (supported-systems '("i686-linux" "x86_64-linux"))
55e1d39b
MB
2433 (license license:gpl2+)))
2434
f5b2a53d
RW
2435(define-public i2c-tools
2436 (package
2437 (name "i2c-tools")
2438 (version "3.1.1")
2439 (source (origin
2440 (method url-fetch)
2441 (uri (string-append
f32274a7 2442 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
2443 version ".tar.bz2"))
2444 (sha256
2445 (base32
2446 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2447 (build-system gnu-build-system)
2448 (arguments
2449 `(#:tests? #f ; no 'check' target
2450 #:make-flags (list (string-append "prefix=" %output)
2451 "CC=gcc")
2452 ;; no configure script
dc1d3cde 2453 #:phases (modify-phases %standard-phases (delete 'configure))))
bccf27cb
RW
2454 (inputs
2455 `(("perl" ,perl)))
f32274a7 2456 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
2457 (synopsis "I2C tools for Linux")
2458 (description
2459 "The i2c-tools package contains a heterogeneous set of I2C tools for
2460Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2461EEPROM decoding scripts, EEPROM programming tools, and a python module for
2462SMBus access.")
3ac73271 2463 (license license:gpl2+)))
f5b2a53d 2464
b087d413
MW
2465(define-public xsensors
2466 (package
2467 (name "xsensors")
2468 (version "0.70")
2469 (source (origin
2470 (method url-fetch)
2471 (uri (string-append
2472 "http://www.linuxhardware.org/xsensors/xsensors-"
2473 version ".tar.gz"))
2474 (sha256
2475 (base32
2476 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2477 (build-system gnu-build-system)
8ddf20b2 2478 (inputs `(("lm-sensors" ,lm-sensors "lib")
b087d413
MW
2479 ("gtk" ,gtk+-2)))
2480 (native-inputs `(("pkg-config" ,pkg-config)))
2481 (arguments
dc1d3cde
KK
2482 `(#:phases
2483 (modify-phases %standard-phases
2484 (add-before 'configure 'enable-deprecated
2485 (lambda _
2486 (substitute* "src/Makefile.in"
2487 (("-DGDK_DISABLE_DEPRECATED") "")
2488 (("-DGTK_DISABLE_DEPRECATED") ""))
2489 #t))
2490 (add-before 'configure 'remove-Werror
2491 (lambda _
2492 (substitute* '("configure" "src/Makefile.in")
2493 (("-Werror") ""))
2494 #t)))))
b087d413
MW
2495 (home-page "http://www.linuxhardware.org/xsensors/")
2496 (synopsis "Hardware health information viewer")
2497 (description
35b9e423 2498 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
2499health such as temperature, voltage and fan speed and displays the information
2500in a digital read-out.")
3ac73271 2501 (license license:gpl2+)))
b62fe07f
LC
2502
2503(define-public perf
2504 (package
2505 (name "perf")
2506 (version (package-version linux-libre))
7394e264
LC
2507 (source (origin
2508 (inherit (package-source linux-libre))
2509 (patches (search-patches "perf-gcc-ice.patch"))))
b62fe07f
LC
2510 (build-system gnu-build-system)
2511 (arguments
dc1d3cde
KK
2512 '(#:phases
2513 (modify-phases %standard-phases
2514 (replace 'configure
2515 (lambda* (#:key inputs #:allow-other-keys)
2516 (setenv "SHELL_PATH" (which "bash"))
2517 (chdir "tools/perf")
2518 #t)))
65dabe4e 2519 #:make-flags (list (string-append "prefix="
b62fe07f 2520 (assoc-ref %outputs "out"))
2af29d23
LC
2521 "WERROR=0"
2522
2523 ;; By default, 'config/Makefile' uses lib64 on
2524 ;; x86_64. Work around that.
2525 "lib=lib")
b62fe07f
LC
2526 #:tests? #f)) ;no tests
2527 (native-inputs
2528 `(("pkg-config" ,pkg-config)
2529 ("bison" ,bison)
2530 ("flex" ,flex)
2531
2532 ;; There are build scripts written in these languages.
2533 ("perl" ,perl)
2534 ("python" ,python-2)))
2535 (inputs
b1fb4b23 2536 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2537 ;; ("newt" ,newt)
6c030d10 2538 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 2539 ("elfutils" ,elfutils)
b25d3bd9 2540 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
1d484507
LC
2541 ("libunwind" ,libunwind) ;better stack walking
2542 ("numactl" ,numactl) ;for 'perf bench numa mem'
b62fe07f 2543
d7ece67a
LC
2544 ;; Documentation.
2545 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
2546 ("docbook-xsl" ,docbook-xsl)
2547 ("xmlto" ,xmlto)
2548 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2549 (home-page "https://perf.wiki.kernel.org/")
2550 (synopsis "Linux profiling with performance counters")
2551 (description
2552 "perf is a tool suite for profiling using hardware performance counters,
2553with support in the Linux kernel. perf can instrument CPU performance
2554counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2555of lightweight profiling. This package contains the user-land tools and in
2556particular the 'perf' command.")
2557 (license (package-license linux-libre))))
c09e60e4
DT
2558
2559(define-public pflask
2560 (package
2561 (name "pflask")
2562 (version "0.2")
2563 (source (origin
2564 (method url-fetch)
2565 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2566 version ".tar.gz"))
f586c877 2567 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2568 (sha256
2569 (base32
2570 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2571 (build-system cmake-build-system)
2572 (arguments
2573 '(#:tests? #f)) ; no tests
81e59e41 2574 (home-page "https://ghedo.github.io/pflask/")
c09e60e4
DT
2575 (synopsis "Simple tool for creating Linux namespace containers")
2576 (description "pflask is a simple tool for creating Linux namespace
2577containers. It can be used for running a command or even booting an OS inside
2578an isolated container, created with the help of Linux namespaces. It is
2579similar in functionality to chroot, although pflask provides better isolation
2580thanks to the use of namespaces.")
3ac73271 2581 (license license:bsd-2)))
288084d5 2582
3ec07ced
RW
2583(define-public singularity
2584 (package
2585 (name "singularity")
2586 (version "2.5.1")
2587 (source (origin
2588 (method url-fetch)
2589 (uri (string-append "https://github.com/singularityware/singularity/"
2590 "releases/download/" version
2591 "/singularity-" version ".tar.gz"))
2592 (sha256
2593 (base32
2594 "0f28dgf2qcy8ljjfix7p9q36q12j7rxyicfzzi4n0fl8zr8ab88g"))))
2595 (build-system gnu-build-system)
2596 (arguments
2597 `(#:configure-flags
2598 (list "--disable-suid"
2599 "--localstatedir=/var")
2600 #:phases
2601 (modify-phases %standard-phases
2602 ;; Do not create directories in /var.
2603 (add-after 'unpack 'disable-install-hook
2604 (lambda _
2605 (substitute* "Makefile.in"
2606 (("\\$\\(MAKE\\) .*install-data-hook") ""))
2607 #t))
2608 (add-after 'unpack 'patch-reference-to-squashfs-tools
2609 (lambda _
2610 (substitute* "libexec/cli/build.exec"
2611 (("if ! singularity_which mksquashfs") "if 0")
2612 (("if ! mksquashfs")
2613 (string-append "if ! " (which "mksquashfs"))))
2614 #t)))))
2615 (inputs
2616 `(("libarchive" ,libarchive)
2617 ("python" ,python-wrapper)
2618 ("nettle" ,nettle)
2619 ("zlib" ,zlib)
2620 ("squashfs-tools" ,squashfs-tools)))
2621 (home-page "https://singularity.lbl.gov/")
2622 (synopsis "Container platform")
2623 (description "Singularity is a container platform supporting a number of
2624container image formats. It can build SquashFS container images or import
2625existing Docker images. Singularity requires kernel support for container
2626isolation or root privileges.")
2627 (license license:bsd-3)))
2628
288084d5
MW
2629(define-public hdparm
2630 (package
2631 (name "hdparm")
39c6af47 2632 (version "9.55")
288084d5
MW
2633 (source (origin
2634 (method url-fetch)
de67e922 2635 (uri (string-append "mirror://sourceforge/" name "/" name "/"
288084d5
MW
2636 name "-" version ".tar.gz"))
2637 (sha256
2638 (base32
39c6af47 2639 "1ivdvrzimaayiq03by8mcq0mhmdljndj06h012zkdpw34irnpixm"))))
288084d5
MW
2640 (build-system gnu-build-system)
2641 (arguments
2642 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2643 (list (string-append "binprefix=" out)
2644 (string-append "manprefix=" out)
2645 "CC=gcc"))
ec238332
TGR
2646 #:phases
2647 (modify-phases %standard-phases
2648 (delete 'configure)) ; no configure script
2649 #:tests? #f)) ; no test suite
3b3b60d0 2650 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 2651 (synopsis "View and tune ATA disk drive parameters")
288084d5 2652 (description
02052b2c
TGR
2653 "@command{hdparm} is a command-line utility to control ATA controllers and
2654disk drives. It can increase performance and/or reliability by careful tuning
2655of hardware settings like power and acoustic management, DMA modes, and caching.
2656It can also display detailed device information, or be used as a simple
2657performance benchmarking tool.
2658
2659@command{hdparm} provides a command line interface to various Linux kernel
2660interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
d08be77a
TGR
2661IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command
2662Translation (@dfn{SAT}) are also supported.")
3ac73271 2663 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2664
c755c854
MW
2665(define-public rfkill
2666 (package
2667 (name "rfkill")
2668 (version "0.5")
2669 (source (origin
2670 (method url-fetch)
2671 (uri (string-append "mirror://kernel.org/software/network/"
2672 name "/" name "-" version ".tar.xz"))
2673 (sha256
2674 (base32
2675 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2676 (build-system gnu-build-system)
2677 (arguments
2678 `(#:make-flags (list "CC=gcc"
2679 (string-append "PREFIX=" %output))
2680 #:phases (modify-phases %standard-phases
2681 (delete 'configure))
2682 #:tests? #f))
2683 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2684 (synopsis "Tool for enabling and disabling wireless devices")
2685 (description
2686 "rfkill is a simple tool for accessing the rfkill device interface,
2687which is used to enable and disable wireless networking devices, typically
2688WLAN, Bluetooth and mobile broadband.")
3ac73271 2689 (license (license:non-copyleft "file://COPYING"
5146f22b
EF
2690 "See COPYING in the distribution."))
2691 ;; rfkill is part of util-linux as of 2.31.
2692 (properties `((superseded . ,util-linux)))))
c755c854 2693
dc9bdb1e
ML
2694(define-public acpi
2695 (package
2696 (name "acpi")
2697 (version "1.7")
2698 (source (origin
2699 (method url-fetch)
81e59e41 2700 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
de67e922 2701 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
2702 (sha256
2703 (base32
2704 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2705 (build-system gnu-build-system)
2706 (home-page "http://acpiclient.sourceforge.net")
2707 (synopsis "Display information on ACPI devices")
2708 (description "@code{acpi} attempts to replicate the functionality of the
2709\"old\" @code{apm} command on ACPI systems, including battery and thermal
2710information. It does not support ACPI suspending, only displays information
2711about ACPI devices.")
2712 (license license:gpl2+)))
2713
57a516d3
LC
2714(define-public acpid
2715 (package
2716 (name "acpid")
169a438c 2717 (version "2.0.28")
57a516d3
LC
2718 (source (origin
2719 (method url-fetch)
2720 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2721 version ".tar.xz"))
2722 (sha256
2723 (base32
169a438c 2724 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
57a516d3 2725 (build-system gnu-build-system)
3b3b60d0 2726 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
2727 (synopsis "Daemon for delivering ACPI events to user-space programs")
2728 (description
2729 "acpid is designed to notify user-space programs of Advanced
2730Configuration and Power Interface (ACPI) events. acpid should be started
2731during the system boot, and will run as a background process. When an ACPI
2732event is received from the kernel, acpid will examine the list of rules
2733specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2734 (license license:gpl2+)))
37f5caec
TUBK
2735
2736(define-public sysfsutils
2737 (package
2738 (name "sysfsutils")
2739 (version "2.1.0")
2740 (source
2741 (origin
2742 (method url-fetch)
2743 (uri
2744 (string-append
2745 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2746 version ".tar.gz"))
2747 (sha256
2748 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2749 (build-system gnu-build-system)
2750 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2751 (synopsis "System utilities based on Linux sysfs")
2752 (description
8f65585b 2753 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
2754Linux kernel versions 2.5+ that exposes a system's device tree. The package
2755also contains the libsysfs library.")
2756 ;; The library is under lgpl2.1+ (all files say "or any later version").
2757 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2758 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2759
2760(define-public sysfsutils-1
2761 (package
2762 (inherit sysfsutils)
2763 (version "1.3.0")
2764 (source
2765 (origin
2766 (method url-fetch)
2767 (uri
2768 (string-append
2769 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2770 "/sysfsutils-" version ".tar.gz"))
2771 (sha256
2772 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2773 (modules '((guix build utils)))
2774 (snippet
2775 '(begin
2776 (substitute* "Makefile.in"
2777 (("includedir = /usr/include/sysfs")
2778 "includedir = @includedir@"))
2779 (substitute* "configure"
2780 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
6cbee49d
MW
2781 (string-append "includedir='" orig "/sysfs'")))
2782 #t))))
a9a1a40b 2783 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2784
2785(define-public cpufrequtils
2786 (package
2787 (name "cpufrequtils")
2788 (version "0.3")
2789 (source
2790 (origin
2791 (method url-fetch)
2792 (uri
2793 (string-append
2794 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2795 version ".tar.gz"))
2796 (sha256
2797 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2798 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2799 (build-system gnu-build-system)
2800 (native-inputs
2801 `(("sysfsutils" ,sysfsutils-1)))
2802 (arguments
2803 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2804 (assoc-ref %outputs "out") "/lib"))))
2805 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2806 (synopsis "Utilities to get and set CPU frequency on Linux")
2807 (description
e881752c 2808 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2809information, and set the CPU frequency if supported, using the cpufreq
2810capabilities of the Linux kernel.")
3ac73271 2811 (license license:gpl2)))
0a588bf9
SB
2812
2813(define-public libraw1394
2814 (package
2815 (name "libraw1394")
7c58c852 2816 (version "2.1.2")
0a588bf9
SB
2817 (source (origin
2818 (method url-fetch)
2819 (uri (string-append
2820 "mirror://kernel.org/linux/libs/ieee1394/"
2821 name "-" version ".tar.xz"))
2822 (sha256
2823 (base32
7c58c852 2824 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
2825 (build-system gnu-build-system)
2826 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2827 (synopsis "Interface library for the Linux IEEE1394 drivers")
2828 (description
2829 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2830the Linux IEEE-1394 subsystem, which provides direct access to the connected
28311394 buses to user space. Through libraw1394/raw1394, applications can directly
2832send to and receive from other nodes without requiring a kernel driver for the
2833protocol in question.")
3ac73271 2834 (license license:lgpl2.1+)))
68e3c29d
SB
2835
2836(define-public libavc1394
2837 (package
2838 (name "libavc1394")
2839 (version "0.5.4")
2840 (source (origin
2841 (method url-fetch)
de67e922 2842 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
2843 name "-" version ".tar.gz"))
2844 (sha256
2845 (base32
2846 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2847 (build-system gnu-build-system)
2848 (native-inputs
2849 `(("pkg-config" ,pkg-config)))
2850 (propagated-inputs
2851 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 2852 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
2853 (synopsis "AV/C protocol library for IEEE 1394")
2854 (description
2855 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2856the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2857 (license license:lgpl2.1+)))
3f7bf86a
SB
2858
2859(define-public libiec61883
2860 (package
2861 (name "libiec61883")
2862 (version "1.2.0")
2863 (source (origin
2864 (method url-fetch)
2865 (uri (string-append
2866 "mirror://kernel.org/linux/libs/ieee1394/"
2867 name "-" version ".tar.xz"))
2868 (sha256
2869 (base32
2870 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2871 (build-system gnu-build-system)
2872 (native-inputs
2873 `(("pkg-config" ,pkg-config)))
2874 (propagated-inputs
2875 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2876 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2877 (synopsis "Isochronous streaming media library for IEEE 1394")
2878 (description
2879 "The libiec61883 library provides a higher level API for streaming DV,
2880MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2881 (license license:lgpl2.1+)))
69159125
MW
2882
2883(define-public mdadm
2884 (package
2885 (name "mdadm")
fae88ae8 2886 (version "4.0")
69159125
MW
2887 (source (origin
2888 (method url-fetch)
2889 (uri (string-append
2890 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2891 version ".tar.xz"))
2892 (sha256
2893 (base32
fae88ae8 2894 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
69159125
MW
2895 (build-system gnu-build-system)
2896 (inputs
2897 `(("udev" ,eudev)))
2898 (arguments
2899 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
2900 (list "CC=gcc"
2901 "INSTALL=install"
69159125
MW
2902 "CHECK_RUN_DIR=0"
2903 ;; TODO: tell it where to find 'sendmail'
2904 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2905 (string-append "BINDIR=" out "/sbin")
2906 (string-append "MANDIR=" out "/share/man")
2907 (string-append "UDEVDIR=" out "/lib/udev")))
dc1d3cde
KK
2908 #:phases
2909 (modify-phases %standard-phases
2910 (add-before 'build 'patch-program-paths
2911 (lambda* (#:key inputs #:allow-other-keys)
2912 (let ((coreutils (assoc-ref inputs "coreutils")))
2913 (substitute* "udev-md-raid-arrays.rules"
2914 (("/usr/bin/(readlink|basename)" all program)
2915 (string-append coreutils "/bin/" program))))
2916 #t))
2917 (add-before 'build 'remove-W-error
2918 (lambda _
2919 ;; We cannot build with -Werror on i686 due to a
2920 ;; 'sign-compare' warning in util.c.
2921 (substitute* "Makefile"
2922 (("-Werror") ""))
2923 #t))
2924 (delete 'configure))
69159125
MW
2925 ;;tests must be done as root
2926 #:tests? #f))
2927 (home-page "http://neil.brown.name/blog/mdadm")
2928 (synopsis "Tool for managing Linux Software RAID arrays")
2929 (description
2930 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2931assemble, report on, and monitor arrays. It can also move spares between raid
2932arrays when needed.")
3ac73271 2933 (license license:gpl2+)))
01ccdfb6 2934
631fda7e
LC
2935(define-public mdadm-static
2936 (package
2937 (inherit mdadm)
2938 (name "mdadm-static")
2939 (arguments
2940 (substitute-keyword-arguments (package-arguments mdadm)
2941 ((#:make-flags flags)
2942 `(cons "LDFLAGS = -static" ,flags))
2943 ((#:phases phases)
2944 `(modify-phases ,phases
2945 (add-after 'install 'remove-cruft
2946 (lambda* (#:key outputs #:allow-other-keys)
2947 (let* ((out (assoc-ref outputs "out"))
2948 (precious? (lambda (file)
2949 (member file '("." ".." "sbin"))))
2950 (directories (scandir out (negate precious?))))
2951 (with-directory-excursion out
2952 (for-each delete-file-recursively directories)
2953 (remove-store-references "sbin/mdadm")
2954 (delete-file "sbin/mdmon")
2955 #t))))))
2956 ((#:modules modules %gnu-build-system-modules)
2957 `((ice-9 ftw) ,@modules))
2958 ((#:strip-flags _ '())
2959 ''("--strip-all")) ;strip a few extra KiB
2960 ((#:allowed-references _ '("out"))
2961 '("out")))) ;refer only self
2962 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2963
b3ed50e6
MB
2964(define-public multipath-tools
2965 (package
2966 (name "multipath-tools")
0afeda65 2967 (version "0.7.6")
b3ed50e6
MB
2968 (source (origin
2969 (method url-fetch)
3e57b7d9 2970 (uri (string-append "https://git.opensvc.com/?p=multipath-tools/"
b3ed50e6
MB
2971 ".git;a=snapshot;h=" version ";sf=tgz"))
2972 (file-name (string-append name "-" version ".tar.gz"))
2973 (sha256
2974 (base32
0afeda65 2975 "0zkcayi3mmp43ji2zid1gprgsvqhjjapsw7jjd60sf75prf50h2r"))
b3ed50e6
MB
2976 (modules '((guix build utils)))
2977 (snippet
2978 '(begin
2979 ;; Drop bundled valgrind headers.
2980 (delete-file-recursively "third-party")
2981 (substitute* '("multipathd/main.c"
2982 "libmultipath/debug.c")
2983 (("#include \"../third-party/")
2984 "#include \""))
2985 #t))))
2986 (build-system gnu-build-system)
2987 (arguments
2988 '(#:tests? #f ; No tests.
2989 #:make-flags (list (string-append "DESTDIR="
2990 (assoc-ref %outputs "out"))
b5fb9430 2991 "SYSTEMDPATH=lib"
b3ed50e6
MB
2992 (string-append "LDFLAGS=-Wl,-rpath="
2993 (assoc-ref %outputs "out")
2994 "/lib"))
2995 #:phases
2996 (modify-phases %standard-phases
b5fb9430 2997 (add-after 'unpack 'patch-source
7f412f33
MB
2998 (lambda* (#:key inputs #:allow-other-keys)
2999 (let ((lvm2 (assoc-ref inputs "lvm2"))
3000 (udev (assoc-ref inputs "udev")))
3001 (substitute* "Makefile.inc"
a9e7d656
MO
3002 (("\\$\\(prefix\\)/usr") "$(prefix)")
3003 ;; Do not save timestamp to avoid gzip "timestamp
3004 ;; out-of-range" warnings.
3005 (("gzip -9") "gzip -9n"))
7f412f33
MB
3006 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
3007 (("/usr/include/libdevmapper.h")
3008 (string-append lvm2 "/include/libdevmapper.h"))
3009 (("/usr/include/libudev.h")
3010 (string-append udev "/include/libudev.h")))
3011 #t)))
b3ed50e6
MB
3012 (delete 'configure)
3013 (add-before 'build 'set-CC
3014 (lambda _
3015 (setenv "CC" "gcc")
3016 #t)))))
3017 (native-inputs
7f412f33
MB
3018 `(("perl" ,perl)
3019 ("pkg-config" ,pkg-config)
3020 ("valgrind" ,valgrind)))
b3ed50e6
MB
3021 (inputs
3022 `(("ceph:lib" ,ceph "lib")
7f412f33 3023 ("json-c" ,json-c)
b3ed50e6
MB
3024 ("libaio" ,libaio)
3025 ("liburcu" ,liburcu)
3026 ("lvm2" ,lvm2)
3027 ("readline" ,readline)
3028 ("udev" ,eudev)))
3029 (home-page "http://christophe.varoqui.free.fr/")
3030 (synopsis "Access block devices through multiple paths")
3031 (description
3032 "This package provides the following binaries to drive the
3033Linux Device Mapper multipathing driver:
3034@enumerate
3035@item @command{multipath} - Device mapper target autoconfig.
3036@item @command{multipathd} - Multipath daemon.
3037@item @command{mpathpersist} - Manages SCSI persistent reservations on
3038@code{dm} multipath devices.
3039@item @command{kpartx} - Create device maps from partition tables.
3040@end enumerate")
3041 (license (list license:gpl2+ ; Main distribution.
3042 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
3043
01ccdfb6
SB
3044(define-public libaio
3045 (package
3046 (name "libaio")
87dc306b 3047 (version "0.3.111")
01ccdfb6
SB
3048 (source (origin
3049 (method url-fetch)
87dc306b
MB
3050 (uri (list
3051 (string-append "https://releases.pagure.org/libaio/"
3052 name "-" version ".tar.gz")))
3053 (sha256
3054 (base32
3055 "0ajhzbqjwsmz51gwccfyw6w9k4j4gmxcl2ph30sfn2gxv0d8gkv2"))))
01ccdfb6
SB
3056 (build-system gnu-build-system)
3057 (arguments
3058 '(#:make-flags
3059 (list "CC=gcc" (string-append "prefix=" %output))
3060 #:test-target "partcheck" ; need root for a full 'check'
3061 #:phases
dc1d3cde 3062 (modify-phases %standard-phases (delete 'configure)))) ; no configure script
87dc306b 3063 (home-page "https://pagure.io/libaio")
01ccdfb6
SB
3064 (synopsis "Linux-native asynchronous I/O access library")
3065 (description
3066 "This library enables userspace to use Linux kernel asynchronous I/O
3067system calls, important for the performance of databases and other advanced
3068applications.")
3ac73271 3069 (license license:lgpl2.1+)))
eb7c43c3 3070
81b98756
RW
3071(define-public sbc
3072 (package
3073 (name "sbc")
3074 (version "1.3")
3075 (source (origin
3076 (method url-fetch)
3077 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
3078 name "-" version ".tar.xz"))
3079 (sha256
3080 (base32
3081 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
3082 (build-system gnu-build-system)
3083 (inputs
3084 `(("libsndfile" ,libsndfile)))
3085 (native-inputs
3086 `(("pkg-config" ,pkg-config)))
3087 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3088 (synopsis "Bluetooth subband audio codec")
3089 (description
3090 "The SBC is a digital audio encoder and decoder used to transfer data to
3091Bluetooth audio output devices like headphones or loudspeakers.")
3092 (license license:gpl2+)))
3093
eb7c43c3
DT
3094(define-public bluez
3095 (package
3096 (name "bluez")
b5724230 3097 (version "5.50")
eb7c43c3
DT
3098 (source (origin
3099 (method url-fetch)
3100 (uri (string-append
e9eb24b1 3101 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
3102 version ".tar.xz"))
3103 (sha256
3104 (base32
b5724230 3105 "048r91vx9gs5nwwbah2s0xig04nwk14c5s0vb7qmaqdvighsmz2z"))))
eb7c43c3
DT
3106 (build-system gnu-build-system)
3107 (arguments
90ea83ee 3108 `(#:configure-flags
eb7c43c3 3109 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
3110 (list "--sysconfdir=/etc"
3111 "--localstatedir=/var"
3112 "--enable-library"
53142109 3113 "--disable-systemd"
eb7c43c3
DT
3114 ;; Install dbus/udev files to the correct location.
3115 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
3116 (string-append "--with-udevdir=" out "/lib/udev")))
3117 #:phases
3118 (modify-phases %standard-phases
fbea821a
TD
3119 ;; Test unit/test-gatt fails unpredictably. Seems to be a timing
3120 ;; issue (discussion on upstream mailing list:
3121 ;; https://marc.info/?t=149578476300002&r=1&w=2)
3122 (add-before 'check 'skip-wonky-test
3123 (lambda _
3124 (substitute* "unit/test-gatt.c"
3125 (("tester_init\\(&argc, &argv\\);") "return 77;"))
3126 #t))
87a16de7
SB
3127 (add-after 'install 'post-install
3128 (lambda* (#:key inputs outputs #:allow-other-keys)
3129 (let* ((out (assoc-ref outputs "out"))
3130 (servicedir (string-append out "/share/dbus-1/services"))
3131 (service "obexd/src/org.bluez.obex.service")
3132 (rule (string-append
3133 out "/lib/udev/rules.d/97-hid2hci.rules")))
3134 ;; Install the obex dbus service file.
3135 (substitute* service
3136 (("/bin/false")
3137 (string-append out "/libexec/bluetooth/obexd")))
3138 (install-file service servicedir)
3139 ;; Fix paths in the udev rule.
3140 (substitute* rule
3141 (("hid2hci --method")
3142 (string-append out "/lib/udev/hid2hci --method"))
3143 (("/sbin/udevadm")
3144 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
de47cfed 3145 #t))))))
eb7c43c3
DT
3146 (native-inputs
3147 `(("pkg-config" ,pkg-config)
b94a6ca0 3148 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
3149 (inputs
3150 `(("glib" ,glib)
3151 ("dbus" ,dbus)
3152 ("eudev" ,eudev)
3153 ("libical" ,libical)
3154 ("readline" ,readline)))
3155 (home-page "http://www.bluez.org/")
3156 (synopsis "Linux Bluetooth protocol stack")
3157 (description
3158 "BlueZ provides support for the core Bluetooth layers and protocols. It
3159is flexible, efficient and uses a modular implementation.")
3ac73271 3160 (license license:gpl2+)))
3d890318
LC
3161
3162(define-public fuse-exfat
3163 (package
3164 (name "fuse-exfat")
ebcab70a 3165 (version "1.2.8")
3d890318
LC
3166 (source (origin
3167 (method url-fetch)
c0cc805e
TGR
3168 (uri (string-append
3169 "https://github.com/relan/exfat/releases/download/v"
3170 version "/" name "-" version ".tar.gz"))
3d890318
LC
3171 (sha256
3172 (base32
ebcab70a 3173 "1jwnxw0bg9v5ij8xvbg4xpjr50nykq8a1lmc2xkblz204rq7wd8z"))))
3d890318
LC
3174 (build-system gnu-build-system)
3175 (native-inputs
c0cc805e 3176 `(("pkg-config" ,pkg-config)))
3d890318
LC
3177 (inputs
3178 `(("fuse" ,fuse)))
c0cc805e 3179 (home-page "https://github.com/relan/exfat")
3d890318
LC
3180 (synopsis "Mount exFAT file systems")
3181 (description
3182 "This package provides a FUSE-based file system that provides read and
3183write access to exFAT devices.")
3ac73271 3184 (license license:gpl2+)))
53ec8d48
LC
3185
3186(define-public gpm
3187 (package
3188 (name "gpm")
3189 (version "1.20.7")
3190 (source (origin
3191 (method url-fetch)
3192 (uri (string-append
3193 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3194 version ".tar.bz2"))
fddb22ac 3195 (patches (search-patches "gpm-glibc-2.26.patch"))
53ec8d48
LC
3196 (sha256
3197 (base32
3198 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3199 (build-system gnu-build-system)
3200 (arguments
3201 '(#:phases (modify-phases %standard-phases
189be331 3202 (replace 'bootstrap
53ec8d48
LC
3203 (lambda _
3204 ;; The tarball was not generated with 'make dist' so we
3205 ;; need to bootstrap things ourselves.
77bb6c22
EF
3206 (substitute* "autogen.sh"
3207 (("/bin/sh") (which "sh")))
90a54e36
MW
3208 (invoke "./autogen.sh")
3209 (patch-makefile-SHELL "Makefile.include.in")
3210 #t)))
53ec8d48
LC
3211
3212 ;; Make sure programs find libgpm.so.
3213 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3214 (assoc-ref %outputs "out")
3215 "/lib"))))
3216 (native-inputs
3217 `(("texinfo" ,texinfo)
3218 ("bison" ,bison)
3219 ("flex" ,flex)
3220 ("autoconf" ,autoconf)
3221 ("automake" ,automake)
3222 ("libtool" ,libtool)))
3223 (home-page "http://www.nico.schottelius.org/software/gpm/")
3224 (synopsis "Mouse support for the Linux console")
3225 (description
3226 "The GPM (general-purpose mouse) daemon is a mouse server for
3227applications running on the Linux console. It allows users to select items
3228and copy/paste text in the console and in xterm.")
3ac73271 3229 (license license:gpl2+)))
fc686f9a
TGR
3230
3231(define-public btrfs-progs
3232 (package
3233 (name "btrfs-progs")
caf4c7c8 3234 (version "4.15.1")
fc686f9a
TGR
3235 (source (origin
3236 (method url-fetch)
3237 (uri (string-append "mirror://kernel.org/linux/kernel/"
3238 "people/kdave/btrfs-progs/"
3239 "btrfs-progs-v" version ".tar.xz"))
3240 (sha256
3241 (base32
caf4c7c8
MW
3242 "15izak6jg6pqr6ha9447cdrdj9k6kfiarvwlrj53cpvrsv02l437"))
3243 (patches (search-patches "btrfs-progs-e-value-block.patch"))))
fc686f9a 3244 (build-system gnu-build-system)
7cad981d 3245 (outputs '("out"
c4b006ba 3246 "static")) ; static versions of the binaries in "out"
fc686f9a 3247 (arguments
7cad981d
TGR
3248 '(#:phases (modify-phases %standard-phases
3249 (add-after 'build 'build-static
caf4c7c8 3250 (lambda _ (invoke "make" "static")))
9a1c4a98
MB
3251 (add-after 'install 'install-bash-completion
3252 (lambda* (#:key outputs #:allow-other-keys)
3ce4e265
MB
3253 (let* ((out (assoc-ref outputs "out"))
3254 (bashcomp (string-append out "/etc/bash_completion.d")))
3255 (mkdir-p bashcomp)
3256 (copy-file "btrfs-completion"
3257 (string-append bashcomp "/btrfs"))
3258 #t)))
7cad981d
TGR
3259 (add-after 'install 'install-static
3260 (let ((staticbin (string-append (assoc-ref %outputs "static")
3261 "/bin")))
3262 (lambda _
caf4c7c8
MW
3263 (invoke "make"
3264 (string-append "bindir=" staticbin)
3265 "install-static")))))
d6fb0985 3266 #:tests? #f ; XXX: require the 'btrfs' kernel module.
7cad981d 3267 #:test-target "test"
fc686f9a
TGR
3268 #:parallel-tests? #f)) ; tests fail when run in parallel
3269 (inputs `(("e2fsprogs" ,e2fsprogs)
3270 ("libblkid" ,util-linux)
7cad981d 3271 ("libblkid:static" ,util-linux "static")
fc686f9a 3272 ("libuuid" ,util-linux)
7cad981d 3273 ("libuuid:static" ,util-linux "static")
e2937a55 3274 ("lzo" ,lzo)
fc686f9a 3275 ("zlib" ,zlib)
e2937a55 3276 ("zstd" ,zstd)))
fc686f9a
TGR
3277 (native-inputs `(("pkg-config" ,pkg-config)
3278 ("asciidoc" ,asciidoc)
3279 ("xmlto" ,xmlto)
41d23dd1 3280 ;; For building documentation.
fc686f9a 3281 ("libxml2" ,libxml2)
48b7e4a6 3282 ("docbook-xsl" ,docbook-xsl)
41d23dd1 3283 ;; For tests.
bc64676c 3284 ("acl" ,acl)
caf4c7c8
MW
3285 ("which" ,which)
3286 ;; The tests need 'grep' with perl regexp support.
3287 ("grep" ,grep)))
fc83ca2b 3288 (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page")
fc686f9a 3289 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
3290 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3291aimed at implementing advanced features while focusing on fault tolerance,
3292repair and easy administration.")
68bcac6b
LF
3293 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3294 ;; GPL2: Everything else.
3295 (license (list license:gpl2 license:gpl2+))))
08e9daf5 3296
f3e44f5c
DC
3297(define-public btrfs-progs/static
3298 (package
3299 (name "btrfs-progs-static")
3300 (version (package-version btrfs-progs))
3301 (source #f)
3302 (build-system trivial-build-system)
3303 (inputs
3304 `(("btrfs-progs:static" ,btrfs-progs "static")))
3305 (arguments
3306 `(#:modules ((guix build utils))
3307 #:builder
3308 (begin
3309 (use-modules (guix build utils)
3310 (ice-9 ftw)
3311 (srfi srfi-26))
3312
3313 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3314 (out (assoc-ref %outputs "out"))
3315 (source (string-append btrfs "/bin/btrfs.static"))
3316 (target (string-append out "/bin/btrfs")))
3317 (mkdir-p (dirname target))
3318 (copy-file source target)
3319 (remove-store-references target)
e3cfef22
MW
3320 (chmod target #o555)
3321 #t))))
f3e44f5c 3322 (home-page (package-home-page btrfs-progs))
ff797172
TGR
3323 (synopsis "Statically-linked btrfs command from btrfs-progs")
3324 (description "This package provides the statically-linked @command{btrfs}
3325from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
3326 (license (package-license btrfs-progs))))
3327
72aa295e 3328(define-public f2fs-tools-1.7
2e456982
MB
3329 (package
3330 (name "f2fs-tools")
72aa295e 3331 (version "1.7.0")
2e456982
MB
3332 (source (origin
3333 (method url-fetch)
3334 (uri (string-append
3335 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3336 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3337 (sha256
3338 (base32
72aa295e
DM
3339 "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k"))))
3340
2e456982
MB
3341 (build-system gnu-build-system)
3342 (arguments
3343 `(#:phases
3344 (modify-phases %standard-phases
72aa295e
DM
3345 (add-after 'install 'install-headers
3346 (lambda* (#:key outputs #:allow-other-keys)
3347 (let* ((out (assoc-ref outputs "out"))
3348 (out-include (string-append out "/include")))
3349 (install-file "include/f2fs_fs.h" out-include)
3350 (install-file "mkfs/f2fs_format_utils.h" out-include)
3351 #t))))))
2e456982
MB
3352 (native-inputs
3353 `(("autoconf" ,autoconf)
3354 ("automake" ,automake)
3355 ("libtool" ,libtool)
3356 ("pkg-config" ,pkg-config)))
3357 (inputs
72aa295e
DM
3358 `(("libuuid" ,util-linux)
3359 ("libselinux" ,libselinux)))
2e456982
MB
3360 (home-page "https://f2fs.wiki.kernel.org/")
3361 (synopsis "Userland tools for f2fs")
3362 (description
3363 "F2FS, the Flash-Friendly File System, is a modern file system
3364designed to be fast and durable on flash devices such as solid-state
3365disks and SD cards. This package provides the userland utilities.")
3366 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3367 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3368 (license (list license:gpl2 license:lgpl2.1))))
3369
72aa295e
DM
3370(define-public f2fs-tools
3371 (package
3372 (inherit f2fs-tools-1.7)
3373 (name "f2fs-tools")
14b0c496 3374 (version "1.10.0")
72aa295e
DM
3375 (source (origin
3376 (method url-fetch)
3377 (uri (string-append
3378 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3379 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3380 (sha256
3381 (base32
14b0c496 3382 "05ikaim0qq3dx9x3sp43ralwz43r3b0viv62n99kabp0vf3b0hg8"))))
72aa295e
DM
3383 (inputs
3384 `(("libuuid" ,util-linux)))))
3385
08e9daf5
TGR
3386(define-public freefall
3387 (package
3388 (name "freefall")
3389 (version (package-version linux-libre))
3390 (source (package-source linux-libre))
3391 (build-system gnu-build-system)
3392 (arguments
3393 '(#:phases (modify-phases %standard-phases
3394 (add-after 'unpack 'enter-subdirectory
3395 (lambda _
2ee42f7e
MW
3396 (chdir "tools/laptop/freefall")
3397 #t))
08e9daf5
TGR
3398 (delete 'configure)
3399 (add-before 'build 'increase-timeout
3400 (lambda _
3401 ;; The default of 2 seconds is too low: it assumes an
3402 ;; open lid and AC power without actually checking.
3403 (substitute* "freefall.c"
2ee42f7e
MW
3404 (("alarm\\(2\\)") "alarm(5)"))
3405 #t)))
08e9daf5 3406 #:make-flags (list (string-append "PREFIX="
c80629e7
EF
3407 (assoc-ref %outputs "out"))
3408 "CC=gcc")
08e9daf5
TGR
3409 #:tests? #f)) ;no tests
3410 (home-page (package-home-page linux-libre))
3411 (synopsis "Free-fall protection for spinning laptop hard drives")
3412 (description
3413 "Prevents shock damage to the internal spinning hard drive(s) of some
3414HP and Dell laptops. When sudden movement is detected, all input/output
3415operations on the drive are suspended and its heads are parked on the ramp,
3416where they are less likely to cause damage to the spinning disc. Requires a
3417drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3418feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3419 (license license:gpl2)))
d17ae8c0
NG
3420
3421(define-public thinkfan
3422 (package
3423 (name "thinkfan")
3424 (version "0.9.3")
3425 (source (origin
3426 (method url-fetch)
3427 (uri (string-append "mirror://sourceforge/thinkfan/"
de67e922 3428 "/thinkfan-" version ".tar.gz"))
d17ae8c0
NG
3429 (sha256
3430 (base32
3431 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3432 (modules '((guix build utils)))
3433 ;; Fix erroneous man page location in Makefile leading to
3434 ;; a compilation failure.
6cbee49d
MW
3435 (snippet '(begin
3436 (substitute* "CMakeLists.txt"
3437 (("thinkfan\\.1") "src/thinkfan.1"))
3438 #t))))
d17ae8c0
NG
3439 (build-system cmake-build-system)
3440 (arguments
3441 `(#:modules ((guix build cmake-build-system)
3442 (guix build utils)
3443 (srfi srfi-26))
3444 #:tests? #f ;no test target
3445 #:configure-flags
3446 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3447 `("-DUSE_ATASMART:BOOL=ON")
3448 #:phases
3449 (modify-phases %standard-phases
75e56aed
NG
3450 ;; Install scripts for various foreign init systems. Also fix
3451 ;; hard-coded path for daemon.
d17ae8c0
NG
3452 (add-after 'install 'install-rc-scripts
3453 (lambda* (#:key outputs #:allow-other-keys)
75e56aed
NG
3454 (let ((out (assoc-ref outputs "out"))
3455 (files (find-files
3456 (string-append "../thinkfan-" ,version "/rcscripts")
3457 ".*")))
3458 (substitute* files
3459 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3460 (string-append out "/sbin/" name)))
3461 (for-each (cute install-file <>
3462 (string-append out "/share/thinkfan"))
3463 files))
d17ae8c0
NG
3464 #t)))))
3465 (inputs
3466 `(("libatasmart" ,libatasmart)))
3467 (home-page "http://thinkfan.sourceforge.net/")
3468 (synopsis "Simple fan control program")
3469 (description
3470 "Thinkfan is a simple fan control program. It reads temperatures,
3471checks them against configured limits and switches to appropriate (also
3472pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3473other @code{hwmon} driver that enables temperature reading and fan control
3474from userspace.")
3475 (license license:gpl3+)))
91231156
LC
3476
3477(define-public ntfs-3g
3478 (package
3479 (name "ntfs-3g")
d8af4f6d 3480 (version "2017.3.23")
91231156
LC
3481 (source (origin
3482 (method url-fetch)
3483 (uri (string-append "https://tuxera.com/opensource/"
3484 "ntfs-3g_ntfsprogs-" version ".tgz"))
3485 (sha256
3486 (base32
d8af4f6d 3487 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
91231156 3488 (modules '((guix build utils)))
6cbee49d
MW
3489 (snippet '(begin
3490 ;; Install under $prefix.
3491 (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3492 (("/sbin")
3493 "@sbindir@"))
3494 #t))))
91231156
LC
3495 (build-system gnu-build-system)
3496 (inputs `(("util-linux" ,util-linux)
3497 ("fuse" ,fuse))) ;libuuid
3498 (native-inputs `(("pkg-config" ,pkg-config)))
3499 (arguments
3500 '(#:configure-flags (list "--exec-prefix=${prefix}"
3501 "--with-fuse=external" ;use our own FUSE
3502 "--enable-mount-helper"
3503 "--enable-posix-acls"
91420521
PN
3504 "--enable-xattr-mappings")
3505 #:phases
3506 (modify-phases %standard-phases
3507 ;; If users install ntfs-3g, they probably want to make it the
3508 ;; default driver as well, so we opt for sensible defaults and link
3509 ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to
3510 ;; mount NTFS filesystems.)
3511 (add-after 'install 'install-link
3512 (lambda* (#:key outputs #:allow-other-keys)
3513 (let* ((out (assoc-ref outputs "out"))
3514 (sbin (string-append out "/sbin")))
3515 (symlink "mount.ntfs-3g"
3516 (string-append sbin "/mount.ntfs"))))))))
8bad0c0b 3517 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
91231156
LC
3518 (synopsis "Read-write access to NTFS file systems")
3519 (description
3520 "NTFS-3G provides read-write access to NTFS file systems, which are
3521commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3522The package provides additional NTFS tools.")
3523 (license license:gpl2+)))
9b0942c1 3524
f8f44dd7
MB
3525(define-public rdma-core
3526 (package
3527 (name "rdma-core")
5826e7b1 3528 (version "14")
f8f44dd7
MB
3529 (source (origin
3530 (method url-fetch)
3531 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3532 "/releases/download/v" version "/rdma-core-"
3533 version ".tar.gz"))
3534 (sha256
3535 (base32
5826e7b1 3536 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
f8f44dd7
MB
3537 (build-system cmake-build-system)
3538 (arguments
3539 '(#:tests? #f ; no tests
3540 ;; Upstream uses the "ninja" build system and encourage distros
3541 ;; to do the same for consistency. They also recommend using the
3542 ;; "Release" build type.
3def739d
TGR
3543 #:build-type "Release"
3544 #:configure-flags (list "-GNinja")
f8f44dd7
MB
3545 #:phases
3546 (modify-phases %standard-phases
3547 (replace 'build
3548 (lambda _
8c3101b8
MW
3549 (invoke "ninja"
3550 "-j" (number->string (parallel-job-count)))))
f8f44dd7
MB
3551 (replace 'install
3552 (lambda _
8c3101b8 3553 (invoke "ninja" "install"))))))
f8f44dd7
MB
3554 (native-inputs
3555 `(("ninja" ,ninja)
3556 ("pkg-config" ,pkg-config)
3557 ("python" ,python-wrapper)))
3558 (inputs
3559 `(("libnl" ,libnl)
3560 ("udev" ,eudev)))
3561 (home-page "https://github.com/linux-rdma/rdma-core")
3562 (synopsis "Utilities and libraries for working with RDMA devices")
3563 (description
3564 "This package provides userspace components for the InfiniBand
3565subsystem of the Linux kernel. Specifically it contains userspace
3566libraries for the following device nodes:
3567
3568@enumerate
3569@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3570@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3571@item @file{/dev/infiniband/umadX} (@code{libibumad})
3572@end enumerate
3573
3574The following service daemons are also provided:
3575@enumerate
3576@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3577@item @code{iwpmd} (for iWARP kernel providers)
3578@item @code{ibacm} (for InfiniBand communication management assistant)
3579@end enumerate")
3580 ;; All library code is dual licensed under GPL2 and a custom MIT
3581 ;; variant. The package also includes some components covered by
3582 ;; other licenses. Consult COPYING.md for full details.
3583 (license
3584 (list license:gpl2
3585 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3586 license:bsd-2 ; Files referring to COPYING.BSD_FB
3587 license:cc0 ; most files in ccan/
3588 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3589
9b0942c1
DC
3590(define-public rng-tools
3591 (package
3592 (name "rng-tools")
1a149de7 3593 (version "6.3.1")
9b0942c1
DC
3594 (source (origin
3595 (method url-fetch)
8bc6956b
LF
3596 (uri (string-append "https://github.com/nhorman/rng-tools/"
3597 "archive/v" version ".tar.gz"))
3598 (file-name (string-append name "-" version ".tar.gz"))
9b0942c1
DC
3599 (sha256
3600 (base32
1a149de7 3601 "04p7wvcm389s21y9mq8ss6z2szxi4nfrfixzwqjkq2qciz705i4s"))))
9b0942c1 3602 (build-system gnu-build-system)
8bc6956b
LF
3603 (arguments
3604 `(;; Avoid using OpenSSL, curl, and libxml2, reducing the closure by 166 MiB.
189be331 3605 #:configure-flags '("--without-nistbeacon")))
8bc6956b
LF
3606 (native-inputs
3607 `(("autoconf" ,autoconf)
3608 ("automake" ,automake)
3609 ("pkg-config" ,pkg-config)))
3610 (inputs
3611 `(("libsysfs" ,sysfsutils)))
9b0942c1
DC
3612 (synopsis "Random number generator daemon")
3613 (description
3614 "Monitor a hardware random number generator, and supply entropy
3615from that to the system kernel's @file{/dev/random} machinery.")
3b3b60d0 3616 (home-page "https://sourceforge.net/projects/gkernel")
9b0942c1
DC
3617 ;; The source package is offered under the GPL2+, but the files
3618 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3619 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
3620
3621(define-public cpupower
3622 (package
3623 (name "cpupower")
3624 (version (package-version linux-libre))
3625 (source (package-source linux-libre))
3626 (build-system gnu-build-system)
3627 (arguments
3628 '(#:phases (modify-phases %standard-phases
3629 (add-after 'unpack 'enter-subdirectory
3630 (lambda _
3631 (chdir "tools/power/cpupower")))
3632 (delete 'configure)
3633 (add-before 'build 'fix-makefiles
3634 (lambda _
3635 (substitute* "Makefile"
3636 (("/usr/") "/")
3637 (("/bin/(install|pwd)" _ command) command))
3638 (substitute* "bench/Makefile"
3639 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3640 #:make-flags (let ((out (assoc-ref %outputs "out")))
3641 (list (string-append "DESTDIR=" out)
3642 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3643 "docdir=/share/doc/cpupower"
3644 "confdir=$(docdir)/examples"
3645 ;; The Makefile recommends the following changes
3646 "DEBUG=false"
3647 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3648 #:tests? #f)) ;no tests
b94a6ca0 3649 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
3650 (inputs `(("pciutils" ,pciutils)))
3651 (home-page (package-home-page linux-libre))
3652 (synopsis "CPU frequency and voltage scaling tools for Linux")
3653 (description
3654 "cpupower is a set of user-space tools that use the cpufreq feature of the
3655Linux kernel to retrieve and control processor features related to power saving,
3656such as frequency and voltage scaling.")
3657 (license license:gpl2)))
2b76f135
TGR
3658
3659(define-public haveged
3660 (package
3661 (name "haveged")
87c6e9d2 3662 (version "1.9.2")
2b76f135
TGR
3663 (source
3664 (origin
3665 (method url-fetch)
3666 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3667 version ".tar.gz"))
3668 (sha256
3669 (base32
87c6e9d2 3670 "0w5ypz6451msckivjriwyw8djydlwffam7x23xh626s2vzdrlzgp"))))
2b76f135
TGR
3671 (build-system gnu-build-system)
3672 (home-page "http://www.issihosts.com/haveged")
3673 (synopsis "Entropy source for the Linux random number generator")
3674 (description
3675 "haveged generates an unpredictable stream of random numbers for use by
3676Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3677standard mechanisms for filling the entropy pool may not be sufficient for
3678systems with high needs or limited user interaction, such as headless servers.
3679@command{haveged} runs as a privileged daemon, harvesting randomness from the
3680indirect effects of hardware events on hidden processor state using the HArdware
3681Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3682its environment and provides the same built-in test suite for the output stream
3683as used on certified hardware security devices.")
3684 (license (list (license:non-copyleft "file://nist/mconf.h")
3685 (license:non-copyleft "file://nist/packtest.c")
3686 license:public-domain ; nist/dfft.c
3687 license:gpl3+)))) ; everything else
e385e957
TGR
3688
3689(define-public ecryptfs-utils
3690 (package
3691 (name "ecryptfs-utils")
3692 (version "111")
3693 (source
3694 (origin
3695 (method url-fetch)
3696 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3697 version "/+download/ecryptfs-utils_"
3698 version ".orig.tar.gz"))
3699 (sha256
3700 (base32
3701 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3702 (build-system gnu-build-system)
3703 (arguments
17a21bcf
BT
3704 `(#:configure-flags (list "--disable-pywrap")
3705 #:phases
3706 (modify-phases %standard-phases
3707 (add-after 'patch-source-shebangs 'patch-hardcoded-paths
3708 (lambda* (#:key inputs outputs #:allow-other-keys)
3709 (let ((out (assoc-ref outputs "out"))
3710 (utils-linux (assoc-ref inputs "utils-linux"))
3711 (cryptsetup (assoc-ref inputs "cryptsetup"))
3712 (linux-pam (assoc-ref inputs "linux-pam"))
3713 (lvm2 (assoc-ref inputs "lvm2")))
3714 (substitute* '("src/utils/ecryptfs-mount-private"
3715 "src/utils/ecryptfs-umount-private"
3716 "src/utils/ecryptfs-setup-private"
e8ec2dda 3717 "src/utils/ecryptfs-setup-swap"
17a21bcf 3718 "src/utils/mount.ecryptfs.c"
e8ec2dda 3719 "src/utils/umount.ecryptfs.c"
17a21bcf
BT
3720 "src/pam_ecryptfs/pam_ecryptfs.c"
3721 "src/desktop/ecryptfs-mount-private.desktop.in"
e8ec2dda 3722 "src/desktop/ecryptfs-setup-private.desktop.in")
17a21bcf
BT
3723 (("/bin/mount")
3724 (string-append utils-linux "/bin/mount"))
3725 (("/bin/umount")
3726 (string-append utils-linux "/bin/umount"))
3727 (("/sbin/mount.ecryptfs_private")
3728 (string-append out "/sbin/mount.ecryptfs_private"))
3729 (("/sbin/umount.ecryptfs_private")
3730 (string-append out "/sbin/umount.ecryptfs_private"))
3731 (("/usr/bin/ecryptfs-mount-private")
3732 (string-append out "/bin/ecryptfs-mount-private"))
3733 (("/usr/bin/ecryptfs-rewrite-file")
3734 (string-append out "/bin/ecryptfs-rewrite-file"))
3735 (("/usr/bin/ecryptfs-setup-private")
3736 (string-append out "/bin/ecryptfs-setup-private"))
3737 (("/sbin/cryptsetup")
3738 (string-append cryptsetup "/sbin/cryptsetup"))
3739 (("/sbin/unix_chkpwd")
3740 (string-append linux-pam "/sbin/unix_chkpwd"))
3741 (("/sbin/dmsetup")
3742 (string-append lvm2 "/sbin/dmsetup")))))))))
e385e957
TGR
3743 (native-inputs
3744 `(("intltool" ,intltool)
3745 ("perl" ,perl) ; for pod2man
3746 ("pkg-config" ,pkg-config)))
3747 (inputs
3748 `(("keyutils" ,keyutils)
3749 ("linux-pam" ,linux-pam)
17a21bcf
BT
3750 ("utils-linux" ,util-linux)
3751 ("cryptsetup" ,cryptsetup)
3752 ("lvm2" ,lvm2)
e385e957
TGR
3753 ("nss" ,nss)))
3754 (home-page "http://ecryptfs.org/")
3755 (synopsis "eCryptfs cryptographic file system utilities")
3756 (description
3757 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3758Each file's cryptographic meta-data is stored inside the file itself, along
3759with the encrypted contents. This allows individual encrypted files to be
3760copied between hosts and still be decrypted with the proper key. eCryptfs is a
3761native Linux file system, and has been part of the Linux kernel since version
37622.6.19. This package contains the userland utilities to manage it.")
3763 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3764 ;; grant additional permission to link with OpenSSL.
3765 (license license:gpl2+)))
cff0adec
DC
3766
3767(define-public libnfsidmap
3768 (package
3769 (name "libnfsidmap")
3770 (version "0.25")
3771 (source (origin
3772 (method url-fetch)
3773 (uri (string-append
3774 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3775 name "/" name "-" version ".tar.gz"))
3776 (sha256
3777 (base32
3778 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3779 (build-system gnu-build-system)
3780 (arguments
3781 `(#:configure-flags (list
3782 (string-append "--with-pluginpath="
3783 (assoc-ref %outputs "out")
3784 "/lib/libnfsidmap"))))
3785 (home-page
3786 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3787 (synopsis
3788 "NFSv4 support library for name/ID mapping")
3789 (description "Libnfsidmap is a library holding mulitiple methods of
3790mapping names to ids and visa versa, mainly for NFSv4. It provides an
3791extensible array of mapping functions, currently consisting of two choices:
3792the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3793 (license (license:non-copyleft "file://COPYING"
3794 "See COPYING in the distribution."))))
035d3593
DC
3795
3796(define-public module-init-tools
3797 (package
3798 (name "module-init-tools")
3799 (version "3.16")
3800 (source (origin
3801 (method url-fetch)
3802 (uri (string-append
3803 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3804 "module-init-tools-" version ".tar.bz2"))
3805 (sha256
3806 (base32
3807 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3808 (patches (search-patches "module-init-tools-moduledir.patch"))))
3809 (build-system gnu-build-system)
3810 (arguments
3811 ;; FIXME: The upstream tarball lacks man pages, and building them would
3812 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3813 ;; but they vanished. In the meantime, fake it.
dc1d3cde
KK
3814 '(#:phases
3815 (modify-phases %standard-phases
3816 (add-before 'configure 'fake-docbook
3817 (lambda _
3818 (substitute* "Makefile.in"
3819 (("^DOCBOOKTOMAN.*$")
3820 "DOCBOOKTOMAN = true\n"))
3821 #t)))))
81e59e41 3822 (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
035d3593
DC
3823 (synopsis "Tools for loading and managing Linux kernel modules")
3824 (description
3825 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3826`insmod', `lsmod', and more.")
3827 (license license:gpl2+)))
dd65f3b7
TGR
3828
3829(define-public mcelog
3830 (package
3831 (name "mcelog")
e03e9c86 3832 (version "154")
dd65f3b7
TGR
3833 (source (origin
3834 (method url-fetch)
3835 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3836 "mcelog.git/snapshot/v" version ".tar.gz"))
3837 (sha256
3838 (base32
e03e9c86 3839 "07628cr05f50m7lsvw26wxlnb7qcl0x6rymdpp5spqzhz91l58p3"))
dd65f3b7
TGR
3840 (file-name (string-append name "-" version ".tar.gz"))
3841 (modules '((guix build utils)))
3842 (snippet
6cbee49d
MW
3843 `(begin
3844 ;; The snapshots lack a .git directory,
3845 ;; breaking ‘git describe’.
3846 (substitute* "Makefile"
3847 (("\"unknown\"") (string-append "\"v" ,version "\"")))
3848 #t))))
dd65f3b7
TGR
3849 (build-system gnu-build-system)
3850 (arguments
3851 `(#:phases (modify-phases %standard-phases
3852 (delete 'configure)) ; no configure script
3853 #:make-flags (let ((out (assoc-ref %outputs "out")))
3854 (list "CC=gcc"
3855 (string-append "prefix=" out)
3856 (string-append "DOCDIR=" out "/share/doc/mcelog")
3857 "etcprefix=$(DOCDIR)/examples"))
3858 ;; The tests will only run as root on certain supported CPU models.
3859 #:tests? #f))
3860 (supported-systems (list "i686-linux" "x86_64-linux"))
71d60b96 3861 (home-page "https://mcelog.org/")
dd65f3b7
TGR
3862 (synopsis "Machine check monitor for x86 Linux systems")
3863 (description
3864 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3865and other hardware errors on x86 systems. It can also perform user-defined
3866tasks, such as bringing bad pages off-line, when configurable error thresholds
3867are exceeded.")
3868 (license license:gpl2)))
0c60cc53
DM
3869
3870(define-public mtd-utils
3871 (package
3872 (name "mtd-utils")
3873 (version "1.5.2")
3874 (source (origin
3875 (method url-fetch)
3876 (uri (string-append
3877 "ftp://ftp.infradead.org/pub/mtd-utils/"
3878 "mtd-utils-" version ".tar.bz2"))
3879 (sha256
3880 (base32
3881 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3882 (inputs
3883 `(("acl" ,acl)
3884 ("libuuid" ,util-linux)
c695fb76 3885 ("lzo" ,lzo)
0c60cc53
DM
3886 ("zlib" ,zlib)))
3887 (build-system gnu-build-system)
3888 (arguments
3889 `(#:test-target "tests"
3890 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3891 #:phases (modify-phases %standard-phases
3892 (delete 'configure))))
3893 (synopsis "MTD Flash Storage Utilities")
3894 (description "This package provides utilities for testing, partitioning, etc
3895of flash storage.")
3896 (home-page "http://www.linux-mtd.infradead.org/")
3897 (license
3898 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3899 license:mpl1.1 ; All ftl* files
3900 license:expat)))) ; libiniparser
def6213f
LF
3901
3902(define-public libseccomp
3903 (package
3904 (name "libseccomp")
83a9003c 3905 (version "2.3.3")
def6213f
LF
3906 (source (origin
3907 (method url-fetch)
3908 (uri (string-append "https://github.com/seccomp/libseccomp/"
3909 "releases/download/v" version
3910 "/libseccomp-" version ".tar.gz"))
3911 (sha256
3912 (base32
83a9003c 3913 "0mdiyfljrkfl50q1m3ws8yfcyfjwf1zgkvcva8ffcwncji18zhkz"))))
def6213f
LF
3914 (build-system gnu-build-system)
3915 (native-inputs
3916 `(("which" ,which)))
3917 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3918 (description "The libseccomp library provides an easy to use, platform
3919independent, interface to the Linux Kernel's syscall filtering mechanism. The
3920libseccomp API is designed to abstract away the underlying BPF based syscall
3921filter language and present a more conventional function-call based filtering
3922interface that should be familiar to, and easily adopted by, application
3923developers.")
3924 (home-page "https://github.com/seccomp/libseccomp")
3925 (license license:lgpl2.1)))
58c4f11e
TGR
3926
3927(define-public radeontop
3928 (package
3929 (name "radeontop")
36f3e1df 3930 (version "1.1")
58c4f11e
TGR
3931 (home-page "https://github.com/clbr/radeontop/")
3932 (source (origin
3933 (method url-fetch)
a7c61512 3934 (uri (string-append home-page "archive/v" version ".tar.gz"))
58c4f11e
TGR
3935 (file-name (string-append name "-" version ".tar.gz"))
3936 (sha256
3937 (base32
36f3e1df 3938 "1fv06j5c99imvzkac3j40lgjhr5b2i77fnyffhlvj92bli1fm1c6"))))
58c4f11e
TGR
3939 (build-system gnu-build-system)
3940 (arguments
3941 `(#:phases (modify-phases %standard-phases
3942 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3943 ;; dependency, and doesn't even work on release(!) tarballs.
3944 (add-after 'unpack 'report-correct-version
3945 (lambda _ (substitute* "getver.sh"
3946 (("ver=unknown")
3947 (string-append "ver=" ,version)))))
3948 (delete 'configure)) ; no configure script
3949 #:make-flags (list "CC=gcc"
3950 (string-append "PREFIX=" %output))
3951 #:tests? #f)) ; no tests
3952 (native-inputs
7c90d0f4 3953 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
3954 ("pkg-config" ,pkg-config)))
3955 (inputs
3956 `(("libdrm" ,libdrm)
3957 ("libpciaccess" ,libpciaccess)
a7c61512 3958 ("libxcb" ,libxcb)
58c4f11e
TGR
3959 ("ncurses" ,ncurses)))
3960 (synopsis "Usage monitor for AMD Radeon graphics")
3961 (description "RadeonTop monitors resource consumption on supported AMD
3962Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3963a terminal or saved to a file for further processing. It measures both the
3964activity of the GPU as a whole, which is also accurate during OpenCL
3965computations, as well as separate component statistics that are only meaningful
3966under OpenGL graphics workloads.")
3967 (license license:gpl3)))
0d74462a
MB
3968
3969(define-public efivar
3970 (package
3971 (name "efivar")
887fe1fb 3972 (version "35")
0d74462a
MB
3973 (source (origin
3974 (method url-fetch)
3975 (uri (string-append "https://github.com/rhinstaller/" name
3976 "/releases/download/" version "/" name
3977 "-" version ".tar.bz2"))
3978 (sha256
3979 (base32
887fe1fb 3980 "153k2ifyl4giz5fkryxhz8z621diqjy7v25hfga4z94rs32ks0qy"))))
0d74462a
MB
3981 (build-system gnu-build-system)
3982 (arguments
3983 `(;; Tests require a UEFI system and is not detected in the chroot.
3984 #:tests? #f
3985 #:make-flags (list (string-append "prefix=" %output)
3986 (string-append "libdir=" %output "/lib")
b2b2ba40 3987 "CC_FOR_BUILD=gcc"
0d74462a
MB
3988 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3989 #:phases
3990 (modify-phases %standard-phases
3991 (delete 'configure))))
3992 (native-inputs
3993 `(("pkg-config" ,pkg-config)))
3994 (inputs
3995 `(("popt" ,popt)))
3996 (home-page "https://github.com/rhinstaller/efivar")
3997 (synopsis "Tool and library to manipulate EFI variables")
3998 (description "This package provides a library and a command line
3999interface to the variable facility of UEFI boot firmware.")
4000 (license license:lgpl2.1+)))
1581406e
MB
4001
4002(define-public efibootmgr
4003 (package
4004 (name "efibootmgr")
732825f3 4005 (version "16")
1581406e
MB
4006 (source (origin
4007 (method url-fetch)
4008 (uri (string-append "https://github.com/rhinstaller/" name
4009 "/releases/download/" version "/" name
4010 "-" version ".tar.bz2"))
4011 (sha256
4012 (base32
732825f3 4013 "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm"))))
1581406e
MB
4014 (build-system gnu-build-system)
4015 (arguments
4016 `(#:tests? #f ; No tests.
4017 #:make-flags (list (string-append "prefix=" %output)
4018 (string-append "libdir=" %output "/lib")
732825f3
MB
4019 ;; EFIDIR denotes a subdirectory relative to the
4020 ;; EFI System Partition where the loader will be
4021 ;; installed (known as OS_VENDOR in the code).
4022 ;; GRUB overrides this, as such it's only used if
4023 ;; nothing else is specified on the command line.
4024 "EFIDIR=gnu"
1581406e
MB
4025 ;; Override CFLAGS to add efivar include directory.
4026 (string-append "CFLAGS=-O2 -g -flto -I"
4027 (assoc-ref %build-inputs "efivar")
4028 "/include/efivar"))
732825f3 4029 #:phases (modify-phases %standard-phases (delete 'configure))))
1581406e
MB
4030 (native-inputs
4031 `(("pkg-config" ,pkg-config)))
4032 (inputs
4033 `(("efivar" ,efivar)
4034 ("popt" ,popt)))
4035 (home-page "https://github.com/rhinstaller/efibootmgr")
4036 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
4037 (description
4038 "@code{efibootmgr} is a user-space application to modify the Intel
4039Extensible Firmware Interface (EFI) Boot Manager. This application can
4040create and destroy boot entries, change the boot order, change the next
4041running boot option, and more.")
4042 (license license:gpl2+)))
6d3e08d4
LF
4043
4044(define-public sysstat
4045 (package
4046 (name "sysstat")
70443013 4047 (version "11.4.3")
6d3e08d4
LF
4048 (source (origin
4049 (method url-fetch)
4050 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
4051 "sysstat-" version ".tar.xz"))
4052 (sha256
4053 (base32
70443013 4054 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
6d3e08d4
LF
4055 (build-system gnu-build-system)
4056 (arguments
4057 `(#:tests? #f ; No test suite.
4058 ;; Without this flag, it tries to install the man pages with group 'root'
4059 ;; and fails because /etc/passwd lacks an entry for the root user.
4060 #:configure-flags
4061 (list "--disable-file-attr"
4062 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
4063 #:phases
4064 (modify-phases %standard-phases
4065 ;; The build process tries to create '/var/lib/sa', so we skip that
4066 ;; instruction.
4067 (add-after 'build 'skip-touching-var
4068 (lambda _
4069 (substitute* "Makefile"
4070 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
4071 ""))
4072 #t)))))
4073 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
4074 (synopsis "Performance monitoring tools for Linux")
4075 (description "The sysstat utilities are a collection of performance
4076monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
4077@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
4078@code{sadf} and @code{sa}.")
4079 (license license:gpl2+)))
01be4f93
JMSG
4080
4081(define-public light
4082 (package
4083 (name "light")
a756fa5a 4084 (version "1.1")
01be4f93 4085 (source (origin
a756fa5a
TGR
4086 (method git-fetch)
4087 (uri (git-reference
4088 (url "https://github.com/haikarainen/light")
4089 (commit version)))
01be4f93
JMSG
4090 (sha256
4091 (base32
a756fa5a 4092 "1qra8yzsga29bxlvq63v1db071a1xdji7i60p4kzrciidm1206js"))))
01be4f93
JMSG
4093 (build-system gnu-build-system)
4094 (arguments
a756fa5a 4095 '(#:tests? #f ; no tests
01be4f93
JMSG
4096 #:make-flags (list "CC=gcc"
4097 (string-append "PREFIX=" %output))
4098 #:phases
4099 (modify-phases %standard-phases
a756fa5a 4100 (delete 'configure) ; no configure script
01be4f93
JMSG
4101 (add-after 'unpack 'patch-makefile
4102 (lambda _
d41a5f82
TGR
4103 (substitute* "Makefile" (("chown") "#"))
4104 #t)))))
01be4f93
JMSG
4105 (native-inputs
4106 `(("help2man" ,help2man)))
4107 (home-page "https://haikarainen.github.io/light")
4108 (synopsis "GNU/Linux application to control backlights")
4109 (description
4110 "Light is a program to send commands to screen backlight controllers
4111under GNU/Linux. Features include:
4112
4113@itemize
4114@item It does not rely on X.
4115@item Light can automatically figure out the best controller to use, making
4116full use of underlying hardware.
4117@item It is possible to set a minimum brightness value, as some controllers
4118set the screen to be pitch black at a vaĺue of 0 (or higher).
4119@end itemize
4120
4121Light is the successor of lightscript.")
4122 (license license:gpl3+)))
189d8422 4123
c7adafa7
MO
4124(define-public tlp
4125 (package
4126 (name "tlp")
59d999f9 4127 (version "1.1")
c7adafa7
MO
4128 (source (origin
4129 (method url-fetch)
4130 (uri (string-append
4131 "https://github.com/linrunner/"
4132 (string-upcase name)
4133 "/archive/" version ".tar.gz"))
4134 (file-name (string-append name "-" version ".tar.gz"))
4135 (sha256
4136 (base32
59d999f9 4137 "068hzmh90x600saynbl7iwg1pm0ywldn4jazyxx5y1fixs8s1qbn"))))
c7adafa7
MO
4138 (inputs `(("bash" ,bash)
4139 ("dbus" ,dbus)
4140 ("ethtool" ,ethtool)
4141 ("eudev" ,eudev)
4142 ("grep" ,grep)
4143 ("hdparm" ,hdparm)
4144 ("inetutils" ,inetutils)
4145 ("iw" ,iw)
4146 ("kmod" ,kmod)
4147 ("pciutils" ,pciutils)
4148 ("perl" ,perl)
4149 ("rfkill" ,rfkill)
4150 ("sed" ,sed)
4151 ("usbutils" ,usbutils)
4152 ("util-linux" ,util-linux)
4153 ("wireless-tools" ,wireless-tools)))
4154 (build-system gnu-build-system)
4155 (arguments
4156 `(#:phases
4157 (modify-phases %standard-phases
cef3f146 4158 (delete 'configure) ; no configure script
c7adafa7
MO
4159 (add-before 'build 'setenv
4160 (lambda* (#:key outputs #:allow-other-keys)
4161 (let ((out (assoc-ref outputs "out")))
4162 (setenv "TLP_WITH_SYSTEMD" "0")
4163 (setenv "TLP_NO_INIT" "1")
4164 (setenv "TLP_NO_PMUTILS" "1")
4165 (setenv "TLP_SBIN" (string-append out "/bin"))
4166 (setenv "TLP_BIN" (string-append out "/bin"))
4167 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
4168 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
32e75b48 4169 (setenv "TLP_CONF" "/etc/tlp")
c7adafa7
MO
4170 (setenv "TLP_SHCPL"
4171 (string-append out "/share/bash-completion/completions"))
6db6c3a9
NG
4172 (setenv "TLP_MAN" (string-append out "/share/man"))
4173 (setenv "TLP_META" (string-append out "/share/metainfo")))))
cef3f146
TGR
4174 (delete 'check) ; no tests
4175 (add-before 'install 'fix-installation
4176 (lambda _
4177 ;; Stop the Makefile from trying to create system directories.
4178 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
c7adafa7
MO
4179 (replace 'install
4180 (lambda _
6db6c3a9
NG
4181 (invoke "make" "install-tlp" "install-man")
4182 #t))
c7adafa7
MO
4183 (add-after 'install 'wrap
4184 (lambda* (#:key inputs outputs #:allow-other-keys)
4185 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
4186 (bin-files (find-files bin ".*")))
4187 (define (bin-directory input-name)
4188 (string-append (assoc-ref inputs input-name) "/bin"))
4189 (define (sbin-directory input-name)
4190 (string-append (assoc-ref inputs input-name) "/sbin"))
4191 (for-each (lambda (program)
4192 (wrap-program program
4193 `("PATH" ":" prefix
4194 ,(append
4195 (map bin-directory '("bash"
4196 "coreutils"
4197 "dbus"
4198 "eudev"
4199 "grep"
4200 "inetutils"
4201 "kmod"
4202 "perl"
4203 "sed"
4204 "usbutils"
4205 "util-linux"))
4206 (map sbin-directory '("ethtool"
4207 "hdparm"
4208 "iw"
4209 "pciutils"
4210 "rfkill"
4211 "wireless-tools"))))))
4212 bin-files)))))))
4213 (home-page "http://linrunner.de/en/tlp/tlp.html")
4214 (synopsis "Power management tool for Linux")
4215 (description "TLP is a power management tool for Linux. It comes with
4216a default configuration already optimized for battery life. Nevertheless,
4217TLP is customizable to fulfil system requirements. TLP settings are applied
4218every time the power supply source is changed.")
4219
4220 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4221 ;; rest is GPLv2+.
4222 (license (list license:gpl2+ license:gpl3+))))
4223
189d8422
BG
4224(define-public lshw
4225 (package
4226 (name "lshw")
4227 (version "B.02.18")
4228 (source (origin
4229 (method url-fetch)
4230 (uri (string-append "https://www.ezix.org/software/"
4231 "files/lshw-" version
4232 ".tar.gz"))
4233 (sha256
4234 (base32
4235 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4236 (build-system gnu-build-system)
4237 (arguments
4238 `(#:phases (modify-phases %standard-phases (delete 'configure))
4239 #:tests? #f ; no tests
4240 #:make-flags
4241 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4242 (synopsis "List hardware information")
4243 (description
4244 "@command{lshw} (Hardware Lister) is a small tool to provide
4245detailed information on the hardware configuration of the machine.
4246It can report exact memory configuration, firmware version, mainboard
4247configuration, CPU version and speed, cache configuration, bus speed,
4248and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4249machines (PowerMac G4 is known to work).")
4250 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4251 (license license:gpl2+)))
2f4a58b5
LF
4252
4253(define-public libmnl
4254 (package
4255 (name "libmnl")
4256 (version "1.0.4")
4257 (source
4258 (origin
4259 (method url-fetch)
f11ae44f 4260 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
4261 "libmnl-" version ".tar.bz2"))
4262 (sha256
4263 (base32
4264 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4265 (build-system gnu-build-system)
4266 (home-page "https://www.netfilter.org/projects/libmnl/")
4267 (synopsis "Netlink utility library")
4268 (description "Libmnl is a minimalistic user-space library oriented to
4269Netlink developers. There are a lot of common tasks in parsing, validating,
4270constructing of both the Netlink header and TLVs that are repetitive and easy to
4271get wrong. This library aims to provide simple helpers that allows you to
4272re-use code and to avoid re-inventing the wheel.")
4273 (license license:lgpl2.1+)))
b754c612
LF
4274
4275(define-public libnftnl
4276 (package
4277 (name "libnftnl")
b85c1858 4278 (version "1.1.0")
b754c612
LF
4279 (source
4280 (origin
4281 (method url-fetch)
f11ae44f 4282 (uri (string-append "mirror://netfilter.org/libnftnl/"
b754c612
LF
4283 "libnftnl-" version ".tar.bz2"))
4284 (sha256
4285 (base32
b85c1858 4286 "0v4gywcjvv2vg4zk632al1zv3ad0lx87nshynv110l8n3fhsq3pc"))))
b754c612
LF
4287 (build-system gnu-build-system)
4288 (native-inputs
4289 `(("pkg-config" ,pkg-config)))
4290 (inputs
4291 `(("libmnl" ,libmnl)))
4292 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4293 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4294 (description "Libnftnl is a userspace library providing a low-level netlink
4295programming interface to the in-kernel nf_tables subsystem. The library
4296libnftnl has been previously known as libnftables. This library is currently
4297used by nftables.")
4298 (license license:gpl2+)))
62b28c0e 4299
dfe93c9a
RH
4300(define-public nftables
4301 (package
4302 (name "nftables")
0646461a 4303 (version "0.8.1")
dfe93c9a
RH
4304 (source
4305 (origin
4306 (method url-fetch)
4307 (uri (string-append "http://www.nftables.org/projects/nftables"
4308 "/files/nftables-" version ".tar.bz2"))
4309 (sha256
4310 (base32
0646461a 4311 "1i1gfy8l7qyhc5vlrpp63s0n5kybmc9pi4dywiq8rmkhrrnddsla"))))
dfe93c9a 4312 (build-system gnu-build-system)
c695fb76
TGR
4313 (inputs `(("bison" ,bison)
4314 ("flex" ,flex)
4315 ("gmp" ,gmp)
4316 ("libmnl" ,libmnl)
4317 ("libnftnl" ,libnftnl)
4318 ("readline" ,readline)))
4319 (native-inputs `(("pkg-config" ,pkg-config)))
dfe93c9a
RH
4320 (home-page "http://www.nftables.org")
4321 (synopsis "Userspace utility for Linux packet filtering")
4322 (description "nftables is the project that aims to replace the existing
4323{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4324filtering framework, a new userspace utility and also a compatibility layer for
4325{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4326infrastructure such as the existing hooks, the connection tracking system, the
4327userspace queueing component and the logging subsystem.")
4328 (license license:gpl2)))
4329
62b28c0e
LC
4330(define-public proot
4331 (package
4332 (name "proot")
4333 (version "5.1.0")
4334 (home-page "https://github.com/proot-me/PRoot")
4335 (source (origin
4336 (method url-fetch)
4337 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4338 (file-name (string-append name "-" version ".tar.gz"))
4339 (sha256
4340 (base32
4341 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4342 (patches (search-patches "proot-test-fhs.patch"))))
4343 (build-system gnu-build-system)
4344 (arguments
4345 '(#:make-flags '("-C" "src")
4346
4347 #:phases (modify-phases %standard-phases
4348 (delete 'configure)
4349 (add-before 'build 'set-shell-file-name
4350 (lambda* (#:key inputs #:allow-other-keys)
4351 (substitute* (find-files "src" "\\.[ch]$")
4352 (("\"/bin/sh\"")
4353 (string-append "\""
4354 (assoc-ref inputs "bash")
4355 "/bin/sh\"")))
4356 #t))
4357 (add-before 'check 'fix-fhs-assumptions-in-tests
4358 (lambda _
4359 (substitute* "tests/test-c6b77b77.mk"
4360 (("/bin/bash") (which "bash"))
4361 (("/usr/bin/test") (which "test")))
4362 (substitute* '("tests/test-16573e73.c")
4363 (("/bin/([a-z-]+)" _ program)
4364 (which program)))
4365
4366 (substitute* (find-files "tests" "\\.sh$")
4367 ;; Some of the tests try to "bind-mount" /bin/true.
4368 (("-b /bin/true:")
4369 (string-append "-b " (which "true") ":"))
4370 ;; Likewise for /bin.
4371 (("-b /bin:") "-b /gnu:")
4372 ;; Others try to run /bin/sh.
4373 (("/bin/sh") (which "sh"))
4374 ;; Others assume /etc/fstab exists.
4375 (("/etc/fstab") "/etc/passwd"))
4376
4377 (substitute* "tests/GNUmakefile"
4378 (("-b /bin:") "-b /gnu:"))
4379
4380 ;; XXX: This test fails in an obscure corner case, just
4381 ;; skip it.
4382 (delete-file "tests/test-kkkkkkkk.c")
4383
4384 #t))
4385 (replace 'check
4386 (lambda _
4387 (let ((n (parallel-job-count)))
4388 ;; For some reason we get lots of segfaults with
4389 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4390 (setenv "PROOT_NO_SECCOMP" "1")
4391
4392 ;; Most of the tests expect "/bin" to be in $PATH so
4393 ;; they can run things that live in $ROOTFS/bin.
4394 (setenv "PATH"
4395 (string-append (getenv "PATH") ":/bin"))
4396
06153a30
MW
4397 (invoke "make" "check" "-C" "tests"
4398 ;;"V=1"
4399 "-j" (number->string n)))))
62b28c0e
LC
4400 (replace 'install
4401 (lambda* (#:key outputs #:allow-other-keys)
4402 ;; The 'install' rule does nearly nothing.
06153a30
MW
4403 (let* ((out (assoc-ref outputs "out"))
4404 (man1 (string-append out "/share/man/man1")))
4405 ;; TODO: 'make install-care' (does not even
4406 ;; build currently.)
4407 (invoke "make" "-C" "src" "install"
4408 (string-append "PREFIX=" out))
4409
4410 (mkdir-p man1)
4411 (copy-file "doc/proot/man.1"
4412 (string-append man1 "/proot.1"))
4413 #t))))))
62b28c0e
LC
4414 (native-inputs `(("which" ,which)
4415
4416 ;; For 'mcookie', used by some of the tests.
4417 ("util-linux" ,util-linux)))
4418 (inputs `(("talloc" ,talloc)))
4419 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4420 (description
4421 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4422and @code{binfmt_misc}. This means that users don't need any privileges or
4423setup to do things like using an arbitrary directory as the new root
162a1374 4424file system, making files accessible somewhere else in the file system
62b28c0e
LC
4425hierarchy, or executing programs built for another CPU architecture
4426transparently through QEMU user-mode. Also, developers can use PRoot as a
4427generic process instrumentation engine thanks to its extension mechanism.
4428Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4429available in the kernel Linux.")
4430 (license license:gpl2+)))
b9048a14
LC
4431
4432(define-public proot-static
4433 (package
4434 (inherit proot)
4435 (name "proot-static")
4436 (synopsis
4437 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4438 (inputs `(("talloc" ,talloc/static)))
4439 (arguments
4440 (substitute-keyword-arguments (package-arguments proot)
4441 ((#:make-flags flags)
4442 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4443 ((#:phases phases)
4444 `(modify-phases ,phases
4445 (add-after 'strip 'remove-store-references
4446 (lambda* (#:key outputs #:allow-other-keys)
4447 (let* ((out (assoc-ref outputs "out")))
4448 (with-directory-excursion out
4449 (remove-store-references "bin/proot")
4450 #t))))))
4451 ((#:allowed-references _ '("out"))
4452 '("out"))))))
1113386b
CL
4453
4454(define-public cpuid
4455 (package
4456 (name "cpuid")
ad21323c 4457 (version "20180519")
1113386b
CL
4458 (source (origin
4459 (method url-fetch)
4460 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4461 version ".src.tar.gz"))
4462 (sha256
4463 (base32
ad21323c 4464 "16pzwyifc9glpk1hm6bqb5d1a7cw0qnqiamh5sbvqg7j6sz26y4n"))))
1113386b
CL
4465 (build-system gnu-build-system)
4466 (arguments
4467 '(#:make-flags '("CC=gcc")
fb9232d7 4468 #:tests? #f ; no tests
1113386b 4469 #:phases (modify-phases %standard-phases
fb9232d7 4470 (delete 'configure) ; no configure script
1113386b
CL
4471 (add-before 'install 'fix-makefile
4472 (lambda* (#:key outputs #:allow-other-keys)
4473 (substitute* "Makefile"
4474 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4475 ;; Make the compressed manpages writable so that the
4476 ;; reset-gzip-timestamps phase does not error out.
4477 (substitute* "Makefile"
4478 (("-m 444") "-m 644"))
4479 #t)))))
4480 (inputs `(("perl" ,perl)))
4481 (supported-systems '("i686-linux" "x86_64-linux"))
4482 (home-page "http://www.etallen.com/cpuid.html")
4483 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4484 (description "cpuid dumps detailed information about the CPU(s) gathered
4485from the CPUID instruction, and also determines the exact model of CPU(s). It
4486supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4487NexGen, Rise, and SiS CPUs.")
4488 (license license:gpl2+)))
afc9d8ec
LF
4489
4490(define-public jmtpfs
4491 (package
4492 (name "jmtpfs")
4493 (version "0.5")
4494 (source
4495 (origin
4496 (method url-fetch)
4497 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4498 version ".tar.gz"))
4499 (file-name (string-append name "-" version ".tar.gz"))
4500 (sha256
4501 (base32
4502 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4503 (build-system gnu-build-system)
4504 (inputs
4505 `(("file" ,file)
4506 ("fuse" ,fuse)
4507 ("libmtp" ,libmtp)))
4508 (native-inputs
4509 `(("pkg-config" ,pkg-config)))
4510 (home-page "https://github.com/JasonFerrara/jmtpfs")
162a1374
TGR
4511 (synopsis "Use a FUSE file system to access data over MTP")
4512 (description "jmtpfs uses FUSE (file system in userspace) to provide access
afc9d8ec 4513to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
162a1374 4514the MTP device as a file system.")
afc9d8ec 4515 (license license:gpl3)))
a73e7dd3
DL
4516
4517(define-public procenv
4518 (package
4519 (name "procenv")
cb9b1a04 4520 (version "0.50")
a73e7dd3
DL
4521 (source
4522 (origin
4523 (method url-fetch)
4524 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4525 version ".tar.gz"))
4526 (file-name (string-append name "-" version ".tar.gz"))
4527 (sha256
cb9b1a04 4528 (base32 "0dvscyf47i3j5ay0amncqmqw9kd916689r2pqdvpnsrhp6j46zp1"))))
a73e7dd3
DL
4529 (build-system gnu-build-system)
4530 (arguments `(#:configure-flags '("--disable-silent-rules")))
86574116 4531 (native-inputs `(("pkg-config" ,pkg-config)))
a73e7dd3
DL
4532 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4533 ("groff" ,groff) ; for tests
4534 ("libselinux" ,libselinux)))
4535 (synopsis "Utility to show process environment")
4536 (description "Procenv is a command-line tool that displays as much detail about
4537itself and its environment as possible. It can be used as a test
4538tool, to understand the type of environment a process runs in, and for
4539comparing system environments.")
4540 (home-page "http://github.com/jamesodhunt/procenv/")
4541 (license license:gpl3+)))
ae5947b0
DL
4542
4543(define-public libfabric
4544 (package
4545 (name "libfabric")
4546 (version "1.4.1")
4547 (source
4548 (origin
4549 (method url-fetch)
4550 (uri
4551 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4552 version "/libfabric-" version ".tar.bz2"))
4553 (sha256
4554 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4555 (build-system gnu-build-system)
4556 (inputs `(("rdma-core" ,rdma-core)
91298042
EF
4557 ,@(match (%current-system)
4558 ((member (package-supported-systems psm))
4559 `(("psm" ,psm)))
4560 (_ `()))
ae5947b0
DL
4561 ("libnl" ,libnl)))
4562 (home-page "https://ofiwg.github.io/libfabric/")
4563 (synopsis "Open Fabric Interfaces")
4564 (description
4565 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4566communication services to applications. OFI is best described as a collection
4567of libraries and applications used to export fabric services. The key
4568components of OFI are: application interfaces, provider libraries, kernel
4569services, daemons, and test applications.
4570
4571Libfabric is a core component of OFI. It is the library that defines and
4572exports the user-space API of OFI, and is typically the only software that
4573applications deal with directly. It works in conjunction with provider
4574libraries, which are often integrated directly into libfabric.")
4575 (license (list license:bsd-2 license:gpl2)))) ;dual
fd23d259
DL
4576
4577(define-public psm
4578 (package
4579 (name "psm")
4580 (version "3.3.20170428")
b50a9cc0 4581 (home-page "https://github.com/intel/psm")
fd23d259
DL
4582 (source
4583 (origin
4584 (method git-fetch)
b50a9cc0 4585 (uri (git-reference (url home-page)
fd23d259
DL
4586 (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b")))
4587 (file-name (string-append "psm-" version ".tar.gz"))
4588 (sha256
4589 (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85"))
4590 (patches (search-patches
4591 "psm-arch.patch" ; uname -p returns "unknown" on Debian 9
4592 "psm-ldflags.patch" ; build shared lib with LDFLAGS
4593 "psm-repro.patch")))) ; reproducibility
4594 (build-system gnu-build-system)
4595 (inputs `(("libuuid" ,util-linux)))
4596 (arguments
4597 '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR="
4598 ,(string-append "INSTALL_PREFIX=" %output)
4599 ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4600 #:tests? #f
4601 #:phases (modify-phases %standard-phases
4602 (delete 'configure)
4603 (add-after 'unpack 'patch-/usr/include
4604 (lambda _
4605 (substitute* "Makefile"
4606 (("\\$\\{DESTDIR}/usr/include")
4607 (string-append %output "/include")))
4608 (substitute* "Makefile"
4609 (("/lib64") "/lib"))
4610 #t)))))
fd23d259
DL
4611 (synopsis "Intel Performance Scaled Messaging (PSM) Libraries")
4612 (description
4613 "The PSM Messaging API, or PSM API, is Intel's low-level user-level
4614communications interface for the True Scale family of products. PSM users are
4615enabled with mechanisms necessary to implement higher level communications
4616interfaces in parallel environments.")
b516b780
EF
4617 ;; Only Intel-compatable processors are supported.
4618 (supported-systems '("i686-linux" "x86_64-linux"))
fd23d259 4619 (license (list license:bsd-2 license:gpl2)))) ;dual
c1c82584
TGR
4620
4621(define-public snapscreenshot
4622 (package
4623 (name "snapscreenshot")
4624 (version "1.0.14.3")
4625 (source
4626 (origin
4627 (method url-fetch)
4628 (uri (string-append "http://bisqwit.iki.fi/src/arch/"
4629 name "-" version ".tar.bz2"))
4630 (sha256
4631 (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk"))))
4632 (build-system gnu-build-system)
4633 (arguments
4634 `(#:make-flags
4635 (let ((out (assoc-ref %outputs "out")))
4636 (list (string-append "BINDIR=" out "/bin")
4637 (string-append "MANDIR=" out "/share/man")))
4638 #:tests? #f ; no test suite
4639 #:phases
4640 (modify-phases %standard-phases
4641 (delete 'configure) ; ./configure is a snarky no-op
4642 (add-before 'install 'fix-ownership
4643 ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’.
4644 (lambda _
4645 (substitute* "depfun.mak"
4646 ((" -o bin -g bin ") " "))
4647 #t))
4648 (add-before 'install 'create-output-directories
4649 (lambda* (#:key outputs #:allow-other-keys)
4650 (let ((out (assoc-ref outputs "out")))
4651 (mkdir-p (string-append out "/share/man/man1"))
4652 #t))))))
81e59e41 4653 (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html")
c1c82584
TGR
4654 (synopsis "Take screenshots of one or more Linux text consoles")
4655 (description
4656 "snapscreenshot saves a screenshot of one or more Linux text consoles as a
4657Targa (@dfn{.tga}) image. It can be used by anyone with read access to the
4658relevant @file{/dev/vcs*} file(s).")
4659 (license license:gpl2)))
8d8d227b
TGR
4660
4661(define-public fbcat
4662 (package
4663 (name "fbcat")
7f86e5e7 4664 (version "0.5.1")
8d8d227b
TGR
4665 (source
4666 (origin
4667 (method url-fetch)
4668 (uri (string-append "https://github.com/jwilk/fbcat/releases/download/"
4669 version "/" name "-" version ".tar.gz"))
4670 (sha256
7f86e5e7 4671 (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7"))))
8d8d227b 4672 (build-system gnu-build-system)
8d8d227b
TGR
4673 (inputs
4674 ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We
4675 ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB
4676 ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output.
4677 `(("pnmtopng" ,netpbm)))
4678 (outputs (list "out" "fbgrab"))
4679 (arguments
7f86e5e7
TGR
4680 `(#:make-flags
4681 (list "CC=gcc"
4682 (string-append "PREFIX=" (assoc-ref %outputs "out")))
8d8d227b
TGR
4683 #:tests? #f ; no tests
4684 #:phases
4685 (modify-phases %standard-phases
8d8d227b 4686 (delete 'configure) ; no configure script
8d8d227b
TGR
4687 (add-after 'build 'qualify-references
4688 (lambda* (#:key inputs outputs #:allow-other-keys)
4689 (let* ((pnmtopng (assoc-ref inputs "pnmtopng"))
4690 (out (assoc-ref outputs "out")))
4691 (substitute* "fbgrab"
4692 (("fbcat" all)
4693 (string-append out "/bin/" all))
4694 (("pnmtopng" all)
4695 (string-append pnmtopng "/bin/" all)))
4696 #t)))
7f86e5e7 4697 (add-after 'install 'split-fbgrab-output
8d8d227b
TGR
4698 (lambda* (#:key outputs #:allow-other-keys)
4699 (let* ((out (assoc-ref outputs "out"))
4700 (out:fbgrab (assoc-ref outputs "fbgrab")))
7f86e5e7
TGR
4701 (for-each (lambda (file)
4702 (let ((old (string-append out "/" file))
4703 (new (string-append out:fbgrab "/" file)))
4704 (mkdir-p (dirname new))
4705 (rename-file old new)))
4706 (list "bin/fbgrab"
4707 "share/man/man1/fbgrab.1"))
8d8d227b
TGR
4708 #t))))))
4709 (home-page "https://jwilk.net/software/fbcat")
4710 (synopsis "Take a screenshot of the contents of the Linux framebuffer")
4711 (description
4712 "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or
4713a dump therof. It supports a wide range of drivers and pixel formats.
4714@command{fbcat} can take screenshots of virtually any application that can be
4715made to write its output to the framebuffer, including (but not limited to)
4716text-mode or graphical applications that don't use a display server.
4717
4718Also included is @command{fbgrab}, a wrapper around @command{fbcat} that
4719emulates the behaviour of Gunnar Monell's older fbgrab utility.")
4720 (license license:gpl2)))
a69e0cf3
4721
4722(define-public libcgroup
4723 (package
4724 (name "libcgroup")
4725 (version "0.41")
4726 (source
4727 (origin
4728 (method url-fetch)
4729 (uri (string-append
4730 "mirror://sourceforge/libcg/" name "/"
4731 version "/" name "-" version ".tar.bz2"))
4732 (sha256
4733 (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4"))))
4734 (build-system gnu-build-system)
4735 (arguments
4736 `(#:tests? #f))
4737 (native-inputs
4738 `(("bison" ,bison)
4739 ("flex" ,flex)))
4740 (inputs
4741 `(("linux-pam" ,linux-pam)))
4742 (home-page "https://sourceforge.net/projects/libcg/")
4743 (synopsis "Control groups management tools")
4744 (description "Control groups is Linux kernel method for process resource
4745restriction, permission handling and more. This package provides userspace
4746interface to this kernel feature.")
4747 (license license:lgpl2.1)))
5849c68a
R
4748
4749(define-public mbpfan
4750 (package
4751 (name "mbpfan")
4752 (version "2.0.2")
4753 (source
4754 (origin
4755 (method url-fetch)
4756 (uri (string-append "https://github.com/dgraziotin/mbpfan/archive/v"
4757 version ".tar.gz"))
4758 (file-name (string-append name "-" version ".tar.gz"))
4759 (sha256
4760 (base32
4761 "0wifsws9icki95hhfh4zw1hmk07ddmkcz9mg5a9jr7q2kkrk01cx"))))
4762 (build-system gnu-build-system)
4763 (arguments
4764 '(#:tests? #f ; no tests
4765 #:make-flags (let ((out (assoc-ref %outputs "out")))
4766 (list (string-append "DESTDIR=" out)
4767 "CC=gcc"))
4768 #:phases
4769 (modify-phases %standard-phases
4770 (add-after 'unpack 'patch-paths
4771 (lambda _
4772 (substitute* "Makefile"
4773 (("/usr") ""))
4774 #t))
4775 (delete 'configure)))) ; There's no configure phase.
4776 (home-page "https://github.com/dgraziotin/mbpfan")
4777 (synopsis "Control fan speed on Macbooks")
4778 (description
4779 "mbpfan is a fan control daemon for Apple Macbooks. It uses input from
4780the @code{coretemp} module and sets the fan speed using the @code{applesmc}
4781module. It can be executed as a daemon or in the foreground with root
4782privileges.")
4783 (license license:gpl3+)))
25637b77
PAR
4784
4785(define-public psm2
4786 (package
4787 (name "psm2")
4788 (version "10.3-46")
4789 (source (origin
4790 (method git-fetch)
4791 (uri (git-reference
4792 (url "https://github.com/intel/opa-psm2.git")
4793 (commit (string-append "PSM2_" version))))
4794 (file-name (git-file-name name version))
4795 (sha256
4796 (base32
4797 "0wadphv4rl5p38x6a3dgpbijlzqdvcn02cfafnp72nh9faz0zvlx"))))
4798 (build-system gnu-build-system)
4799 (arguments
4800 '(#:make-flags
4801 `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
4802 #:tests? #f
4803 #:phases (modify-phases %standard-phases
4804 (delete 'configure)
4805 (add-after 'unpack 'patch-Makefiles
4806 (lambda _
4807 (substitute* "Makefile"
4808 (("/lib64") "/lib")
4809 (("/usr") ""))
4810 (substitute* "compat/Makefile"
4811 (("/lib64") "/lib")
4812 (("/usr") ""))
4813 #t))
4814 (replace 'install
4815 (lambda _
4816 (setenv "DESTDIR" %output)
4817 (invoke "make" "install")
4818 #t)))))
4819 (inputs
4820 `(("rdma-core" ,rdma-core)
4821 ("numactl" ,numactl)))
4822 (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library")
4823 (description
4824 "This package is low-level user-level Intel's communications interface.
4825The PSM2 API is a high-performance vendor-specific protocol that provides a
4826low-level communications interface for the Intel Omni-Path family of
4827high-speed networking devices.")
4828 (home-page "https://github.com/intel/opa-psm2")
4829 ;; Only the x86_64 architecure is supported.
4830 (supported-systems '("x86_64-linux"))
4831 (license (list license:bsd-3 license:gpl2)))) ; dual
2690b6ce
PAR
4832
4833(define-public libpfm4
4834 (package
4835 (name "libpfm4")
4836 (version "4.9.0")
4837 (source (origin
4838 (method url-fetch)
4839 (uri (string-append "mirror://sourceforge/perfmon2/"
4840 name "/libpfm-" version ".tar.gz"))
4841 (sha256
4842 (base32
4843 "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv"))))
4844 (build-system gnu-build-system)
4845 (arguments
4846 '(#:modules ((guix build utils)
4847 (guix build gnu-build-system))
4848 #:phases (modify-phases %standard-phases
4849 (delete 'configure)
4850 (delete 'check)
4851 (replace 'build
4852 (lambda* (#:key inputs outputs #:allow-other-keys)
4853 (let* ((out (assoc-ref outputs "out")))
4854 (setenv "CC" "gcc")
4855 (invoke "make")
4856 #t)))
4857 (replace 'install
4858 (lambda* (#:key outputs #:allow-other-keys)
4859 (let* ((out (assoc-ref outputs "out")))
4860 (invoke "make"
4861 (string-append "PREFIX=" out)
4862 "install")
4863 #t))))))
4864 (synopsis "Performance event monitoring library")
4865 (description
4866 "This package provides a library called libpfm4, which is used to develop
4867monitoring tools exploiting the performance monitoring events such as those
4868provided by the Performance Monitoring Unit (PMU) of modern processors.
4869
4870Libpfm4 helps convert from an event name, expressed as a string, to the event
4871encoding that is either the raw event as documented by the hardware vendor or
4872the OS-specific encoding. In the latter case, the library is able to prepare
4873the OS-specific data structures needed by the kernel to setup the event.
4874
4875libpfm4 provides support for the @code{perf_events} interface, which was
4876introduced in Linux 2.6.31.")
4877 (home-page "http://perfmon2.sourceforge.net/")
4878 (license license:expat)))
4dd1fb79
SB
4879
4880(define-public libnfnetlink
4881 (package
4882 (name "libnfnetlink")
4883 (version "1.0.1")
4884 (source (origin
4885 (method url-fetch)
4886 (uri (string-append
4887 "https://www.netfilter.org/projects/libnfnetlink/files/"
4888 "libnfnetlink-" version ".tar.bz2"))
4889 (sha256
4890 (base32
4891 "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j"))))
4892 (build-system gnu-build-system)
4893 (home-page "https://www.netfilter.org/projects/libnfnetlink/")
4894 (synopsis "Low-level netfilter netlink communication library")
4895 (description
4896 "@code{libnfnetlink} is the low-level library for netfilter related
4897kernel/userspace communication. It provides a generic messaging
4898infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log,
4899nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or
4900management tools in userspace.")
4901 (license license:gpl2)))