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