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