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