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