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