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