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