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