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