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