gnu: bootstrap: Add the location of ld.so on arm64.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
400ed6ac 2;;; Copyright © 2012, 2013, 2014, 2015, 2016 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>
beed3af5 5;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw@netris.org>
31aa4379 6;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
e1e27737 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
ebf89f13 8;;; Copyright © 2015, 2016 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
fc686f9a 10;;; Copyright © 2016 Tobias Geerinckx-Rice <tobias.geerinckx.rice@gmail.com>
b53e44fb 11;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
96e9f097 12;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
fd76c904 13;;;
233e7676 14;;; This file is part of GNU Guix.
fd76c904 15;;;
233e7676 16;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
17;;; under the terms of the GNU General Public License as published by
18;;; the Free Software Foundation; either version 3 of the License, or (at
19;;; your option) any later version.
20;;;
233e7676 21;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
22;;; WITHOUT ANY WARRANTY; without even the implied warranty of
23;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24;;; GNU General Public License for more details.
25;;;
26;;; You should have received a copy of the GNU General Public License
233e7676 27;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 28
1ffa7090 29(define-module (gnu packages linux)
3ac73271 30 #:use-module ((guix licenses) #:prefix license:)
59a43334 31 #:use-module (gnu packages)
f61e0e79 32 #:use-module (gnu packages compression)
3b027388 33 #:use-module (gnu packages gcc)
1ffa7090 34 #:use-module (gnu packages flex)
90a0048f 35 #:use-module (gnu packages bison)
9f533d60 36 #:use-module (gnu packages admin)
d7d42d6b 37 #:use-module (gnu packages gperf)
1ffa7090
LC
38 #:use-module (gnu packages libusb)
39 #:use-module (gnu packages ncurses)
d7d42d6b 40 #:use-module (gnu packages pciutils)
5f96f303 41 #:use-module (gnu packages databases)
1ffa7090
LC
42 #:use-module (gnu packages perl)
43 #:use-module (gnu packages pkg-config)
7c0dbe78 44 #:use-module (gnu packages python)
b1fb4b23 45 #:use-module (gnu packages slang)
e7b38500 46 #:use-module (gnu packages algebra)
1dba6407 47 #:use-module (gnu packages gettext)
db288efa 48 #:use-module (gnu packages glib)
17b293a0 49 #:use-module (gnu packages pulseaudio)
c762e82e 50 #:use-module (gnu packages attr)
17b293a0 51 #:use-module (gnu packages xml)
215b6431 52 #:use-module (gnu packages autotools)
f57d2639 53 #:use-module (gnu packages texinfo)
b10e9ff6 54 #:use-module (gnu packages check)
30016044 55 #:use-module (gnu packages maths)
ce0614dd 56 #:use-module (gnu packages base)
30016044 57 #:use-module (gnu packages rrdtool)
b62fe07f 58 #:use-module (gnu packages elf)
b087d413 59 #:use-module (gnu packages gtk)
d7ece67a
LC
60 #:use-module (gnu packages docbook)
61 #:use-module (gnu packages asciidoc)
eb7c43c3
DT
62 #:use-module (gnu packages readline)
63 #:use-module (gnu packages calendar)
75343704 64 #:use-module (gnu packages tls)
02b80c3f
NK
65 #:use-module (guix packages)
66 #:use-module (guix download)
dc2d59af 67 #:use-module (guix utils)
7c0dbe78 68 #:use-module (guix build-system gnu)
220193ad 69 #:use-module (guix build-system cmake)
e102f940 70 #:use-module (guix build-system python)
a94546ec 71 #:use-module (guix build-system trivial)
adddd5ba 72 #:use-module (srfi srfi-1)
17db0706 73 #:use-module (srfi srfi-2)
a94546ec
LC
74 #:use-module (srfi srfi-26)
75 #:use-module (ice-9 match))
fd76c904 76
aaf4cb20
LC
77(define-public (system->linux-architecture arch)
78 "Return the Linux architecture name for ARCH, a Guix system name such as
79\"x86_64-linux\"."
618cea69
NK
80 (let ((arch (car (string-split arch #\-))))
81 (cond ((string=? arch "i686") "i386")
82 ((string-prefix? "mips" arch) "mips")
aaf4cb20 83 ((string-prefix? "arm" arch) "arm")
618cea69
NK
84 (else arch))))
85
6023cc74
LC
86(define (linux-libre-urls version)
87 "Return a list of URLs for Linux-Libre VERSION."
88 (list (string-append
89 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
90 version "-gnu/linux-libre-" version "-gnu.tar.xz")
91
92 ;; XXX: Work around <http://bugs.gnu.org/14851>.
93 (string-append
94 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
95 version "-gnu.tar.xz")
96
97 ;; Maybe this URL will become valid eventually.
98 (string-append
99 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
100 version "-gnu.tar.xz")))
101
80fe5c60 102(define-public linux-libre-headers
e081385a 103 (let* ((version "3.14.37")
80fe5c60 104 (build-phase
618cea69
NK
105 (lambda (arch)
106 `(lambda _
107 (setenv "ARCH" ,(system->linux-architecture arch))
108 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 109
618cea69
NK
110 (and (zero? (system* "make" "defconfig"))
111 (zero? (system* "make" "mrproper" "headers_check"))))))
80fe5c60
LC
112 (install-phase
113 `(lambda* (#:key outputs #:allow-other-keys)
114 (let ((out (assoc-ref outputs "out")))
115 (and (zero? (system* "make"
116 (string-append "INSTALL_HDR_PATH=" out)
117 "headers_install"))
b15389e1
LC
118 (begin
119 (mkdir (string-append out "/include/config"))
120 (call-with-output-file
121 (string-append out
122 "/include/config/kernel.release")
123 (lambda (p)
124 (format p "~a-default~%" ,version)))
125
126 ;; Remove the '.install' and '..install.cmd' files; the
127 ;; latter contains store paths, which pulls in bootstrap
128 ;; binaries in the build environment, and prevents bit
129 ;; reproducibility for the bootstrap binaries.
130 (for-each delete-file (find-files out "\\.install"))
131
132 #t))))))
80fe5c60
LC
133 (package
134 (name "linux-libre-headers")
dfb52abb 135 (version version)
80fe5c60
LC
136 (source (origin
137 (method url-fetch)
6023cc74 138 (uri (linux-libre-urls version))
80fe5c60
LC
139 (sha256
140 (base32
e081385a 141 "1blxr2bsvfqi9khj4cpspv434bmx252zak2wsbi2mgl60zh77gza"))))
80fe5c60
LC
142 (build-system gnu-build-system)
143 (native-inputs `(("perl" ,perl)))
144 (arguments
145 `(#:modules ((guix build gnu-build-system)
146 (guix build utils)
56c092ce 147 (srfi srfi-1))
80fe5c60 148 #:phases (alist-replace
fb6c2fa8
LC
149 'build ,(build-phase (or (%current-target-system)
150 (%current-system)))
80fe5c60
LC
151 (alist-replace
152 'install ,install-phase
56c092ce 153 (alist-delete 'configure %standard-phases)))
b15389e1 154 #:allowed-references ()
80fe5c60
LC
155 #:tests? #f))
156 (synopsis "GNU Linux-Libre kernel headers")
157 (description "Headers of the Linux-Libre kernel.")
3ac73271 158 (license license:gpl2)
80fe5c60
LC
159 (home-page "http://www.gnu.org/software/linux-libre/"))))
160
b4fcb735
LC
161(define-public module-init-tools
162 (package
163 (name "module-init-tools")
164 (version "3.16")
165 (source (origin
166 (method url-fetch)
167 (uri (string-append
168 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
169 version ".tar.bz2"))
170 (sha256
171 (base32
d3bbe992 172 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
fc1adab1 173 (patches (search-patches "module-init-tools-moduledir.patch"))))
b4fcb735 174 (build-system gnu-build-system)
b4fcb735 175 (arguments
5c413a9c
LC
176 ;; FIXME: The upstream tarball lacks man pages, and building them would
177 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
178 ;; but they vanished. In the meantime, fake it.
b4fcb735 179 '(#:phases (alist-cons-before
5c413a9c
LC
180 'configure 'fake-docbook
181 (lambda _
182 (substitute* "Makefile.in"
183 (("^DOCBOOKTOMAN.*$")
184 "DOCBOOKTOMAN = true\n")))
b4fcb735
LC
185 %standard-phases)))
186 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
187 (synopsis "Tools for loading and managing Linux kernel modules")
188 (description
189 "Tools for loading and managing Linux kernel modules, such as `modprobe',
190`insmod', `lsmod', and more.")
3ac73271 191 (license license:gpl2+)))
b4fcb735 192
ac47a7c2
LC
193(define %boot-logo-patch
194 ;; Linux-Libre boot logo featuring Freedo and a gnu.
195 (origin
196 (method url-fetch)
197 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 198 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
199 (sha256
200 (base32
201 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
202
17db0706 203(define* (kernel-config system #:key variant)
a94546ec 204 "Return the absolute file name of the Linux-Libre build configuration file
17db0706
MW
205for SYSTEM and optionally VARIANT, or #f if there is no such configuration."
206 (and-let* ((arch (match system
207 ("i686-linux"
208 "i686")
209 ("x86_64-linux"
210 "x86_64")
211 (_
212 #f)))
213 (name (string-append "linux-libre-"
214 (if variant
215 (string-append variant "-")
216 "")
217 arch
218 ".conf"))
219 (file (string-append "gnu/packages/" name)))
220 (search-path %load-path file)))
a94546ec 221
beacfcab 222(define-public linux-libre
f7cfd80f 223 (let* ((version "4.5.1")
beacfcab 224 (build-phase
ac47a7c2 225 '(lambda* (#:key system inputs #:allow-other-keys #:rest args)
96e9f097
RN
226 ;; Avoid introducing timestamps
227 (setenv "KCONFIG_NOTIMESTAMP" "1")
228 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
229
ac47a7c2 230 ;; Apply the neat patch.
9a224ac2 231 (system* "patch" "-p1" "--force"
ac47a7c2
LC
232 "-i" (assoc-ref inputs "patch/freedo+gnu"))
233
beacfcab
LC
234 (let ((arch (car (string-split system #\-))))
235 (setenv "ARCH"
236 (cond ((string=? arch "i686") "i386")
726029b2 237 ((string=? arch "mips64el") "mips")
beacfcab
LC
238 (else arch)))
239 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
240
a94546ec
LC
241 (let ((build (assoc-ref %standard-phases 'build))
242 (config (assoc-ref inputs "kconfig")))
1650dd8a
LC
243
244 ;; Use the architecture-specific config if available, and
245 ;; 'defconfig' otherwise.
246 (if config
247 (begin
248 (copy-file config ".config")
249 (chmod ".config" #o666))
250 (system* "make" "defconfig"))
a94546ec
LC
251
252 ;; Appending works even when the option wasn't in the
253 ;; file. The last one prevails if duplicated.
254 (let ((port (open-file ".config" "a")))
255 (display (string-append "CONFIG_NET_9P=m\n"
256 "CONFIG_NET_9P_VIRTIO=m\n"
257 "CONFIG_VIRTIO_BLK=m\n"
258 "CONFIG_VIRTIO_NET=m\n"
259 ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
260 "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n"
261 "CONFIG_VIRTIO_PCI=m\n"
262 "CONFIG_VIRTIO_BALLOON=m\n"
263 "CONFIG_VIRTIO_MMIO=m\n"
264 "CONFIG_FUSE_FS=m\n"
265 "CONFIG_CIFS=m\n"
266 "CONFIG_9P_FS=m\n")
267 port)
268 (close-port port))
269
270 (zero? (system* "make" "oldconfig"))
271
272 ;; Call the default `build' phase so `-j' is correctly
273 ;; passed.
274 (apply build #:make-flags "all" args))))
beacfcab
LC
275 (install-phase
276 `(lambda* (#:key inputs outputs #:allow-other-keys)
277 (let* ((out (assoc-ref outputs "out"))
278 (moddir (string-append out "/lib/modules"))
279 (mit (assoc-ref inputs "module-init-tools")))
280 (mkdir-p moddir)
281 (for-each (lambda (file)
282 (copy-file file
283 (string-append out "/" (basename file))))
44a88ce4 284 (find-files "." "^(bzImage|vmlinuz|System\\.map)$"))
beacfcab
LC
285 (copy-file ".config" (string-append out "/config"))
286 (zero? (system* "make"
287 (string-append "DEPMOD=" mit "/sbin/depmod")
288 (string-append "MODULE_DIR=" moddir)
289 (string-append "INSTALL_PATH=" out)
290 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 291 "INSTALL_MOD_STRIP=1"
beacfcab
LC
292 "modules_install"))))))
293 (package
294 (name "linux-libre")
dfb52abb 295 (version version)
beacfcab
LC
296 (source (origin
297 (method url-fetch)
6023cc74 298 (uri (linux-libre-urls version))
beacfcab
LC
299 (sha256
300 (base32
f7cfd80f 301 "1x621kvaf842bzpgglfl31zi74ny9w9jgvmkz3z6m3708n8clrdh"))))
beacfcab 302 (build-system gnu-build-system)
6c8d70b0 303 (supported-systems '("x86_64-linux" "i686-linux"))
beacfcab 304 (native-inputs `(("perl" ,perl)
e7b38500 305 ("bc" ,bc)
75343704 306 ("openssl" ,openssl)
ac47a7c2 307 ("module-init-tools" ,module-init-tools)
a94546ec 308 ("patch/freedo+gnu" ,%boot-logo-patch)
1650dd8a 309
75b314a6
MW
310 ,@(let ((conf (kernel-config
311 (or (%current-target-system)
312 (%current-system))
313 #:variant (version-major+minor version))))
1650dd8a
LC
314 (if conf
315 `(("kconfig" ,conf))
316 '()))))
beacfcab
LC
317 (arguments
318 `(#:modules ((guix build gnu-build-system)
319 (guix build utils)
320 (srfi srfi-1)
321 (ice-9 match))
322 #:phases (alist-replace
323 'build ,build-phase
324 (alist-replace
325 'install ,install-phase
326 (alist-delete 'configure %standard-phases)))
327 #:tests? #f))
f50d2669 328 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 329 (description
79c311b8
LC
330 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
331It has been modified to remove all non-free binary blobs.")
3ac73271 332 (license license:gpl2)
beacfcab
LC
333 (home-page "http://www.gnu.org/software/linux-libre/"))))
334
75b314a6
MW
335(define-public linux-libre-4.4
336 (package
337 (inherit linux-libre)
557a2503 338 (version "4.4.7")
75b314a6
MW
339 (source (origin
340 (method url-fetch)
341 (uri (linux-libre-urls version))
342 (sha256
343 (base32
557a2503 344 "031wh2k204zvshira28bf33sk1bbk19ilgqmkvkwjp6spk5wmvpq"))))
75b314a6
MW
345 (native-inputs
346 (let ((conf (kernel-config (or (%current-target-system)
347 (%current-system))
348 #:variant "4.4")))
349 `(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
350 ("kconfig" ,conf))))))
351
adddd5ba
MW
352(define-public linux-libre-4.1
353 (package
354 (inherit linux-libre)
1a9f5e9f 355 (version "4.1.21")
adddd5ba
MW
356 (source (origin
357 (method url-fetch)
358 (uri (linux-libre-urls version))
359 (sha256
360 (base32
1a9f5e9f 361 "1gfzwiinpxzhqb5xi7b1iv7ay96nrjlhia6bvcyq8ffkx7a2r715"))))
adddd5ba
MW
362 (native-inputs
363 (let ((conf (kernel-config (or (%current-target-system)
364 (%current-system))
365 #:variant "4.1")))
366 `(,@(alist-delete "kconfig" (package-native-inputs linux-libre))
367 ("kconfig" ,conf))))))
368
97121c2a 369\f
c84d0eca
LC
370;;;
371;;; Pluggable authentication modules (PAM).
372;;;
373
fd76c904
LC
374(define-public linux-pam
375 (package
376 (name "linux-pam")
e3780200 377 (version "1.2.1")
fd76c904
LC
378 (source
379 (origin
380 (method url-fetch)
381 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
382 version ".tar.bz2")
383 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
384 version ".tar.bz2")))
385 (sha256
386 (base32
e3780200 387 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))))
fd76c904 388 (build-system gnu-build-system)
c4c4cc05 389 (native-inputs
fd76c904
LC
390 `(("flex" ,flex)
391
392 ;; TODO: optional dependencies
393 ;; ("libxcrypt" ,libxcrypt)
394 ;; ("cracklib" ,cracklib)
395 ))
396 (arguments
c134056a
LC
397 '(;; Most users, such as `shadow', expect the headers to be under
398 ;; `security'.
399 #:configure-flags (list (string-append "--includedir="
400 (assoc-ref %outputs "out")
401 "/include/security"))
402
403 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
404 ;; isn't available.
405 #:tests? #f))
fd76c904
LC
406 (home-page "http://www.linux-pam.org/")
407 (synopsis "Pluggable authentication modules for Linux")
408 (description
409 "A *Free* project to implement OSF's RFC 86.0.
410Pluggable authentication modules are small shared object files that can
411be used through the PAM API to perform tasks, like authenticating a user
e881752c 412at login. Local and dynamic reconfiguration are its key features.")
3ac73271 413 (license license:bsd-3)))
686f14e8 414
53142109 415
c84d0eca
LC
416;;;
417;;; Miscellaneous.
418;;;
419
686f14e8
LC
420(define-public psmisc
421 (package
422 (name "psmisc")
423 (version "22.20")
424 (source
425 (origin
426 (method url-fetch)
427 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
428 version ".tar.gz"))
429 (sha256
430 (base32
431 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
432 (build-system gnu-build-system)
433 (inputs `(("ncurses" ,ncurses)))
434 (home-page "http://psmisc.sourceforge.net/")
435 (synopsis
35b9e423 436 "Small utilities that use the proc filesystem")
686f14e8
LC
437 (description
438 "This PSmisc package is a set of some small useful utilities that
35b9e423 439use the proc filesystem. We're not about changing the world, but
686f14e8 440providing the system administrator with some help in common tasks.")
3ac73271 441 (license license:gpl2+)))
02b80c3f
NK
442
443(define-public util-linux
444 (package
445 (name "util-linux")
57a66c27 446 (version "2.27")
5a6a3ba4
LC
447 (source (origin
448 (method url-fetch)
449 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
450 name "/v" (version-major+minor version) "/"
451 name "-" version ".tar.xz"))
5a6a3ba4
LC
452 (sha256
453 (base32
57a66c27 454 "1ivdx1bhjbakf77agm9dn3wyxia1wgz9lzxgd61zqxw3xzih9gzw"))
fc1adab1 455 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
456 (modules '((guix build utils)))
457 (snippet
ec2da92c
LC
458 ;; We take the 'logger' program from GNU Inetutils and 'kill'
459 ;; from GNU Coreutils.
8338c241
MW
460 '(begin
461 (substitute* "configure"
462 (("build_logger=yes") "build_logger=no")
463 (("build_kill=yes") "build_kill=no"))
464 #t))))
02b80c3f
NK
465 (build-system gnu-build-system)
466 (arguments
29ec55ee 467 `(#:configure-flags (list "--disable-use-tty-group"
29ec55ee 468
85c7e8e6
DT
469 ;; Do not build .a files to save 2 MiB.
470 "--disable-static"
471
29ec55ee
LC
472 ;; Install completions where our
473 ;; bash-completion package expects them.
474 (string-append "--with-bashcompletiondir="
475 (assoc-ref %outputs "out")
476 "/etc/bash_completion.d"))
1b9cf4ad 477 #:phases (modify-phases %standard-phases
7e512497
LC
478 (add-before
479 'build 'set-umount-file-name
480 (lambda* (#:key outputs #:allow-other-keys)
481 ;; Tell 'eject' the right file name of 'umount'.
482 (let ((out (assoc-ref outputs "out")))
483 (substitute* "sys-utils/eject.c"
484 (("\"/bin/umount\"")
485 (string-append "\"" out "/bin/umount\"")))
486 #t)))
1b9cf4ad
LC
487 (add-before
488 'check 'pre-check
489 (lambda* (#:key inputs outputs #:allow-other-keys)
490 (let ((out (assoc-ref outputs "out"))
491 (net (assoc-ref inputs "net-base")))
492 ;; Change the test to refer to the right file.
493 (substitute* "tests/ts/misc/mcookie"
494 (("/etc/services")
495 (string-append net "/etc/services")))
496 #t))))))
f61e0e79 497 (inputs `(("zlib" ,zlib)
c4c4cc05
JD
498 ("ncurses" ,ncurses)))
499 (native-inputs
9f533d60
LC
500 `(("perl" ,perl)
501 ("net-base" ,net-base))) ;for tests
02b80c3f 502 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 503 (synopsis "Collection of utilities for the Linux kernel")
437d7286
LF
504 (description "Util-linux is a diverse collection of Linux kernel
505utilities. It provides dmesg and includes tools for working with filesystems,
506block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 507
02b80c3f 508 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 509 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 510 ;; explicitly defined license.
3ac73271
LC
511 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
512 license:bsd-4 license:public-domain))))
5d5c4278 513
e47e3eff
LC
514(define-public procps
515 (package
516 (name "procps")
0cc22848 517 (version "3.3.11")
e47e3eff 518 (source (origin
0cc22848
SB
519 (method url-fetch)
520 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
521 "procps-ng-" version ".tar.xz"))
522 (sha256
523 (base32
524 "1va4n0mpsq327ca9dqp4hnrpgs6821rp0f2m0jyc1bfjl9lk2jg9"))))
e47e3eff 525 (build-system gnu-build-system)
e47e3eff 526 (arguments
80393eed
LC
527 '(#:modules ((guix build utils)
528 (guix build gnu-build-system)
529 (srfi srfi-1)
530 (srfi srfi-26))
0cc22848
SB
531 #:phases
532 (modify-phases %standard-phases
533 (add-after
534 'install 'post-install
535 ;; Remove commands and man pages redudant with
536 ;; Coreutils.
537 (lambda* (#:key outputs #:allow-other-keys)
538 (let* ((out (assoc-ref outputs "out"))
539 (dup (append-map (cut find-files out <>)
540 '("^kill" "^uptime"))))
541 (for-each delete-file dup)
542 #t))))))
543 (inputs `(("ncurses" ,ncurses)))
544 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 545 (synopsis "Utilities that give information about processes")
e47e3eff 546 (description
35b9e423 547 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
548that give information about processes using the Linux /proc file system.
549The package includes the programs ps, top, vmstat, w, kill, free,
550slabtop, and skill.")
3ac73271 551 (license license:gpl2)))
e47e3eff 552
5d5c4278
NK
553(define-public usbutils
554 (package
555 (name "usbutils")
556 (version "006")
557 (source
558 (origin
559 (method url-fetch)
560 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
561 "usbutils-" version ".tar.xz"))
562 (sha256
563 (base32
564 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
565 (build-system gnu-build-system)
566 (inputs
c4c4cc05
JD
567 `(("libusb" ,libusb)))
568 (native-inputs
569 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
570 (home-page "http://www.linux-usb.org/")
571 (synopsis
572 "Tools for working with USB devices, such as lsusb")
573 (description
574 "Tools for working with USB devices, such as lsusb.")
3ac73271 575 (license license:gpl2+)))
0750452a
LC
576
577(define-public e2fsprogs
578 (package
579 (name "e2fsprogs")
7409c8d4 580 (version "1.42.13")
0750452a
LC
581 (source (origin
582 (method url-fetch)
7409c8d4
MW
583 (uri (string-append
584 "mirror://kernel.org/linux/kernel/people/tytso/"
585 name "/v" version "/"
586 name "-" version ".tar.xz"))
0750452a
LC
587 (sha256
588 (base32
7409c8d4 589 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
7c594a2c
LC
590 (modules '((guix build utils)))
591 (snippet
592 '(substitute* "MCONFIG.in"
593 (("INSTALL_SYMLINK = /bin/sh")
594 "INSTALL_SYMLINK = sh")))))
0750452a 595 (build-system gnu-build-system)
c4c4cc05 596 (inputs `(("util-linux" ,util-linux)))
f57d2639 597 (native-inputs `(("pkg-config" ,pkg-config)
7c594a2c 598 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
0750452a 599 (arguments
097e012b 600 '(;; util-linux is the preferred source for some of the libraries and
c44ed26c 601 ;; commands, so disable them (see, e.g.,
a124bbd2 602 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
c44ed26c
LC
603 #:configure-flags '("--disable-libblkid"
604 "--disable-libuuid" "--disable-uuidd"
605 "--disable-fsck"
7c594a2c
LC
606
607 ;; Install libext2fs et al.
608 "--enable-elf-shlibs")
609
610 #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
611 (assoc-ref %outputs "out")
612 "/lib"))
ddfc2fd8
LC
613
614 #:phases (alist-cons-before
0750452a
LC
615 'configure 'patch-shells
616 (lambda _
617 (substitute* "configure"
618 (("/bin/sh (.*)parse-types.sh" _ dir)
619 (string-append (which "sh") " " dir
620 "parse-types.sh")))
621 (substitute* (find-files "." "^Makefile.in$")
622 (("#!/bin/sh")
623 (string-append "#!" (which "sh")))))
1c975f60
LC
624 (alist-cons-after
625 'install 'install-libs
853c2f18
LC
626 (lambda* (#:key outputs #:allow-other-keys)
627 (let* ((out (assoc-ref outputs "out"))
628 (lib (string-append out "/lib")))
629 (and (zero? (system* "make" "install-libs"))
630
631 ;; Make the .a writable so that 'strip' works.
632 ;; Failing to do that, due to debug symbols, we
633 ;; retain a reference to the final
634 ;; linux-libre-headers, which refer to the
635 ;; bootstrap binaries.
636 (let ((archives (find-files lib "\\.a$")))
637 (for-each (lambda (file)
638 (chmod file #o666))
639 archives)
640 #t))))
1c975f60 641 %standard-phases))
0750452a
LC
642
643 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
644 ;; they fail because we get an extra line that says "Can't check if
645 ;; filesystem is mounted due to missing mtab file".
646 #:tests? #f))
647 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 648 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
649 (description
650 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
3ac73271
LC
651 (license (list license:gpl2 ;programs
652 license:lgpl2.0 ;libext2fs
653 license:x11)))) ;libuuid
d8482ad0 654
e48977e7
LC
655(define e2fsprogs/static
656 (static-package
657 (package (inherit e2fsprogs)
658 (arguments
659 ;; Do not build shared libraries.
660 (substitute-keyword-arguments (package-arguments e2fsprogs)
661 ((#:configure-flags _)
662 '(list "--disable-blkid"))
663 ((#:make-flags _)
664 '(list)))))))
665
e102f940
LC
666(define-public e2fsck/static
667 (package
668 (name "e2fsck-static")
0997771a 669 (version (package-version e2fsprogs))
e102f940
LC
670 (build-system trivial-build-system)
671 (source #f)
672 (arguments
673 `(#:modules ((guix build utils))
674 #:builder
675 (begin
676 (use-modules (guix build utils)
677 (ice-9 ftw)
678 (srfi srfi-26))
679
680 (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs")
681 "/sbin"))
682 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
683 (mkdir-p bin)
684 (with-directory-excursion bin
685 (for-each (lambda (file)
686 (copy-file (string-append source "/" file)
687 file)
688 (remove-store-references file)
689 (chmod file #o555))
690 (scandir source (cut string-prefix? "fsck." <>))))))))
e48977e7 691 (inputs `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
692 (synopsis "Statically-linked fsck.* commands from e2fsprogs")
693 (description
694 "This package provides statically-linked command of fsck.ext[234] taken
695from the e2fsprogs package. It is meant to be used in initrds.")
0997771a
LC
696 (home-page (package-home-page e2fsprogs))
697 (license (package-license e2fsprogs))))
e102f940 698
7c0a9104
LC
699(define-public extundelete
700 (package
701 (name "extundelete")
702 (version "0.2.4")
703 (source (origin
704 (method url-fetch)
705 (uri (string-append "mirror://sourceforge/extundelete/"
706 version "/extundelete-" version ".tar.bz2"))
707 (sha256
708 (base32
709 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
710 (build-system gnu-build-system)
711 (inputs `(("e2fsprogs" ,e2fsprogs)))
712 (home-page "http://extundelete.sourceforge.net/")
713 (synopsis "Recover deleted files from ext2/3/4 partitions")
714 (description
715 "Extundelete is a set of tools that can recover deleted files from an
716ext3 or ext4 partition.")
3ac73271 717 (license license:gpl2)))
7c0a9104 718
1c975f60
LC
719(define-public zerofree
720 (package
721 (name "zerofree")
722 (version "1.0.3")
723 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
724 (source (origin
725 (method url-fetch)
726 (uri (string-append home-page name "-" version
727 ".tgz"))
728 (sha256
729 (base32
730 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
731 (build-system gnu-build-system)
732 (arguments
733 '(#:phases (alist-replace
734 'install
735 (lambda* (#:key outputs #:allow-other-keys)
736 (let* ((out (assoc-ref outputs "out"))
737 (bin (string-append out "/bin")))
738 (mkdir-p bin)
739 (copy-file "zerofree"
740 (string-append bin "/zerofree"))
741 (chmod (string-append bin "/zerofree")
742 #o555)
743 #t))
744 (alist-delete 'configure %standard-phases))
745 #:tests? #f)) ;no tests
746 (inputs `(("libext2fs" ,e2fsprogs)))
747 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
748 (description
749 "The zerofree command scans the free blocks in an ext2 file system and
750fills any non-zero blocks with zeroes. This is a useful way to make disk
751images more compressible.")
3ac73271 752 (license license:gpl2)))
1c975f60 753
d8482ad0
LC
754(define-public strace
755 (package
756 (name "strace")
757 (version "4.7")
758 (source (origin
759 (method url-fetch)
760 (uri (string-append "mirror://sourceforge/strace/strace-"
761 version ".tar.xz"))
762 (sha256
763 (base32
764 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
765 (build-system gnu-build-system)
c4c4cc05 766 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
767 (home-page "http://strace.sourceforge.net/")
768 (synopsis "System call tracer for Linux")
769 (description
770 "strace is a system call tracer, i.e. a debugging tool which prints out a
771trace of all the system calls made by a another process/program.")
3ac73271 772 (license license:bsd-3)))
ba04571a 773
e1e27737
TUBK
774(define-public ltrace
775 (package
776 (name "ltrace")
777 (version "0.7.3")
778 (source (origin
779 (method url-fetch)
780 (uri (string-append "http://www.ltrace.org/ltrace_" version
781 ".orig.tar.bz2"))
782 (sha256
783 (base32
784 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
785 (build-system gnu-build-system)
786 (inputs `(("libelf" ,libelf)))
787 (arguments
788 ;; Compilation uses -Werror by default, but it fails.
789 '(#:configure-flags '("--disable-werror")))
790 (home-page "http://www.ltrace.org/")
791 (synopsis "Library call tracer for Linux")
792 (description
793 "ltrace intercepts and records dynamic library calls which are called by
794an executed process and the signals received by that process. It can also
795intercept and print the system calls executed by the program.")
3ac73271 796 (license license:gpl2+)))
e1e27737 797
ba04571a
LC
798(define-public alsa-lib
799 (package
800 (name "alsa-lib")
801 (version "1.0.27.1")
802 (source (origin
803 (method url-fetch)
804 (uri (string-append
805 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
806 version ".tar.bz2"))
807 (sha256
808 (base32
bcd94e19 809 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
fc1adab1 810 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
ba04571a
LC
811 (build-system gnu-build-system)
812 (home-page "http://www.alsa-project.org/")
813 (synopsis "The Advanced Linux Sound Architecture libraries")
814 (description
815 "The Advanced Linux Sound Architecture (ALSA) provides audio and
816MIDI functionality to the Linux-based operating system.")
3ac73271 817 (license license:lgpl2.1+)))
10afdf50 818
17b293a0
LC
819(define-public alsa-utils
820 (package
821 (name "alsa-utils")
992b527d 822 (version "1.1.0")
17b293a0
LC
823 (source (origin
824 (method url-fetch)
992b527d
EF
825 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
826 name "-" version ".tar.bz2"))
17b293a0
LC
827 (sha256
828 (base32
992b527d 829 "1wa88wvqcfhak9x3y65wzzwxmmyxb5bv2gyj7lnm653fnwsk271v"))))
17b293a0
LC
830 (build-system gnu-build-system)
831 (arguments
832 ;; XXX: Disable man page creation until we have DocBook.
833 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
834
835 ;; The udev rule is responsible for restoring
836 ;; the volume.
17b293a0
LC
837 (string-append "--with-udev-rules-dir="
838 (assoc-ref %outputs "out")
839 "/lib/udev/rules.d"))
840 #:phases (alist-cons-before
841 'install 'pre-install
842 (lambda _
843 ;; Don't try to mkdir /var/lib/alsa.
844 (substitute* "Makefile"
845 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
846 "true\n")))
847 %standard-phases)))
848 (inputs
849 `(("libsamplerate" ,libsamplerate)
850 ("ncurses" ,ncurses)
851 ("alsa-lib" ,alsa-lib)
852 ("xmlto" ,xmlto)
1dba6407 853 ("gettext" ,gnu-gettext)))
17b293a0
LC
854 (home-page "http://www.alsa-project.org/")
855 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
856 (description
857 "The Advanced Linux Sound Architecture (ALSA) provides audio and
858MIDI functionality to the Linux-based operating system.")
859
860 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
861 ;; GPLv2-only.
3ac73271 862 (license license:gpl2)))
17b293a0 863
10afdf50
LC
864(define-public iptables
865 (package
866 (name "iptables")
867 (version "1.4.16.2")
868 (source (origin
869 (method url-fetch)
870 (uri (string-append
871 "http://www.netfilter.org/projects/iptables/files/iptables-"
872 version ".tar.bz2"))
873 (sha256
874 (base32
875 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
876 (build-system gnu-build-system)
50c26d9e
SB
877 (arguments
878 '(#:tests? #f ; no test suite
879 #:configure-flags ; add $libdir to the RUNPATH of executables
880 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
10afdf50
LC
881 (home-page "http://www.netfilter.org/projects/iptables/index.html")
882 (synopsis "Program to configure the Linux IP packet filtering rules")
883 (description
884 "iptables is the userspace command line program used to configure the
885Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
886system administrators. Since Network Address Translation is also configured
887from the packet filter ruleset, iptables is used for this, too. The iptables
888package also includes ip6tables. ip6tables is used for configuring the IPv6
889packet filter.")
3ac73271 890 (license license:gpl2+)))
90a0048f
LC
891
892(define-public iproute
893 (package
894 (name "iproute2")
75cd4b05 895 (version "4.4.0")
90a0048f 896 (source (origin
75cd4b05
AK
897 (method url-fetch)
898 (uri (string-append
899 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
900 version ".tar.xz"))
901 (sha256
902 (base32
903 "05351m4m0whsivlblvs3m0nz5q9v6r06ik80z27gf6ca51kw74dw"))))
90a0048f
LC
904 (build-system gnu-build-system)
905 (arguments
906 `(#:tests? #f ; no test suite
907 #:make-flags (let ((out (assoc-ref %outputs "out")))
908 (list "DESTDIR="
909 (string-append "LIBDIR=" out "/lib")
910 (string-append "SBINDIR=" out "/sbin")
911 (string-append "CONFDIR=" out "/etc")
912 (string-append "DOCDIR=" out "/share/doc/"
913 ,name "-" ,version)
914 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
915 #:phases (modify-phases %standard-phases
916 (add-before 'install 'pre-install
917 (lambda _
918 ;; Don't attempt to create /var/lib/arpd.
919 (substitute* "Makefile"
920 (("^.*ARPDDIR.*$") "")))))))
90a0048f
LC
921 (inputs
922 `(("iptables" ,iptables)
c4c4cc05
JD
923 ("db4" ,bdb)))
924 (native-inputs
925 `(("pkg-config" ,pkg-config)
90a0048f
LC
926 ("flex" ,flex)
927 ("bison" ,bison)))
928 (home-page
929 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
930 (synopsis
9e771e3b 931 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f
LC
932 (description
933 "Iproute2 is a collection of utilities for controlling TCP/IP
934networking and traffic with the Linux kernel.
935
936Most network configuration manuals still refer to ifconfig and route as the
937primary network configuration tools, but ifconfig is known to behave
938inadequately in modern network environments. They should be deprecated, but
939most distros still include them. Most network configuration systems make use
940of ifconfig and thus provide a limited feature set. The /etc/net project aims
941to support most modern network technologies, as it doesn't use ifconfig and
942allows a system administrator to make use of all iproute2 features, including
943traffic control.
944
945iproute2 is usually shipped in a package called iproute or iproute2 and
946consists of several tools, of which the most important are ip and tc. ip
947controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
948tools print detailed usage messages and are accompanied by a set of
949manpages.")
3ac73271 950 (license license:gpl2+)))
85e0dc6a
LC
951
952(define-public net-tools
953 ;; XXX: This package is basically unmaintained, but it provides a few
954 ;; commands not yet provided by Inetutils, such as 'route', so we have to
955 ;; live with it.
956 (package
957 (name "net-tools")
958 (version "1.60")
6b55ee88 959 (home-page "http://net-tools.sourceforge.net/")
85e0dc6a
LC
960 (source (origin
961 (method url-fetch)
6b55ee88
LC
962 (uri (list (string-append
963 "mirror://sourceforge/net-tools/net-tools-"
964 version ".tar.bz2")
965 (string-append
966 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
967 "/base/net-tools/net-tools-1.60.tar.bz2")))
85e0dc6a
LC
968 (sha256
969 (base32
177088a3 970 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
fc1adab1 971 (patches (search-patches "net-tools-bitrot.patch"))))
85e0dc6a
LC
972 (build-system gnu-build-system)
973 (arguments
c9e0a44e
LC
974 '(#:modules ((guix build gnu-build-system)
975 (guix build utils)
976 (srfi srfi-1)
977 (srfi srfi-26))
978 #:phases (alist-cons-after
cd143df0 979 'unpack 'patch
85e0dc6a
LC
980 (lambda* (#:key inputs #:allow-other-keys)
981 (define (apply-patch file)
9a224ac2 982 (zero? (system* "patch" "-p1" "--force"
85e0dc6a
LC
983 "--input" file)))
984
985 (let ((patch.gz (assoc-ref inputs "patch")))
986 (format #t "applying Debian patch set '~a'...~%"
987 patch.gz)
988 (system (string-append "gunzip < " patch.gz " > the-patch"))
85e0dc6a
LC
989 (and (apply-patch "the-patch")
990 (for-each apply-patch
991 (find-files "debian/patches"
992 "\\.patch")))))
993 (alist-replace
994 'configure
995 (lambda* (#:key outputs #:allow-other-keys)
996 (let ((out (assoc-ref outputs "out")))
997 (mkdir-p (string-append out "/bin"))
998 (mkdir-p (string-append out "/sbin"))
999
1000 ;; Pretend we have everything...
1001 (system "yes | make config")
1002
a153ff80
MW
1003 ;; ... except for the things we don't have.
1004 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1005 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1006 ;; that have been removed.
85e0dc6a 1007 (substitute* '("config.make" "config.h")
a153ff80 1008 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
c9e0a44e
LC
1009 (alist-cons-after
1010 'install 'remove-redundant-commands
1011 (lambda* (#:key outputs #:allow-other-keys)
1012 ;; Remove commands and man pages redundant with
1013 ;; Inetutils.
1014 (let* ((out (assoc-ref outputs "out"))
1015 (dup (append-map (cut find-files out <>)
1016 '("^hostname"
1017 "^(yp|nis|dns)?domainname"))))
1018 (for-each delete-file dup)
1019 #t))
1020 %standard-phases)))
85e0dc6a
LC
1021
1022 ;; Binaries that depend on libnet-tools.a don't declare that
1023 ;; dependency, making it parallel-unsafe.
1024 #:parallel-build? #f
1025
1026 #:tests? #f ; no test suite
0d55c356
MW
1027 #:make-flags (let ((out (assoc-ref %outputs "out")))
1028 (list "CC=gcc"
1029 (string-append "BASEDIR=" out)
1030 (string-append "INSTALLNLSDIR=" out "/share/locale")
1031 (string-append "mandir=/share/man")))))
85e0dc6a
LC
1032
1033 ;; Use the big Debian patch set (the thing does not even compile out of
1034 ;; the box.)
1035 (inputs `(("patch" ,(origin
1036 (method url-fetch)
1037 (uri
1038 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1039 (sha256
1040 (base32
1041 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1dba6407 1042 (native-inputs `(("gettext" ,gnu-gettext)))
85e0dc6a
LC
1043
1044 (synopsis "Tools for controlling the network subsystem in Linux")
1045 (description
1046 "This package includes the important tools for controlling the network
1047subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1048netstat, rarp and route. Additionally, this package contains utilities
1049relating to particular network hardware types (plipconfig, slattach) and
1050advanced aspects of IP configuration (iptunnel, ipmaddr).")
3ac73271 1051 (license license:gpl2+)))
c762e82e
LC
1052
1053(define-public libcap
1054 (package
1055 (name "libcap")
f6c2d05c 1056 (version "2.24")
c762e82e
LC
1057 (source (origin
1058 (method url-fetch)
c762e82e 1059 (uri (string-append
f6c2d05c
LC
1060 "mirror://kernel.org/linux/libs/security/linux-privs/"
1061 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
1062 (sha256
1063 (base32
f6c2d05c 1064 "0rbc9qbqs5bp9am9s9g83wxj5k4ixps2agy9dxr1v1fwg27mdr6f"))))
c762e82e 1065 (build-system gnu-build-system)
6d889daf
SB
1066 (arguments '(#:phases
1067 (modify-phases %standard-phases
1068 (replace 'configure
1069 ;; Add $libdir to the RUNPATH of executables.
1070 (lambda _
1071 (substitute* "Make.Rules"
1072 (("LDFLAGS := #-g")
1073 (string-append "LDFLAGS := -Wl,-rpath="
1074 %output "/lib"))))))
c762e82e
LC
1075 #:tests? #f ; no 'check' target
1076 #:make-flags (list "lib=lib"
1077 (string-append "prefix="
1078 (assoc-ref %outputs "out"))
1079 "RAISE_SETFCAP=no")))
1080 (native-inputs `(("perl" ,perl)))
1081 (inputs `(("attr" ,attr)))
1082 (home-page "https://sites.google.com/site/fullycapable/")
1083 (synopsis "Library for working with POSIX capabilities")
1084 (description
35b9e423 1085 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
1086Linux-based operating systems.")
1087
1088 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 1089 (license license:gpl2)))
215b6431
LC
1090
1091(define-public bridge-utils
1092 (package
1093 (name "bridge-utils")
1094 (version "1.5")
1095 (source (origin
1096 (method url-fetch)
1097 (uri (string-append "mirror://sourceforge/bridge/bridge-utils-"
1098 version ".tar.gz"))
1099 (sha256
1100 (base32
1101 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1102 (build-system gnu-build-system)
1103
1104 ;; The tarball lacks all the generated files.
1105 (native-inputs `(("autoconf" ,autoconf)
1106 ("automake" ,automake)))
1107 (arguments
722ec722
MW
1108 '(#:phases (alist-cons-after
1109 'unpack 'bootstrap
215b6431 1110 (lambda _
e5c8e4f3
DT
1111 ;; Fix "field ‘ip6’ has incomplete type" errors.
1112 (substitute* "libbridge/libbridge.h"
1113 (("#include <linux/if_bridge.h>")
1114 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1115
1116 ;; Ensure that the entire build fails if one of the
1117 ;; sub-Makefiles fails.
1118 (substitute* "Makefile.in"
1119 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1120 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1121
215b6431
LC
1122 (zero? (system* "autoreconf" "-vf")))
1123 %standard-phases)
1124 #:tests? #f)) ; no 'check' target
1125
1126 (home-page
1127 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1128 (synopsis "Manipulate Ethernet bridges")
1129 (description
1130 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1131to connect two Ethernet segments together in a protocol independent way.
1132Packets are forwarded based on Ethernet address, rather than IP address (like
1133a router). Since forwarding is done at Layer 2, all protocols can go
1134transparently through a bridge.")
3ac73271 1135 (license license:gpl2+)))
3cc20675
LC
1136
1137(define-public libnl
1138 (package
1139 (name "libnl")
bdac3d4b 1140 (version "3.2.25")
3cc20675
LC
1141 (source (origin
1142 (method url-fetch)
1143 (uri (string-append
1144 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1145 version ".tar.gz"))
1146 (sha256
1147 (base32
bdac3d4b 1148 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
3cc20675
LC
1149 (build-system gnu-build-system)
1150 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1151 (home-page "http://www.infradead.org/~tgr/libnl/")
1152 (synopsis "NetLink protocol library suite")
1153 (description
1154 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 1155protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
1156between the kernel and user space processes. It was designed to be a more
1157flexible successor to ioctl to provide mainly networking related kernel
1158configuration and monitoring interfaces.")
1159
1160 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1161 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 1162 (license license:gpl2)))
023fef7d 1163
65cd77db
MW
1164(define-public iw
1165 (package
1166 (name "iw")
1167 (version "3.17")
1168 (source (origin
1169 (method url-fetch)
1170 (uri (string-append
1171 "https://www.kernel.org/pub/software/network/iw/iw-"
1172 version ".tar.xz"))
1173 (sha256
1174 (base32
1175 "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8"))))
1176 (build-system gnu-build-system)
1177 (native-inputs `(("pkg-config" ,pkg-config)))
1178 (inputs `(("libnl" ,libnl)))
1179 (arguments
1180 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1181 "CC=gcc")
1182 #:phases (alist-delete 'configure %standard-phases)))
1183 (home-page "http://wireless.kernel.org/en/users/Documentation/iw")
1184 (synopsis "Tool for configuring wireless devices")
1185 (description
1186 "iw is a new nl80211 based CLI configuration utility for wireless
1187devices. It replaces 'iwconfig', which is deprecated.")
3ac73271 1188 (license license:isc)))
65cd77db 1189
023fef7d
LC
1190(define-public powertop
1191 (package
1192 (name "powertop")
ebacb0de 1193 (version "2.8")
023fef7d
LC
1194 (source
1195 (origin
1196 (method url-fetch)
1197 (uri (string-append
bd60e4e2 1198 "https://01.org/sites/default/files/downloads/powertop/powertop-"
023fef7d
LC
1199 version ".tar.gz"))
1200 (sha256
1201 (base32
ebacb0de 1202 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
023fef7d
LC
1203 (build-system gnu-build-system)
1204 (inputs
f61e0e79 1205 `(("zlib" ,zlib)
cfd745d6 1206 ("pciutils" ,pciutils)
023fef7d
LC
1207 ("ncurses" ,ncurses)
1208 ("libnl" ,libnl)))
c4c4cc05 1209 (native-inputs
ebacb0de 1210 `(("pkg-config" ,pkg-config)))
023fef7d
LC
1211 (home-page "https://01.org/powertop/")
1212 (synopsis "Analyze power consumption on Intel-based laptops")
1213 (description
1214 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1215power management. In addition to being a diagnostic tool, PowerTOP also has
1216an interactive mode where the user can experiment various power management
1217settings for cases where the operating system has not enabled these
1218settings.")
3ac73271 1219 (license license:gpl2)))
6869e5c9
LC
1220
1221(define-public aumix
1222 (package
1223 (name "aumix")
1224 (version "2.9.1")
1225 (source (origin
1226 (method url-fetch)
1227 (uri (string-append
1228 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1229 version ".tar.bz2"))
1230 (sha256
1231 (base32
1232 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1233 (build-system gnu-build-system)
1234 (inputs `(("ncurses" ,ncurses)))
1235 (home-page "http://www.jpj.net/~trevor/aumix.html")
1236 (synopsis "Audio mixer for X and the console")
1237 (description
1238 "Aumix adjusts an audio mixer from X, the console, a terminal,
1239the command line or a script.")
3ac73271 1240 (license license:gpl2+)))
7c0dbe78
SHT
1241
1242(define-public iotop
1243 (package
1244 (name "iotop")
1245 (version "0.6")
1246 (source
1247 (origin
1248 (method url-fetch)
1249 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1250 version ".tar.gz"))
1251 (sha256 (base32
1252 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1253 (build-system python-build-system)
1254 (arguments
35cebf01 1255 ;; The setup.py script expects python-2.
7c0dbe78 1256 `(#:python ,python-2
35cebf01 1257 ;; There are currently no checks in the package.
7c0dbe78
SHT
1258 #:tests? #f))
1259 (native-inputs `(("python" ,python-2)))
1260 (home-page "http://guichaz.free.fr/iotop/")
1261 (synopsis
1262 "Displays the IO activity of running processes")
1263 (description
1264 "Iotop is a Python program with a top like user interface to show the
1265processes currently causing I/O.")
3ac73271 1266 (license license:gpl2+)))
e30835e2
LC
1267
1268(define-public fuse
1269 (package
1270 (name "fuse")
ebf89f13 1271 (version "2.9.5")
e30835e2
LC
1272 (source (origin
1273 (method url-fetch)
b7e7d1b9
LF
1274 (uri (let ((version-with-underscores
1275 (string-join (string-split version #\.) "_")))
1276 (string-append
1277 "https://github.com/libfuse/libfuse/"
826244f0 1278 "releases/download/fuse_" version-with-underscores
b7e7d1b9 1279 "/fuse-" version ".tar.gz")))
e30835e2
LC
1280 (sha256
1281 (base32
ebf89f13 1282 "1dfvbi1p57svbv2sfnbqwpnsk219spvjnlapf35azhgzqlf3g7sp"))))
e30835e2 1283 (build-system gnu-build-system)
b148bd71 1284 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1285 (arguments
1286 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1287 (assoc-ref %outputs "out")
1288 "/sbin")
1289 (string-append "INIT_D_PATH="
1290 (assoc-ref %outputs "out")
1291 "/etc/init.d")
9a4efac9
LC
1292
1293 ;; The rule makes /dev/fuse 666.
e30835e2
LC
1294 (string-append "UDEV_RULES_PATH="
1295 (assoc-ref %outputs "out")
9a4efac9 1296 "/lib/udev/rules.d"))
b148bd71
LC
1297 #:phases (alist-cons-before
1298 'build 'set-file-names
1299 (lambda* (#:key inputs #:allow-other-keys)
1300 ;; libfuse calls out to mount(8) and umount(8). Make sure
1301 ;; it refers to the right ones.
1302 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1303 (("/bin/(u?)mount" _ maybe-u)
1304 (string-append (assoc-ref inputs "util-linux")
1305 "/bin/" maybe-u "mount")))
1306 (substitute* '("util/mount.fuse.c")
1307 (("/bin/sh")
bd663902
LC
1308 (which "sh")))
1309
1310 ;; This hack leads libfuse to search for 'fusermount' in
1311 ;; $PATH, where it may find a setuid-root binary, instead of
1312 ;; trying solely $out/sbin/fusermount and failing because
1313 ;; it's not setuid.
1314 (substitute* "lib/Makefile"
1315 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1316 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1317 %standard-phases)))
e30835e2
LC
1318 (home-page "http://fuse.sourceforge.net/")
1319 (synopsis "Support file systems implemented in user space")
1320 (description
1321 "As a consequence of its monolithic design, file system code for Linux
1322normally goes into the kernel itself---which is not only a robustness issue,
1323but also an impediment to system extensibility. FUSE, for \"file systems in
1324user space\", is a kernel module and user-space library that tries to address
1325part of this problem by allowing users to run file system implementations as
1326user-space processes.")
3ac73271
LC
1327 (license (list license:lgpl2.1 ;library
1328 license:gpl2+)))) ;command-line utilities
220193ad
LC
1329
1330(define-public unionfs-fuse
1331 (package
1332 (name "unionfs-fuse")
1333 (version "0.26")
1334 (source (origin
1335 (method url-fetch)
1336 (uri (string-append
1337 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1338 version ".tar.xz"))
1339 (sha256
1340 (base32
1341 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1342 (build-system cmake-build-system)
1343 (inputs `(("fuse" ,fuse)))
1344 (arguments '(#:tests? #f)) ; no tests
1345 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1346 (synopsis "User-space union file system")
1347 (description
1348 "UnionFS-FUSE is a flexible union file system implementation in user
1349space, using the FUSE library. Mounting a union file system allows you to
1350\"aggregate\" the contents of several directories into a single mount point.
1351UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 1352 (license license:bsd-3)))
ed748588 1353
0b7a0c20
LC
1354(define fuse-static
1355 (package (inherit fuse)
1356 (name "fuse-static")
1357 (source (origin (inherit (package-source fuse))
1358 (modules '((guix build utils)))
1359 (snippet
1360 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1361 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1362 ;; it doesn't do that, allowing us to remove the dependency on
1363 ;; util-linux (something that is useful in initrds.)
1364 '(substitute* '("lib/mount_util.c"
1365 "util/mount_util.c")
1366 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1367 "0")
1368 (("/bin/")
1369 "")))))))
1370
ed748588
LC
1371(define-public unionfs-fuse/static
1372 (package (inherit unionfs-fuse)
1373 (synopsis "User-space union file system (statically linked)")
1374 (name (string-append (package-name unionfs-fuse) "-static"))
1375 (source (origin (inherit (package-source unionfs-fuse))
1376 (modules '((guix build utils)))
1377 (snippet
1378 ;; Add -ldl to the libraries, because libfuse.a needs that.
1379 '(substitute* "src/CMakeLists.txt"
1380 (("target_link_libraries(.*)\\)" _ libs)
1381 (string-append "target_link_libraries"
1382 libs " dl)"))))))
1383 (arguments
1384 '(#:tests? #f
1456cff1
LC
1385 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1386 #:phases (alist-cons-after
1387 'install 'post-install
1388 (lambda* (#:key outputs #:allow-other-keys)
1389 (let* ((out (assoc-ref outputs "out"))
1390 (exe (string-append out "/bin/unionfs")))
1391 ;; By default, 'unionfs' keeps references to
1392 ;; $glibc/share/locale and similar stuff. Remove them.
1393 (remove-store-references exe)))
1394 %standard-phases)))
0b7a0c20 1395 (inputs `(("fuse" ,fuse-static)))))
67b66003 1396
db288efa
LC
1397(define-public sshfs-fuse
1398 (package
1399 (name "sshfs-fuse")
1400 (version "2.5")
1401 (source (origin
1402 (method url-fetch)
6959a132
LF
1403 (uri (let ((version-with-underscores
1404 (string-join (string-split version #\.) "_")))
1405 (string-append "https://github.com/libfuse/sshfs/releases/"
1406 "download/sshfs_" version-with-underscores
1407 "/sshfs-fuse-" version ".tar.gz")))
db288efa
LC
1408 (sha256
1409 (base32
1410 "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9"))))
1411 (build-system gnu-build-system)
1412 (inputs
1413 `(("fuse" ,fuse)
1414 ("glib" ,glib)))
1415 (native-inputs
1416 `(("pkg-config" ,pkg-config)))
1417 (home-page "http://fuse.sourceforge.net/sshfs.html")
1418 (synopsis "Mount remote file systems over SSH")
1419 (description
1420 "This is a file system client based on the SSH File Transfer Protocol.
1421Since most SSH servers already support this protocol it is very easy to set
1422up: on the server side there's nothing to do; on the client side mounting the
1423file system is as easy as logging into the server with an SSH client.")
3ac73271 1424 (license license:gpl2+)))
db288efa 1425
67b66003
LC
1426(define-public numactl
1427 (package
1428 (name "numactl")
e35dff97 1429 (version "2.0.11")
67b66003
LC
1430 (source (origin
1431 (method url-fetch)
1432 (uri (string-append
1433 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1434 version
1435 ".tar.gz"))
1436 (sha256
1437 (base32
e35dff97 1438 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
67b66003
LC
1439 (build-system gnu-build-system)
1440 (arguments
e35dff97 1441 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
1442 ;; to run, which we can't assume to have.
1443 #:tests? #f))
b0015064 1444
35dfcdd7
AE
1445 ;; NUMA is apparently not supported on armhf, see
1446 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1447 (supported-systems (delete "armhf-linux" %supported-systems))
67b66003
LC
1448 (home-page "http://oss.sgi.com/projects/libnuma/")
1449 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1450 (description
1451 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1452memory is not all in one place. The numactl program allows you to run your
1453application program on specific CPU's and memory nodes. It does this by
1454supplying a NUMA memory policy to the operating system before running your
1455program.
1456
1457The package contains other commands, such as numademo, numastat and memhog.
1458The numademo command provides a quick overview of NUMA performance on your
1459system.")
3ac73271
LC
1460 (license (list license:gpl2 ;programs
1461 license:lgpl2.1)))) ;library
b10e9ff6
LC
1462
1463(define-public kbd
1464 (package
1465 (name "kbd")
710b4928 1466 (version "2.0.2")
b10e9ff6
LC
1467 (source (origin
1468 (method url-fetch)
1469 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 1470 version ".tar.xz"))
b10e9ff6
LC
1471 (sha256
1472 (base32
710b4928 1473 "04mrms12nm5sas0nxs94yrr3hz7gmqhnmfgb9ff34bh1jszxmzcx"))
c8f60748
LC
1474 (modules '((guix build utils)))
1475 (snippet
f2cdcafb
LC
1476 '(begin
1477 (substitute* "tests/Makefile.in"
1478 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1479 (("@VERSION@")
1480 "[@]VERSION[@]"))
1481 (substitute* '("src/unicode_start" "src/unicode_stop")
1482 ;; Assume the Coreutils are in $PATH.
1483 (("/usr/bin/tty")
1484 "tty"))))))
b10e9ff6
LC
1485 (build-system gnu-build-system)
1486 (arguments
1487 '(#:phases (alist-cons-before
1488 'build 'pre-build
1489 (lambda* (#:key inputs #:allow-other-keys)
1490 (let ((gzip (assoc-ref %build-inputs "gzip"))
1491 (bzip2 (assoc-ref %build-inputs "bzip2")))
1492 (substitute* "src/libkeymap/findfile.c"
1493 (("gzip")
1494 (string-append gzip "/bin/gzip"))
1495 (("bzip2")
1496 (string-append bzip2 "/bin/bzip2")))))
f2cdcafb
LC
1497 (alist-cons-after
1498 'install 'post-install
1499 (lambda* (#:key outputs #:allow-other-keys)
1500 ;; Make sure these programs find their comrades.
1501 (let* ((out (assoc-ref outputs "out"))
1502 (bin (string-append out "/bin")))
1503 (for-each (lambda (prog)
1504 (wrap-program (string-append bin "/" prog)
1505 `("PATH" ":" prefix (,bin))))
1506 '("unicode_start" "unicode_stop"))))
1507 %standard-phases))))
b10e9ff6 1508 (inputs `(("check" ,check)
f61e0e79
LC
1509 ("gzip" ,gzip)
1510 ("bzip2" ,bzip2)
b10e9ff6
LC
1511 ("pam" ,linux-pam)))
1512 (native-inputs `(("pkg-config" ,pkg-config)))
1513 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1514 (synopsis "Linux keyboard utilities and keyboard maps")
1515 (description
1516 "This package contains keytable files and keyboard utilities compatible
1517for systems using the Linux kernel. This includes commands such as
1518'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
3ac73271 1519 (license license:gpl2+)))
de0b620e
LC
1520
1521(define-public inotify-tools
1522 (package
1523 (name "inotify-tools")
1524 (version "3.13")
1525 (source (origin
1526 (method url-fetch)
1527 (uri (string-append
1528 "mirror://sourceforge/inotify-tools/inotify-tools/"
1529 version "/inotify-tools-" version ".tar.gz"))
1530 (sha256
1531 (base32
1532 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1533 (build-system gnu-build-system)
1534 (home-page "http://inotify-tools.sourceforge.net/")
1535 (synopsis "Monitor file accesses")
1536 (description
1537 "The inotify-tools packages provides a C library and command-line tools
1538to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 1539 (license license:gpl2+)))
e062d542
AE
1540
1541(define-public kmod
1542 (package
1543 (name "kmod")
1544 (version "17")
1545 (source (origin
1546 (method url-fetch)
1547 (uri
1548 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1549 "kmod-" version ".tar.xz"))
1550 (sha256
1551 (base32
528b6a3d 1552 "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv"))
fc1adab1 1553 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
1554 (build-system gnu-build-system)
1555 (native-inputs
1556 `(("pkg-config" ,pkg-config)))
1557 (inputs
f61e0e79
LC
1558 `(("xz" ,xz)
1559 ("zlib" ,zlib)))
e062d542
AE
1560 (arguments
1561 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1562 #:configure-flags '("--with-xz" "--with-zlib")
1563 #:phases (alist-cons-after
1564 'install 'install-modprobe&co
1565 (lambda* (#:key outputs #:allow-other-keys)
1566 (let* ((out (assoc-ref outputs "out"))
1567 (bin (string-append out "/bin")))
1568 (for-each (lambda (tool)
1569 (symlink "kmod"
1570 (string-append bin "/" tool)))
1571 '("insmod" "rmmod" "lsmod" "modprobe"
1572 "modinfo" "depmod"))))
1573 %standard-phases)))
e062d542
AE
1574 (home-page "https://www.kernel.org/")
1575 (synopsis "Kernel module tools")
35b9e423 1576 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
1577kernel modules like insert, remove, list, check properties, resolve
1578dependencies and aliases.
1579
1580These tools are designed on top of libkmod, a library that is shipped with
1581kmod. The aim is to be compatible with tools, configurations and indices
1582from the module-init-tools project.")
3ac73271 1583 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 1584
7fa715e7
LC
1585(define-public eudev
1586 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 1587 (package
7fa715e7 1588 (name "eudev")
e75230c1 1589 (version "3.1.5")
7fa715e7
LC
1590 (source (origin
1591 (method url-fetch)
1592 (uri (string-append
1593 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1594 version ".tar.gz"))
1595 (sha256
1596 (base32
e75230c1 1597 "0akg9gcc3c2p56xbhlvbybqavcprly5q0bvk655zwl6d62j8an7p"))
fc1adab1 1598 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7
MW
1599 (build-system gnu-build-system)
1600 (native-inputs
1601 `(("pkg-config" ,pkg-config)
e75230c1
SB
1602 ("perl" ,perl)
1603 ("gperf" ,gperf)))
fe32c7f7 1604 (inputs
255f7308
LC
1605 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1606 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1607 ;; which contains the rules to do that.
1608 `(("util-linux" ,util-linux) ;for blkid
1609 ("kmod" ,kmod)))
e1921a38 1610 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
1611 (synopsis "Userspace device management")
1612 (description "Udev is a daemon which dynamically creates and removes
1613device nodes from /dev/, handles hotplug events and loads drivers at boot
1614time.")
3ac73271 1615 (license license:gpl2+)))
7fa715e7 1616
66269d47
LC
1617(define-public lvm2
1618 (package
1619 (name "lvm2")
1620 (version "2.02.109")
1621 (source (origin
1622 (method url-fetch)
1623 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1624 version ".tgz"))
1625 (sha256
1626 (base32
1627 "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv"))
1628 (modules '((guix build utils)))
1629 (snippet
1630 '(begin
1631 (use-modules (guix build utils))
1632
1633 ;; Honor sysconfdir.
1634 (substitute* "make.tmpl.in"
1635 (("confdir = .*$")
1636 "confdir = @sysconfdir@\n")
1637 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1638 "DEFAULT_SYS_DIR = @sysconfdir@"))))))
1639 (build-system gnu-build-system)
1640 (native-inputs
1641 `(("pkg-config" ,pkg-config)
1642 ("procps" ,procps))) ;tests use 'pgrep'
1643 (inputs
8fcaf8b1 1644 `(("udev" ,eudev)))
66269d47
LC
1645 (arguments
1646 '(#:phases (alist-cons-after
1647 'configure 'set-makefile-shell
1648 (lambda _
1649 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1650 ;; expected.
1651 (setenv "SHELL" (which "sh"))
1652
1653 ;; Replace /bin/sh with the right file name.
1654 (patch-makefile-SHELL "make.tmpl"))
1655 %standard-phases)
1656
1657 #:configure-flags (list (string-append "--sysconfdir="
1658 (assoc-ref %outputs "out")
1659 "/etc/lvm")
1660 "--enable-udev_sync"
f2817d43
LC
1661 "--enable-udev_rules"
1662
1663 ;; Make sure programs such as 'dmsetup' can
1664 ;; find libdevmapper.so.
1665 (string-append "LDFLAGS=-Wl,-rpath="
1666 (assoc-ref %outputs "out")
1667 "/lib"))
66269d47
LC
1668
1669 ;; The tests use 'mknod', which requires root access.
1670 #:tests? #f))
1671 (home-page "http://sourceware.org/lvm2/")
1672 (synopsis "Logical volume management for Linux")
1673 (description
1674 "LVM2 is the logical volume management tool set for Linux-based systems.
1675This package includes the user-space libraries and tools, including the device
1676mapper. Kernel components are part of Linux-libre.")
1677
1678 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1679 ;; Command-line tools are GPLv2.
3ac73271 1680 (license (list license:gpl2 license:lgpl2.1))))
66269d47 1681
000f7559
DT
1682(define-public wireless-tools
1683 (package
1684 (name "wireless-tools")
1685 (version "30.pre9")
1686 (source (origin
1687 (method url-fetch)
1688 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1689 version ".tar.gz"))
1690 (sha256
1691 (base32
ec01f22d 1692 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 1693 (snippet
c2099a4c
MW
1694 '(begin
1695 ;; Remove the older header files that are not free software.
1696 (for-each (lambda (n)
1697 (delete-file (format #f "wireless.~a.h" n)))
1698 '(10 11 12 13 14 15 16 17 18 19 20))
1699 #t))))
000f7559
DT
1700 (build-system gnu-build-system)
1701 (arguments
c2099a4c
MW
1702 `(#:make-flags
1703 (list (string-append "PREFIX=" %output)
1704 (string-append "INSTALL_MAN=" %output "/share/man")
1705 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1706 "BUILD_STATIC=")
1707 #:phases (modify-phases %standard-phases
1708 (delete 'configure))
000f7559
DT
1709 #:tests? #f))
1710 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
1711 (description "Wireless Tools are used to manipulate the now-deprecated
1712Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1713Extension was an interface allowing you to set Wireless LAN specific
1714parameters and get the specific stats. It is deprecated in favor the nl80211
1715interface.")
000f7559 1716 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
1717 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1718 ;; other files are distributed under gpl2.
3ac73271 1719 (license (list license:gpl2 license:lgpl2.1+))))
30016044 1720
cc205dac
LC
1721(define-public crda
1722 (package
1723 (name "crda")
1724 (version "3.18")
1725 (source (origin
1726 (method url-fetch)
1727 (uri (string-append "mirror://kernel.org/software/network/crda/"
1728 "crda-" version ".tar.xz"))
1729 (sha256
1730 (base32
1731 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 1732 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
1733 (build-system gnu-build-system)
1734 (arguments
1735 '(#:phases (modify-phases %standard-phases
1736 (delete 'configure)
1737 (add-before
1738 'build 'no-werror-no-ldconfig
1739 (lambda _
1740 (substitute* "Makefile"
1741 (("-Werror") "")
1742 (("ldconfig") "true"))
1743 #t))
1744 (add-before
1745 'build 'set-regulator-db-file-name
1746 (lambda* (#:key inputs #:allow-other-keys)
1747 ;; Tell CRDA where to find our database.
1748 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1749 (substitute* "crda.c"
1750 (("\"/lib/crda/regulatory.bin\"")
1751 (string-append "\"" regdb
1752 "/lib/crda/regulatory.bin\"")))
1753 #t))))
1754 #:test-target "verify"
1755 #:make-flags (let ((out (assoc-ref %outputs "out"))
1756 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1757 (list "CC=gcc" "V=1"
1758
1759 ;; Disable signature-checking on 'regulatory.bin'.
1760 ;; The reason is that this simplifies maintenance
1761 ;; on our side (no need to manage a distro key
1762 ;; pair), and we can guarantee integrity of
1763 ;; 'regulatory.bin' by other means anyway, such as
1764 ;; 'guix gc --verify'. See
1765 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1766 ;; for a discssion.
1767 "USE_OPENSSL=0"
1768
1769 (string-append "PREFIX=" out)
1770 (string-append "SBINDIR=" out "/sbin/")
1771 (string-append "UDEV_RULE_DIR="
1772 out "/lib/udev/rules.d")
1773 (string-append "LDFLAGS=-Wl,-rpath="
1774 out "/lib -L.")
1775 (string-append "REG_BIN=" regdb
1776 "/lib/crda/regulatory.bin")))))
1777 (native-inputs `(("pkg-config" ,pkg-config)
1778 ("python" ,python-2)
1779 ("wireless-regdb" ,wireless-regdb)))
1780 (inputs `(("libnl" ,libnl)))
1781 (home-page
1782 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1783 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1784 (description
1785 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1786communication between the kernel Linux and user space for regulatory
1787compliance.")
3ac73271 1788 (license license:copyleft-next)))
cc205dac 1789
c80b4a3e
LC
1790(define-public wireless-regdb
1791 (package
1792 (name "wireless-regdb")
1793 (version "2015.04.06")
1794 (source (origin
1795 (method url-fetch)
1796 (uri (string-append
1797 "mirror://kernel.org/software/network/wireless-regdb/"
1798 "wireless-regdb-" version ".tar.xz"))
1799 (sha256
1800 (base32
5568151f
LC
1801 "0czi83k311fp27z42hxjm8vi88fsbc23mhavv96lkb4pmari0jjc"))
1802
1803 ;; We're building 'regulatory.bin' by ourselves.
1804 (snippet '(delete-file "regulatory.bin"))))
c80b4a3e
LC
1805 (build-system gnu-build-system)
1806 (arguments
1807 '(#:phases (modify-phases %standard-phases
1808 (delete 'configure))
5568151f
LC
1809
1810 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
1811 ;; is computed and can be equal to 'maintainer-clean'; when that
1812 ;; happens, we can end up deleting the 'regulatory.bin' file that we
1813 ;; just built. Thus, build things sequentially.
1814 #:parallel-build? #f
1815
c80b4a3e
LC
1816 #:tests? #f ;no tests
1817 #:make-flags (let ((out (assoc-ref %outputs "out")))
1818 (list (string-append "PREFIX=" out)
1819 (string-append "LSB_ID=GuixSD")
1820 (string-append "DISTRO_PUBKEY=/dev/null")
1821 (string-append "DISTRO_PRIVKEY=/dev/null")
1822 (string-append "REGDB_PUBKEY=/dev/null")
1823
1824 ;; Leave that empty so that db2bin.py doesn't try
1825 ;; to sign 'regulatory.bin'. This allows us to
1826 ;; avoid managing a key pair for the whole distro.
1827 (string-append "REGDB_PRIVKEY=")))))
1828 (native-inputs `(("python" ,python-2)))
1829 (home-page
1830 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
1831 (synopsis "Wireless regulatory database")
1832 (description
1833 "This package contains the wireless regulatory database Central
1834Regulatory Database Agent (CRDA) daemon. The database contains information on
1835country-specific regulations for the wireless spectrum.")
3ac73271 1836 (license license:isc)))
c80b4a3e 1837
30016044
MW
1838(define-public lm-sensors
1839 (package
1840 (name "lm-sensors")
1841 (version "3.3.5")
1842 (source (origin
1843 (method url-fetch)
1844 (uri (string-append
3a04d5d4 1845 "ftp://ftp.netroedge.com/pub/lm-sensors/lm_sensors-"
30016044
MW
1846 version ".tar.bz2"))
1847 (sha256
1848 (base32
1849 "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx"))
fc1adab1 1850 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
1851 (build-system gnu-build-system)
1852 (inputs `(("rrdtool" ,rrdtool)
1853 ("perl" ,perl)
1854 ("kmod" ,kmod)
1855 ("gnuplot" ,gnuplot)))
1856 (native-inputs `(("pkg-config" ,pkg-config)
1857 ("flex" ,flex)
1858 ("bison" ,bison)
1859 ("which" ,which)))
1860 (arguments
1861 `(#:tests? #f ; no 'check' target
1862 #:make-flags (list (string-append "PREFIX=" %output)
1863 (string-append "ETCDIR=" %output "/etc")
1864 (string-append "MANDIR=" %output "/share/man"))
1865 #:phases
1866 (alist-delete
1867 'configure
1868 (alist-cons-before
1869 'build 'patch-exec-paths
1870 (lambda* (#:key inputs outputs #:allow-other-keys)
1871 (substitute* "prog/detect/sensors-detect"
1872 (("`uname")
1873 (string-append "`" (assoc-ref inputs "coreutils")
1874 "/bin/uname"))
1875 (("(`|\")modprobe" all open-quote)
1876 (string-append open-quote
1877 (assoc-ref inputs "kmod")
1878 "/bin/modprobe")))
1879 (substitute* '("prog/pwm/pwmconfig"
1880 "prog/pwm/fancontrol")
1881 (("gnuplot")
1882 (string-append (assoc-ref inputs "gnuplot")
1883 "/bin/gnuplot"))
1884 (("cat ")
1885 (string-append (assoc-ref inputs "coreutils")
1886 "/bin/cat "))
1887 (("egrep ")
1888 (string-append (assoc-ref inputs "grep")
1889 "/bin/egrep "))
1890 (("sed -e")
1891 (string-append (assoc-ref inputs "sed")
1892 "/bin/sed -e"))
1893 (("cut -d")
1894 (string-append (assoc-ref inputs "coreutils")
1895 "/bin/cut -d"))
1896 (("sleep ")
1897 (string-append (assoc-ref inputs "coreutils")
1898 "/bin/sleep "))
1899 (("readlink -f")
1900 (string-append (assoc-ref inputs "coreutils")
1901 "/bin/readlink -f"))))
1902 %standard-phases))))
3a04d5d4 1903 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
1904 (synopsis "Utilities to read temperature/voltage/fan sensors")
1905 (description
35b9e423 1906 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
1907you to access information from temperature, voltage, and fan speed sensors.
1908It works with most newer systems.")
3ac73271 1909 (license license:gpl2+)))
b087d413 1910
f5b2a53d
RW
1911(define-public i2c-tools
1912 (package
1913 (name "i2c-tools")
1914 (version "3.1.1")
1915 (source (origin
1916 (method url-fetch)
1917 (uri (string-append
f32274a7 1918 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
1919 version ".tar.bz2"))
1920 (sha256
1921 (base32
1922 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
1923 (build-system gnu-build-system)
1924 (arguments
1925 `(#:tests? #f ; no 'check' target
1926 #:make-flags (list (string-append "prefix=" %output)
1927 "CC=gcc")
1928 ;; no configure script
1929 #:phases (alist-delete 'configure %standard-phases)))
bccf27cb
RW
1930 (inputs
1931 `(("perl" ,perl)))
f32274a7 1932 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
1933 (synopsis "I2C tools for Linux")
1934 (description
1935 "The i2c-tools package contains a heterogeneous set of I2C tools for
1936Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
1937EEPROM decoding scripts, EEPROM programming tools, and a python module for
1938SMBus access.")
3ac73271 1939 (license license:gpl2+)))
f5b2a53d 1940
b087d413
MW
1941(define-public xsensors
1942 (package
1943 (name "xsensors")
1944 (version "0.70")
1945 (source (origin
1946 (method url-fetch)
1947 (uri (string-append
1948 "http://www.linuxhardware.org/xsensors/xsensors-"
1949 version ".tar.gz"))
1950 (sha256
1951 (base32
1952 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
1953 (build-system gnu-build-system)
1954 (inputs `(("lm-sensors" ,lm-sensors)
1955 ("gtk" ,gtk+-2)))
1956 (native-inputs `(("pkg-config" ,pkg-config)))
1957 (arguments
1958 `(#:phases (alist-cons-before
1959 'configure 'enable-deprecated
1960 (lambda _
1961 (substitute* "src/Makefile.in"
1962 (("-DGDK_DISABLE_DEPRECATED") "")
1963 (("-DGTK_DISABLE_DEPRECATED") "")))
1964 (alist-cons-before
1965 'configure 'remove-Werror
1966 (lambda _
1967 (substitute* '("configure" "src/Makefile.in")
1968 (("-Werror") "")))
1969 %standard-phases))))
1970 (home-page "http://www.linuxhardware.org/xsensors/")
1971 (synopsis "Hardware health information viewer")
1972 (description
35b9e423 1973 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
1974health such as temperature, voltage and fan speed and displays the information
1975in a digital read-out.")
3ac73271 1976 (license license:gpl2+)))
b62fe07f
LC
1977
1978(define-public perf
1979 (package
1980 (name "perf")
1981 (version (package-version linux-libre))
1982 (source (package-source linux-libre))
1983 (build-system gnu-build-system)
1984 (arguments
1985 '(#:phases (alist-replace
1986 'configure
1987 (lambda* (#:key inputs #:allow-other-keys)
1988 (setenv "SHELL_PATH" (which "bash"))
1989 (chdir "tools/perf"))
1990 %standard-phases)
1991 #:make-flags (list (string-append "DESTDIR="
1992 (assoc-ref %outputs "out"))
2af29d23
LC
1993 "WERROR=0"
1994
1995 ;; By default, 'config/Makefile' uses lib64 on
1996 ;; x86_64. Work around that.
1997 "lib=lib")
b62fe07f
LC
1998 #:tests? #f)) ;no tests
1999 (native-inputs
2000 `(("pkg-config" ,pkg-config)
2001 ("bison" ,bison)
2002 ("flex" ,flex)
2003
2004 ;; There are build scripts written in these languages.
2005 ("perl" ,perl)
2006 ("python" ,python-2)))
2007 (inputs
b1fb4b23 2008 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2009 ;; ("newt" ,newt)
6c030d10 2010 ("python" ,python-2) ;'perf' links against libpython
b62fe07f
LC
2011 ("elfutils" ,elfutils)
2012
d7ece67a
LC
2013 ;; Documentation.
2014 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2015 ("libxslt" ,libxslt)
2016 ("docbook-xml" ,docbook-xml)
2017 ("docbook-xsl" ,docbook-xsl)
2018 ("xmlto" ,xmlto)
2019 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2020 (home-page "https://perf.wiki.kernel.org/")
2021 (synopsis "Linux profiling with performance counters")
2022 (description
2023 "perf is a tool suite for profiling using hardware performance counters,
2024with support in the Linux kernel. perf can instrument CPU performance
2025counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2026of lightweight profiling. This package contains the user-land tools and in
2027particular the 'perf' command.")
2028 (license (package-license linux-libre))))
c09e60e4
DT
2029
2030(define-public pflask
2031 (package
2032 (name "pflask")
2033 (version "0.2")
2034 (source (origin
2035 (method url-fetch)
2036 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2037 version ".tar.gz"))
f586c877 2038 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2039 (sha256
2040 (base32
2041 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2042 (build-system cmake-build-system)
2043 (arguments
2044 '(#:tests? #f)) ; no tests
2045 (home-page "http://ghedo.github.io/pflask/")
2046 (synopsis "Simple tool for creating Linux namespace containers")
2047 (description "pflask is a simple tool for creating Linux namespace
2048containers. It can be used for running a command or even booting an OS inside
2049an isolated container, created with the help of Linux namespaces. It is
2050similar in functionality to chroot, although pflask provides better isolation
2051thanks to the use of namespaces.")
3ac73271 2052 (license license:bsd-2)))
288084d5
MW
2053
2054(define-public hdparm
2055 (package
2056 (name "hdparm")
2057 (version "9.45")
2058 (source (origin
2059 (method url-fetch)
2060 (uri (string-append "mirror://sourceforge/" name "/"
2061 name "-" version ".tar.gz"))
2062 (sha256
2063 (base32
2064 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2065 (build-system gnu-build-system)
2066 (arguments
2067 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2068 (list (string-append "binprefix=" out)
2069 (string-append "manprefix=" out)
2070 "CC=gcc"))
2071 #:phases (alist-delete 'configure %standard-phases)
2072 #:tests? #f)) ; no test suite
2073 (home-page "http://sourceforge.net/projects/hdparm/")
e881752c 2074 (synopsis "Tune hard disk parameters for high performance")
288084d5
MW
2075 (description
2076 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
e881752c 2077is for enabling irq-unmasking and IDE multiple-mode.")
3ac73271 2078 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2079
c755c854
MW
2080(define-public rfkill
2081 (package
2082 (name "rfkill")
2083 (version "0.5")
2084 (source (origin
2085 (method url-fetch)
2086 (uri (string-append "mirror://kernel.org/software/network/"
2087 name "/" name "-" version ".tar.xz"))
2088 (sha256
2089 (base32
2090 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2091 (build-system gnu-build-system)
2092 (arguments
2093 `(#:make-flags (list "CC=gcc"
2094 (string-append "PREFIX=" %output))
2095 #:phases (modify-phases %standard-phases
2096 (delete 'configure))
2097 #:tests? #f))
2098 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2099 (synopsis "Tool for enabling and disabling wireless devices")
2100 (description
2101 "rfkill is a simple tool for accessing the rfkill device interface,
2102which is used to enable and disable wireless networking devices, typically
2103WLAN, Bluetooth and mobile broadband.")
3ac73271
LC
2104 (license (license:non-copyleft "file://COPYING"
2105 "See COPYING in the distribution."))))
c755c854 2106
57a516d3
LC
2107(define-public acpid
2108 (package
2109 (name "acpid")
2110 (version "2.0.23")
2111 (source (origin
2112 (method url-fetch)
2113 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2114 version ".tar.xz"))
2115 (sha256
2116 (base32
2117 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
2118 (build-system gnu-build-system)
2119 (home-page "http://sourceforge.net/projects/acpid2/")
2120 (synopsis "Daemon for delivering ACPI events to user-space programs")
2121 (description
2122 "acpid is designed to notify user-space programs of Advanced
2123Configuration and Power Interface (ACPI) events. acpid should be started
2124during the system boot, and will run as a background process. When an ACPI
2125event is received from the kernel, acpid will examine the list of rules
2126specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2127 (license license:gpl2+)))
37f5caec
TUBK
2128
2129(define-public sysfsutils
2130 (package
2131 (name "sysfsutils")
2132 (version "2.1.0")
2133 (source
2134 (origin
2135 (method url-fetch)
2136 (uri
2137 (string-append
2138 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2139 version ".tar.gz"))
2140 (sha256
2141 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2142 (build-system gnu-build-system)
2143 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2144 (synopsis "System utilities based on Linux sysfs")
2145 (description
69b4ffcf 2146 "These are a set of utilities built upon sysfs, a virtual filesystem in
37f5caec
TUBK
2147Linux kernel versions 2.5+ that exposes a system's device tree. The package
2148also contains the libsysfs library.")
2149 ;; The library is under lgpl2.1+ (all files say "or any later version").
2150 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2151 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2152
2153(define-public sysfsutils-1
2154 (package
2155 (inherit sysfsutils)
2156 (version "1.3.0")
2157 (source
2158 (origin
2159 (method url-fetch)
2160 (uri
2161 (string-append
2162 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2163 "/sysfsutils-" version ".tar.gz"))
2164 (sha256
2165 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2166 (modules '((guix build utils)))
2167 (snippet
2168 '(begin
2169 (substitute* "Makefile.in"
2170 (("includedir = /usr/include/sysfs")
2171 "includedir = @includedir@"))
2172 (substitute* "configure"
2173 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2174 (string-append "includedir='" orig "/sysfs'")))))))
2175 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2176
2177(define-public cpufrequtils
2178 (package
2179 (name "cpufrequtils")
2180 (version "0.3")
2181 (source
2182 (origin
2183 (method url-fetch)
2184 (uri
2185 (string-append
2186 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2187 version ".tar.gz"))
2188 (sha256
2189 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2190 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2191 (build-system gnu-build-system)
2192 (native-inputs
2193 `(("sysfsutils" ,sysfsutils-1)))
2194 (arguments
2195 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2196 (assoc-ref %outputs "out") "/lib"))))
2197 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2198 (synopsis "Utilities to get and set CPU frequency on Linux")
2199 (description
e881752c 2200 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2201information, and set the CPU frequency if supported, using the cpufreq
2202capabilities of the Linux kernel.")
3ac73271 2203 (license license:gpl2)))
0a588bf9
SB
2204
2205(define-public libraw1394
2206 (package
2207 (name "libraw1394")
2208 (version "2.1.0")
2209 (source (origin
2210 (method url-fetch)
2211 (uri (string-append
2212 "mirror://kernel.org/linux/libs/ieee1394/"
2213 name "-" version ".tar.xz"))
2214 (sha256
2215 (base32
2216 "0kwnf4ha45c04mhc4yla672aqmvqqihxix1gvblns5cd2pc2cc8b"))))
2217 (build-system gnu-build-system)
2218 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2219 (synopsis "Interface library for the Linux IEEE1394 drivers")
2220 (description
2221 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2222the Linux IEEE-1394 subsystem, which provides direct access to the connected
22231394 buses to user space. Through libraw1394/raw1394, applications can directly
2224send to and receive from other nodes without requiring a kernel driver for the
2225protocol in question.")
3ac73271 2226 (license license:lgpl2.1+)))
68e3c29d
SB
2227
2228(define-public libavc1394
2229 (package
2230 (name "libavc1394")
2231 (version "0.5.4")
2232 (source (origin
2233 (method url-fetch)
2234 (uri (string-append "mirror://sourceforge/libavc1394/"
2235 name "-" version ".tar.gz"))
2236 (sha256
2237 (base32
2238 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2239 (build-system gnu-build-system)
2240 (native-inputs
2241 `(("pkg-config" ,pkg-config)))
2242 (propagated-inputs
2243 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2244 (home-page "http://sourceforge.net/projects/libavc1394/")
2245 (synopsis "AV/C protocol library for IEEE 1394")
2246 (description
2247 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2248the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2249 (license license:lgpl2.1+)))
3f7bf86a
SB
2250
2251(define-public libiec61883
2252 (package
2253 (name "libiec61883")
2254 (version "1.2.0")
2255 (source (origin
2256 (method url-fetch)
2257 (uri (string-append
2258 "mirror://kernel.org/linux/libs/ieee1394/"
2259 name "-" version ".tar.xz"))
2260 (sha256
2261 (base32
2262 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2263 (build-system gnu-build-system)
2264 (native-inputs
2265 `(("pkg-config" ,pkg-config)))
2266 (propagated-inputs
2267 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2268 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2269 (synopsis "Isochronous streaming media library for IEEE 1394")
2270 (description
2271 "The libiec61883 library provides a higher level API for streaming DV,
2272MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2273 (license license:lgpl2.1+)))
69159125
MW
2274
2275(define-public mdadm
2276 (package
2277 (name "mdadm")
2278 (version "3.3.2")
2279 (source (origin
2280 (method url-fetch)
2281 (uri (string-append
2282 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2283 version ".tar.xz"))
2284 (sha256
2285 (base32
9a6953d2 2286 "132vdvh3myjgcjn6i9w90ck16ddjxjcszklzkyvr4f5ifqd7wfhg"))
fc1adab1 2287 (patches (search-patches "mdadm-gcc-4.9-fix.patch"))))
69159125
MW
2288 (build-system gnu-build-system)
2289 (inputs
2290 `(("udev" ,eudev)))
2291 (arguments
2292 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2293 (list "INSTALL=install"
2294 "CHECK_RUN_DIR=0"
2295 ;; TODO: tell it where to find 'sendmail'
2296 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2297 (string-append "BINDIR=" out "/sbin")
2298 (string-append "MANDIR=" out "/share/man")
2299 (string-append "UDEVDIR=" out "/lib/udev")))
2300 #:phases (alist-cons-before
2301 'build 'patch-program-paths
2302 (lambda* (#:key inputs #:allow-other-keys)
2303 (let ((coreutils (assoc-ref inputs "coreutils")))
2304 (substitute* "udev-md-raid-arrays.rules"
2305 (("/usr/bin/(readlink|basename)" all program)
2306 (string-append coreutils "/bin/" program)))))
2307 (alist-delete 'configure %standard-phases))
2308 ;;tests must be done as root
2309 #:tests? #f))
2310 (home-page "http://neil.brown.name/blog/mdadm")
2311 (synopsis "Tool for managing Linux Software RAID arrays")
2312 (description
2313 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2314assemble, report on, and monitor arrays. It can also move spares between raid
2315arrays when needed.")
3ac73271 2316 (license license:gpl2+)))
01ccdfb6
SB
2317
2318(define-public libaio
2319 (package
2320 (name "libaio")
2321 (version "0.3.110")
2322 (source (origin
2323 (method url-fetch)
2324 (uri (list
2325 (string-append "mirror://debian/pool/main/liba/libaio/"
2326 name "_" version ".orig.tar.gz")
2327 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2328 name "-" version ".tar.gz")))
2329 (sha256
2330 (base32
2331 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2332 (build-system gnu-build-system)
2333 (arguments
2334 '(#:make-flags
2335 (list "CC=gcc" (string-append "prefix=" %output))
2336 #:test-target "partcheck" ; need root for a full 'check'
2337 #:phases
2338 (alist-delete 'configure %standard-phases))) ; no configure script
2339 (home-page "http://lse.sourceforge.net/io/aio.html")
2340 (synopsis "Linux-native asynchronous I/O access library")
2341 (description
2342 "This library enables userspace to use Linux kernel asynchronous I/O
2343system calls, important for the performance of databases and other advanced
2344applications.")
3ac73271 2345 (license license:lgpl2.1+)))
eb7c43c3
DT
2346
2347(define-public bluez
2348 (package
2349 (name "bluez")
9c1c2a7f 2350 (version "5.36")
eb7c43c3
DT
2351 (source (origin
2352 (method url-fetch)
2353 (uri (string-append
2354 "https://www.kernel.org/pub/linux/bluetooth/bluez-"
2355 version ".tar.xz"))
2356 (sha256
2357 (base32
9c1c2a7f 2358 "1wkqwmi5krr37mxcqqlp5m2xnw7vw70v3ww7j09vvlskxcdflhx3"))))
eb7c43c3
DT
2359 (build-system gnu-build-system)
2360 (arguments
2361 '(#:configure-flags
2362 (let ((out (assoc-ref %outputs "out")))
53142109
AE
2363 (list "--enable-library"
2364 "--disable-systemd"
eb7c43c3
DT
2365 ;; Install dbus/udev files to the correct location.
2366 (string-append "--with-dbusconfdir=" out "/etc")
2367 (string-append "--with-udevdir=" out "/lib/udev")))))
2368 (native-inputs
2369 `(("pkg-config" ,pkg-config)
2370 ("gettext" ,gnu-gettext)))
2371 (inputs
2372 `(("glib" ,glib)
2373 ("dbus" ,dbus)
2374 ("eudev" ,eudev)
2375 ("libical" ,libical)
2376 ("readline" ,readline)))
2377 (home-page "http://www.bluez.org/")
2378 (synopsis "Linux Bluetooth protocol stack")
2379 (description
2380 "BlueZ provides support for the core Bluetooth layers and protocols. It
2381is flexible, efficient and uses a modular implementation.")
3ac73271 2382 (license license:gpl2+)))
3d890318
LC
2383
2384(define-public fuse-exfat
2385 (package
2386 (name "fuse-exfat")
2387 (version "1.1.0")
2388 (source (origin
2389 (method url-fetch)
2390 (uri "https://docs.google.com/uc?export=download&\
2391id=0B7CLI-REKbE3VTdaa0EzTkhYdU0")
2392 (sha256
2393 (base32
2394 "0glmgwrf0nv09am54i6s35ksbvrywrwc51w6q32mv5by8475530r"))
2395 (file-name (string-append name "-" version ".tar.gz"))))
2396 (build-system gnu-build-system)
2397 (native-inputs
2398 `(("scons" ,scons)
2399 ("pkg-config" ,pkg-config)))
2400 (inputs
2401 `(("fuse" ,fuse)))
2402 (arguments
2403 '(#:tests? #f ;no test suite
2404
2405 ;; XXX: Factorize with 'exfat-utils'.
2406 #:phases (modify-phases %standard-phases
2407 (delete 'configure)
2408 (add-after 'unpack 'scons-propagate-environment
2409 (lambda _
2410 ;; Modify the SConstruct file to arrange for
2411 ;; environment variables to be propagated.
2412 (substitute* "SConstruct"
2413 (("^env = Environment\\(")
2414 "env = Environment(ENV=os.environ, "))))
2415 (replace 'build
2416 (lambda _
2417 (zero? (system* "scons"))))
2418 (replace 'install
2419 (lambda* (#:key outputs #:allow-other-keys)
2420 (let* ((out (assoc-ref outputs "out"))
2421 (bin (string-append out "/bin"))
2422 (man8 (string-append out
2423 "/share/man/man8")))
2424 (mkdir-p bin)
2425 (mkdir-p man8)
2426 (for-each (lambda (file)
2427 (copy-file
2428 file
2429 (string-append man8 "/"
2430 (basename file))))
2431 (find-files "." "\\.8$"))
2432 (zero? (system* "scons" "install"
2433 (string-append "DESTDIR="
2434 bin)))))))))
2435 (home-page "http://code.google.com/p/exfat/")
2436 (synopsis "Mount exFAT file systems")
2437 (description
2438 "This package provides a FUSE-based file system that provides read and
2439write access to exFAT devices.")
3ac73271 2440 (license license:gpl2+)))
53ec8d48
LC
2441
2442(define-public gpm
2443 (package
2444 (name "gpm")
2445 (version "1.20.7")
2446 (source (origin
2447 (method url-fetch)
2448 (uri (string-append
2449 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2450 version ".tar.bz2"))
2451 (sha256
2452 (base32
2453 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2454 (build-system gnu-build-system)
2455 (arguments
2456 '(#:phases (modify-phases %standard-phases
2457 (add-before 'configure 'bootstrap
2458 (lambda _
2459 ;; The tarball was not generated with 'make dist' so we
2460 ;; need to bootstrap things ourselves.
2461 (and (zero? (system* "./autogen.sh"))
2462 (begin
2463 (patch-makefile-SHELL "Makefile.include.in")
2464 #t)))))
2465
2466 ;; Make sure programs find libgpm.so.
2467 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2468 (assoc-ref %outputs "out")
2469 "/lib"))))
2470 (native-inputs
2471 `(("texinfo" ,texinfo)
2472 ("bison" ,bison)
2473 ("flex" ,flex)
2474 ("autoconf" ,autoconf)
2475 ("automake" ,automake)
2476 ("libtool" ,libtool)))
2477 (home-page "http://www.nico.schottelius.org/software/gpm/")
2478 (synopsis "Mouse support for the Linux console")
2479 (description
2480 "The GPM (general-purpose mouse) daemon is a mouse server for
2481applications running on the Linux console. It allows users to select items
2482and copy/paste text in the console and in xterm.")
3ac73271 2483 (license license:gpl2+)))
fc686f9a
TGR
2484
2485(define-public btrfs-progs
2486 (package
2487 (name "btrfs-progs")
916627b4 2488 (version "4.5.1")
fc686f9a
TGR
2489 (source (origin
2490 (method url-fetch)
2491 (uri (string-append "mirror://kernel.org/linux/kernel/"
2492 "people/kdave/btrfs-progs/"
2493 "btrfs-progs-v" version ".tar.xz"))
2494 (sha256
2495 (base32
916627b4 2496 "1znf2zhb56zbmdjk3lq107678xwsqwc5gczspypmc5i31qnppy7f"))))
fc686f9a
TGR
2497 (build-system gnu-build-system)
2498 (arguments
08fbfa8d 2499 '(#:test-target "test"
fc686f9a
TGR
2500 #:parallel-tests? #f)) ; tests fail when run in parallel
2501 (inputs `(("e2fsprogs" ,e2fsprogs)
2502 ("libblkid" ,util-linux)
2503 ("libuuid" ,util-linux)
2504 ("zlib" ,zlib)
2505 ("lzo" ,lzo)))
2506 (native-inputs `(("pkg-config" ,pkg-config)
2507 ("asciidoc" ,asciidoc)
2508 ("xmlto" ,xmlto)
2509 ;; For building documentation
2510 ("libxml2" ,libxml2)
2511 ("docbook-xml" ,docbook-xml)
2512 ("docbook-xsl" ,docbook-xsl)))
2513 (home-page "https://btrfs.wiki.kernel.org/")
2514 (synopsis "Create and manage btrfs copy-on-write file systems")
2515 (description "Btrfs is a copy-on-write (CoW) filesystem for Linux aimed at
2516implementing advanced features while focusing on fault tolerance, repair and
2517easy administration.")
68bcac6b
LF
2518 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2519 ;; GPL2: Everything else.
2520 (license (list license:gpl2 license:gpl2+))))
08e9daf5
TGR
2521
2522(define-public freefall
2523 (package
2524 (name "freefall")
2525 (version (package-version linux-libre))
2526 (source (package-source linux-libre))
2527 (build-system gnu-build-system)
2528 (arguments
2529 '(#:phases (modify-phases %standard-phases
2530 (add-after 'unpack 'enter-subdirectory
2531 (lambda _
2532 (chdir "tools/laptop/freefall")))
2533 (delete 'configure)
2534 (add-before 'build 'increase-timeout
2535 (lambda _
2536 ;; The default of 2 seconds is too low: it assumes an
2537 ;; open lid and AC power without actually checking.
2538 (substitute* "freefall.c"
2539 (("alarm\\(2\\)") "alarm(5)")))))
2540 #:make-flags (list (string-append "PREFIX="
2541 (assoc-ref %outputs "out")))
2542 #:tests? #f)) ;no tests
2543 (home-page (package-home-page linux-libre))
2544 (synopsis "Free-fall protection for spinning laptop hard drives")
2545 (description
2546 "Prevents shock damage to the internal spinning hard drive(s) of some
2547HP and Dell laptops. When sudden movement is detected, all input/output
2548operations on the drive are suspended and its heads are parked on the ramp,
2549where they are less likely to cause damage to the spinning disc. Requires a
2550drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2551feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2552 (license license:gpl2)))