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