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