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