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