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