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