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