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