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