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