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