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