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