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