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