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