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