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