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