gnu: fio: Enable rbd support.
[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>
75fd35b6 5;;; Copyright © 2014, 2015, 2016, 2017 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>
ebf89f13 8;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
cd7caa3e 10;;; Copyright © 2016, 2017 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>
0d74462a 18;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
411264c2 19;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
7d2511bc 20;;; Copyright © 2016 ng0 <ng0@libertad.pw>
6d3e08d4 21;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
01be4f93 22;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
189d8422 23;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
c7adafa7 24;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
fd76c904 25;;;
233e7676 26;;; This file is part of GNU Guix.
fd76c904 27;;;
233e7676 28;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
29;;; under the terms of the GNU General Public License as published by
30;;; the Free Software Foundation; either version 3 of the License, or (at
31;;; your option) any later version.
32;;;
233e7676 33;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
34;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36;;; GNU General Public License for more details.
37;;;
38;;; You should have received a copy of the GNU General Public License
233e7676 39;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 40
1ffa7090 41(define-module (gnu packages linux)
59a43334 42 #:use-module (gnu packages)
0c60cc53 43 #:use-module (gnu packages acl)
75750abb
DC
44 #:use-module (gnu packages admin)
45 #:use-module (gnu packages algebra)
46 #:use-module (gnu packages attr)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages base)
c7adafa7 49 #:use-module (gnu packages bash)
75750abb
DC
50 #:use-module (gnu packages bison)
51 #:use-module (gnu packages calendar)
52 #:use-module (gnu packages check)
e385e957 53 #:use-module (gnu packages crypto)
f61e0e79 54 #:use-module (gnu packages compression)
75750abb
DC
55 #:use-module (gnu packages databases)
56 #:use-module (gnu packages docbook)
57 #:use-module (gnu packages documentation)
58 #:use-module (gnu packages elf)
1ffa7090 59 #:use-module (gnu packages flex)
75750abb
DC
60 #:use-module (gnu packages freedesktop)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages gettext)
63 #:use-module (gnu packages glib)
e385e957 64 #:use-module (gnu packages gnuzilla)
d7d42d6b 65 #:use-module (gnu packages gperf)
75750abb 66 #:use-module (gnu packages gtk)
1ffa7090 67 #:use-module (gnu packages libusb)
01be4f93 68 #:use-module (gnu packages man)
75750abb 69 #:use-module (gnu packages maths)
1ffa7090 70 #:use-module (gnu packages ncurses)
c7adafa7 71 #:use-module (gnu packages networking)
1ffa7090 72 #:use-module (gnu packages perl)
75750abb 73 #:use-module (gnu packages pciutils)
1ffa7090 74 #:use-module (gnu packages pkg-config)
0d74462a 75 #:use-module (gnu packages popt)
75750abb 76 #:use-module (gnu packages pulseaudio)
7c0dbe78 77 #:use-module (gnu packages python)
75750abb
DC
78 #:use-module (gnu packages readline)
79 #:use-module (gnu packages rrdtool)
b1fb4b23 80 #:use-module (gnu packages slang)
f57d2639 81 #:use-module (gnu packages texinfo)
75343704 82 #:use-module (gnu packages tls)
7d2511bc 83 #:use-module (gnu packages video)
84 #:use-module (gnu packages xiph)
75750abb 85 #:use-module (gnu packages xml)
58c4f11e
TGR
86 #:use-module (gnu packages xdisorg)
87 #:use-module (gnu packages xorg)
220193ad 88 #:use-module (guix build-system cmake)
75750abb 89 #:use-module (guix build-system gnu)
e102f940 90 #:use-module (guix build-system python)
a94546ec 91 #:use-module (guix build-system trivial)
75750abb
DC
92 #:use-module (guix download)
93 #:use-module ((guix licenses) #:prefix license:)
94 #:use-module (guix packages)
95 #:use-module (guix utils)
adddd5ba 96 #:use-module (srfi srfi-1)
17db0706 97 #:use-module (srfi srfi-2)
a94546ec
LC
98 #:use-module (srfi srfi-26)
99 #:use-module (ice-9 match))
fd76c904 100
aaf4cb20
LC
101(define-public (system->linux-architecture arch)
102 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 103\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
104 (let ((arch (car (string-split arch #\-))))
105 (cond ((string=? arch "i686") "i386")
106 ((string-prefix? "mips" arch) "mips")
aaf4cb20 107 ((string-prefix? "arm" arch) "arm")
503275e9 108 ((string-prefix? "aarch64" arch) "arm64")
605fec78 109 ((string-prefix? "alpha" arch) "alpha")
618cea69
NK
110 (else arch))))
111
6023cc74
LC
112(define (linux-libre-urls version)
113 "Return a list of URLs for Linux-Libre VERSION."
114 (list (string-append
115 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
116 version "-gnu/linux-libre-" version "-gnu.tar.xz")
117
118 ;; XXX: Work around <http://bugs.gnu.org/14851>.
119 (string-append
120 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
121 version "-gnu.tar.xz")
122
123 ;; Maybe this URL will become valid eventually.
124 (string-append
125 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
126 version "-gnu.tar.xz")))
127
80fe5c60 128(define-public linux-libre-headers
b450d2b4
DC
129 (package
130 (name "linux-libre-headers")
131 (version "4.4.18")
132 (source (origin
133 (method url-fetch)
134 (uri (linux-libre-urls version))
135 (sha256
136 (base32
137 "0k8k17in7dkjd9d8zg3i8l1ax466dba6bxw28flxizzyq8znljps"))))
138 (build-system gnu-build-system)
139 (native-inputs `(("perl" ,perl)))
140 (arguments
141 `(#:modules ((guix build gnu-build-system)
142 (guix build utils)
143 (srfi srfi-1))
144 #:phases
145 (modify-phases %standard-phases
146 (delete 'configure)
147 (replace 'build
148 (lambda _
149 (let ((arch ,(system->linux-architecture
150 (or (%current-target-system)
151 (%current-system)))))
152 (setenv "ARCH" arch)
618cea69 153 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 154
618cea69
NK
155 (and (zero? (system* "make" "defconfig"))
156 (zero? (system* "make" "mrproper" "headers_check"))))))
b450d2b4
DC
157 (replace 'install
158 (lambda* (#:key outputs #:allow-other-keys)
80fe5c60
LC
159 (let ((out (assoc-ref outputs "out")))
160 (and (zero? (system* "make"
161 (string-append "INSTALL_HDR_PATH=" out)
162 "headers_install"))
b15389e1
LC
163 (begin
164 (mkdir (string-append out "/include/config"))
165 (call-with-output-file
166 (string-append out
167 "/include/config/kernel.release")
168 (lambda (p)
169 (format p "~a-default~%" ,version)))
170
171 ;; Remove the '.install' and '..install.cmd' files; the
172 ;; latter contains store paths, which pulls in bootstrap
173 ;; binaries in the build environment, and prevents bit
174 ;; reproducibility for the bootstrap binaries.
175 (for-each delete-file (find-files out "\\.install"))
176
177 #t))))))
b15389e1 178 #:allowed-references ()
80fe5c60 179 #:tests? #f))
b450d2b4 180 (home-page "http://www.gnu.org/software/linux-libre")
80fe5c60
LC
181 (synopsis "GNU Linux-Libre kernel headers")
182 (description "Headers of the Linux-Libre kernel.")
b450d2b4 183 (license license:gpl2)))
80fe5c60 184
ac47a7c2
LC
185(define %boot-logo-patch
186 ;; Linux-Libre boot logo featuring Freedo and a gnu.
187 (origin
188 (method url-fetch)
189 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 190 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
191 (sha256
192 (base32
193 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
194
c258807a 195(define* (kernel-config arch #:key variant)
a94546ec 196 "Return the absolute file name of the Linux-Libre build configuration file
c258807a 197for ARCH and optionally VARIANT, or #f if there is no such configuration."
7994250f 198 (let* ((name (string-append (if variant (string-append variant "-") "")
25847b32 199 (if (string=? "i386" arch) "i686" arch) ".conf"))
7994250f
AK
200 (file (string-append "linux-libre/" name)))
201 (search-auxiliary-file file)))
a94546ec 202
90c18c32 203(define %default-extra-linux-options
50dbc036 204 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
b9f7895d
DC
205 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
206 ;; Modules required for initrd:
207 ("CONFIG_NET_9P" . m)
208 ("CONFIG_NET_9P_VIRTIO" . m)
209 ("CONFIG_VIRTIO_BLK" . m)
210 ("CONFIG_VIRTIO_NET" . m)
211 ("CONFIG_VIRTIO_PCI" . m)
212 ("CONFIG_VIRTIO_BALLOON" . m)
213 ("CONFIG_VIRTIO_MMIO" . m)
214 ("CONFIG_FUSE_FS" . m)
215 ("CONFIG_CIFS" . m)
216 ("CONFIG_9P_FS" . m)))
90c18c32
DC
217
218(define (config->string options)
219 (string-join (map (match-lambda
220 ((option . 'm)
221 (string-append option "=m"))
222 ((option . #t)
223 (string-append option "=y"))
224 ((option . #f)
225 (string-append option "=n")))
226 options)
227 "\n"))
228
3129b9c2 229(define* (make-linux-libre version hash supported-systems
c258807a
DC
230 #:key
231 ;; A function that takes an arch and a variant.
232 ;; See kernel-config for an example.
a6d01325 233 (extra-version #f)
c258807a 234 (configuration-file #f)
90c18c32 235 (defconfig "defconfig")
64de7d1c
MW
236 (extra-options %default-extra-linux-options)
237 (patches (list %boot-logo-patch)))
614d1738 238 (package
a6d01325
DC
239 (name (if extra-version
240 (string-append "linux-libre-" extra-version)
241 "linux-libre"))
c258807a 242 (version version)
614d1738
DC
243 (source (origin
244 (method url-fetch)
245 (uri (linux-libre-urls version))
c258807a 246 (sha256 (base32 hash))
64de7d1c 247 (patches patches)))
3129b9c2 248 (supported-systems supported-systems)
614d1738 249 (build-system gnu-build-system)
614d1738
DC
250 (native-inputs
251 `(("perl" ,perl)
252 ("bc" ,bc)
253 ("openssl" ,openssl)
78edcccc 254 ("kmod" ,kmod)
64b5e413
LC
255 ,@(match (and configuration-file
256 (configuration-file
257 (system->linux-architecture
258 (or (%current-target-system) (%current-system)))
259 #:variant (version-major+minor version)))
260 (#f ;no config for this platform
261 '())
262 ((? string? config)
263 `(("kconfig" ,config))))))
614d1738
DC
264 (arguments
265 `(#:modules ((guix build gnu-build-system)
266 (guix build utils)
267 (srfi srfi-1)
268 (ice-9 match))
269 #:phases
270 (modify-phases %standard-phases
9416459b 271 (replace 'configure
4b42703e 272 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
96e9f097
RN
273 ;; Avoid introducing timestamps
274 (setenv "KCONFIG_NOTIMESTAMP" "1")
275 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
276
4b42703e 277 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
278 (let ((arch ,(system->linux-architecture
279 (or (%current-target-system)
280 (%current-system)))))
4b42703e
DC
281 (setenv "ARCH" arch)
282 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 283
4b42703e
DC
284 (when target
285 (setenv "CROSS_COMPILE" (string-append target "-"))
286 (format #t "`CROSS_COMPILE' set to `~a'~%"
287 (getenv "CROSS_COMPILE"))))
beacfcab 288
a6d01325
DC
289 (setenv "EXTRA_VERSION" ,extra-version)
290
a94546ec
LC
291 (let ((build (assoc-ref %standard-phases 'build))
292 (config (assoc-ref inputs "kconfig")))
1650dd8a 293
e4e9c0a0
DC
294 ;; Use a custom kernel configuration file or a default
295 ;; configuration file.
1650dd8a
LC
296 (if config
297 (begin
298 (copy-file config ".config")
299 (chmod ".config" #o666))
c258807a 300 (system* "make" ,defconfig))
a94546ec
LC
301
302 ;; Appending works even when the option wasn't in the
303 ;; file. The last one prevails if duplicated.
90c18c32
DC
304 (let ((port (open-file ".config" "a"))
305 (extra-configuration ,(config->string extra-options)))
306 (display extra-configuration port)
a94546ec
LC
307 (close-port port))
308
9416459b 309 (zero? (system* "make" "oldconfig")))))
614d1738 310 (replace 'install
4b42703e 311 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
312 (let* ((out (assoc-ref outputs "out"))
313 (moddir (string-append out "/lib/modules"))
e4e9c0a0
DC
314 (dtbdir (string-append out "/lib/dtbs"))
315 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
316 ;; Install kernel image, kernel configuration and link map.
317 (for-each (lambda (file) (install-file file out))
318 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
319 ;; Install device tree files
320 (for-each (lambda (file) (install-file file dtbdir))
321 (find-files "." "\\.dtb$"))
322 ;; Install kernel modules
beacfcab 323 (mkdir-p moddir)
beacfcab 324 (zero? (system* "make"
78edcccc 325 (string-append "DEPMOD=" kmod "/bin/depmod")
beacfcab
LC
326 (string-append "MODULE_DIR=" moddir)
327 (string-append "INSTALL_PATH=" out)
328 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 329 "INSTALL_MOD_STRIP=1"
beacfcab 330 "modules_install"))))))
beacfcab 331 #:tests? #f))
614d1738 332 (home-page "http://www.gnu.org/software/linux-libre/")
f50d2669 333 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 334 (description
79c311b8
LC
335 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
336It has been modified to remove all non-free binary blobs.")
614d1738 337 (license license:gpl2)))
beacfcab 338
3129b9c2
DC
339(define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
340
9909b8b9
MW
341(define %linux-libre-version "4.10.6")
342(define %linux-libre-hash "01iv39dpqvnmynrvjk3ji5411ywazx96pkjkw4v1bm7jqvc1b7bh")
76e62ef7 343
c258807a 344(define-public linux-libre
76e62ef7
MW
345 (make-linux-libre %linux-libre-version
346 %linux-libre-hash
3129b9c2 347 %intel-compatible-systems
81d6fd24 348 #:configuration-file kernel-config))
c258807a 349
52d901da 350(define-public linux-libre-4.9
cd5ba395
MW
351 (make-linux-libre "4.9.18"
352 "1f8a4z0hjl4j899pzlyblp7wbn6n5r5lxkw0hwy6ml0dm0dkscrj"
52d901da 353 %intel-compatible-systems
f11a48c0 354 #:configuration-file kernel-config))
52d901da 355
75b314a6 356(define-public linux-libre-4.4
8ba0bd1c
MW
357 (make-linux-libre "4.4.57"
358 "18mgf2xvjfqkg62kmffhbpgxgqpizy400b9ndagq3rlx7pcx5v1j"
3129b9c2 359 %intel-compatible-systems
c46d8e92 360 #:configuration-file kernel-config))
75b314a6 361
adddd5ba 362(define-public linux-libre-4.1
9b05ccfe
LF
363 (make-linux-libre "4.1.39"
364 "06pb3zpkfkc7pb7yh537vvzn8i9nhqyx58kqxv0wq23b4hhpza7d"
3129b9c2 365 %intel-compatible-systems
89234419
LF
366 #:configuration-file kernel-config
367 #:patches
368 (list %boot-logo-patch
369 (origin
370 (method url-fetch)
371 (uri "\
372https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/patch/?id=5edabca9d4cff7f1f2b68f0bac55ef99d9798ba4")
373 (file-name "linux-libre-CVE-2017-6074.patch")
374 (sha256
375 (base32
376 "1x40slfz1qxgiaznyy13bwlh34450pkyyrkljpyjlx6c4mrzb1jj"))))))
adddd5ba 377
cde7c23f
DC
378(define-public linux-libre-arm-generic
379 (make-linux-libre %linux-libre-version
380 %linux-libre-hash
381 '("armhf-linux")
382 #:defconfig "multi_v7_defconfig"
81d6fd24 383 #:extra-version "arm-generic"))
cde7c23f 384
97121c2a 385\f
c84d0eca
LC
386;;;
387;;; Pluggable authentication modules (PAM).
388;;;
389
fd76c904
LC
390(define-public linux-pam
391 (package
392 (name "linux-pam")
7483230f 393 (version "1.3.0")
fd76c904
LC
394 (source
395 (origin
396 (method url-fetch)
7483230f
DC
397 (uri (string-append
398 "http://www.linux-pam.org/library/"
399 "Linux-PAM-" version ".tar.bz2"))
fd76c904
LC
400 (sha256
401 (base32
411264c2
RS
402 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
403 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
404
fd76c904 405 (build-system gnu-build-system)
c4c4cc05 406 (native-inputs
fd76c904
LC
407 `(("flex" ,flex)
408
409 ;; TODO: optional dependencies
410 ;; ("libxcrypt" ,libxcrypt)
411 ;; ("cracklib" ,cracklib)
412 ))
413 (arguments
c134056a
LC
414 '(;; Most users, such as `shadow', expect the headers to be under
415 ;; `security'.
416 #:configure-flags (list (string-append "--includedir="
417 (assoc-ref %outputs "out")
418 "/include/security"))
419
420 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
421 ;; isn't available.
422 #:tests? #f))
fd76c904
LC
423 (home-page "http://www.linux-pam.org/")
424 (synopsis "Pluggable authentication modules for Linux")
425 (description
426 "A *Free* project to implement OSF's RFC 86.0.
427Pluggable authentication modules are small shared object files that can
428be used through the PAM API to perform tasks, like authenticating a user
e881752c 429at login. Local and dynamic reconfiguration are its key features.")
3ac73271 430 (license license:bsd-3)))
686f14e8 431
4c93ce42
EF
432(define-public linux-pam-1.2
433 (package
434 (inherit linux-pam)
4c93ce42
EF
435 (version "1.2.1")
436 (source
437 (origin
438 (method url-fetch)
439 (uri (string-append
440 "http://www.linux-pam.org/library/"
441 "Linux-PAM-" version ".tar.bz2"))
442 (sha256
443 (base32
411264c2
RS
444 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
445 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
4c93ce42 446
53142109 447
c84d0eca
LC
448;;;
449;;; Miscellaneous.
450;;;
451
686f14e8
LC
452(define-public psmisc
453 (package
454 (name "psmisc")
455 (version "22.20")
456 (source
457 (origin
458 (method url-fetch)
459 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
460 version ".tar.gz"))
461 (sha256
462 (base32
463 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
464 (build-system gnu-build-system)
465 (inputs `(("ncurses" ,ncurses)))
466 (home-page "http://psmisc.sourceforge.net/")
467 (synopsis
8f65585b 468 "Small utilities that use the proc file system")
686f14e8
LC
469 (description
470 "This PSmisc package is a set of some small useful utilities that
8f65585b 471use the proc file system. We're not about changing the world, but
686f14e8 472providing the system administrator with some help in common tasks.")
3ac73271 473 (license license:gpl2+)))
02b80c3f
NK
474
475(define-public util-linux
476 (package
477 (name "util-linux")
1d311009 478 (replacement util-linux/fixed)
f041616d 479 (version "2.28.1")
5a6a3ba4
LC
480 (source (origin
481 (method url-fetch)
482 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
483 name "/v" (version-major+minor version) "/"
484 name "-" version ".tar.xz"))
5a6a3ba4
LC
485 (sha256
486 (base32
f041616d 487 "03xnaw3c7pavxvvh1vnimcr44hlhhf25whawiyv8dxsflfj4xkiy"))
fc1adab1 488 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
489 (modules '((guix build utils)))
490 (snippet
ec2da92c
LC
491 ;; We take the 'logger' program from GNU Inetutils and 'kill'
492 ;; from GNU Coreutils.
8338c241
MW
493 '(begin
494 (substitute* "configure"
495 (("build_logger=yes") "build_logger=no")
496 (("build_kill=yes") "build_kill=no"))
497 #t))))
02b80c3f 498 (build-system gnu-build-system)
dd581e9a
TGR
499 (outputs '("out"
500 "static")) ; >2 MiB of static .a libraries
02b80c3f 501 (arguments
29ec55ee 502 `(#:configure-flags (list "--disable-use-tty-group"
29ec55ee
LC
503
504 ;; Install completions where our
505 ;; bash-completion package expects them.
506 (string-append "--with-bashcompletiondir="
507 (assoc-ref %outputs "out")
508 "/etc/bash_completion.d"))
1b9cf4ad 509 #:phases (modify-phases %standard-phases
7e512497
LC
510 (add-before
511 'build 'set-umount-file-name
512 (lambda* (#:key outputs #:allow-other-keys)
513 ;; Tell 'eject' the right file name of 'umount'.
514 (let ((out (assoc-ref outputs "out")))
515 (substitute* "sys-utils/eject.c"
516 (("\"/bin/umount\"")
517 (string-append "\"" out "/bin/umount\"")))
518 #t)))
1b9cf4ad
LC
519 (add-before
520 'check 'pre-check
521 (lambda* (#:key inputs outputs #:allow-other-keys)
522 (let ((out (assoc-ref outputs "out"))
523 (net (assoc-ref inputs "net-base")))
524 ;; Change the test to refer to the right file.
525 (substitute* "tests/ts/misc/mcookie"
526 (("/etc/services")
527 (string-append net "/etc/services")))
dd581e9a
TGR
528 #t)))
529 (add-after
530 'install 'move-static-libraries
531 (lambda* (#:key outputs #:allow-other-keys)
532 (let ((out (assoc-ref outputs "out"))
533 (static (assoc-ref outputs "static")))
534 (mkdir-p (string-append static "/lib"))
535 (with-directory-excursion out
536 (for-each (lambda (file)
537 (rename-file file
538 (string-append static "/"
539 file)))
540 (find-files "lib" "\\.a$")))
1b9cf4ad 541 #t))))))
f61e0e79 542 (inputs `(("zlib" ,zlib)
c4c4cc05
JD
543 ("ncurses" ,ncurses)))
544 (native-inputs
9f533d60
LC
545 `(("perl" ,perl)
546 ("net-base" ,net-base))) ;for tests
02b80c3f 547 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 548 (synopsis "Collection of utilities for the Linux kernel")
437d7286 549 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 550utilities. It provides dmesg and includes tools for working with file systems,
437d7286 551block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 552
02b80c3f 553 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 554 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 555 ;; explicitly defined license.
3ac73271
LC
556 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
557 license:bsd-4 license:public-domain))))
5d5c4278 558
1d311009
LF
559(define util-linux/fixed
560 (package
561 (inherit util-linux)
562 (source
563 (origin
564 (inherit (package-source util-linux))
565 (patches
566 (append
567 (origin-patches (package-source util-linux))
568 (search-patches "util-linux-CVE-2017-2616.patch")))))))
569
e47e3eff
LC
570(define-public procps
571 (package
572 (name "procps")
74a3c4bb 573 (version "3.3.12")
e47e3eff 574 (source (origin
0cc22848
SB
575 (method url-fetch)
576 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
577 "procps-ng-" version ".tar.xz"))
578 (sha256
579 (base32
74a3c4bb 580 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
e47e3eff 581 (build-system gnu-build-system)
e47e3eff 582 (arguments
80393eed
LC
583 '(#:modules ((guix build utils)
584 (guix build gnu-build-system)
585 (srfi srfi-1)
586 (srfi srfi-26))
0cc22848
SB
587 #:phases
588 (modify-phases %standard-phases
241826b5
LC
589 (add-before 'check 'disable-strtod-test
590 (lambda _
591 ;; Disable the 'strtod' test, which fails on 32-bit systems.
592 ;; This is what upstream does:
593 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
594 (substitute* "Makefile"
595 (("^(TESTS|check_PROGRAMS) = .*$" all)
596 (string-append "# " all "\n")))
597 #t))
0cc22848
SB
598 (add-after
599 'install 'post-install
600 ;; Remove commands and man pages redudant with
601 ;; Coreutils.
602 (lambda* (#:key outputs #:allow-other-keys)
603 (let* ((out (assoc-ref outputs "out"))
604 (dup (append-map (cut find-files out <>)
605 '("^kill" "^uptime"))))
606 (for-each delete-file dup)
607 #t))))))
608 (inputs `(("ncurses" ,ncurses)))
609 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 610 (synopsis "Utilities that give information about processes")
e47e3eff 611 (description
35b9e423 612 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
613that give information about processes using the Linux /proc file system.
614The package includes the programs ps, top, vmstat, w, kill, free,
615slabtop, and skill.")
3ac73271 616 (license license:gpl2)))
e47e3eff 617
5d5c4278
NK
618(define-public usbutils
619 (package
620 (name "usbutils")
e8a463e6 621 (version "008")
5d5c4278
NK
622 (source
623 (origin
624 (method url-fetch)
625 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
626 "usbutils-" version ".tar.xz"))
627 (sha256
628 (base32
e8a463e6 629 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
5d5c4278
NK
630 (build-system gnu-build-system)
631 (inputs
e8a463e6 632 `(("libusb" ,libusb)
e5d861f3 633 ("eudev" ,eudev-with-hwdb)))
c4c4cc05
JD
634 (native-inputs
635 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
636 (home-page "http://www.linux-usb.org/")
637 (synopsis
638 "Tools for working with USB devices, such as lsusb")
639 (description
640 "Tools for working with USB devices, such as lsusb.")
3ac73271 641 (license license:gpl2+)))
0750452a
LC
642
643(define-public e2fsprogs
644 (package
645 (name "e2fsprogs")
7409c8d4 646 (version "1.42.13")
0750452a
LC
647 (source (origin
648 (method url-fetch)
7409c8d4
MW
649 (uri (string-append
650 "mirror://kernel.org/linux/kernel/people/tytso/"
651 name "/v" version "/"
652 name "-" version ".tar.xz"))
0750452a
LC
653 (sha256
654 (base32
7409c8d4 655 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
7c594a2c
LC
656 (modules '((guix build utils)))
657 (snippet
082be6d2
LC
658 '(begin
659 (substitute* "MCONFIG.in"
660 (("INSTALL_SYMLINK = /bin/sh")
661 "INSTALL_SYMLINK = sh"))
662
663 ;; Do not include a timestamp in libext2fs.info.gz.
664 (substitute* "doc/Makefile.in"
665 (("gzip -9")
666 "gzip -9n"))))))
0750452a 667 (build-system gnu-build-system)
c4c4cc05 668 (inputs `(("util-linux" ,util-linux)))
f57d2639 669 (native-inputs `(("pkg-config" ,pkg-config)
7c594a2c 670 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
0750452a 671 (arguments
7d453656
LF
672 '(;; Parallel building reliably yields a failure like this:
673 ;; "make[2]: *** No rule to make target '../lib/libss.so', needed by
14594760 674 ;; 'debugfs'. Stop."
7d453656
LF
675 #:parallel-build? #f
676 ;; util-linux is the preferred source for some of the libraries and
c44ed26c 677 ;; commands, so disable them (see, e.g.,
a124bbd2 678 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
c44ed26c
LC
679 #:configure-flags '("--disable-libblkid"
680 "--disable-libuuid" "--disable-uuidd"
681 "--disable-fsck"
7c594a2c 682
74d21291
LC
683 ;; Use symlinks instead of hard links for
684 ;; 'fsck.extN' etc. This makes the resulting nar
685 ;; smaller and is preserved across copies.
686 "--enable-symlink-install"
687
7c594a2c
LC
688 ;; Install libext2fs et al.
689 "--enable-elf-shlibs")
690
691 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
692 (assoc-ref %outputs "out")
693 "/lib"))
ddfc2fd8
LC
694
695 #:phases (alist-cons-before
0750452a
LC
696 'configure 'patch-shells
697 (lambda _
698 (substitute* "configure"
699 (("/bin/sh (.*)parse-types.sh" _ dir)
700 (string-append (which "sh") " " dir
701 "parse-types.sh")))
702 (substitute* (find-files "." "^Makefile.in$")
703 (("#!/bin/sh")
704 (string-append "#!" (which "sh")))))
1c975f60
LC
705 (alist-cons-after
706 'install 'install-libs
853c2f18
LC
707 (lambda* (#:key outputs #:allow-other-keys)
708 (let* ((out (assoc-ref outputs "out"))
709 (lib (string-append out "/lib")))
710 (and (zero? (system* "make" "install-libs"))
711
712 ;; Make the .a writable so that 'strip' works.
713 ;; Failing to do that, due to debug symbols, we
714 ;; retain a reference to the final
715 ;; linux-libre-headers, which refer to the
716 ;; bootstrap binaries.
717 (let ((archives (find-files lib "\\.a$")))
718 (for-each (lambda (file)
719 (chmod file #o666))
720 archives)
721 #t))))
1c975f60 722 %standard-phases))
0750452a
LC
723
724 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
725 ;; they fail because we get an extra line that says "Can't check if
8f65585b 726 ;; file system is mounted due to missing mtab file".
0750452a
LC
727 #:tests? #f))
728 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 729 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
730 (description
731 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3ac73271
LC
732 (license (list license:gpl2 ;programs
733 license:lgpl2.0 ;libext2fs
734 license:x11)))) ;libuuid
d8482ad0 735
e48977e7
LC
736(define e2fsprogs/static
737 (static-package
738 (package (inherit e2fsprogs)
739 (arguments
740 ;; Do not build shared libraries.
741 (substitute-keyword-arguments (package-arguments e2fsprogs)
742 ((#:configure-flags _)
743 '(list "--disable-blkid"))
744 ((#:make-flags _)
745 '(list)))))))
746
e102f940
LC
747(define-public e2fsck/static
748 (package
749 (name "e2fsck-static")
0997771a 750 (version (package-version e2fsprogs))
e102f940
LC
751 (build-system trivial-build-system)
752 (source #f)
313880c7
DC
753 (inputs
754 `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
755 (arguments
756 `(#:modules ((guix build utils))
757 #:builder
758 (begin
759 (use-modules (guix build utils)
760 (ice-9 ftw)
761 (srfi srfi-26))
762
313880c7
DC
763 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
764 "/sbin/e2fsck"))
e102f940
LC
765 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
766 (mkdir-p bin)
767 (with-directory-excursion bin
313880c7
DC
768 (copy-file e2fsck "e2fsck")
769 (remove-store-references "e2fsck")
770 (chmod "e2fsck" #o555))))))
0997771a 771 (home-page (package-home-page e2fsprogs))
313880c7
DC
772 (synopsis "Statically-linked e2fsck command from e2fsprogs")
773 (description "This package provides statically-linked e2fsck command taken
774from the e2fsprogs package. It is meant to be used in initrds.")
0997771a 775 (license (package-license e2fsprogs))))
e102f940 776
7c0a9104
LC
777(define-public extundelete
778 (package
779 (name "extundelete")
780 (version "0.2.4")
781 (source (origin
782 (method url-fetch)
783 (uri (string-append "mirror://sourceforge/extundelete/"
de67e922
LF
784 "extundelete/" version "/extundelete-"
785 version ".tar.bz2"))
7c0a9104
LC
786 (sha256
787 (base32
788 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
789 (build-system gnu-build-system)
790 (inputs `(("e2fsprogs" ,e2fsprogs)))
791 (home-page "http://extundelete.sourceforge.net/")
792 (synopsis "Recover deleted files from ext2/3/4 partitions")
793 (description
794 "Extundelete is a set of tools that can recover deleted files from an
795ext3 or ext4 partition.")
3ac73271 796 (license license:gpl2)))
7c0a9104 797
1c975f60
LC
798(define-public zerofree
799 (package
800 (name "zerofree")
801 (version "1.0.3")
802 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
803 (source (origin
804 (method url-fetch)
805 (uri (string-append home-page name "-" version
806 ".tgz"))
807 (sha256
808 (base32
809 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
810 (build-system gnu-build-system)
811 (arguments
812 '(#:phases (alist-replace
813 'install
814 (lambda* (#:key outputs #:allow-other-keys)
815 (let* ((out (assoc-ref outputs "out"))
816 (bin (string-append out "/bin")))
817 (mkdir-p bin)
818 (copy-file "zerofree"
819 (string-append bin "/zerofree"))
820 (chmod (string-append bin "/zerofree")
821 #o555)
822 #t))
823 (alist-delete 'configure %standard-phases))
824 #:tests? #f)) ;no tests
825 (inputs `(("libext2fs" ,e2fsprogs)))
826 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
827 (description
828 "The zerofree command scans the free blocks in an ext2 file system and
829fills any non-zero blocks with zeroes. This is a useful way to make disk
830images more compressible.")
3ac73271 831 (license license:gpl2)))
1c975f60 832
d8482ad0
LC
833(define-public strace
834 (package
835 (name "strace")
6983b8a8 836 (version "4.16")
d8482ad0
LC
837 (source (origin
838 (method url-fetch)
de67e922
LF
839 (uri (string-append "mirror://sourceforge/strace/strace/" version
840 "/strace-" version ".tar.xz"))
d8482ad0
LC
841 (sha256
842 (base32
6983b8a8 843 "1vzhmpcy989i4k12q4cc438yal2ghhm6x7ychscjbhcf2yspqj4q"))))
d8482ad0 844 (build-system gnu-build-system)
6983b8a8
MB
845 (arguments
846 '(#:phases
847 (modify-phases %standard-phases
848 (add-after 'unpack 'patch-/bin/sh
849 (lambda _
850 (substitute* "strace.c"
851 (("/bin/sh") (which "sh")))
852 #t)))))
c4c4cc05 853 (native-inputs `(("perl" ,perl)))
6983b8a8 854 (home-page "https://strace.io/")
d8482ad0
LC
855 (synopsis "System call tracer for Linux")
856 (description
857 "strace is a system call tracer, i.e. a debugging tool which prints out a
858trace of all the system calls made by a another process/program.")
3ac73271 859 (license license:bsd-3)))
ba04571a 860
e1e27737
TUBK
861(define-public ltrace
862 (package
863 (name "ltrace")
864 (version "0.7.3")
865 (source (origin
866 (method url-fetch)
867 (uri (string-append "http://www.ltrace.org/ltrace_" version
868 ".orig.tar.bz2"))
869 (sha256
870 (base32
871 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
872 (build-system gnu-build-system)
873 (inputs `(("libelf" ,libelf)))
874 (arguments
875 ;; Compilation uses -Werror by default, but it fails.
876 '(#:configure-flags '("--disable-werror")))
877 (home-page "http://www.ltrace.org/")
878 (synopsis "Library call tracer for Linux")
879 (description
880 "ltrace intercepts and records dynamic library calls which are called by
881an executed process and the signals received by that process. It can also
882intercept and print the system calls executed by the program.")
3ac73271 883 (license license:gpl2+)))
e1e27737 884
ba04571a
LC
885(define-public alsa-lib
886 (package
887 (name "alsa-lib")
888 (version "1.0.27.1")
889 (source (origin
890 (method url-fetch)
891 (uri (string-append
892 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
893 version ".tar.bz2"))
894 (sha256
895 (base32
bcd94e19 896 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
fc1adab1 897 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
ba04571a
LC
898 (build-system gnu-build-system)
899 (home-page "http://www.alsa-project.org/")
900 (synopsis "The Advanced Linux Sound Architecture libraries")
901 (description
902 "The Advanced Linux Sound Architecture (ALSA) provides audio and
903MIDI functionality to the Linux-based operating system.")
3ac73271 904 (license license:lgpl2.1+)))
10afdf50 905
17b293a0
LC
906(define-public alsa-utils
907 (package
908 (name "alsa-utils")
457d154f 909 (version "1.1.3")
17b293a0
LC
910 (source (origin
911 (method url-fetch)
992b527d
EF
912 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
913 name "-" version ".tar.bz2"))
17b293a0
LC
914 (sha256
915 (base32
457d154f 916 "0z0nnqp1707bm02dys2d16m88lsg5nd26bqaf14rl3za9sjifwhj"))))
17b293a0
LC
917 (build-system gnu-build-system)
918 (arguments
919 ;; XXX: Disable man page creation until we have DocBook.
920 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
921
922 ;; The udev rule is responsible for restoring
923 ;; the volume.
17b293a0
LC
924 (string-append "--with-udev-rules-dir="
925 (assoc-ref %outputs "out")
926 "/lib/udev/rules.d"))
49165145
EF
927 #:phases
928 (modify-phases %standard-phases
929 (add-before
930 'install 'pre-install
931 (lambda _
932 ;; Don't try to mkdir /var/lib/alsa.
933 (substitute* "Makefile"
934 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
457d154f
EF
935 "true\n"))
936 #t)))))
17b293a0
LC
937 (inputs
938 `(("libsamplerate" ,libsamplerate)
939 ("ncurses" ,ncurses)
940 ("alsa-lib" ,alsa-lib)
941 ("xmlto" ,xmlto)
b94a6ca0 942 ("gettext" ,gettext-minimal)))
17b293a0
LC
943 (home-page "http://www.alsa-project.org/")
944 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
945 (description
946 "The Advanced Linux Sound Architecture (ALSA) provides audio and
947MIDI functionality to the Linux-based operating system.")
948
949 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
950 ;; GPLv2-only.
3ac73271 951 (license license:gpl2)))
17b293a0 952
7d2511bc 953(define-public alsa-plugins
954 (package
955 (name "alsa-plugins")
956 (version "1.1.1")
957 (source (origin
958 (method url-fetch)
959 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
960 name "-" version ".tar.bz2"))
961 (sha256
962 (base32
963 "1w81z5jlwqhd1l2m7qrq69lc4k9dnrg1wn52jsl2hrf3hbhd394f"))))
964 (build-system gnu-build-system)
965 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
966 ;; be split, there are references to both in files.
967 ;; TODO: Remove OSS related plugins, they add support to run native
968 ;; ALSA applications on OSS however we do not offer OSS and OSS is
969 ;; obsolete.
970 (outputs '("out" "pulseaudio"))
971 (arguments
972 `(#:phases
973 (modify-phases %standard-phases
974 (add-after 'install 'split
975 (lambda* (#:key inputs outputs #:allow-other-keys)
976 ;; Distribute the binaries to the various outputs.
977 (let* ((out (assoc-ref outputs "out"))
978 (pua (assoc-ref outputs "pulseaudio"))
979 (pualib (string-append pua "/lib/alsa-lib"))
980 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
981 (mkdir-p puaconf)
982 (mkdir-p pualib)
983 (chdir (string-append out "/share"))
984 (for-each (lambda (file)
985 (rename-file file (string-append puaconf "/" (basename file))))
986 (find-files out "\\.(conf|example)"))
987 (for-each (lambda (file)
988 (rename-file file (string-append pualib "/" (basename file))))
989 (find-files out ".*pulse\\.(la|so)"))
990 (chdir "..")
991 ;; We have moved the files to output pulsaudio, the
992 ;; directory is now empty.
993 (delete-file-recursively (string-append out "/share"))
994 #t))))))
995 (inputs
996 `(("alsa-lib" ,alsa-lib)
997 ("speex" ,speex) ; libspeexdsp resampling plugin
998 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
999 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1000 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1001 (native-inputs
1002 `(("pkg-config" ,pkg-config)))
1003 (home-page "http://www.alsa-project.org/")
1004 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1005 (description
1006 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1007MIDI functionality to the Linux-based operating system. This package enhances ALSA
1008by providing additional plugins which include: upmixing, downmixing, jackd and
1009pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1010external rate conversion.")
1011 (license (list license:gpl2+
1012 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1013 license:lgpl2.1+))))
1014
10afdf50
LC
1015(define-public iptables
1016 (package
1017 (name "iptables")
ac9fc78f 1018 (version "1.4.21")
10afdf50
LC
1019 (source (origin
1020 (method url-fetch)
1021 (uri (string-append
1022 "http://www.netfilter.org/projects/iptables/files/iptables-"
1023 version ".tar.bz2"))
1024 (sha256
1025 (base32
ac9fc78f 1026 "1q6kg7sf0pgpq0qhab6sywl23cngxxfzc9zdzscsba8x09l4q02j"))))
10afdf50 1027 (build-system gnu-build-system)
50c26d9e
SB
1028 (arguments
1029 '(#:tests? #f ; no test suite
1030 #:configure-flags ; add $libdir to the RUNPATH of executables
1031 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
10afdf50
LC
1032 (home-page "http://www.netfilter.org/projects/iptables/index.html")
1033 (synopsis "Program to configure the Linux IP packet filtering rules")
1034 (description
1035 "iptables is the userspace command line program used to configure the
35e4b3d5 1036Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
10afdf50
LC
1037system administrators. Since Network Address Translation is also configured
1038from the packet filter ruleset, iptables is used for this, too. The iptables
1039package also includes ip6tables. ip6tables is used for configuring the IPv6
1040packet filter.")
3ac73271 1041 (license license:gpl2+)))
90a0048f
LC
1042
1043(define-public iproute
1044 (package
1045 (name "iproute2")
61f78e72 1046 (version "4.10.0")
90a0048f 1047 (source (origin
75cd4b05
AK
1048 (method url-fetch)
1049 (uri (string-append
1050 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1051 version ".tar.xz"))
1052 (sha256
1053 (base32
61f78e72 1054 "1a59y1zkddvr7z0lh2y9iasbh9wpfc1n39p56xcd6jkhzk0y3c92"))))
90a0048f
LC
1055 (build-system gnu-build-system)
1056 (arguments
1057 `(#:tests? #f ; no test suite
1058 #:make-flags (let ((out (assoc-ref %outputs "out")))
1059 (list "DESTDIR="
e777d07d
LF
1060 (string-append "BASH_COMPDIR=" out
1061 "/etc/bash_completion.d")
90a0048f 1062 (string-append "LIBDIR=" out "/lib")
61f78e72 1063 (string-append "HDRDIR=" out "/include")
90a0048f
LC
1064 (string-append "SBINDIR=" out "/sbin")
1065 (string-append "CONFDIR=" out "/etc")
1066 (string-append "DOCDIR=" out "/share/doc/"
1067 ,name "-" ,version)
1068 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
1069 #:phases (modify-phases %standard-phases
1070 (add-before 'install 'pre-install
1071 (lambda _
1072 ;; Don't attempt to create /var/lib/arpd.
1073 (substitute* "Makefile"
1074 (("^.*ARPDDIR.*$") "")))))))
90a0048f
LC
1075 (inputs
1076 `(("iptables" ,iptables)
c4c4cc05
JD
1077 ("db4" ,bdb)))
1078 (native-inputs
1079 `(("pkg-config" ,pkg-config)
90a0048f
LC
1080 ("flex" ,flex)
1081 ("bison" ,bison)))
1082 (home-page
d7f84eab 1083 "https://wiki.linuxfoundation.org/networking/iproute2")
90a0048f 1084 (synopsis
9e771e3b 1085 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f
LC
1086 (description
1087 "Iproute2 is a collection of utilities for controlling TCP/IP
1088networking and traffic with the Linux kernel.
1089
1090Most network configuration manuals still refer to ifconfig and route as the
1091primary network configuration tools, but ifconfig is known to behave
1092inadequately in modern network environments. They should be deprecated, but
1093most distros still include them. Most network configuration systems make use
1094of ifconfig and thus provide a limited feature set. The /etc/net project aims
1095to support most modern network technologies, as it doesn't use ifconfig and
1096allows a system administrator to make use of all iproute2 features, including
1097traffic control.
1098
1099iproute2 is usually shipped in a package called iproute or iproute2 and
02041872
TGR
1100consists of several tools, of which the most important are @command{ip} and
1101@command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1102@command{tc} stands for traffic control. Both tools print detailed usage
1103messages and are accompanied by a set of manpages.")
3ac73271 1104 (license license:gpl2+)))
85e0dc6a
LC
1105
1106(define-public net-tools
1107 ;; XXX: This package is basically unmaintained, but it provides a few
1108 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1109 ;; live with it.
1110 (package
1111 (name "net-tools")
1112 (version "1.60")
6b55ee88 1113 (home-page "http://net-tools.sourceforge.net/")
85e0dc6a
LC
1114 (source (origin
1115 (method url-fetch)
6b55ee88
LC
1116 (uri (list (string-append
1117 "mirror://sourceforge/net-tools/net-tools-"
1118 version ".tar.bz2")
1119 (string-append
1120 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1121 "/base/net-tools/net-tools-1.60.tar.bz2")))
85e0dc6a
LC
1122 (sha256
1123 (base32
177088a3 1124 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
fc1adab1 1125 (patches (search-patches "net-tools-bitrot.patch"))))
85e0dc6a
LC
1126 (build-system gnu-build-system)
1127 (arguments
c9e0a44e
LC
1128 '(#:modules ((guix build gnu-build-system)
1129 (guix build utils)
1130 (srfi srfi-1)
1131 (srfi srfi-26))
1132 #:phases (alist-cons-after
cd143df0 1133 'unpack 'patch
85e0dc6a
LC
1134 (lambda* (#:key inputs #:allow-other-keys)
1135 (define (apply-patch file)
9a224ac2 1136 (zero? (system* "patch" "-p1" "--force"
85e0dc6a
LC
1137 "--input" file)))
1138
1139 (let ((patch.gz (assoc-ref inputs "patch")))
1140 (format #t "applying Debian patch set '~a'...~%"
1141 patch.gz)
1142 (system (string-append "gunzip < " patch.gz " > the-patch"))
85e0dc6a
LC
1143 (and (apply-patch "the-patch")
1144 (for-each apply-patch
1145 (find-files "debian/patches"
1146 "\\.patch")))))
1147 (alist-replace
1148 'configure
1149 (lambda* (#:key outputs #:allow-other-keys)
1150 (let ((out (assoc-ref outputs "out")))
1151 (mkdir-p (string-append out "/bin"))
1152 (mkdir-p (string-append out "/sbin"))
1153
1154 ;; Pretend we have everything...
1155 (system "yes | make config")
1156
a153ff80
MW
1157 ;; ... except for the things we don't have.
1158 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1159 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1160 ;; that have been removed.
85e0dc6a 1161 (substitute* '("config.make" "config.h")
a153ff80 1162 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
c9e0a44e
LC
1163 (alist-cons-after
1164 'install 'remove-redundant-commands
1165 (lambda* (#:key outputs #:allow-other-keys)
1166 ;; Remove commands and man pages redundant with
1167 ;; Inetutils.
1168 (let* ((out (assoc-ref outputs "out"))
1169 (dup (append-map (cut find-files out <>)
1170 '("^hostname"
1171 "^(yp|nis|dns)?domainname"))))
1172 (for-each delete-file dup)
1173 #t))
1174 %standard-phases)))
85e0dc6a
LC
1175
1176 ;; Binaries that depend on libnet-tools.a don't declare that
1177 ;; dependency, making it parallel-unsafe.
1178 #:parallel-build? #f
1179
1180 #:tests? #f ; no test suite
0d55c356
MW
1181 #:make-flags (let ((out (assoc-ref %outputs "out")))
1182 (list "CC=gcc"
1183 (string-append "BASEDIR=" out)
1184 (string-append "INSTALLNLSDIR=" out "/share/locale")
1185 (string-append "mandir=/share/man")))))
85e0dc6a
LC
1186
1187 ;; Use the big Debian patch set (the thing does not even compile out of
1188 ;; the box.)
1189 (inputs `(("patch" ,(origin
1190 (method url-fetch)
1191 (uri
1192 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1193 (sha256
1194 (base32
1195 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
b94a6ca0 1196 (native-inputs `(("gettext" ,gettext-minimal)))
85e0dc6a
LC
1197
1198 (synopsis "Tools for controlling the network subsystem in Linux")
1199 (description
1200 "This package includes the important tools for controlling the network
1201subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1202netstat, rarp and route. Additionally, this package contains utilities
1203relating to particular network hardware types (plipconfig, slattach) and
1204advanced aspects of IP configuration (iptunnel, ipmaddr).")
3ac73271 1205 (license license:gpl2+)))
c762e82e
LC
1206
1207(define-public libcap
1208 (package
1209 (name "libcap")
f6c2d05c 1210 (version "2.24")
c762e82e
LC
1211 (source (origin
1212 (method url-fetch)
c762e82e 1213 (uri (string-append
f6c2d05c
LC
1214 "mirror://kernel.org/linux/libs/security/linux-privs/"
1215 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
1216 (sha256
1217 (base32
f6c2d05c 1218 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
c762e82e 1219 (build-system gnu-build-system)
6d889daf
SB
1220 (arguments '(#:phases
1221 (modify-phases %standard-phases
1222 (replace 'configure
1223 ;; Add $libdir to the RUNPATH of executables.
1224 (lambda _
1225 (substitute* "Make.Rules"
1226 (("LDFLAGS := #-g")
1227 (string-append "LDFLAGS := -Wl,-rpath="
1228 %output "/lib"))))))
c762e82e
LC
1229 #:tests? #f ; no 'check' target
1230 #:make-flags (list "lib=lib"
1231 (string-append "prefix="
1232 (assoc-ref %outputs "out"))
1233 "RAISE_SETFCAP=no")))
1234 (native-inputs `(("perl" ,perl)))
1235 (inputs `(("attr" ,attr)))
1236 (home-page "https://sites.google.com/site/fullycapable/")
1237 (synopsis "Library for working with POSIX capabilities")
1238 (description
35b9e423 1239 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
1240Linux-based operating systems.")
1241
1242 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 1243 (license license:gpl2)))
215b6431
LC
1244
1245(define-public bridge-utils
1246 (package
1247 (name "bridge-utils")
1248 (version "1.5")
1249 (source (origin
1250 (method url-fetch)
de67e922
LF
1251 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1252 "bridge-utils-" version ".tar.gz"))
215b6431
LC
1253 (sha256
1254 (base32
1255 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1256 (build-system gnu-build-system)
1257
1258 ;; The tarball lacks all the generated files.
1259 (native-inputs `(("autoconf" ,autoconf)
1260 ("automake" ,automake)))
1261 (arguments
722ec722
MW
1262 '(#:phases (alist-cons-after
1263 'unpack 'bootstrap
215b6431 1264 (lambda _
e5c8e4f3
DT
1265 ;; Fix "field ‘ip6’ has incomplete type" errors.
1266 (substitute* "libbridge/libbridge.h"
1267 (("#include <linux/if_bridge.h>")
1268 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1269
1270 ;; Ensure that the entire build fails if one of the
1271 ;; sub-Makefiles fails.
1272 (substitute* "Makefile.in"
1273 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1274 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1275
215b6431
LC
1276 (zero? (system* "autoreconf" "-vf")))
1277 %standard-phases)
1278 #:tests? #f)) ; no 'check' target
1279
1280 (home-page
1281 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1282 (synopsis "Manipulate Ethernet bridges")
1283 (description
1284 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1285to connect two Ethernet segments together in a protocol independent way.
1286Packets are forwarded based on Ethernet address, rather than IP address (like
1287a router). Since forwarding is done at Layer 2, all protocols can go
1288transparently through a bridge.")
3ac73271 1289 (license license:gpl2+)))
3cc20675
LC
1290
1291(define-public libnl
1292 (package
1293 (name "libnl")
bdac3d4b 1294 (version "3.2.25")
3cc20675
LC
1295 (source (origin
1296 (method url-fetch)
1297 (uri (string-append
1298 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1299 version ".tar.gz"))
1300 (sha256
1301 (base32
bdac3d4b 1302 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
3cc20675
LC
1303 (build-system gnu-build-system)
1304 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1305 (home-page "http://www.infradead.org/~tgr/libnl/")
1306 (synopsis "NetLink protocol library suite")
1307 (description
1308 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 1309protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
1310between the kernel and user space processes. It was designed to be a more
1311flexible successor to ioctl to provide mainly networking related kernel
1312configuration and monitoring interfaces.")
1313
1314 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1315 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 1316 (license license:gpl2)))
023fef7d 1317
65cd77db
MW
1318(define-public iw
1319 (package
1320 (name "iw")
72f0c5ea 1321 (version "4.9")
65cd77db
MW
1322 (source (origin
1323 (method url-fetch)
1324 (uri (string-append
2f9e312a 1325 "mirror://kernel.org/software/network/iw/iw-"
65cd77db
MW
1326 version ".tar.xz"))
1327 (sha256
1328 (base32
72f0c5ea 1329 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
65cd77db
MW
1330 (build-system gnu-build-system)
1331 (native-inputs `(("pkg-config" ,pkg-config)))
1332 (inputs `(("libnl" ,libnl)))
1333 (arguments
1334 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1335 "CC=gcc")
1336 #:phases (alist-delete 'configure %standard-phases)))
2f9e312a 1337 (home-page "https://wireless.wiki.kernel.org/")
65cd77db
MW
1338 (synopsis "Tool for configuring wireless devices")
1339 (description
1340 "iw is a new nl80211 based CLI configuration utility for wireless
2f9e312a 1341devices. It replaces @code{iwconfig}, which is deprecated.")
3ac73271 1342 (license license:isc)))
65cd77db 1343
023fef7d
LC
1344(define-public powertop
1345 (package
1346 (name "powertop")
ebacb0de 1347 (version "2.8")
023fef7d
LC
1348 (source
1349 (origin
1350 (method url-fetch)
1351 (uri (string-append
bd60e4e2 1352 "https://01.org/sites/default/files/downloads/powertop/powertop-"
023fef7d
LC
1353 version ".tar.gz"))
1354 (sha256
1355 (base32
ebacb0de 1356 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
023fef7d 1357 (build-system gnu-build-system)
4c48bf55
ML
1358 (arguments
1359 '(#:phases
1360 (modify-phases %standard-phases
1361 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1362 ;; allow calibrating the network interface in GuixSD.
1363 (add-after 'unpack 'patch-absolute-file-names
1364 (lambda* (#:key inputs #:allow-other-keys)
1365 (let ((kmod (assoc-ref inputs "kmod")))
1366 (substitute* (find-files "src" "\\.cpp$")
1367 ;; Give the right 'modprobe' file name so that essential
1368 ;; modules such as msr.ko can be loaded.
1369 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1370 ;; These programs are only needed to calibrate, so using
1371 ;; relative file names avoids adding extra inputs. When they
1372 ;; are missing powertop gracefully handles it.
1373 (("/usr/bin/hcitool") "hcitool")
1374 (("/usr/bin/xset") "xset")
1375 (("/usr/sbin/hciconfig") "hciconfig"))
1376 #t))))))
023fef7d 1377 (inputs
4c48bf55
ML
1378 `(("kmod" ,kmod)
1379 ("libnl" ,libnl)
023fef7d 1380 ("ncurses" ,ncurses)
4c48bf55
ML
1381 ("pciutils" ,pciutils)
1382 ("zlib" ,zlib)))
c4c4cc05 1383 (native-inputs
ebacb0de 1384 `(("pkg-config" ,pkg-config)))
023fef7d
LC
1385 (home-page "https://01.org/powertop/")
1386 (synopsis "Analyze power consumption on Intel-based laptops")
1387 (description
1388 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1389power management. In addition to being a diagnostic tool, PowerTOP also has
1390an interactive mode where the user can experiment various power management
1391settings for cases where the operating system has not enabled these
1392settings.")
3ac73271 1393 (license license:gpl2)))
6869e5c9
LC
1394
1395(define-public aumix
1396 (package
1397 (name "aumix")
1398 (version "2.9.1")
1399 (source (origin
1400 (method url-fetch)
1401 (uri (string-append
1402 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1403 version ".tar.bz2"))
1404 (sha256
1405 (base32
1406 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1407 (build-system gnu-build-system)
1408 (inputs `(("ncurses" ,ncurses)))
1409 (home-page "http://www.jpj.net/~trevor/aumix.html")
1410 (synopsis "Audio mixer for X and the console")
1411 (description
1412 "Aumix adjusts an audio mixer from X, the console, a terminal,
1413the command line or a script.")
3ac73271 1414 (license license:gpl2+)))
7c0dbe78
SHT
1415
1416(define-public iotop
1417 (package
1418 (name "iotop")
1419 (version "0.6")
1420 (source
1421 (origin
1422 (method url-fetch)
1423 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1424 version ".tar.gz"))
1425 (sha256 (base32
1426 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1427 (build-system python-build-system)
1428 (arguments
35cebf01 1429 ;; The setup.py script expects python-2.
7c0dbe78 1430 `(#:python ,python-2
35cebf01 1431 ;; There are currently no checks in the package.
7c0dbe78
SHT
1432 #:tests? #f))
1433 (native-inputs `(("python" ,python-2)))
1434 (home-page "http://guichaz.free.fr/iotop/")
1435 (synopsis
1436 "Displays the IO activity of running processes")
1437 (description
1438 "Iotop is a Python program with a top like user interface to show the
1439processes currently causing I/O.")
3ac73271 1440 (license license:gpl2+)))
e30835e2
LC
1441
1442(define-public fuse
1443 (package
1444 (name "fuse")
0e9bc883 1445 (version "2.9.6")
e30835e2
LC
1446 (source (origin
1447 (method url-fetch)
0e9bc883
LF
1448 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1449 "download/fuse-" version
1450 "/fuse-" version ".tar.gz"))
e30835e2
LC
1451 (sha256
1452 (base32
0e9bc883 1453 "0szi2vlsjxg03y4ji51jks34p269jqj5ify6l0ajsqq6f6y8pd0c"))))
e30835e2 1454 (build-system gnu-build-system)
b148bd71 1455 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1456 (arguments
1457 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1458 (assoc-ref %outputs "out")
1459 "/sbin")
1460 (string-append "INIT_D_PATH="
1461 (assoc-ref %outputs "out")
1462 "/etc/init.d")
9a4efac9
LC
1463
1464 ;; The rule makes /dev/fuse 666.
e30835e2
LC
1465 (string-append "UDEV_RULES_PATH="
1466 (assoc-ref %outputs "out")
9a4efac9 1467 "/lib/udev/rules.d"))
b148bd71
LC
1468 #:phases (alist-cons-before
1469 'build 'set-file-names
1470 (lambda* (#:key inputs #:allow-other-keys)
1471 ;; libfuse calls out to mount(8) and umount(8). Make sure
1472 ;; it refers to the right ones.
1473 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1474 (("/bin/(u?)mount" _ maybe-u)
1475 (string-append (assoc-ref inputs "util-linux")
1476 "/bin/" maybe-u "mount")))
1477 (substitute* '("util/mount.fuse.c")
1478 (("/bin/sh")
bd663902
LC
1479 (which "sh")))
1480
1481 ;; This hack leads libfuse to search for 'fusermount' in
1482 ;; $PATH, where it may find a setuid-root binary, instead of
1483 ;; trying solely $out/sbin/fusermount and failing because
1484 ;; it's not setuid.
1485 (substitute* "lib/Makefile"
1486 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1487 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1488 %standard-phases)))
0e9bc883 1489 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
1490 (synopsis "Support file systems implemented in user space")
1491 (description
1492 "As a consequence of its monolithic design, file system code for Linux
1493normally goes into the kernel itself---which is not only a robustness issue,
1494but also an impediment to system extensibility. FUSE, for \"file systems in
1495user space\", is a kernel module and user-space library that tries to address
1496part of this problem by allowing users to run file system implementations as
1497user-space processes.")
3ac73271
LC
1498 (license (list license:lgpl2.1 ;library
1499 license:gpl2+)))) ;command-line utilities
220193ad
LC
1500
1501(define-public unionfs-fuse
1502 (package
1503 (name "unionfs-fuse")
1504 (version "0.26")
1505 (source (origin
1506 (method url-fetch)
1507 (uri (string-append
1508 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1509 version ".tar.xz"))
1510 (sha256
1511 (base32
1512 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1513 (build-system cmake-build-system)
1514 (inputs `(("fuse" ,fuse)))
1515 (arguments '(#:tests? #f)) ; no tests
1516 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1517 (synopsis "User-space union file system")
1518 (description
1519 "UnionFS-FUSE is a flexible union file system implementation in user
1520space, using the FUSE library. Mounting a union file system allows you to
1521\"aggregate\" the contents of several directories into a single mount point.
1522UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 1523 (license license:bsd-3)))
ed748588 1524
0b7a0c20
LC
1525(define fuse-static
1526 (package (inherit fuse)
1527 (name "fuse-static")
1528 (source (origin (inherit (package-source fuse))
1529 (modules '((guix build utils)))
1530 (snippet
1531 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1532 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1533 ;; it doesn't do that, allowing us to remove the dependency on
1534 ;; util-linux (something that is useful in initrds.)
1535 '(substitute* '("lib/mount_util.c"
1536 "util/mount_util.c")
1537 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1538 "0")
1539 (("/bin/")
1540 "")))))))
1541
ed748588
LC
1542(define-public unionfs-fuse/static
1543 (package (inherit unionfs-fuse)
1544 (synopsis "User-space union file system (statically linked)")
1545 (name (string-append (package-name unionfs-fuse) "-static"))
1546 (source (origin (inherit (package-source unionfs-fuse))
1547 (modules '((guix build utils)))
1548 (snippet
1549 ;; Add -ldl to the libraries, because libfuse.a needs that.
1550 '(substitute* "src/CMakeLists.txt"
1551 (("target_link_libraries(.*)\\)" _ libs)
1552 (string-append "target_link_libraries"
1553 libs " dl)"))))))
1554 (arguments
1555 '(#:tests? #f
1456cff1
LC
1556 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1557 #:phases (alist-cons-after
1558 'install 'post-install
1559 (lambda* (#:key outputs #:allow-other-keys)
1560 (let* ((out (assoc-ref outputs "out"))
1561 (exe (string-append out "/bin/unionfs")))
1562 ;; By default, 'unionfs' keeps references to
1563 ;; $glibc/share/locale and similar stuff. Remove them.
1564 (remove-store-references exe)))
1565 %standard-phases)))
0b7a0c20 1566 (inputs `(("fuse" ,fuse-static)))))
67b66003 1567
db288efa
LC
1568(define-public sshfs-fuse
1569 (package
1570 (name "sshfs-fuse")
b58c1b2d 1571 (version "2.8")
db288efa
LC
1572 (source (origin
1573 (method url-fetch)
b58c1b2d
EF
1574 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1575 "download/sshfs_" version
1576 "/sshfs-" version ".tar.gz"))
db288efa
LC
1577 (sha256
1578 (base32
b58c1b2d 1579 "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
db288efa
LC
1580 (build-system gnu-build-system)
1581 (inputs
1582 `(("fuse" ,fuse)
1583 ("glib" ,glib)))
1584 (native-inputs
1585 `(("pkg-config" ,pkg-config)))
1586 (home-page "http://fuse.sourceforge.net/sshfs.html")
1587 (synopsis "Mount remote file systems over SSH")
1588 (description
1589 "This is a file system client based on the SSH File Transfer Protocol.
1590Since most SSH servers already support this protocol it is very easy to set
1591up: on the server side there's nothing to do; on the client side mounting the
1592file system is as easy as logging into the server with an SSH client.")
3ac73271 1593 (license license:gpl2+)))
db288efa 1594
67b66003
LC
1595(define-public numactl
1596 (package
1597 (name "numactl")
e35dff97 1598 (version "2.0.11")
67b66003
LC
1599 (source (origin
1600 (method url-fetch)
1601 (uri (string-append
1602 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1603 version
1604 ".tar.gz"))
1605 (sha256
1606 (base32
e35dff97 1607 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
67b66003
LC
1608 (build-system gnu-build-system)
1609 (arguments
e35dff97 1610 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
1611 ;; to run, which we can't assume to have.
1612 #:tests? #f))
b0015064 1613
35dfcdd7
AE
1614 ;; NUMA is apparently not supported on armhf, see
1615 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1616 (supported-systems (delete "armhf-linux" %supported-systems))
67b66003
LC
1617 (home-page "http://oss.sgi.com/projects/libnuma/")
1618 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1619 (description
1620 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1621memory is not all in one place. The numactl program allows you to run your
1622application program on specific CPU's and memory nodes. It does this by
1623supplying a NUMA memory policy to the operating system before running your
1624program.
1625
1626The package contains other commands, such as numademo, numastat and memhog.
1627The numademo command provides a quick overview of NUMA performance on your
1628system.")
3ac73271
LC
1629 (license (list license:gpl2 ;programs
1630 license:lgpl2.1)))) ;library
b10e9ff6
LC
1631
1632(define-public kbd
1633 (package
1634 (name "kbd")
8555a609 1635 (version "2.0.4")
b10e9ff6
LC
1636 (source (origin
1637 (method url-fetch)
1638 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 1639 version ".tar.xz"))
b10e9ff6
LC
1640 (sha256
1641 (base32
8555a609 1642 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
c8f60748
LC
1643 (modules '((guix build utils)))
1644 (snippet
f2cdcafb
LC
1645 '(begin
1646 (substitute* "tests/Makefile.in"
1647 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1648 (("@VERSION@")
1649 "[@]VERSION[@]"))
1650 (substitute* '("src/unicode_start" "src/unicode_stop")
1651 ;; Assume the Coreutils are in $PATH.
1652 (("/usr/bin/tty")
1653 "tty"))))))
b10e9ff6
LC
1654 (build-system gnu-build-system)
1655 (arguments
5953d2b7
AK
1656 '(#:phases
1657 (modify-phases %standard-phases
1658 (add-before 'build 'pre-build
1659 (lambda* (#:key inputs #:allow-other-keys)
1660 (let ((gzip (assoc-ref %build-inputs "gzip"))
1661 (bzip2 (assoc-ref %build-inputs "bzip2")))
1662 (substitute* "src/libkeymap/findfile.c"
1663 (("gzip")
1664 (string-append gzip "/bin/gzip"))
1665 (("bzip2")
1666 (string-append bzip2 "/bin/bzip2"))))))
1667 (add-after 'install 'post-install
1668 (lambda* (#:key outputs #:allow-other-keys)
1669 ;; Make sure these programs find their comrades.
1670 (let* ((out (assoc-ref outputs "out"))
1671 (bin (string-append out "/bin")))
1672 (for-each (lambda (prog)
1673 (wrap-program (string-append bin "/" prog)
1674 `("PATH" ":" prefix (,bin))))
1675 '("unicode_start" "unicode_stop"))))))))
b10e9ff6 1676 (inputs `(("check" ,check)
f61e0e79
LC
1677 ("gzip" ,gzip)
1678 ("bzip2" ,bzip2)
b10e9ff6
LC
1679 ("pam" ,linux-pam)))
1680 (native-inputs `(("pkg-config" ,pkg-config)))
1681 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1682 (synopsis "Linux keyboard utilities and keyboard maps")
1683 (description
1684 "This package contains keytable files and keyboard utilities compatible
1685for systems using the Linux kernel. This includes commands such as
1686'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
3ac73271 1687 (license license:gpl2+)))
de0b620e
LC
1688
1689(define-public inotify-tools
1690 (package
1691 (name "inotify-tools")
1692 (version "3.13")
1693 (source (origin
1694 (method url-fetch)
1695 (uri (string-append
1696 "mirror://sourceforge/inotify-tools/inotify-tools/"
1697 version "/inotify-tools-" version ".tar.gz"))
1698 (sha256
1699 (base32
1700 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1701 (build-system gnu-build-system)
1702 (home-page "http://inotify-tools.sourceforge.net/")
1703 (synopsis "Monitor file accesses")
1704 (description
1705 "The inotify-tools packages provides a C library and command-line tools
1706to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 1707 (license license:gpl2+)))
e062d542
AE
1708
1709(define-public kmod
1710 (package
1711 (name "kmod")
45e38a07 1712 (version "23")
e062d542
AE
1713 (source (origin
1714 (method url-fetch)
1715 (uri
1716 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1717 "kmod-" version ".tar.xz"))
1718 (sha256
1719 (base32
45e38a07 1720 "0mc12sx06p8il1ym3hdmgxxb37apn9yv7xij26gddjdfkx8xa0yk"))
fc1adab1 1721 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
1722 (build-system gnu-build-system)
1723 (native-inputs
1724 `(("pkg-config" ,pkg-config)))
1725 (inputs
f61e0e79
LC
1726 `(("xz" ,xz)
1727 ("zlib" ,zlib)))
e062d542
AE
1728 (arguments
1729 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1730 #:configure-flags '("--with-xz" "--with-zlib")
1731 #:phases (alist-cons-after
1732 'install 'install-modprobe&co
1733 (lambda* (#:key outputs #:allow-other-keys)
1734 (let* ((out (assoc-ref outputs "out"))
1735 (bin (string-append out "/bin")))
1736 (for-each (lambda (tool)
1737 (symlink "kmod"
1738 (string-append bin "/" tool)))
1739 '("insmod" "rmmod" "lsmod" "modprobe"
1740 "modinfo" "depmod"))))
1741 %standard-phases)))
e062d542
AE
1742 (home-page "https://www.kernel.org/")
1743 (synopsis "Kernel module tools")
35b9e423 1744 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
1745kernel modules like insert, remove, list, check properties, resolve
1746dependencies and aliases.
1747
1748These tools are designed on top of libkmod, a library that is shipped with
1749kmod. The aim is to be compatible with tools, configurations and indices
1750from the module-init-tools project.")
3ac73271 1751 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 1752
7fa715e7
LC
1753(define-public eudev
1754 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 1755 (package
7fa715e7 1756 (name "eudev")
2c6a1c67 1757 (version "3.2")
7fa715e7
LC
1758 (source (origin
1759 (method url-fetch)
1760 (uri (string-append
1761 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1762 version ".tar.gz"))
1763 (sha256
1764 (base32
2c6a1c67 1765 "099w62ncq78nxpxizf910mx18hc8x4qvzw3azjd00fir89wmyjnq"))
fc1adab1 1766 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7
MW
1767 (build-system gnu-build-system)
1768 (native-inputs
1769 `(("pkg-config" ,pkg-config)
e75230c1
SB
1770 ("perl" ,perl)
1771 ("gperf" ,gperf)))
fe32c7f7 1772 (inputs
255f7308
LC
1773 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1774 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1775 ;; which contains the rules to do that.
1776 `(("util-linux" ,util-linux) ;for blkid
1777 ("kmod" ,kmod)))
e1921a38 1778 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
1779 (synopsis "Userspace device management")
1780 (description "Udev is a daemon which dynamically creates and removes
1781device nodes from /dev/, handles hotplug events and loads drivers at boot
1782time.")
3ac73271 1783 (license license:gpl2+)))
7fa715e7 1784
e5d861f3
LC
1785(define-public eudev-with-hwdb
1786 ;; TODO: Merge with 'eudev'.
1787 (package
1788 (inherit eudev)
1789 (name "eudev-with-hwdb")
1790 (arguments
1791 '(#:phases (modify-phases %standard-phases
1792 (add-after 'install 'build-hwdb
1793 (lambda* (#:key outputs #:allow-other-keys)
1794 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1795 ;; similar tools to display product names.
1796 (let ((out (assoc-ref outputs "out")))
1797 (zero? (system* (string-append out "/bin/udevadm")
1798 "hwdb" "--update"))))))))))
1799
66269d47
LC
1800(define-public lvm2
1801 (package
1802 (name "lvm2")
5c2af899 1803 (version "2.02.168")
66269d47
LC
1804 (source (origin
1805 (method url-fetch)
1806 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1807 version ".tgz"))
1808 (sha256
1809 (base32
5c2af899 1810 "03b62hcsj9z37ckd8c21wwpm07s9zblq7grfh58yzcs1vp6x38r3"))
66269d47
LC
1811 (modules '((guix build utils)))
1812 (snippet
1813 '(begin
1814 (use-modules (guix build utils))
1815
1816 ;; Honor sysconfdir.
1817 (substitute* "make.tmpl.in"
1818 (("confdir = .*$")
1819 "confdir = @sysconfdir@\n")
1820 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
01f94cca
LC
1821 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1822 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
1823 (build-system gnu-build-system)
1824 (native-inputs
1825 `(("pkg-config" ,pkg-config)
1826 ("procps" ,procps))) ;tests use 'pgrep'
1827 (inputs
8fcaf8b1 1828 `(("udev" ,eudev)))
66269d47 1829 (arguments
3afbc6b3
LF
1830 '(#:phases
1831 (modify-phases %standard-phases
1832 (add-after 'configure 'set-makefile-shell
1833 (lambda _
1834 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1835 ;; expected.
1836 (setenv "SHELL" (which "sh"))
66269d47 1837
3afbc6b3
LF
1838 ;; Replace /bin/sh with the right file name.
1839 (patch-makefile-SHELL "make.tmpl")
7ca97fae
LF
1840 #t))
1841 (add-before 'strip 'make-objects-writable
1842 (lambda* (#:key outputs #:allow-other-keys)
1843 ;; Make compiled objects writable so they can be stripped.
1844 (let ((out (assoc-ref outputs "out")))
1845 (for-each (lambda (file)
1846 (chmod file #o755))
1847 (append
1848 (find-files (string-append out "/lib"))
1849 (find-files (string-append out "/sbin"))))
1850 #t))))
66269d47
LC
1851
1852 #:configure-flags (list (string-append "--sysconfdir="
1853 (assoc-ref %outputs "out")
1854 "/etc/lvm")
1855 "--enable-udev_sync"
f2817d43
LC
1856 "--enable-udev_rules"
1857
1858 ;; Make sure programs such as 'dmsetup' can
1859 ;; find libdevmapper.so.
1860 (string-append "LDFLAGS=-Wl,-rpath="
1861 (assoc-ref %outputs "out")
1862 "/lib"))
66269d47
LC
1863
1864 ;; The tests use 'mknod', which requires root access.
1865 #:tests? #f))
1866 (home-page "http://sourceware.org/lvm2/")
1867 (synopsis "Logical volume management for Linux")
1868 (description
1869 "LVM2 is the logical volume management tool set for Linux-based systems.
1870This package includes the user-space libraries and tools, including the device
1871mapper. Kernel components are part of Linux-libre.")
1872
1873 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1874 ;; Command-line tools are GPLv2.
3ac73271 1875 (license (list license:gpl2 license:lgpl2.1))))
66269d47 1876
01f94cca
LC
1877(define-public lvm2-static
1878 (package
1879 (inherit lvm2)
1880 (name "lvm2-static")
1881
1882 ;; Propagate udev because libdevmapper.a depends on libudev.
1883 (inputs (alist-delete "udev" (package-inputs lvm2)))
1884 (propagated-inputs `(("udev" ,eudev)))
1885
1886 (arguments
1887 (substitute-keyword-arguments (package-arguments lvm2)
1888 ((#:configure-flags flags '())
1889 ;; LVM2 doesn't use Libtool, hence the custom option.
1890 `(cons "--enable-static_link" ,flags))))
1891 (synopsis "Logical volume management for Linux (statically linked)")))
1892
000f7559
DT
1893(define-public wireless-tools
1894 (package
1895 (name "wireless-tools")
1896 (version "30.pre9")
1897 (source (origin
1898 (method url-fetch)
1899 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1900 version ".tar.gz"))
1901 (sha256
1902 (base32
ec01f22d 1903 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 1904 (snippet
c2099a4c
MW
1905 '(begin
1906 ;; Remove the older header files that are not free software.
1907 (for-each (lambda (n)
1908 (delete-file (format #f "wireless.~a.h" n)))
1909 '(10 11 12 13 14 15 16 17 18 19 20))
1910 #t))))
000f7559
DT
1911 (build-system gnu-build-system)
1912 (arguments
c2099a4c
MW
1913 `(#:make-flags
1914 (list (string-append "PREFIX=" %output)
1915 (string-append "INSTALL_MAN=" %output "/share/man")
1916 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1917 "BUILD_STATIC=")
1918 #:phases (modify-phases %standard-phases
1919 (delete 'configure))
000f7559
DT
1920 #:tests? #f))
1921 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
1922 (description "Wireless Tools are used to manipulate the now-deprecated
1923Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1924Extension was an interface allowing you to set Wireless LAN specific
1925parameters and get the specific stats. It is deprecated in favor the nl80211
1926interface.")
000f7559 1927 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
1928 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1929 ;; other files are distributed under gpl2.
3ac73271 1930 (license (list license:gpl2 license:lgpl2.1+))))
30016044 1931
cc205dac
LC
1932(define-public crda
1933 (package
1934 (name "crda")
1935 (version "3.18")
1936 (source (origin
1937 (method url-fetch)
1938 (uri (string-append "mirror://kernel.org/software/network/crda/"
1939 "crda-" version ".tar.xz"))
1940 (sha256
1941 (base32
1942 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 1943 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
1944 (build-system gnu-build-system)
1945 (arguments
1946 '(#:phases (modify-phases %standard-phases
1947 (delete 'configure)
1948 (add-before
1949 'build 'no-werror-no-ldconfig
1950 (lambda _
1951 (substitute* "Makefile"
1952 (("-Werror") "")
1953 (("ldconfig") "true"))
1954 #t))
1955 (add-before
1956 'build 'set-regulator-db-file-name
1957 (lambda* (#:key inputs #:allow-other-keys)
1958 ;; Tell CRDA where to find our database.
1959 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1960 (substitute* "crda.c"
1961 (("\"/lib/crda/regulatory.bin\"")
1962 (string-append "\"" regdb
1963 "/lib/crda/regulatory.bin\"")))
1964 #t))))
1965 #:test-target "verify"
1966 #:make-flags (let ((out (assoc-ref %outputs "out"))
1967 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1968 (list "CC=gcc" "V=1"
1969
1970 ;; Disable signature-checking on 'regulatory.bin'.
1971 ;; The reason is that this simplifies maintenance
1972 ;; on our side (no need to manage a distro key
1973 ;; pair), and we can guarantee integrity of
1974 ;; 'regulatory.bin' by other means anyway, such as
1975 ;; 'guix gc --verify'. See
1976 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1977 ;; for a discssion.
1978 "USE_OPENSSL=0"
1979
1980 (string-append "PREFIX=" out)
1981 (string-append "SBINDIR=" out "/sbin/")
1982 (string-append "UDEV_RULE_DIR="
1983 out "/lib/udev/rules.d")
1984 (string-append "LDFLAGS=-Wl,-rpath="
1985 out "/lib -L.")
1986 (string-append "REG_BIN=" regdb
1987 "/lib/crda/regulatory.bin")))))
1988 (native-inputs `(("pkg-config" ,pkg-config)
1989 ("python" ,python-2)
1990 ("wireless-regdb" ,wireless-regdb)))
1991 (inputs `(("libnl" ,libnl)))
1992 (home-page
1993 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1994 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1995 (description
1996 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1997communication between the kernel Linux and user space for regulatory
1998compliance.")
3ac73271 1999 (license license:copyleft-next)))
cc205dac 2000
c80b4a3e
LC
2001(define-public wireless-regdb
2002 (package
2003 (name "wireless-regdb")
a70782d3 2004 (version "2017.03.07")
c80b4a3e
LC
2005 (source (origin
2006 (method url-fetch)
2007 (uri (string-append
2008 "mirror://kernel.org/software/network/wireless-regdb/"
2009 "wireless-regdb-" version ".tar.xz"))
2010 (sha256
2011 (base32
a70782d3 2012 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
5568151f
LC
2013
2014 ;; We're building 'regulatory.bin' by ourselves.
2015 (snippet '(delete-file "regulatory.bin"))))
c80b4a3e
LC
2016 (build-system gnu-build-system)
2017 (arguments
2018 '(#:phases (modify-phases %standard-phases
2019 (delete 'configure))
5568151f
LC
2020
2021 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2022 ;; is computed and can be equal to 'maintainer-clean'; when that
2023 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2024 ;; just built. Thus, build things sequentially.
2025 #:parallel-build? #f
2026
c80b4a3e
LC
2027 #:tests? #f ;no tests
2028 #:make-flags (let ((out (assoc-ref %outputs "out")))
2029 (list (string-append "PREFIX=" out)
2030 (string-append "LSB_ID=GuixSD")
2031 (string-append "DISTRO_PUBKEY=/dev/null")
2032 (string-append "DISTRO_PRIVKEY=/dev/null")
2033 (string-append "REGDB_PUBKEY=/dev/null")
2034
2035 ;; Leave that empty so that db2bin.py doesn't try
2036 ;; to sign 'regulatory.bin'. This allows us to
2037 ;; avoid managing a key pair for the whole distro.
2038 (string-append "REGDB_PRIVKEY=")))))
2039 (native-inputs `(("python" ,python-2)))
2040 (home-page
2041 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2042 (synopsis "Wireless regulatory database")
2043 (description
2044 "This package contains the wireless regulatory database Central
2045Regulatory Database Agent (CRDA) daemon. The database contains information on
2046country-specific regulations for the wireless spectrum.")
3ac73271 2047 (license license:isc)))
c80b4a3e 2048
30016044
MW
2049(define-public lm-sensors
2050 (package
2051 (name "lm-sensors")
171091a8 2052 (version "3.4.0")
30016044
MW
2053 (source (origin
2054 (method url-fetch)
ee6a5d0e 2055 (uri (list (string-append
171091a8
AE
2056 "https://github.com/groeck/lm-sensors/archive/V"
2057 (string-join (string-split version #\.) "-")
2058 ".tar.gz")))
bc4a2b85 2059 (file-name (string-append name "-" version ".tar.gz"))
30016044
MW
2060 (sha256
2061 (base32
171091a8 2062 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
fc1adab1 2063 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
2064 (build-system gnu-build-system)
2065 (inputs `(("rrdtool" ,rrdtool)
2066 ("perl" ,perl)
2067 ("kmod" ,kmod)
2068 ("gnuplot" ,gnuplot)))
2069 (native-inputs `(("pkg-config" ,pkg-config)
2070 ("flex" ,flex)
2071 ("bison" ,bison)
2072 ("which" ,which)))
2073 (arguments
2074 `(#:tests? #f ; no 'check' target
2075 #:make-flags (list (string-append "PREFIX=" %output)
2076 (string-append "ETCDIR=" %output "/etc")
2077 (string-append "MANDIR=" %output "/share/man"))
2078 #:phases
2079 (alist-delete
2080 'configure
2081 (alist-cons-before
2082 'build 'patch-exec-paths
2083 (lambda* (#:key inputs outputs #:allow-other-keys)
2084 (substitute* "prog/detect/sensors-detect"
2085 (("`uname")
2086 (string-append "`" (assoc-ref inputs "coreutils")
2087 "/bin/uname"))
2088 (("(`|\")modprobe" all open-quote)
2089 (string-append open-quote
2090 (assoc-ref inputs "kmod")
2091 "/bin/modprobe")))
2092 (substitute* '("prog/pwm/pwmconfig"
2093 "prog/pwm/fancontrol")
2094 (("gnuplot")
2095 (string-append (assoc-ref inputs "gnuplot")
2096 "/bin/gnuplot"))
2097 (("cat ")
2098 (string-append (assoc-ref inputs "coreutils")
2099 "/bin/cat "))
2100 (("egrep ")
2101 (string-append (assoc-ref inputs "grep")
2102 "/bin/egrep "))
2103 (("sed -e")
2104 (string-append (assoc-ref inputs "sed")
2105 "/bin/sed -e"))
2106 (("cut -d")
2107 (string-append (assoc-ref inputs "coreutils")
2108 "/bin/cut -d"))
2109 (("sleep ")
2110 (string-append (assoc-ref inputs "coreutils")
2111 "/bin/sleep "))
2112 (("readlink -f")
2113 (string-append (assoc-ref inputs "coreutils")
2114 "/bin/readlink -f"))))
2115 %standard-phases))))
3a04d5d4 2116 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
2117 (synopsis "Utilities to read temperature/voltage/fan sensors")
2118 (description
35b9e423 2119 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
2120you to access information from temperature, voltage, and fan speed sensors.
2121It works with most newer systems.")
3ac73271 2122 (license license:gpl2+)))
b087d413 2123
f5b2a53d
RW
2124(define-public i2c-tools
2125 (package
2126 (name "i2c-tools")
2127 (version "3.1.1")
2128 (source (origin
2129 (method url-fetch)
2130 (uri (string-append
f32274a7 2131 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
2132 version ".tar.bz2"))
2133 (sha256
2134 (base32
2135 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2136 (build-system gnu-build-system)
2137 (arguments
2138 `(#:tests? #f ; no 'check' target
2139 #:make-flags (list (string-append "prefix=" %output)
2140 "CC=gcc")
2141 ;; no configure script
2142 #:phases (alist-delete 'configure %standard-phases)))
bccf27cb
RW
2143 (inputs
2144 `(("perl" ,perl)))
f32274a7 2145 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
2146 (synopsis "I2C tools for Linux")
2147 (description
2148 "The i2c-tools package contains a heterogeneous set of I2C tools for
2149Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2150EEPROM decoding scripts, EEPROM programming tools, and a python module for
2151SMBus access.")
3ac73271 2152 (license license:gpl2+)))
f5b2a53d 2153
b087d413
MW
2154(define-public xsensors
2155 (package
2156 (name "xsensors")
2157 (version "0.70")
2158 (source (origin
2159 (method url-fetch)
2160 (uri (string-append
2161 "http://www.linuxhardware.org/xsensors/xsensors-"
2162 version ".tar.gz"))
2163 (sha256
2164 (base32
2165 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2166 (build-system gnu-build-system)
2167 (inputs `(("lm-sensors" ,lm-sensors)
2168 ("gtk" ,gtk+-2)))
2169 (native-inputs `(("pkg-config" ,pkg-config)))
2170 (arguments
2171 `(#:phases (alist-cons-before
2172 'configure 'enable-deprecated
2173 (lambda _
2174 (substitute* "src/Makefile.in"
2175 (("-DGDK_DISABLE_DEPRECATED") "")
2176 (("-DGTK_DISABLE_DEPRECATED") "")))
2177 (alist-cons-before
2178 'configure 'remove-Werror
2179 (lambda _
2180 (substitute* '("configure" "src/Makefile.in")
2181 (("-Werror") "")))
2182 %standard-phases))))
2183 (home-page "http://www.linuxhardware.org/xsensors/")
2184 (synopsis "Hardware health information viewer")
2185 (description
35b9e423 2186 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
2187health such as temperature, voltage and fan speed and displays the information
2188in a digital read-out.")
3ac73271 2189 (license license:gpl2+)))
b62fe07f
LC
2190
2191(define-public perf
2192 (package
2193 (name "perf")
2194 (version (package-version linux-libre))
2195 (source (package-source linux-libre))
2196 (build-system gnu-build-system)
2197 (arguments
2198 '(#:phases (alist-replace
2199 'configure
2200 (lambda* (#:key inputs #:allow-other-keys)
2201 (setenv "SHELL_PATH" (which "bash"))
2202 (chdir "tools/perf"))
2203 %standard-phases)
2204 #:make-flags (list (string-append "DESTDIR="
2205 (assoc-ref %outputs "out"))
2af29d23
LC
2206 "WERROR=0"
2207
2208 ;; By default, 'config/Makefile' uses lib64 on
2209 ;; x86_64. Work around that.
2210 "lib=lib")
b62fe07f
LC
2211 #:tests? #f)) ;no tests
2212 (native-inputs
2213 `(("pkg-config" ,pkg-config)
2214 ("bison" ,bison)
2215 ("flex" ,flex)
2216
2217 ;; There are build scripts written in these languages.
2218 ("perl" ,perl)
2219 ("python" ,python-2)))
2220 (inputs
b1fb4b23 2221 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2222 ;; ("newt" ,newt)
6c030d10 2223 ("python" ,python-2) ;'perf' links against libpython
b62fe07f
LC
2224 ("elfutils" ,elfutils)
2225
d7ece67a
LC
2226 ;; Documentation.
2227 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
2228 ("docbook-xsl" ,docbook-xsl)
2229 ("xmlto" ,xmlto)
2230 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2231 (home-page "https://perf.wiki.kernel.org/")
2232 (synopsis "Linux profiling with performance counters")
2233 (description
2234 "perf is a tool suite for profiling using hardware performance counters,
2235with support in the Linux kernel. perf can instrument CPU performance
2236counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2237of lightweight profiling. This package contains the user-land tools and in
2238particular the 'perf' command.")
2239 (license (package-license linux-libre))))
c09e60e4
DT
2240
2241(define-public pflask
2242 (package
2243 (name "pflask")
2244 (version "0.2")
2245 (source (origin
2246 (method url-fetch)
2247 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2248 version ".tar.gz"))
f586c877 2249 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2250 (sha256
2251 (base32
2252 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2253 (build-system cmake-build-system)
2254 (arguments
2255 '(#:tests? #f)) ; no tests
2256 (home-page "http://ghedo.github.io/pflask/")
2257 (synopsis "Simple tool for creating Linux namespace containers")
2258 (description "pflask is a simple tool for creating Linux namespace
2259containers. It can be used for running a command or even booting an OS inside
2260an isolated container, created with the help of Linux namespaces. It is
2261similar in functionality to chroot, although pflask provides better isolation
2262thanks to the use of namespaces.")
3ac73271 2263 (license license:bsd-2)))
288084d5
MW
2264
2265(define-public hdparm
2266 (package
2267 (name "hdparm")
2268 (version "9.45")
2269 (source (origin
2270 (method url-fetch)
de67e922 2271 (uri (string-append "mirror://sourceforge/" name "/" name "/"
288084d5
MW
2272 name "-" version ".tar.gz"))
2273 (sha256
2274 (base32
2275 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2276 (build-system gnu-build-system)
2277 (arguments
2278 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2279 (list (string-append "binprefix=" out)
2280 (string-append "manprefix=" out)
2281 "CC=gcc"))
2282 #:phases (alist-delete 'configure %standard-phases)
2283 #:tests? #f)) ; no test suite
3b3b60d0 2284 (home-page "https://sourceforge.net/projects/hdparm/")
e881752c 2285 (synopsis "Tune hard disk parameters for high performance")
288084d5
MW
2286 (description
2287 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
e881752c 2288is for enabling irq-unmasking and IDE multiple-mode.")
3ac73271 2289 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2290
c755c854
MW
2291(define-public rfkill
2292 (package
2293 (name "rfkill")
2294 (version "0.5")
2295 (source (origin
2296 (method url-fetch)
2297 (uri (string-append "mirror://kernel.org/software/network/"
2298 name "/" name "-" version ".tar.xz"))
2299 (sha256
2300 (base32
2301 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2302 (build-system gnu-build-system)
2303 (arguments
2304 `(#:make-flags (list "CC=gcc"
2305 (string-append "PREFIX=" %output))
2306 #:phases (modify-phases %standard-phases
2307 (delete 'configure))
2308 #:tests? #f))
2309 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2310 (synopsis "Tool for enabling and disabling wireless devices")
2311 (description
2312 "rfkill is a simple tool for accessing the rfkill device interface,
2313which is used to enable and disable wireless networking devices, typically
2314WLAN, Bluetooth and mobile broadband.")
3ac73271
LC
2315 (license (license:non-copyleft "file://COPYING"
2316 "See COPYING in the distribution."))))
c755c854 2317
dc9bdb1e
ML
2318(define-public acpi
2319 (package
2320 (name "acpi")
2321 (version "1.7")
2322 (source (origin
2323 (method url-fetch)
de67e922
LF
2324 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2325 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
2326 (sha256
2327 (base32
2328 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2329 (build-system gnu-build-system)
2330 (home-page "http://acpiclient.sourceforge.net")
2331 (synopsis "Display information on ACPI devices")
2332 (description "@code{acpi} attempts to replicate the functionality of the
2333\"old\" @code{apm} command on ACPI systems, including battery and thermal
2334information. It does not support ACPI suspending, only displays information
2335about ACPI devices.")
2336 (license license:gpl2+)))
2337
57a516d3
LC
2338(define-public acpid
2339 (package
2340 (name "acpid")
169a438c 2341 (version "2.0.28")
57a516d3
LC
2342 (source (origin
2343 (method url-fetch)
2344 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2345 version ".tar.xz"))
2346 (sha256
2347 (base32
169a438c 2348 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
57a516d3 2349 (build-system gnu-build-system)
3b3b60d0 2350 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
2351 (synopsis "Daemon for delivering ACPI events to user-space programs")
2352 (description
2353 "acpid is designed to notify user-space programs of Advanced
2354Configuration and Power Interface (ACPI) events. acpid should be started
2355during the system boot, and will run as a background process. When an ACPI
2356event is received from the kernel, acpid will examine the list of rules
2357specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2358 (license license:gpl2+)))
37f5caec
TUBK
2359
2360(define-public sysfsutils
2361 (package
2362 (name "sysfsutils")
2363 (version "2.1.0")
2364 (source
2365 (origin
2366 (method url-fetch)
2367 (uri
2368 (string-append
2369 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2370 version ".tar.gz"))
2371 (sha256
2372 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2373 (build-system gnu-build-system)
2374 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2375 (synopsis "System utilities based on Linux sysfs")
2376 (description
8f65585b 2377 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
2378Linux kernel versions 2.5+ that exposes a system's device tree. The package
2379also contains the libsysfs library.")
2380 ;; The library is under lgpl2.1+ (all files say "or any later version").
2381 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2382 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2383
2384(define-public sysfsutils-1
2385 (package
2386 (inherit sysfsutils)
2387 (version "1.3.0")
2388 (source
2389 (origin
2390 (method url-fetch)
2391 (uri
2392 (string-append
2393 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2394 "/sysfsutils-" version ".tar.gz"))
2395 (sha256
2396 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2397 (modules '((guix build utils)))
2398 (snippet
2399 '(begin
2400 (substitute* "Makefile.in"
2401 (("includedir = /usr/include/sysfs")
2402 "includedir = @includedir@"))
2403 (substitute* "configure"
2404 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2405 (string-append "includedir='" orig "/sysfs'")))))))
2406 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2407
2408(define-public cpufrequtils
2409 (package
2410 (name "cpufrequtils")
2411 (version "0.3")
2412 (source
2413 (origin
2414 (method url-fetch)
2415 (uri
2416 (string-append
2417 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2418 version ".tar.gz"))
2419 (sha256
2420 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2421 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2422 (build-system gnu-build-system)
2423 (native-inputs
2424 `(("sysfsutils" ,sysfsutils-1)))
2425 (arguments
2426 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2427 (assoc-ref %outputs "out") "/lib"))))
2428 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2429 (synopsis "Utilities to get and set CPU frequency on Linux")
2430 (description
e881752c 2431 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2432information, and set the CPU frequency if supported, using the cpufreq
2433capabilities of the Linux kernel.")
3ac73271 2434 (license license:gpl2)))
0a588bf9
SB
2435
2436(define-public libraw1394
2437 (package
2438 (name "libraw1394")
7c58c852 2439 (version "2.1.2")
0a588bf9
SB
2440 (source (origin
2441 (method url-fetch)
2442 (uri (string-append
2443 "mirror://kernel.org/linux/libs/ieee1394/"
2444 name "-" version ".tar.xz"))
2445 (sha256
2446 (base32
7c58c852 2447 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
2448 (build-system gnu-build-system)
2449 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2450 (synopsis "Interface library for the Linux IEEE1394 drivers")
2451 (description
2452 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2453the Linux IEEE-1394 subsystem, which provides direct access to the connected
24541394 buses to user space. Through libraw1394/raw1394, applications can directly
2455send to and receive from other nodes without requiring a kernel driver for the
2456protocol in question.")
3ac73271 2457 (license license:lgpl2.1+)))
68e3c29d
SB
2458
2459(define-public libavc1394
2460 (package
2461 (name "libavc1394")
2462 (version "0.5.4")
2463 (source (origin
2464 (method url-fetch)
de67e922 2465 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
2466 name "-" version ".tar.gz"))
2467 (sha256
2468 (base32
2469 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2470 (build-system gnu-build-system)
2471 (native-inputs
2472 `(("pkg-config" ,pkg-config)))
2473 (propagated-inputs
2474 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 2475 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
2476 (synopsis "AV/C protocol library for IEEE 1394")
2477 (description
2478 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2479the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2480 (license license:lgpl2.1+)))
3f7bf86a
SB
2481
2482(define-public libiec61883
2483 (package
2484 (name "libiec61883")
2485 (version "1.2.0")
2486 (source (origin
2487 (method url-fetch)
2488 (uri (string-append
2489 "mirror://kernel.org/linux/libs/ieee1394/"
2490 name "-" version ".tar.xz"))
2491 (sha256
2492 (base32
2493 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2494 (build-system gnu-build-system)
2495 (native-inputs
2496 `(("pkg-config" ,pkg-config)))
2497 (propagated-inputs
2498 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2499 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2500 (synopsis "Isochronous streaming media library for IEEE 1394")
2501 (description
2502 "The libiec61883 library provides a higher level API for streaming DV,
2503MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2504 (license license:lgpl2.1+)))
69159125
MW
2505
2506(define-public mdadm
2507 (package
2508 (name "mdadm")
fae88ae8 2509 (version "4.0")
69159125
MW
2510 (source (origin
2511 (method url-fetch)
2512 (uri (string-append
2513 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2514 version ".tar.xz"))
2515 (sha256
2516 (base32
fae88ae8 2517 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
69159125
MW
2518 (build-system gnu-build-system)
2519 (inputs
2520 `(("udev" ,eudev)))
2521 (arguments
2522 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
2523 (list "CC=gcc"
2524 "INSTALL=install"
69159125
MW
2525 "CHECK_RUN_DIR=0"
2526 ;; TODO: tell it where to find 'sendmail'
2527 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2528 (string-append "BINDIR=" out "/sbin")
2529 (string-append "MANDIR=" out "/share/man")
2530 (string-append "UDEVDIR=" out "/lib/udev")))
2531 #:phases (alist-cons-before
2532 'build 'patch-program-paths
2533 (lambda* (#:key inputs #:allow-other-keys)
2534 (let ((coreutils (assoc-ref inputs "coreutils")))
2535 (substitute* "udev-md-raid-arrays.rules"
2536 (("/usr/bin/(readlink|basename)" all program)
2537 (string-append coreutils "/bin/" program)))))
d76f44e8
LC
2538 (alist-cons-before
2539 'build 'remove-W-error
2540 (lambda _
2541 ;; We cannot build with -Werror on i686 due to a
2542 ;; 'sign-compare' warning in util.c.
2543 (substitute* "Makefile"
2544 (("-Werror") ""))
2545 #t)
2546 (alist-delete 'configure %standard-phases)))
69159125
MW
2547 ;;tests must be done as root
2548 #:tests? #f))
2549 (home-page "http://neil.brown.name/blog/mdadm")
2550 (synopsis "Tool for managing Linux Software RAID arrays")
2551 (description
2552 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2553assemble, report on, and monitor arrays. It can also move spares between raid
2554arrays when needed.")
3ac73271 2555 (license license:gpl2+)))
01ccdfb6 2556
631fda7e
LC
2557(define-public mdadm-static
2558 (package
2559 (inherit mdadm)
2560 (name "mdadm-static")
2561 (arguments
2562 (substitute-keyword-arguments (package-arguments mdadm)
2563 ((#:make-flags flags)
2564 `(cons "LDFLAGS = -static" ,flags))
2565 ((#:phases phases)
2566 `(modify-phases ,phases
2567 (add-after 'install 'remove-cruft
2568 (lambda* (#:key outputs #:allow-other-keys)
2569 (let* ((out (assoc-ref outputs "out"))
2570 (precious? (lambda (file)
2571 (member file '("." ".." "sbin"))))
2572 (directories (scandir out (negate precious?))))
2573 (with-directory-excursion out
2574 (for-each delete-file-recursively directories)
2575 (remove-store-references "sbin/mdadm")
2576 (delete-file "sbin/mdmon")
2577 #t))))))
2578 ((#:modules modules %gnu-build-system-modules)
2579 `((ice-9 ftw) ,@modules))
2580 ((#:strip-flags _ '())
2581 ''("--strip-all")) ;strip a few extra KiB
2582 ((#:allowed-references _ '("out"))
2583 '("out")))) ;refer only self
2584 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2585
01ccdfb6
SB
2586(define-public libaio
2587 (package
2588 (name "libaio")
2589 (version "0.3.110")
2590 (source (origin
2591 (method url-fetch)
2592 (uri (list
2593 (string-append "mirror://debian/pool/main/liba/libaio/"
2594 name "_" version ".orig.tar.gz")
2595 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2596 name "-" version ".tar.gz")))
2597 (sha256
2598 (base32
2599 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2600 (build-system gnu-build-system)
2601 (arguments
2602 '(#:make-flags
2603 (list "CC=gcc" (string-append "prefix=" %output))
2604 #:test-target "partcheck" ; need root for a full 'check'
2605 #:phases
2606 (alist-delete 'configure %standard-phases))) ; no configure script
2607 (home-page "http://lse.sourceforge.net/io/aio.html")
2608 (synopsis "Linux-native asynchronous I/O access library")
2609 (description
2610 "This library enables userspace to use Linux kernel asynchronous I/O
2611system calls, important for the performance of databases and other advanced
2612applications.")
3ac73271 2613 (license license:lgpl2.1+)))
eb7c43c3 2614
81b98756
RW
2615(define-public sbc
2616 (package
2617 (name "sbc")
2618 (version "1.3")
2619 (source (origin
2620 (method url-fetch)
2621 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2622 name "-" version ".tar.xz"))
2623 (sha256
2624 (base32
2625 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2626 (build-system gnu-build-system)
2627 (inputs
2628 `(("libsndfile" ,libsndfile)))
2629 (native-inputs
2630 `(("pkg-config" ,pkg-config)))
2631 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2632 (synopsis "Bluetooth subband audio codec")
2633 (description
2634 "The SBC is a digital audio encoder and decoder used to transfer data to
2635Bluetooth audio output devices like headphones or loudspeakers.")
2636 (license license:gpl2+)))
2637
eb7c43c3
DT
2638(define-public bluez
2639 (package
2640 (name "bluez")
a189ac71 2641 (version "5.43")
eb7c43c3
DT
2642 (source (origin
2643 (method url-fetch)
2644 (uri (string-append
e9eb24b1 2645 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
2646 version ".tar.xz"))
2647 (sha256
2648 (base32
a189ac71 2649 "05cdnpz0w2lwq2x5ba87q1h2wgb4lfnpbnbh6p7499hx59fw1j8n"))))
eb7c43c3
DT
2650 (build-system gnu-build-system)
2651 (arguments
2652 '(#:configure-flags
2653 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
2654 (list "--sysconfdir=/etc"
2655 "--localstatedir=/var"
2656 "--enable-library"
53142109 2657 "--disable-systemd"
eb7c43c3
DT
2658 ;; Install dbus/udev files to the correct location.
2659 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
2660 (string-append "--with-udevdir=" out "/lib/udev")))
2661 #:phases
2662 (modify-phases %standard-phases
2663 (add-after 'install 'post-install
2664 (lambda* (#:key inputs outputs #:allow-other-keys)
2665 (let* ((out (assoc-ref outputs "out"))
2666 (servicedir (string-append out "/share/dbus-1/services"))
2667 (service "obexd/src/org.bluez.obex.service")
2668 (rule (string-append
2669 out "/lib/udev/rules.d/97-hid2hci.rules")))
2670 ;; Install the obex dbus service file.
2671 (substitute* service
2672 (("/bin/false")
2673 (string-append out "/libexec/bluetooth/obexd")))
2674 (install-file service servicedir)
2675 ;; Fix paths in the udev rule.
2676 (substitute* rule
2677 (("hid2hci --method")
2678 (string-append out "/lib/udev/hid2hci --method"))
2679 (("/sbin/udevadm")
2680 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2681 #t))))))
eb7c43c3
DT
2682 (native-inputs
2683 `(("pkg-config" ,pkg-config)
b94a6ca0 2684 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
2685 (inputs
2686 `(("glib" ,glib)
2687 ("dbus" ,dbus)
2688 ("eudev" ,eudev)
2689 ("libical" ,libical)
2690 ("readline" ,readline)))
2691 (home-page "http://www.bluez.org/")
2692 (synopsis "Linux Bluetooth protocol stack")
2693 (description
2694 "BlueZ provides support for the core Bluetooth layers and protocols. It
2695is flexible, efficient and uses a modular implementation.")
3ac73271 2696 (license license:gpl2+)))
3d890318
LC
2697
2698(define-public fuse-exfat
2699 (package
2700 (name "fuse-exfat")
9ff04ff7 2701 (version "1.2.6")
3d890318
LC
2702 (source (origin
2703 (method url-fetch)
c0cc805e
TGR
2704 (uri (string-append
2705 "https://github.com/relan/exfat/releases/download/v"
2706 version "/" name "-" version ".tar.gz"))
3d890318
LC
2707 (sha256
2708 (base32
9ff04ff7 2709 "1rvq4hapy2anal1vg1yidv4x8rg4iw5sxfwqixkw0q2qsxb54471"))))
3d890318
LC
2710 (build-system gnu-build-system)
2711 (native-inputs
c0cc805e 2712 `(("pkg-config" ,pkg-config)))
3d890318
LC
2713 (inputs
2714 `(("fuse" ,fuse)))
c0cc805e 2715 (home-page "https://github.com/relan/exfat")
3d890318
LC
2716 (synopsis "Mount exFAT file systems")
2717 (description
2718 "This package provides a FUSE-based file system that provides read and
2719write access to exFAT devices.")
3ac73271 2720 (license license:gpl2+)))
53ec8d48
LC
2721
2722(define-public gpm
2723 (package
2724 (name "gpm")
2725 (version "1.20.7")
2726 (source (origin
2727 (method url-fetch)
2728 (uri (string-append
2729 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2730 version ".tar.bz2"))
2731 (sha256
2732 (base32
2733 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2734 (build-system gnu-build-system)
2735 (arguments
2736 '(#:phases (modify-phases %standard-phases
2737 (add-before 'configure 'bootstrap
2738 (lambda _
2739 ;; The tarball was not generated with 'make dist' so we
2740 ;; need to bootstrap things ourselves.
2741 (and (zero? (system* "./autogen.sh"))
2742 (begin
2743 (patch-makefile-SHELL "Makefile.include.in")
2744 #t)))))
2745
2746 ;; Make sure programs find libgpm.so.
2747 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2748 (assoc-ref %outputs "out")
2749 "/lib"))))
2750 (native-inputs
2751 `(("texinfo" ,texinfo)
2752 ("bison" ,bison)
2753 ("flex" ,flex)
2754 ("autoconf" ,autoconf)
2755 ("automake" ,automake)
2756 ("libtool" ,libtool)))
2757 (home-page "http://www.nico.schottelius.org/software/gpm/")
2758 (synopsis "Mouse support for the Linux console")
2759 (description
2760 "The GPM (general-purpose mouse) daemon is a mouse server for
2761applications running on the Linux console. It allows users to select items
2762and copy/paste text in the console and in xterm.")
3ac73271 2763 (license license:gpl2+)))
fc686f9a
TGR
2764
2765(define-public btrfs-progs
2766 (package
2767 (name "btrfs-progs")
0d3ddd49 2768 (version "4.10.1")
fc686f9a
TGR
2769 (source (origin
2770 (method url-fetch)
2771 (uri (string-append "mirror://kernel.org/linux/kernel/"
2772 "people/kdave/btrfs-progs/"
2773 "btrfs-progs-v" version ".tar.xz"))
2774 (sha256
2775 (base32
0d3ddd49 2776 "06hs20jwa15xybbmlalba8wvhv3slq1g0wrqrgyh7ll5y11bc5kc"))))
fc686f9a 2777 (build-system gnu-build-system)
7cad981d
TGR
2778 (outputs '("out"
2779 "static")) ; static versions of binaries in "out" (~16MiB!)
fc686f9a 2780 (arguments
7cad981d
TGR
2781 '(#:phases (modify-phases %standard-phases
2782 (add-after 'build 'build-static
2783 (lambda _ (zero? (system* "make" "static"))))
2784 (add-after 'install 'install-static
2785 (let ((staticbin (string-append (assoc-ref %outputs "static")
2786 "/bin")))
2787 (lambda _
2788 (zero? (system* "make"
2789 (string-append "bindir=" staticbin)
2790 "install-static"))))))
2791 #:test-target "test"
fc686f9a
TGR
2792 #:parallel-tests? #f)) ; tests fail when run in parallel
2793 (inputs `(("e2fsprogs" ,e2fsprogs)
2794 ("libblkid" ,util-linux)
7cad981d 2795 ("libblkid:static" ,util-linux "static")
fc686f9a 2796 ("libuuid" ,util-linux)
7cad981d 2797 ("libuuid:static" ,util-linux "static")
fc686f9a
TGR
2798 ("zlib" ,zlib)
2799 ("lzo" ,lzo)))
2800 (native-inputs `(("pkg-config" ,pkg-config)
2801 ("asciidoc" ,asciidoc)
2802 ("xmlto" ,xmlto)
41d23dd1 2803 ;; For building documentation.
fc686f9a 2804 ("libxml2" ,libxml2)
48b7e4a6 2805 ("docbook-xsl" ,docbook-xsl)
41d23dd1 2806 ;; For tests.
48b7e4a6 2807 ("which" ,which)))
fc686f9a
TGR
2808 (home-page "https://btrfs.wiki.kernel.org/")
2809 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
2810 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
2811aimed at implementing advanced features while focusing on fault tolerance,
2812repair and easy administration.")
68bcac6b
LF
2813 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2814 ;; GPL2: Everything else.
2815 (license (list license:gpl2 license:gpl2+))))
08e9daf5 2816
f3e44f5c
DC
2817(define-public btrfs-progs/static
2818 (package
2819 (name "btrfs-progs-static")
2820 (version (package-version btrfs-progs))
2821 (source #f)
2822 (build-system trivial-build-system)
2823 (inputs
2824 `(("btrfs-progs:static" ,btrfs-progs "static")))
2825 (arguments
2826 `(#:modules ((guix build utils))
2827 #:builder
2828 (begin
2829 (use-modules (guix build utils)
2830 (ice-9 ftw)
2831 (srfi srfi-26))
2832
2833 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
2834 (out (assoc-ref %outputs "out"))
2835 (source (string-append btrfs "/bin/btrfs.static"))
2836 (target (string-append out "/bin/btrfs")))
2837 (mkdir-p (dirname target))
2838 (copy-file source target)
2839 (remove-store-references target)
2840 (chmod target #o555)))))
2841 (home-page (package-home-page btrfs-progs))
ff797172
TGR
2842 (synopsis "Statically-linked btrfs command from btrfs-progs")
2843 (description "This package provides the statically-linked @command{btrfs}
2844from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
2845 (license (package-license btrfs-progs))))
2846
08e9daf5
TGR
2847(define-public freefall
2848 (package
2849 (name "freefall")
2850 (version (package-version linux-libre))
2851 (source (package-source linux-libre))
2852 (build-system gnu-build-system)
2853 (arguments
2854 '(#:phases (modify-phases %standard-phases
2855 (add-after 'unpack 'enter-subdirectory
2856 (lambda _
2857 (chdir "tools/laptop/freefall")))
2858 (delete 'configure)
2859 (add-before 'build 'increase-timeout
2860 (lambda _
2861 ;; The default of 2 seconds is too low: it assumes an
2862 ;; open lid and AC power without actually checking.
2863 (substitute* "freefall.c"
2864 (("alarm\\(2\\)") "alarm(5)")))))
2865 #:make-flags (list (string-append "PREFIX="
2866 (assoc-ref %outputs "out")))
2867 #:tests? #f)) ;no tests
2868 (home-page (package-home-page linux-libre))
2869 (synopsis "Free-fall protection for spinning laptop hard drives")
2870 (description
2871 "Prevents shock damage to the internal spinning hard drive(s) of some
2872HP and Dell laptops. When sudden movement is detected, all input/output
2873operations on the drive are suspended and its heads are parked on the ramp,
2874where they are less likely to cause damage to the spinning disc. Requires a
2875drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2876feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2877 (license license:gpl2)))
d17ae8c0
NG
2878
2879(define-public thinkfan
2880 (package
2881 (name "thinkfan")
2882 (version "0.9.3")
2883 (source (origin
2884 (method url-fetch)
2885 (uri (string-append "mirror://sourceforge/thinkfan/"
de67e922 2886 "/thinkfan-" version ".tar.gz"))
d17ae8c0
NG
2887 (sha256
2888 (base32
2889 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2890 (modules '((guix build utils)))
2891 ;; Fix erroneous man page location in Makefile leading to
2892 ;; a compilation failure.
2893 (snippet
2894 '(substitute* "CMakeLists.txt"
2895 (("thinkfan\\.1") "src/thinkfan.1")))))
2896 (build-system cmake-build-system)
2897 (arguments
2898 `(#:modules ((guix build cmake-build-system)
2899 (guix build utils)
2900 (srfi srfi-26))
2901 #:tests? #f ;no test target
2902 #:configure-flags
2903 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2904 `("-DUSE_ATASMART:BOOL=ON")
2905 #:phases
2906 (modify-phases %standard-phases
75e56aed
NG
2907 ;; Install scripts for various foreign init systems. Also fix
2908 ;; hard-coded path for daemon.
d17ae8c0
NG
2909 (add-after 'install 'install-rc-scripts
2910 (lambda* (#:key outputs #:allow-other-keys)
75e56aed
NG
2911 (let ((out (assoc-ref outputs "out"))
2912 (files (find-files
2913 (string-append "../thinkfan-" ,version "/rcscripts")
2914 ".*")))
2915 (substitute* files
2916 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2917 (string-append out "/sbin/" name)))
2918 (for-each (cute install-file <>
2919 (string-append out "/share/thinkfan"))
2920 files))
d17ae8c0
NG
2921 #t)))))
2922 (inputs
2923 `(("libatasmart" ,libatasmart)))
2924 (home-page "http://thinkfan.sourceforge.net/")
2925 (synopsis "Simple fan control program")
2926 (description
2927 "Thinkfan is a simple fan control program. It reads temperatures,
2928checks them against configured limits and switches to appropriate (also
2929pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2930other @code{hwmon} driver that enables temperature reading and fan control
2931from userspace.")
2932 (license license:gpl3+)))
91231156
LC
2933
2934(define-public ntfs-3g
2935 (package
2936 (name "ntfs-3g")
2937 (version "2016.2.22")
2938 (source (origin
2939 (method url-fetch)
2940 (uri (string-append "https://tuxera.com/opensource/"
2941 "ntfs-3g_ntfsprogs-" version ".tgz"))
2942 (sha256
2943 (base32
2944 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
2945 (modules '((guix build utils)))
1a82ba66 2946 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
91231156
LC
2947 (snippet
2948 ;; Install under $prefix.
2949 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
2950 (("/sbin")
2951 "@sbindir@")))))
2952 (build-system gnu-build-system)
2953 (inputs `(("util-linux" ,util-linux)
2954 ("fuse" ,fuse))) ;libuuid
2955 (native-inputs `(("pkg-config" ,pkg-config)))
2956 (arguments
2957 '(#:configure-flags (list "--exec-prefix=${prefix}"
2958 "--with-fuse=external" ;use our own FUSE
2959 "--enable-mount-helper"
2960 "--enable-posix-acls"
2961 "--enable-xattr-mappings")))
2962 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
2963 (synopsis "Read-write access to NTFS file systems")
2964 (description
2965 "NTFS-3G provides read-write access to NTFS file systems, which are
2966commonly found on Microsoft Windows. It is implemented as a FUSE file system.
2967The package provides additional NTFS tools.")
2968 (license license:gpl2+)))
9b0942c1
DC
2969
2970(define-public rng-tools
2971 (package
2972 (name "rng-tools")
2973 (version "5")
2974 (source (origin
2975 (method url-fetch)
2976 (uri (string-append
2977 "http://downloads.sourceforge.net/sourceforge/gkernel/"
2978 "rng-tools-" version ".tar.gz"))
2979 (sha256
2980 (base32
2981 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
2982 (build-system gnu-build-system)
2983 (synopsis "Random number generator daemon")
2984 (description
2985 "Monitor a hardware random number generator, and supply entropy
2986from that to the system kernel's @file{/dev/random} machinery.")
3b3b60d0 2987 (home-page "https://sourceforge.net/projects/gkernel")
9b0942c1
DC
2988 ;; The source package is offered under the GPL2+, but the files
2989 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
2990 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
2991
2992(define-public cpupower
2993 (package
2994 (name "cpupower")
2995 (version (package-version linux-libre))
2996 (source (package-source linux-libre))
2997 (build-system gnu-build-system)
2998 (arguments
2999 '(#:phases (modify-phases %standard-phases
3000 (add-after 'unpack 'enter-subdirectory
3001 (lambda _
3002 (chdir "tools/power/cpupower")))
3003 (delete 'configure)
3004 (add-before 'build 'fix-makefiles
3005 (lambda _
3006 (substitute* "Makefile"
3007 (("/usr/") "/")
3008 (("/bin/(install|pwd)" _ command) command))
3009 (substitute* "bench/Makefile"
3010 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3011 #:make-flags (let ((out (assoc-ref %outputs "out")))
3012 (list (string-append "DESTDIR=" out)
3013 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3014 "docdir=/share/doc/cpupower"
3015 "confdir=$(docdir)/examples"
3016 ;; The Makefile recommends the following changes
3017 "DEBUG=false"
3018 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3019 #:tests? #f)) ;no tests
b94a6ca0 3020 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
3021 (inputs `(("pciutils" ,pciutils)))
3022 (home-page (package-home-page linux-libre))
3023 (synopsis "CPU frequency and voltage scaling tools for Linux")
3024 (description
3025 "cpupower is a set of user-space tools that use the cpufreq feature of the
3026Linux kernel to retrieve and control processor features related to power saving,
3027such as frequency and voltage scaling.")
3028 (license license:gpl2)))
2b76f135
TGR
3029
3030(define-public haveged
3031 (package
3032 (name "haveged")
3033 (version "1.9.1")
3034 (source
3035 (origin
3036 (method url-fetch)
3037 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3038 version ".tar.gz"))
3039 (sha256
3040 (base32
3041 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3042 (build-system gnu-build-system)
3043 (home-page "http://www.issihosts.com/haveged")
3044 (synopsis "Entropy source for the Linux random number generator")
3045 (description
3046 "haveged generates an unpredictable stream of random numbers for use by
3047Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3048standard mechanisms for filling the entropy pool may not be sufficient for
3049systems with high needs or limited user interaction, such as headless servers.
3050@command{haveged} runs as a privileged daemon, harvesting randomness from the
3051indirect effects of hardware events on hidden processor state using the HArdware
3052Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3053its environment and provides the same built-in test suite for the output stream
3054as used on certified hardware security devices.")
3055 (license (list (license:non-copyleft "file://nist/mconf.h")
3056 (license:non-copyleft "file://nist/packtest.c")
3057 license:public-domain ; nist/dfft.c
3058 license:gpl3+)))) ; everything else
e385e957
TGR
3059
3060(define-public ecryptfs-utils
3061 (package
3062 (name "ecryptfs-utils")
3063 (version "111")
3064 (source
3065 (origin
3066 (method url-fetch)
3067 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3068 version "/+download/ecryptfs-utils_"
3069 version ".orig.tar.gz"))
3070 (sha256
3071 (base32
3072 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3073 (build-system gnu-build-system)
3074 (arguments
3075 `(#:configure-flags (list "--disable-pywrap")))
3076 (native-inputs
3077 `(("intltool" ,intltool)
3078 ("perl" ,perl) ; for pod2man
3079 ("pkg-config" ,pkg-config)))
3080 (inputs
3081 `(("keyutils" ,keyutils)
3082 ("linux-pam" ,linux-pam)
3083 ("nss" ,nss)))
3084 (home-page "http://ecryptfs.org/")
3085 (synopsis "eCryptfs cryptographic file system utilities")
3086 (description
3087 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3088Each file's cryptographic meta-data is stored inside the file itself, along
3089with the encrypted contents. This allows individual encrypted files to be
3090copied between hosts and still be decrypted with the proper key. eCryptfs is a
3091native Linux file system, and has been part of the Linux kernel since version
30922.6.19. This package contains the userland utilities to manage it.")
3093 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3094 ;; grant additional permission to link with OpenSSL.
3095 (license license:gpl2+)))
cff0adec
DC
3096
3097(define-public libnfsidmap
3098 (package
3099 (name "libnfsidmap")
3100 (version "0.25")
3101 (source (origin
3102 (method url-fetch)
3103 (uri (string-append
3104 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3105 name "/" name "-" version ".tar.gz"))
3106 (sha256
3107 (base32
3108 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3109 (build-system gnu-build-system)
3110 (arguments
3111 `(#:configure-flags (list
3112 (string-append "--with-pluginpath="
3113 (assoc-ref %outputs "out")
3114 "/lib/libnfsidmap"))))
3115 (home-page
3116 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3117 (synopsis
3118 "NFSv4 support library for name/ID mapping")
3119 (description "Libnfsidmap is a library holding mulitiple methods of
3120mapping names to ids and visa versa, mainly for NFSv4. It provides an
3121extensible array of mapping functions, currently consisting of two choices:
3122the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3123 (license (license:non-copyleft "file://COPYING"
3124 "See COPYING in the distribution."))))
035d3593
DC
3125
3126(define-public module-init-tools
3127 (package
3128 (name "module-init-tools")
3129 (version "3.16")
3130 (source (origin
3131 (method url-fetch)
3132 (uri (string-append
3133 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3134 "module-init-tools-" version ".tar.bz2"))
3135 (sha256
3136 (base32
3137 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3138 (patches (search-patches "module-init-tools-moduledir.patch"))))
3139 (build-system gnu-build-system)
3140 (arguments
3141 ;; FIXME: The upstream tarball lacks man pages, and building them would
3142 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3143 ;; but they vanished. In the meantime, fake it.
3144 '(#:phases (alist-cons-before
3145 'configure 'fake-docbook
3146 (lambda _
3147 (substitute* "Makefile.in"
3148 (("^DOCBOOKTOMAN.*$")
3149 "DOCBOOKTOMAN = true\n")))
3150 %standard-phases)))
3151 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3152 (synopsis "Tools for loading and managing Linux kernel modules")
3153 (description
3154 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3155`insmod', `lsmod', and more.")
3156 (license license:gpl2+)))
dd65f3b7
TGR
3157
3158(define-public mcelog
3159 (package
3160 (name "mcelog")
bd9b8d89 3161 (version "149")
dd65f3b7
TGR
3162 (source (origin
3163 (method url-fetch)
3164 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3165 "mcelog.git/snapshot/v" version ".tar.gz"))
3166 (sha256
3167 (base32
bd9b8d89 3168 "08hd8bl9rgss990icb69srarrfwcg8k7py979ak753j92ybbkhdm"))
dd65f3b7
TGR
3169 (file-name (string-append name "-" version ".tar.gz"))
3170 (modules '((guix build utils)))
3171 (snippet
3172 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3173 `(substitute* "Makefile"
3174 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3175 (build-system gnu-build-system)
3176 (arguments
3177 `(#:phases (modify-phases %standard-phases
3178 (delete 'configure)) ; no configure script
3179 #:make-flags (let ((out (assoc-ref %outputs "out")))
3180 (list "CC=gcc"
3181 (string-append "prefix=" out)
3182 (string-append "DOCDIR=" out "/share/doc/mcelog")
3183 "etcprefix=$(DOCDIR)/examples"))
3184 ;; The tests will only run as root on certain supported CPU models.
3185 #:tests? #f))
3186 (supported-systems (list "i686-linux" "x86_64-linux"))
3187 (home-page "http://mcelog.org/")
3188 (synopsis "Machine check monitor for x86 Linux systems")
3189 (description
3190 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3191and other hardware errors on x86 systems. It can also perform user-defined
3192tasks, such as bringing bad pages off-line, when configurable error thresholds
3193are exceeded.")
3194 (license license:gpl2)))
0c60cc53
DM
3195
3196(define-public mtd-utils
3197 (package
3198 (name "mtd-utils")
3199 (version "1.5.2")
3200 (source (origin
3201 (method url-fetch)
3202 (uri (string-append
3203 "ftp://ftp.infradead.org/pub/mtd-utils/"
3204 "mtd-utils-" version ".tar.bz2"))
3205 (sha256
3206 (base32
3207 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3208 (inputs
3209 `(("acl" ,acl)
3210 ("libuuid" ,util-linux)
3211 ("lzo", lzo)
3212 ("zlib" ,zlib)))
3213 (build-system gnu-build-system)
3214 (arguments
3215 `(#:test-target "tests"
3216 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3217 #:phases (modify-phases %standard-phases
3218 (delete 'configure))))
3219 (synopsis "MTD Flash Storage Utilities")
3220 (description "This package provides utilities for testing, partitioning, etc
3221of flash storage.")
3222 (home-page "http://www.linux-mtd.infradead.org/")
3223 (license
3224 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3225 license:mpl1.1 ; All ftl* files
3226 license:expat)))) ; libiniparser
def6213f
LF
3227
3228(define-public libseccomp
3229 (package
3230 (name "libseccomp")
488a3734 3231 (version "2.3.2")
def6213f
LF
3232 (source (origin
3233 (method url-fetch)
3234 (uri (string-append "https://github.com/seccomp/libseccomp/"
3235 "releases/download/v" version
3236 "/libseccomp-" version ".tar.gz"))
3237 (sha256
3238 (base32
488a3734 3239 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
def6213f
LF
3240 (build-system gnu-build-system)
3241 (native-inputs
3242 `(("which" ,which)))
3243 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3244 (description "The libseccomp library provides an easy to use, platform
3245independent, interface to the Linux Kernel's syscall filtering mechanism. The
3246libseccomp API is designed to abstract away the underlying BPF based syscall
3247filter language and present a more conventional function-call based filtering
3248interface that should be familiar to, and easily adopted by, application
3249developers.")
3250 (home-page "https://github.com/seccomp/libseccomp")
3251 (license license:lgpl2.1)))
58c4f11e
TGR
3252
3253(define-public radeontop
3254 (package
3255 (name "radeontop")
3256 (version "0.9")
3257 (home-page "https://github.com/clbr/radeontop/")
3258 (source (origin
3259 (method url-fetch)
3260 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3261 (file-name (string-append name "-" version ".tar.gz"))
3262 (sha256
3263 (base32
3264 "07fnimn6wwablmdjw0av11hk9a6xilbryh09izq4b2ic4b8md2p7"))))
3265 (build-system gnu-build-system)
3266 (arguments
3267 `(#:phases (modify-phases %standard-phases
3268 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3269 ;; dependency, and doesn't even work on release(!) tarballs.
3270 (add-after 'unpack 'report-correct-version
3271 (lambda _ (substitute* "getver.sh"
3272 (("ver=unknown")
3273 (string-append "ver=" ,version)))))
3274 (delete 'configure)) ; no configure script
3275 #:make-flags (list "CC=gcc"
3276 (string-append "PREFIX=" %output))
3277 #:tests? #f)) ; no tests
3278 (native-inputs
7c90d0f4 3279 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
3280 ("pkg-config" ,pkg-config)))
3281 (inputs
3282 `(("libdrm" ,libdrm)
3283 ("libpciaccess" ,libpciaccess)
3284 ("ncurses" ,ncurses)))
3285 (synopsis "Usage monitor for AMD Radeon graphics")
3286 (description "RadeonTop monitors resource consumption on supported AMD
3287Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3288a terminal or saved to a file for further processing. It measures both the
3289activity of the GPU as a whole, which is also accurate during OpenCL
3290computations, as well as separate component statistics that are only meaningful
3291under OpenGL graphics workloads.")
3292 (license license:gpl3)))
0d74462a
MB
3293
3294(define-public efivar
3295 (package
3296 (name "efivar")
3297 (version "30")
3298 (source (origin
3299 (method url-fetch)
3300 (uri (string-append "https://github.com/rhinstaller/" name
3301 "/releases/download/" version "/" name
3302 "-" version ".tar.bz2"))
3303 (sha256
3304 (base32
3305 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3306 (build-system gnu-build-system)
3307 (arguments
3308 `(;; Tests require a UEFI system and is not detected in the chroot.
3309 #:tests? #f
3310 #:make-flags (list (string-append "prefix=" %output)
3311 (string-append "libdir=" %output "/lib")
3312 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3313 #:phases
3314 (modify-phases %standard-phases
3315 (delete 'configure))))
3316 (native-inputs
3317 `(("pkg-config" ,pkg-config)))
3318 (inputs
3319 `(("popt" ,popt)))
3320 (home-page "https://github.com/rhinstaller/efivar")
3321 (synopsis "Tool and library to manipulate EFI variables")
3322 (description "This package provides a library and a command line
3323interface to the variable facility of UEFI boot firmware.")
3324 (license license:lgpl2.1+)))
1581406e
MB
3325
3326(define-public efibootmgr
3327 (package
3328 (name "efibootmgr")
3329 (version "14")
3330 (source (origin
3331 (method url-fetch)
3332 (uri (string-append "https://github.com/rhinstaller/" name
3333 "/releases/download/" version "/" name
3334 "-" version ".tar.bz2"))
3335 (sha256
3336 (base32
3337 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3338 (build-system gnu-build-system)
3339 (arguments
3340 `(#:tests? #f ; No tests.
3341 #:make-flags (list (string-append "prefix=" %output)
3342 (string-append "libdir=" %output "/lib")
3343 ;; Override CFLAGS to add efivar include directory.
3344 (string-append "CFLAGS=-O2 -g -flto -I"
3345 (assoc-ref %build-inputs "efivar")
3346 "/include/efivar"))
3347 #:phases
3348 (modify-phases %standard-phases
3349 (add-after 'unpack 'branding
3350 ;; Replace default loader path with something more familiar.
3351 (lambda _
3352 (substitute* "src/efibootmgr.c"
3353 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3354 "EFI\\\\gnu"))
3355 #t))
3356 (delete 'configure))))
3357 (native-inputs
3358 `(("pkg-config" ,pkg-config)))
3359 (inputs
3360 `(("efivar" ,efivar)
3361 ("popt" ,popt)))
3362 (home-page "https://github.com/rhinstaller/efibootmgr")
3363 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3364 (description
3365 "@code{efibootmgr} is a user-space application to modify the Intel
3366Extensible Firmware Interface (EFI) Boot Manager. This application can
3367create and destroy boot entries, change the boot order, change the next
3368running boot option, and more.")
3369 (license license:gpl2+)))
6d3e08d4
LF
3370
3371(define-public sysstat
3372 (package
3373 (name "sysstat")
3374 (version "11.4.2")
3375 (source (origin
3376 (method url-fetch)
3377 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3378 "sysstat-" version ".tar.xz"))
3379 (sha256
3380 (base32
3381 "0f8gk1hma3bk198ziwrhh5jhisnbbgc1v4rxhny58n0zjzw0gm0z"))))
3382 (build-system gnu-build-system)
3383 (arguments
3384 `(#:tests? #f ; No test suite.
3385 ;; Without this flag, it tries to install the man pages with group 'root'
3386 ;; and fails because /etc/passwd lacks an entry for the root user.
3387 #:configure-flags
3388 (list "--disable-file-attr"
3389 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3390 #:phases
3391 (modify-phases %standard-phases
3392 ;; The build process tries to create '/var/lib/sa', so we skip that
3393 ;; instruction.
3394 (add-after 'build 'skip-touching-var
3395 (lambda _
3396 (substitute* "Makefile"
3397 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3398 ""))
3399 #t)))))
3400 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3401 (synopsis "Performance monitoring tools for Linux")
3402 (description "The sysstat utilities are a collection of performance
3403monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3404@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3405@code{sadf} and @code{sa}.")
3406 (license license:gpl2+)))
01be4f93
JMSG
3407
3408(define-public light
3409 (package
3410 (name "light")
3411 (version "1.0")
3412 (source (origin
3413 (method url-fetch)
3414 (uri (string-append "https://github.com/haikarainen/" name
3415 "/archive/v" version ".tar.gz"))
3416 (sha256
3417 (base32
3418 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3419 (file-name (string-append name "-" version ".tar.gz"))))
3420 (build-system gnu-build-system)
3421 (arguments
3422 '(#:tests? #f ; no tests
3423 #:make-flags (list "CC=gcc"
3424 (string-append "PREFIX=" %output))
3425 #:phases
3426 (modify-phases %standard-phases
3427 (delete 'configure)
3428 (add-after 'unpack 'patch-makefile
3429 (lambda _
3430 (substitute* "Makefile" (("chown") "#")))))))
3431 (native-inputs
3432 `(("help2man" ,help2man)))
3433 (home-page "https://haikarainen.github.io/light")
3434 (synopsis "GNU/Linux application to control backlights")
3435 (description
3436 "Light is a program to send commands to screen backlight controllers
3437under GNU/Linux. Features include:
3438
3439@itemize
3440@item It does not rely on X.
3441@item Light can automatically figure out the best controller to use, making
3442full use of underlying hardware.
3443@item It is possible to set a minimum brightness value, as some controllers
3444set the screen to be pitch black at a vaĺue of 0 (or higher).
3445@end itemize
3446
3447Light is the successor of lightscript.")
3448 (license license:gpl3+)))
189d8422 3449
c7adafa7
MO
3450(define-public tlp
3451 (package
3452 (name "tlp")
3453 (version "0.9")
3454 (source (origin
3455 (method url-fetch)
3456 (uri (string-append
3457 "https://github.com/linrunner/"
3458 (string-upcase name)
3459 "/archive/" version ".tar.gz"))
3460 (file-name (string-append name "-" version ".tar.gz"))
3461 (sha256
3462 (base32
3463 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3464 (inputs `(("bash" ,bash)
3465 ("dbus" ,dbus)
3466 ("ethtool" ,ethtool)
3467 ("eudev" ,eudev)
3468 ("grep" ,grep)
3469 ("hdparm" ,hdparm)
3470 ("inetutils" ,inetutils)
3471 ("iw" ,iw)
3472 ("kmod" ,kmod)
3473 ("pciutils" ,pciutils)
3474 ("perl" ,perl)
3475 ("rfkill" ,rfkill)
3476 ("sed" ,sed)
3477 ("usbutils" ,usbutils)
3478 ("util-linux" ,util-linux)
3479 ("wireless-tools" ,wireless-tools)))
3480 (build-system gnu-build-system)
3481 (arguments
3482 `(#:phases
3483 (modify-phases %standard-phases
3484 (delete 'configure)
3485 (add-before 'build 'setenv
3486 (lambda* (#:key outputs #:allow-other-keys)
3487 (let ((out (assoc-ref outputs "out")))
3488 (setenv "TLP_WITH_SYSTEMD" "0")
3489 (setenv "TLP_NO_INIT" "1")
3490 (setenv "TLP_NO_PMUTILS" "1")
3491 (setenv "TLP_SBIN" (string-append out "/bin"))
3492 (setenv "TLP_BIN" (string-append out "/bin"))
3493 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3494 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
32e75b48 3495 (setenv "TLP_CONF" "/etc/tlp")
c7adafa7
MO
3496 (setenv "TLP_SHCPL"
3497 (string-append out "/share/bash-completion/completions"))
3498 (setenv "TLP_MAN" (string-append out "/share/man")))))
3499 (delete 'check)
3500 (replace 'install
3501 (lambda _
3502 (system "make install-tlp install-man")))
3503 (add-after 'install 'wrap
3504 (lambda* (#:key inputs outputs #:allow-other-keys)
3505 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3506 (bin-files (find-files bin ".*")))
3507 (define (bin-directory input-name)
3508 (string-append (assoc-ref inputs input-name) "/bin"))
3509 (define (sbin-directory input-name)
3510 (string-append (assoc-ref inputs input-name) "/sbin"))
3511 (for-each (lambda (program)
3512 (wrap-program program
3513 `("PATH" ":" prefix
3514 ,(append
3515 (map bin-directory '("bash"
3516 "coreutils"
3517 "dbus"
3518 "eudev"
3519 "grep"
3520 "inetutils"
3521 "kmod"
3522 "perl"
3523 "sed"
3524 "usbutils"
3525 "util-linux"))
3526 (map sbin-directory '("ethtool"
3527 "hdparm"
3528 "iw"
3529 "pciutils"
3530 "rfkill"
3531 "wireless-tools"))))))
3532 bin-files)))))))
3533 (home-page "http://linrunner.de/en/tlp/tlp.html")
3534 (synopsis "Power management tool for Linux")
3535 (description "TLP is a power management tool for Linux. It comes with
3536a default configuration already optimized for battery life. Nevertheless,
3537TLP is customizable to fulfil system requirements. TLP settings are applied
3538every time the power supply source is changed.")
3539
3540 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3541 ;; rest is GPLv2+.
3542 (license (list license:gpl2+ license:gpl3+))))
3543
189d8422
BG
3544(define-public lshw
3545 (package
3546 (name "lshw")
3547 (version "B.02.18")
3548 (source (origin
3549 (method url-fetch)
3550 (uri (string-append "https://www.ezix.org/software/"
3551 "files/lshw-" version
3552 ".tar.gz"))
3553 (sha256
3554 (base32
3555 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3556 (build-system gnu-build-system)
3557 (arguments
3558 `(#:phases (modify-phases %standard-phases (delete 'configure))
3559 #:tests? #f ; no tests
3560 #:make-flags
3561 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3562 (synopsis "List hardware information")
3563 (description
3564 "@command{lshw} (Hardware Lister) is a small tool to provide
3565detailed information on the hardware configuration of the machine.
3566It can report exact memory configuration, firmware version, mainboard
3567configuration, CPU version and speed, cache configuration, bus speed,
3568and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3569machines (PowerMac G4 is known to work).")
3570 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3571 (license license:gpl2+)))