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