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