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