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