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