gnu: libxcb: Update to 1.12.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
74d21291 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 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>
75fd35b6 5;;; Copyright © 2014, 2015, 2016, 2017 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>
e77fe950 8;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
cd7caa3e 10;;; Copyright © 2016, 2017 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>
0d74462a 18;;; Copyright © 2016 Marius Bakke <mbakke@fastmail.com>
411264c2 19;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
440a3143 20;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
7d2511bc 21;;; Copyright © 2016 ng0 <ng0@libertad.pw>
6d3e08d4 22;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
01be4f93 23;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
189d8422 24;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
c7adafa7 25;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
fd76c904 26;;;
233e7676 27;;; This file is part of GNU Guix.
fd76c904 28;;;
233e7676 29;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
30;;; under the terms of the GNU General Public License as published by
31;;; the Free Software Foundation; either version 3 of the License, or (at
32;;; your option) any later version.
33;;;
233e7676 34;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
35;;; WITHOUT ANY WARRANTY; without even the implied warranty of
36;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37;;; GNU General Public License for more details.
38;;;
39;;; You should have received a copy of the GNU General Public License
233e7676 40;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 41
1ffa7090 42(define-module (gnu packages linux)
59a43334 43 #:use-module (gnu packages)
0c60cc53 44 #:use-module (gnu packages acl)
75750abb
DC
45 #:use-module (gnu packages admin)
46 #:use-module (gnu packages algebra)
47 #:use-module (gnu packages attr)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages base)
c7adafa7 50 #:use-module (gnu packages bash)
75750abb
DC
51 #:use-module (gnu packages bison)
52 #:use-module (gnu packages calendar)
53 #:use-module (gnu packages check)
e385e957 54 #:use-module (gnu packages crypto)
f61e0e79 55 #:use-module (gnu packages compression)
75750abb
DC
56 #:use-module (gnu packages databases)
57 #:use-module (gnu packages docbook)
58 #:use-module (gnu packages documentation)
59 #:use-module (gnu packages elf)
1ffa7090 60 #:use-module (gnu packages flex)
75750abb
DC
61 #:use-module (gnu packages freedesktop)
62 #:use-module (gnu packages gcc)
63 #:use-module (gnu packages gettext)
64 #:use-module (gnu packages glib)
e385e957 65 #:use-module (gnu packages gnuzilla)
d7d42d6b 66 #:use-module (gnu packages gperf)
75750abb 67 #:use-module (gnu packages gtk)
1ffa7090 68 #:use-module (gnu packages libusb)
01be4f93 69 #:use-module (gnu packages man)
75750abb 70 #:use-module (gnu packages maths)
1ffa7090 71 #:use-module (gnu packages ncurses)
c7adafa7 72 #:use-module (gnu packages networking)
1ffa7090 73 #:use-module (gnu packages perl)
75750abb 74 #:use-module (gnu packages pciutils)
1ffa7090 75 #:use-module (gnu packages pkg-config)
0d74462a 76 #:use-module (gnu packages popt)
75750abb 77 #:use-module (gnu packages pulseaudio)
7c0dbe78 78 #:use-module (gnu packages python)
75750abb
DC
79 #:use-module (gnu packages readline)
80 #:use-module (gnu packages rrdtool)
b1fb4b23 81 #:use-module (gnu packages slang)
f57d2639 82 #:use-module (gnu packages texinfo)
75343704 83 #:use-module (gnu packages tls)
7d2511bc 84 #:use-module (gnu packages video)
85 #:use-module (gnu packages xiph)
75750abb 86 #:use-module (gnu packages xml)
58c4f11e
TGR
87 #:use-module (gnu packages xdisorg)
88 #:use-module (gnu packages xorg)
220193ad 89 #:use-module (guix build-system cmake)
75750abb 90 #:use-module (guix build-system gnu)
e102f940 91 #:use-module (guix build-system python)
a94546ec 92 #:use-module (guix build-system trivial)
75750abb
DC
93 #:use-module (guix download)
94 #:use-module ((guix licenses) #:prefix license:)
95 #:use-module (guix packages)
96 #:use-module (guix utils)
adddd5ba 97 #:use-module (srfi srfi-1)
17db0706 98 #:use-module (srfi srfi-2)
a94546ec
LC
99 #:use-module (srfi srfi-26)
100 #:use-module (ice-9 match))
fd76c904 101
aaf4cb20
LC
102(define-public (system->linux-architecture arch)
103 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 104\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
105 (let ((arch (car (string-split arch #\-))))
106 (cond ((string=? arch "i686") "i386")
107 ((string-prefix? "mips" arch) "mips")
aaf4cb20 108 ((string-prefix? "arm" arch) "arm")
503275e9 109 ((string-prefix? "aarch64" arch) "arm64")
618cea69
NK
110 (else arch))))
111
440a3143
CSLL
112(define-public (system->defconfig system)
113 "Some systems (notably powerpc-linux) require a special target for kernel
114defconfig. Return the appropiate make target if applicable, otherwise return
115\"defconfig\"."
116 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
117 (else "defconfig")))
118
6023cc74
LC
119(define (linux-libre-urls version)
120 "Return a list of URLs for Linux-Libre VERSION."
121 (list (string-append
122 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
123 version "-gnu/linux-libre-" version "-gnu.tar.xz")
124
125 ;; XXX: Work around <http://bugs.gnu.org/14851>.
126 (string-append
127 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
128 version "-gnu.tar.xz")
129
130 ;; Maybe this URL will become valid eventually.
131 (string-append
132 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
133 version "-gnu.tar.xz")))
134
80fe5c60 135(define-public linux-libre-headers
b450d2b4
DC
136 (package
137 (name "linux-libre-headers")
e77fe950 138 (version "4.4.47")
b450d2b4
DC
139 (source (origin
140 (method url-fetch)
141 (uri (linux-libre-urls version))
142 (sha256
143 (base32
e77fe950 144 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
b450d2b4
DC
145 (build-system gnu-build-system)
146 (native-inputs `(("perl" ,perl)))
147 (arguments
148 `(#:modules ((guix build gnu-build-system)
149 (guix build utils)
150 (srfi srfi-1))
151 #:phases
152 (modify-phases %standard-phases
153 (delete 'configure)
154 (replace 'build
155 (lambda _
156 (let ((arch ,(system->linux-architecture
157 (or (%current-target-system)
440a3143
CSLL
158 (%current-system))))
159 (defconfig ,(system->defconfig
160 (or (%current-target-system)
161 (%current-system)))))
b450d2b4 162 (setenv "ARCH" arch)
618cea69 163 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
440a3143 164 (and (zero? (system* "make" defconfig))
618cea69 165 (zero? (system* "make" "mrproper" "headers_check"))))))
b450d2b4
DC
166 (replace 'install
167 (lambda* (#:key outputs #:allow-other-keys)
80fe5c60
LC
168 (let ((out (assoc-ref outputs "out")))
169 (and (zero? (system* "make"
170 (string-append "INSTALL_HDR_PATH=" out)
171 "headers_install"))
b15389e1
LC
172 (begin
173 (mkdir (string-append out "/include/config"))
174 (call-with-output-file
175 (string-append out
176 "/include/config/kernel.release")
177 (lambda (p)
178 (format p "~a-default~%" ,version)))
179
180 ;; Remove the '.install' and '..install.cmd' files; the
181 ;; latter contains store paths, which pulls in bootstrap
182 ;; binaries in the build environment, and prevents bit
183 ;; reproducibility for the bootstrap binaries.
184 (for-each delete-file (find-files out "\\.install"))
185
186 #t))))))
b15389e1 187 #:allowed-references ()
80fe5c60 188 #:tests? #f))
b450d2b4 189 (home-page "http://www.gnu.org/software/linux-libre")
80fe5c60
LC
190 (synopsis "GNU Linux-Libre kernel headers")
191 (description "Headers of the Linux-Libre kernel.")
b450d2b4 192 (license license:gpl2)))
80fe5c60 193
ac47a7c2
LC
194(define %boot-logo-patch
195 ;; Linux-Libre boot logo featuring Freedo and a gnu.
196 (origin
197 (method url-fetch)
198 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 199 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
200 (sha256
201 (base32
202 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
203
c258807a 204(define* (kernel-config arch #:key variant)
a94546ec 205 "Return the absolute file name of the Linux-Libre build configuration file
c258807a
DC
206for ARCH and optionally VARIANT, or #f if there is no such configuration."
207 (let* ((name (string-append "linux-libre-"
208 (if variant (string-append variant "-") "")
25847b32 209 (if (string=? "i386" arch) "i686" arch) ".conf"))
c258807a 210 (file (string-append "gnu/packages/" name)))
d6feaf6e 211 (search-path %load-path file)))
a94546ec 212
90c18c32 213(define %default-extra-linux-options
50dbc036 214 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
b9f7895d
DC
215 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
216 ;; Modules required for initrd:
217 ("CONFIG_NET_9P" . m)
218 ("CONFIG_NET_9P_VIRTIO" . m)
219 ("CONFIG_VIRTIO_BLK" . m)
220 ("CONFIG_VIRTIO_NET" . m)
221 ("CONFIG_VIRTIO_PCI" . m)
222 ("CONFIG_VIRTIO_BALLOON" . m)
223 ("CONFIG_VIRTIO_MMIO" . m)
224 ("CONFIG_FUSE_FS" . m)
225 ("CONFIG_CIFS" . m)
226 ("CONFIG_9P_FS" . m)))
90c18c32
DC
227
228(define (config->string options)
229 (string-join (map (match-lambda
230 ((option . 'm)
231 (string-append option "=m"))
232 ((option . #t)
233 (string-append option "=y"))
234 ((option . #f)
235 (string-append option "=n")))
236 options)
237 "\n"))
238
3129b9c2 239(define* (make-linux-libre version hash supported-systems
c258807a
DC
240 #:key
241 ;; A function that takes an arch and a variant.
242 ;; See kernel-config for an example.
a6d01325 243 (extra-version #f)
c258807a 244 (configuration-file #f)
90c18c32 245 (defconfig "defconfig")
64de7d1c
MW
246 (extra-options %default-extra-linux-options)
247 (patches (list %boot-logo-patch)))
614d1738 248 (package
a6d01325
DC
249 (name (if extra-version
250 (string-append "linux-libre-" extra-version)
251 "linux-libre"))
c258807a 252 (version version)
614d1738
DC
253 (source (origin
254 (method url-fetch)
255 (uri (linux-libre-urls version))
c258807a 256 (sha256 (base32 hash))
64de7d1c 257 (patches patches)))
3129b9c2 258 (supported-systems supported-systems)
614d1738 259 (build-system gnu-build-system)
614d1738
DC
260 (native-inputs
261 `(("perl" ,perl)
262 ("bc" ,bc)
263 ("openssl" ,openssl)
78edcccc 264 ("kmod" ,kmod)
64b5e413
LC
265 ,@(match (and configuration-file
266 (configuration-file
267 (system->linux-architecture
268 (or (%current-target-system) (%current-system)))
269 #:variant (version-major+minor version)))
270 (#f ;no config for this platform
271 '())
272 ((? string? config)
273 `(("kconfig" ,config))))))
614d1738
DC
274 (arguments
275 `(#:modules ((guix build gnu-build-system)
276 (guix build utils)
277 (srfi srfi-1)
278 (ice-9 match))
279 #:phases
280 (modify-phases %standard-phases
9416459b 281 (replace 'configure
4b42703e 282 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
96e9f097
RN
283 ;; Avoid introducing timestamps
284 (setenv "KCONFIG_NOTIMESTAMP" "1")
285 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
286
4b42703e 287 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
288 (let ((arch ,(system->linux-architecture
289 (or (%current-target-system)
290 (%current-system)))))
4b42703e
DC
291 (setenv "ARCH" arch)
292 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 293
4b42703e
DC
294 (when target
295 (setenv "CROSS_COMPILE" (string-append target "-"))
296 (format #t "`CROSS_COMPILE' set to `~a'~%"
297 (getenv "CROSS_COMPILE"))))
beacfcab 298
a6d01325
DC
299 (setenv "EXTRA_VERSION" ,extra-version)
300
a94546ec
LC
301 (let ((build (assoc-ref %standard-phases 'build))
302 (config (assoc-ref inputs "kconfig")))
1650dd8a 303
e4e9c0a0
DC
304 ;; Use a custom kernel configuration file or a default
305 ;; configuration file.
1650dd8a
LC
306 (if config
307 (begin
308 (copy-file config ".config")
309 (chmod ".config" #o666))
c258807a 310 (system* "make" ,defconfig))
a94546ec
LC
311
312 ;; Appending works even when the option wasn't in the
313 ;; file. The last one prevails if duplicated.
90c18c32
DC
314 (let ((port (open-file ".config" "a"))
315 (extra-configuration ,(config->string extra-options)))
316 (display extra-configuration port)
a94546ec
LC
317 (close-port port))
318
9416459b 319 (zero? (system* "make" "oldconfig")))))
614d1738 320 (replace 'install
4b42703e 321 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
322 (let* ((out (assoc-ref outputs "out"))
323 (moddir (string-append out "/lib/modules"))
e4e9c0a0
DC
324 (dtbdir (string-append out "/lib/dtbs"))
325 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
326 ;; Install kernel image, kernel configuration and link map.
327 (for-each (lambda (file) (install-file file out))
328 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
329 ;; Install device tree files
330 (for-each (lambda (file) (install-file file dtbdir))
331 (find-files "." "\\.dtb$"))
332 ;; Install kernel modules
beacfcab 333 (mkdir-p moddir)
beacfcab 334 (zero? (system* "make"
78edcccc 335 (string-append "DEPMOD=" kmod "/bin/depmod")
beacfcab
LC
336 (string-append "MODULE_DIR=" moddir)
337 (string-append "INSTALL_PATH=" out)
338 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 339 "INSTALL_MOD_STRIP=1"
beacfcab 340 "modules_install"))))))
beacfcab 341 #:tests? #f))
614d1738 342 (home-page "http://www.gnu.org/software/linux-libre/")
f50d2669 343 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 344 (description
79c311b8
LC
345 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
346It has been modified to remove all non-free binary blobs.")
614d1738 347 (license license:gpl2)))
beacfcab 348
3129b9c2
DC
349(define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
350
52d901da
MW
351(define %linux-libre-version "4.10")
352(define %linux-libre-hash "167zzgkivpqsp07did25wjqsswddzp3gifcdkq7xk00llxlmspla")
76e62ef7 353
c258807a 354(define-public linux-libre
76e62ef7
MW
355 (make-linux-libre %linux-libre-version
356 %linux-libre-hash
3129b9c2 357 %intel-compatible-systems
c258807a
DC
358 #:configuration-file kernel-config))
359
52d901da
MW
360(define-public linux-libre-4.9
361 (make-linux-libre "4.9.11"
362 "1gypfg2984zr4z7hihnl3bbpxnk1mrqbynb6xd8ad2v2z04aw13q"
363 %intel-compatible-systems
364 #:configuration-file kernel-config))
365
75b314a6 366(define-public linux-libre-4.4
64d38538
MW
367 (make-linux-libre "4.4.50"
368 "0c157kk0vgrb1fsyy4q3czqdg4npgql82n6p303afy8ylh2w6d3l"
3129b9c2 369 %intel-compatible-systems
c258807a 370 #:configuration-file kernel-config))
75b314a6 371
adddd5ba 372(define-public linux-libre-4.1
13c0eccb
MW
373 (make-linux-libre "4.1.38"
374 "165kmzglhg63hn7y4q7r6cb2dpsljxiq1czvgyx0bkd1vd2bcvsa"
3129b9c2 375 %intel-compatible-systems
e9a19bde 376 #:configuration-file kernel-config))
adddd5ba 377
cde7c23f
DC
378(define-public linux-libre-arm-generic
379 (make-linux-libre %linux-libre-version
380 %linux-libre-hash
381 '("armhf-linux")
382 #:defconfig "multi_v7_defconfig"
383 #:extra-version "arm-generic"))
384
97121c2a 385\f
c84d0eca
LC
386;;;
387;;; Pluggable authentication modules (PAM).
388;;;
389
fd76c904
LC
390(define-public linux-pam
391 (package
392 (name "linux-pam")
7483230f 393 (version "1.3.0")
fd76c904
LC
394 (source
395 (origin
396 (method url-fetch)
7483230f
DC
397 (uri (string-append
398 "http://www.linux-pam.org/library/"
399 "Linux-PAM-" version ".tar.bz2"))
fd76c904
LC
400 (sha256
401 (base32
411264c2
RS
402 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
403 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
404
fd76c904 405 (build-system gnu-build-system)
c4c4cc05 406 (native-inputs
fd76c904
LC
407 `(("flex" ,flex)
408
409 ;; TODO: optional dependencies
410 ;; ("libxcrypt" ,libxcrypt)
411 ;; ("cracklib" ,cracklib)
412 ))
413 (arguments
c134056a
LC
414 '(;; Most users, such as `shadow', expect the headers to be under
415 ;; `security'.
416 #:configure-flags (list (string-append "--includedir="
417 (assoc-ref %outputs "out")
418 "/include/security"))
419
420 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
421 ;; isn't available.
422 #:tests? #f))
fd76c904
LC
423 (home-page "http://www.linux-pam.org/")
424 (synopsis "Pluggable authentication modules for Linux")
425 (description
426 "A *Free* project to implement OSF's RFC 86.0.
427Pluggable authentication modules are small shared object files that can
428be used through the PAM API to perform tasks, like authenticating a user
e881752c 429at login. Local and dynamic reconfiguration are its key features.")
3ac73271 430 (license license:bsd-3)))
686f14e8 431
4c93ce42
EF
432(define-public linux-pam-1.2
433 (package
434 (inherit linux-pam)
4c93ce42
EF
435 (version "1.2.1")
436 (source
437 (origin
438 (method url-fetch)
439 (uri (string-append
440 "http://www.linux-pam.org/library/"
441 "Linux-PAM-" version ".tar.bz2"))
442 (sha256
443 (base32
411264c2
RS
444 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
445 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
4c93ce42 446
53142109 447
c84d0eca
LC
448;;;
449;;; Miscellaneous.
450;;;
451
686f14e8
LC
452(define-public psmisc
453 (package
454 (name "psmisc")
455 (version "22.20")
456 (source
457 (origin
458 (method url-fetch)
459 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
460 version ".tar.gz"))
461 (sha256
462 (base32
463 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
464 (build-system gnu-build-system)
465 (inputs `(("ncurses" ,ncurses)))
466 (home-page "http://psmisc.sourceforge.net/")
467 (synopsis
8f65585b 468 "Small utilities that use the proc file system")
686f14e8
LC
469 (description
470 "This PSmisc package is a set of some small useful utilities that
8f65585b 471use the proc file system. We're not about changing the world, but
686f14e8 472providing the system administrator with some help in common tasks.")
3ac73271 473 (license license:gpl2+)))
02b80c3f
NK
474
475(define-public util-linux
476 (package
477 (name "util-linux")
0172d5a1 478 (version "2.29.1")
5a6a3ba4
LC
479 (source (origin
480 (method url-fetch)
481 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
482 name "/v" (version-major+minor version) "/"
483 name "-" version ".tar.xz"))
5a6a3ba4
LC
484 (sha256
485 (base32
0172d5a1 486 "0kzmhb2swiqk402jp0y2jsx53l42d7z4xz3bzbn2zv1lp400dr0c"))
fc1adab1 487 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
488 (modules '((guix build utils)))
489 (snippet
ec2da92c
LC
490 ;; We take the 'logger' program from GNU Inetutils and 'kill'
491 ;; from GNU Coreutils.
8338c241
MW
492 '(begin
493 (substitute* "configure"
494 (("build_logger=yes") "build_logger=no")
495 (("build_kill=yes") "build_kill=no"))
496 #t))))
02b80c3f 497 (build-system gnu-build-system)
dd581e9a
TGR
498 (outputs '("out"
499 "static")) ; >2 MiB of static .a libraries
02b80c3f 500 (arguments
29ec55ee 501 `(#:configure-flags (list "--disable-use-tty-group"
d9804e50 502 "--enable-fs-paths-default=/run/current-system/profile/sbin"
29ec55ee
LC
503 ;; Install completions where our
504 ;; bash-completion package expects them.
505 (string-append "--with-bashcompletiondir="
506 (assoc-ref %outputs "out")
507 "/etc/bash_completion.d"))
1b9cf4ad 508 #:phases (modify-phases %standard-phases
7e512497
LC
509 (add-before
510 'build 'set-umount-file-name
511 (lambda* (#:key outputs #:allow-other-keys)
512 ;; Tell 'eject' the right file name of 'umount'.
513 (let ((out (assoc-ref outputs "out")))
514 (substitute* "sys-utils/eject.c"
515 (("\"/bin/umount\"")
516 (string-append "\"" out "/bin/umount\"")))
517 #t)))
1b9cf4ad
LC
518 (add-before
519 'check 'pre-check
520 (lambda* (#:key inputs outputs #:allow-other-keys)
521 (let ((out (assoc-ref outputs "out"))
522 (net (assoc-ref inputs "net-base")))
523 ;; Change the test to refer to the right file.
524 (substitute* "tests/ts/misc/mcookie"
525 (("/etc/services")
526 (string-append net "/etc/services")))
dd581e9a
TGR
527 #t)))
528 (add-after
529 'install 'move-static-libraries
530 (lambda* (#:key outputs #:allow-other-keys)
531 (let ((out (assoc-ref outputs "out"))
532 (static (assoc-ref outputs "static")))
533 (mkdir-p (string-append static "/lib"))
534 (with-directory-excursion out
535 (for-each (lambda (file)
536 (rename-file file
537 (string-append static "/"
538 file)))
539 (find-files "lib" "\\.a$")))
1b9cf4ad 540 #t))))))
f61e0e79 541 (inputs `(("zlib" ,zlib)
c4c4cc05
JD
542 ("ncurses" ,ncurses)))
543 (native-inputs
9f533d60
LC
544 `(("perl" ,perl)
545 ("net-base" ,net-base))) ;for tests
02b80c3f 546 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 547 (synopsis "Collection of utilities for the Linux kernel")
437d7286 548 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 549utilities. It provides dmesg and includes tools for working with file systems,
437d7286 550block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 551
02b80c3f 552 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 553 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 554 ;; explicitly defined license.
3ac73271
LC
555 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
556 license:bsd-4 license:public-domain))))
5d5c4278 557
e47e3eff
LC
558(define-public procps
559 (package
560 (name "procps")
74a3c4bb 561 (version "3.3.12")
e47e3eff 562 (source (origin
0cc22848
SB
563 (method url-fetch)
564 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
565 "procps-ng-" version ".tar.xz"))
566 (sha256
567 (base32
74a3c4bb 568 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
e47e3eff 569 (build-system gnu-build-system)
e47e3eff 570 (arguments
80393eed
LC
571 '(#:modules ((guix build utils)
572 (guix build gnu-build-system)
573 (srfi srfi-1)
574 (srfi srfi-26))
0cc22848
SB
575 #:phases
576 (modify-phases %standard-phases
241826b5
LC
577 (add-before 'check 'disable-strtod-test
578 (lambda _
579 ;; Disable the 'strtod' test, which fails on 32-bit systems.
580 ;; This is what upstream does:
581 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
582 (substitute* "Makefile"
583 (("^(TESTS|check_PROGRAMS) = .*$" all)
584 (string-append "# " all "\n")))
585 #t))
0cc22848
SB
586 (add-after
587 'install 'post-install
588 ;; Remove commands and man pages redudant with
589 ;; Coreutils.
590 (lambda* (#:key outputs #:allow-other-keys)
591 (let* ((out (assoc-ref outputs "out"))
592 (dup (append-map (cut find-files out <>)
593 '("^kill" "^uptime"))))
594 (for-each delete-file dup)
595 #t))))))
596 (inputs `(("ncurses" ,ncurses)))
597 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 598 (synopsis "Utilities that give information about processes")
e47e3eff 599 (description
35b9e423 600 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
601that give information about processes using the Linux /proc file system.
602The package includes the programs ps, top, vmstat, w, kill, free,
603slabtop, and skill.")
3ac73271 604 (license license:gpl2)))
e47e3eff 605
5d5c4278
NK
606(define-public usbutils
607 (package
608 (name "usbutils")
e8a463e6 609 (version "008")
5d5c4278
NK
610 (source
611 (origin
612 (method url-fetch)
613 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
614 "usbutils-" version ".tar.xz"))
615 (sha256
616 (base32
e8a463e6 617 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
5d5c4278
NK
618 (build-system gnu-build-system)
619 (inputs
e8a463e6 620 `(("libusb" ,libusb)
e5d861f3 621 ("eudev" ,eudev-with-hwdb)))
c4c4cc05
JD
622 (native-inputs
623 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
624 (home-page "http://www.linux-usb.org/")
625 (synopsis
626 "Tools for working with USB devices, such as lsusb")
627 (description
628 "Tools for working with USB devices, such as lsusb.")
3ac73271 629 (license license:gpl2+)))
0750452a
LC
630
631(define-public e2fsprogs
632 (package
633 (name "e2fsprogs")
7409c8d4 634 (version "1.42.13")
0750452a
LC
635 (source (origin
636 (method url-fetch)
7409c8d4
MW
637 (uri (string-append
638 "mirror://kernel.org/linux/kernel/people/tytso/"
639 name "/v" version "/"
640 name "-" version ".tar.xz"))
0750452a
LC
641 (sha256
642 (base32
7409c8d4 643 "1ix0b83zgw5n0p2grh2961c6796m92yr2jqc2sbr23x3lfsp8r71"))
7c594a2c
LC
644 (modules '((guix build utils)))
645 (snippet
082be6d2
LC
646 '(begin
647 (substitute* "MCONFIG.in"
648 (("INSTALL_SYMLINK = /bin/sh")
649 "INSTALL_SYMLINK = sh"))
650
651 ;; Do not include a timestamp in libext2fs.info.gz.
652 (substitute* "doc/Makefile.in"
653 (("gzip -9")
654 "gzip -9n"))))))
0750452a 655 (build-system gnu-build-system)
c4c4cc05 656 (inputs `(("util-linux" ,util-linux)))
f57d2639 657 (native-inputs `(("pkg-config" ,pkg-config)
7c594a2c 658 ("texinfo" ,texinfo))) ;for the libext2fs Info manual
0750452a 659 (arguments
7d453656
LF
660 '(;; Parallel building reliably yields a failure like this:
661 ;; "make[2]: *** No rule to make target '../lib/libss.so', needed by
14594760 662 ;; 'debugfs'. Stop."
7d453656
LF
663 #:parallel-build? #f
664 ;; util-linux is the preferred source for some of the libraries and
c44ed26c 665 ;; commands, so disable them (see, e.g.,
a124bbd2 666 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
c44ed26c
LC
667 #:configure-flags '("--disable-libblkid"
668 "--disable-libuuid" "--disable-uuidd"
669 "--disable-fsck"
7c594a2c 670
74d21291
LC
671 ;; Use symlinks instead of hard links for
672 ;; 'fsck.extN' etc. This makes the resulting nar
673 ;; smaller and is preserved across copies.
674 "--enable-symlink-install"
675
7c594a2c
LC
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
8f65585b 714 ;; file system is mounted due to missing mtab file".
0750452a
LC
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)
313880c7
DC
741 (inputs
742 `(("e2fsprogs" ,e2fsprogs/static)))
e102f940
LC
743 (arguments
744 `(#:modules ((guix build utils))
745 #:builder
746 (begin
747 (use-modules (guix build utils)
748 (ice-9 ftw)
749 (srfi srfi-26))
750
313880c7
DC
751 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
752 "/sbin/e2fsck"))
e102f940
LC
753 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
754 (mkdir-p bin)
755 (with-directory-excursion bin
313880c7
DC
756 (copy-file e2fsck "e2fsck")
757 (remove-store-references "e2fsck")
758 (chmod "e2fsck" #o555))))))
0997771a 759 (home-page (package-home-page e2fsprogs))
313880c7
DC
760 (synopsis "Statically-linked e2fsck command from e2fsprogs")
761 (description "This package provides statically-linked e2fsck command taken
762from the e2fsprogs package. It is meant to be used in initrds.")
0997771a 763 (license (package-license e2fsprogs))))
e102f940 764
7c0a9104
LC
765(define-public extundelete
766 (package
767 (name "extundelete")
768 (version "0.2.4")
769 (source (origin
770 (method url-fetch)
771 (uri (string-append "mirror://sourceforge/extundelete/"
de67e922
LF
772 "extundelete/" version "/extundelete-"
773 version ".tar.bz2"))
7c0a9104
LC
774 (sha256
775 (base32
776 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
777 (build-system gnu-build-system)
778 (inputs `(("e2fsprogs" ,e2fsprogs)))
779 (home-page "http://extundelete.sourceforge.net/")
780 (synopsis "Recover deleted files from ext2/3/4 partitions")
781 (description
782 "Extundelete is a set of tools that can recover deleted files from an
783ext3 or ext4 partition.")
3ac73271 784 (license license:gpl2)))
7c0a9104 785
1c975f60
LC
786(define-public zerofree
787 (package
788 (name "zerofree")
789 (version "1.0.3")
790 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
791 (source (origin
792 (method url-fetch)
793 (uri (string-append home-page name "-" version
794 ".tgz"))
795 (sha256
796 (base32
797 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
798 (build-system gnu-build-system)
799 (arguments
800 '(#:phases (alist-replace
801 'install
802 (lambda* (#:key outputs #:allow-other-keys)
803 (let* ((out (assoc-ref outputs "out"))
804 (bin (string-append out "/bin")))
805 (mkdir-p bin)
806 (copy-file "zerofree"
807 (string-append bin "/zerofree"))
808 (chmod (string-append bin "/zerofree")
809 #o555)
810 #t))
811 (alist-delete 'configure %standard-phases))
812 #:tests? #f)) ;no tests
813 (inputs `(("libext2fs" ,e2fsprogs)))
814 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
815 (description
816 "The zerofree command scans the free blocks in an ext2 file system and
817fills any non-zero blocks with zeroes. This is a useful way to make disk
818images more compressible.")
3ac73271 819 (license license:gpl2)))
1c975f60 820
d8482ad0
LC
821(define-public strace
822 (package
823 (name "strace")
824 (version "4.7")
825 (source (origin
826 (method url-fetch)
de67e922
LF
827 (uri (string-append "mirror://sourceforge/strace/strace/" version
828 "/strace-" version ".tar.xz"))
d8482ad0
LC
829 (sha256
830 (base32
831 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
832 (build-system gnu-build-system)
c4c4cc05 833 (native-inputs `(("perl" ,perl)))
d8482ad0
LC
834 (home-page "http://strace.sourceforge.net/")
835 (synopsis "System call tracer for Linux")
836 (description
837 "strace is a system call tracer, i.e. a debugging tool which prints out a
838trace of all the system calls made by a another process/program.")
3ac73271 839 (license license:bsd-3)))
ba04571a 840
e1e27737
TUBK
841(define-public ltrace
842 (package
843 (name "ltrace")
844 (version "0.7.3")
845 (source (origin
846 (method url-fetch)
847 (uri (string-append "http://www.ltrace.org/ltrace_" version
848 ".orig.tar.bz2"))
849 (sha256
850 (base32
851 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
852 (build-system gnu-build-system)
853 (inputs `(("libelf" ,libelf)))
854 (arguments
855 ;; Compilation uses -Werror by default, but it fails.
856 '(#:configure-flags '("--disable-werror")))
857 (home-page "http://www.ltrace.org/")
858 (synopsis "Library call tracer for Linux")
859 (description
860 "ltrace intercepts and records dynamic library calls which are called by
861an executed process and the signals received by that process. It can also
862intercept and print the system calls executed by the program.")
3ac73271 863 (license license:gpl2+)))
e1e27737 864
ba04571a
LC
865(define-public alsa-lib
866 (package
867 (name "alsa-lib")
868 (version "1.0.27.1")
869 (source (origin
870 (method url-fetch)
871 (uri (string-append
872 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
873 version ".tar.bz2"))
874 (sha256
875 (base32
bcd94e19 876 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))
fc1adab1 877 (patches (search-patches "alsa-lib-mips-atomic-fix.patch"))))
ba04571a
LC
878 (build-system gnu-build-system)
879 (home-page "http://www.alsa-project.org/")
880 (synopsis "The Advanced Linux Sound Architecture libraries")
881 (description
882 "The Advanced Linux Sound Architecture (ALSA) provides audio and
883MIDI functionality to the Linux-based operating system.")
3ac73271 884 (license license:lgpl2.1+)))
10afdf50 885
17b293a0
LC
886(define-public alsa-utils
887 (package
888 (name "alsa-utils")
457d154f 889 (version "1.1.3")
17b293a0
LC
890 (source (origin
891 (method url-fetch)
992b527d
EF
892 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
893 name "-" version ".tar.bz2"))
17b293a0
LC
894 (sha256
895 (base32
457d154f 896 "0z0nnqp1707bm02dys2d16m88lsg5nd26bqaf14rl3za9sjifwhj"))))
17b293a0
LC
897 (build-system gnu-build-system)
898 (arguments
899 ;; XXX: Disable man page creation until we have DocBook.
900 '(#:configure-flags (list "--disable-xmlto"
f2817d43
LC
901
902 ;; The udev rule is responsible for restoring
903 ;; the volume.
17b293a0
LC
904 (string-append "--with-udev-rules-dir="
905 (assoc-ref %outputs "out")
906 "/lib/udev/rules.d"))
49165145
EF
907 #:phases
908 (modify-phases %standard-phases
909 (add-before
910 'install 'pre-install
911 (lambda _
912 ;; Don't try to mkdir /var/lib/alsa.
913 (substitute* "Makefile"
914 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
457d154f
EF
915 "true\n"))
916 #t)))))
17b293a0
LC
917 (inputs
918 `(("libsamplerate" ,libsamplerate)
919 ("ncurses" ,ncurses)
920 ("alsa-lib" ,alsa-lib)
921 ("xmlto" ,xmlto)
b94a6ca0 922 ("gettext" ,gettext-minimal)))
17b293a0
LC
923 (home-page "http://www.alsa-project.org/")
924 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
925 (description
926 "The Advanced Linux Sound Architecture (ALSA) provides audio and
927MIDI functionality to the Linux-based operating system.")
928
929 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
930 ;; GPLv2-only.
3ac73271 931 (license license:gpl2)))
17b293a0 932
7d2511bc 933(define-public alsa-plugins
934 (package
935 (name "alsa-plugins")
936 (version "1.1.1")
937 (source (origin
938 (method url-fetch)
939 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
940 name "-" version ".tar.bz2"))
941 (sha256
942 (base32
943 "1w81z5jlwqhd1l2m7qrq69lc4k9dnrg1wn52jsl2hrf3hbhd394f"))))
944 (build-system gnu-build-system)
945 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
946 ;; be split, there are references to both in files.
947 ;; TODO: Remove OSS related plugins, they add support to run native
948 ;; ALSA applications on OSS however we do not offer OSS and OSS is
949 ;; obsolete.
950 (outputs '("out" "pulseaudio"))
951 (arguments
952 `(#:phases
953 (modify-phases %standard-phases
954 (add-after 'install 'split
955 (lambda* (#:key inputs outputs #:allow-other-keys)
956 ;; Distribute the binaries to the various outputs.
957 (let* ((out (assoc-ref outputs "out"))
958 (pua (assoc-ref outputs "pulseaudio"))
959 (pualib (string-append pua "/lib/alsa-lib"))
960 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
961 (mkdir-p puaconf)
962 (mkdir-p pualib)
963 (chdir (string-append out "/share"))
964 (for-each (lambda (file)
965 (rename-file file (string-append puaconf "/" (basename file))))
966 (find-files out "\\.(conf|example)"))
967 (for-each (lambda (file)
968 (rename-file file (string-append pualib "/" (basename file))))
969 (find-files out ".*pulse\\.(la|so)"))
970 (chdir "..")
971 ;; We have moved the files to output pulsaudio, the
972 ;; directory is now empty.
973 (delete-file-recursively (string-append out "/share"))
974 #t))))))
975 (inputs
976 `(("alsa-lib" ,alsa-lib)
977 ("speex" ,speex) ; libspeexdsp resampling plugin
978 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
979 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
980 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
981 (native-inputs
982 `(("pkg-config" ,pkg-config)))
983 (home-page "http://www.alsa-project.org/")
984 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
985 (description
986 "The Advanced Linux Sound Architecture (ALSA) provides audio and
987MIDI functionality to the Linux-based operating system. This package enhances ALSA
988by providing additional plugins which include: upmixing, downmixing, jackd and
989pulseaudio support for native alsa applications, format conversion (s16 to a52), and
990external rate conversion.")
991 (license (list license:gpl2+
992 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
993 license:lgpl2.1+))))
994
10afdf50
LC
995(define-public iptables
996 (package
997 (name "iptables")
ac9fc78f 998 (version "1.4.21")
10afdf50
LC
999 (source (origin
1000 (method url-fetch)
1001 (uri (string-append
1002 "http://www.netfilter.org/projects/iptables/files/iptables-"
1003 version ".tar.bz2"))
1004 (sha256
1005 (base32
ac9fc78f 1006 "1q6kg7sf0pgpq0qhab6sywl23cngxxfzc9zdzscsba8x09l4q02j"))))
10afdf50 1007 (build-system gnu-build-system)
50c26d9e
SB
1008 (arguments
1009 '(#:tests? #f ; no test suite
1010 #:configure-flags ; add $libdir to the RUNPATH of executables
1011 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
10afdf50
LC
1012 (home-page "http://www.netfilter.org/projects/iptables/index.html")
1013 (synopsis "Program to configure the Linux IP packet filtering rules")
1014 (description
1015 "iptables is the userspace command line program used to configure the
35e4b3d5 1016Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
10afdf50
LC
1017system administrators. Since Network Address Translation is also configured
1018from the packet filter ruleset, iptables is used for this, too. The iptables
1019package also includes ip6tables. ip6tables is used for configuring the IPv6
1020packet filter.")
3ac73271 1021 (license license:gpl2+)))
90a0048f
LC
1022
1023(define-public iproute
1024 (package
1025 (name "iproute2")
d7f84eab 1026 (version "4.9.0")
90a0048f 1027 (source (origin
75cd4b05
AK
1028 (method url-fetch)
1029 (uri (string-append
1030 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1031 version ".tar.xz"))
1032 (sha256
1033 (base32
d7f84eab 1034 "1i0n071hiqxw1gisngw2jln3kcp9sh47n6fj5hdwqrvp7w20zwy0"))))
90a0048f
LC
1035 (build-system gnu-build-system)
1036 (arguments
1037 `(#:tests? #f ; no test suite
1038 #:make-flags (let ((out (assoc-ref %outputs "out")))
1039 (list "DESTDIR="
e777d07d
LF
1040 (string-append "BASH_COMPDIR=" out
1041 "/etc/bash_completion.d")
90a0048f
LC
1042 (string-append "LIBDIR=" out "/lib")
1043 (string-append "SBINDIR=" out "/sbin")
1044 (string-append "CONFDIR=" out "/etc")
1045 (string-append "DOCDIR=" out "/share/doc/"
1046 ,name "-" ,version)
1047 (string-append "MANDIR=" out "/share/man")))
b53e44fb
AK
1048 #:phases (modify-phases %standard-phases
1049 (add-before 'install 'pre-install
1050 (lambda _
1051 ;; Don't attempt to create /var/lib/arpd.
1052 (substitute* "Makefile"
1053 (("^.*ARPDDIR.*$") "")))))))
90a0048f
LC
1054 (inputs
1055 `(("iptables" ,iptables)
c4c4cc05
JD
1056 ("db4" ,bdb)))
1057 (native-inputs
1058 `(("pkg-config" ,pkg-config)
90a0048f
LC
1059 ("flex" ,flex)
1060 ("bison" ,bison)))
1061 (home-page
d7f84eab 1062 "https://wiki.linuxfoundation.org/networking/iproute2")
90a0048f 1063 (synopsis
9e771e3b 1064 "Utilities for controlling TCP/IP networking and traffic in Linux")
90a0048f
LC
1065 (description
1066 "Iproute2 is a collection of utilities for controlling TCP/IP
1067networking and traffic with the Linux kernel.
1068
1069Most network configuration manuals still refer to ifconfig and route as the
1070primary network configuration tools, but ifconfig is known to behave
1071inadequately in modern network environments. They should be deprecated, but
1072most distros still include them. Most network configuration systems make use
1073of ifconfig and thus provide a limited feature set. The /etc/net project aims
1074to support most modern network technologies, as it doesn't use ifconfig and
1075allows a system administrator to make use of all iproute2 features, including
1076traffic control.
1077
1078iproute2 is usually shipped in a package called iproute or iproute2 and
1079consists of several tools, of which the most important are ip and tc. ip
1080controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
1081tools print detailed usage messages and are accompanied by a set of
1082manpages.")
3ac73271 1083 (license license:gpl2+)))
85e0dc6a
LC
1084
1085(define-public net-tools
1086 ;; XXX: This package is basically unmaintained, but it provides a few
1087 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1088 ;; live with it.
1089 (package
1090 (name "net-tools")
1091 (version "1.60")
6b55ee88 1092 (home-page "http://net-tools.sourceforge.net/")
85e0dc6a
LC
1093 (source (origin
1094 (method url-fetch)
6b55ee88
LC
1095 (uri (list (string-append
1096 "mirror://sourceforge/net-tools/net-tools-"
1097 version ".tar.bz2")
1098 (string-append
1099 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1100 "/base/net-tools/net-tools-1.60.tar.bz2")))
85e0dc6a
LC
1101 (sha256
1102 (base32
177088a3 1103 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
fc1adab1 1104 (patches (search-patches "net-tools-bitrot.patch"))))
85e0dc6a
LC
1105 (build-system gnu-build-system)
1106 (arguments
c9e0a44e
LC
1107 '(#:modules ((guix build gnu-build-system)
1108 (guix build utils)
1109 (srfi srfi-1)
1110 (srfi srfi-26))
1111 #:phases (alist-cons-after
cd143df0 1112 'unpack 'patch
85e0dc6a
LC
1113 (lambda* (#:key inputs #:allow-other-keys)
1114 (define (apply-patch file)
9a224ac2 1115 (zero? (system* "patch" "-p1" "--force"
85e0dc6a
LC
1116 "--input" file)))
1117
1118 (let ((patch.gz (assoc-ref inputs "patch")))
1119 (format #t "applying Debian patch set '~a'...~%"
1120 patch.gz)
1121 (system (string-append "gunzip < " patch.gz " > the-patch"))
85e0dc6a
LC
1122 (and (apply-patch "the-patch")
1123 (for-each apply-patch
1124 (find-files "debian/patches"
1125 "\\.patch")))))
1126 (alist-replace
1127 'configure
1128 (lambda* (#:key outputs #:allow-other-keys)
1129 (let ((out (assoc-ref outputs "out")))
1130 (mkdir-p (string-append out "/bin"))
1131 (mkdir-p (string-append out "/sbin"))
1132
1133 ;; Pretend we have everything...
1134 (system "yes | make config")
1135
a153ff80
MW
1136 ;; ... except for the things we don't have.
1137 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1138 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1139 ;; that have been removed.
85e0dc6a 1140 (substitute* '("config.make" "config.h")
a153ff80 1141 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
c9e0a44e
LC
1142 (alist-cons-after
1143 'install 'remove-redundant-commands
1144 (lambda* (#:key outputs #:allow-other-keys)
1145 ;; Remove commands and man pages redundant with
1146 ;; Inetutils.
1147 (let* ((out (assoc-ref outputs "out"))
1148 (dup (append-map (cut find-files out <>)
1149 '("^hostname"
1150 "^(yp|nis|dns)?domainname"))))
1151 (for-each delete-file dup)
1152 #t))
1153 %standard-phases)))
85e0dc6a
LC
1154
1155 ;; Binaries that depend on libnet-tools.a don't declare that
1156 ;; dependency, making it parallel-unsafe.
1157 #:parallel-build? #f
1158
1159 #:tests? #f ; no test suite
0d55c356
MW
1160 #:make-flags (let ((out (assoc-ref %outputs "out")))
1161 (list "CC=gcc"
1162 (string-append "BASEDIR=" out)
1163 (string-append "INSTALLNLSDIR=" out "/share/locale")
1164 (string-append "mandir=/share/man")))))
85e0dc6a
LC
1165
1166 ;; Use the big Debian patch set (the thing does not even compile out of
1167 ;; the box.)
1168 (inputs `(("patch" ,(origin
1169 (method url-fetch)
1170 (uri
1171 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1172 (sha256
1173 (base32
1174 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
b94a6ca0 1175 (native-inputs `(("gettext" ,gettext-minimal)))
85e0dc6a
LC
1176
1177 (synopsis "Tools for controlling the network subsystem in Linux")
1178 (description
1179 "This package includes the important tools for controlling the network
1180subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1181netstat, rarp and route. Additionally, this package contains utilities
1182relating to particular network hardware types (plipconfig, slattach) and
1183advanced aspects of IP configuration (iptunnel, ipmaddr).")
3ac73271 1184 (license license:gpl2+)))
c762e82e
LC
1185
1186(define-public libcap
1187 (package
1188 (name "libcap")
68ea090b 1189 (version "2.25")
c762e82e
LC
1190 (source (origin
1191 (method url-fetch)
c762e82e 1192 (uri (string-append
f6c2d05c
LC
1193 "mirror://kernel.org/linux/libs/security/linux-privs/"
1194 "libcap2/libcap-" version ".tar.xz"))
c762e82e
LC
1195 (sha256
1196 (base32
68ea090b 1197 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
c762e82e 1198 (build-system gnu-build-system)
6d889daf
SB
1199 (arguments '(#:phases
1200 (modify-phases %standard-phases
1201 (replace 'configure
1202 ;; Add $libdir to the RUNPATH of executables.
1203 (lambda _
1204 (substitute* "Make.Rules"
1205 (("LDFLAGS := #-g")
1206 (string-append "LDFLAGS := -Wl,-rpath="
1207 %output "/lib"))))))
c762e82e
LC
1208 #:tests? #f ; no 'check' target
1209 #:make-flags (list "lib=lib"
1210 (string-append "prefix="
1211 (assoc-ref %outputs "out"))
1212 "RAISE_SETFCAP=no")))
1213 (native-inputs `(("perl" ,perl)))
1214 (inputs `(("attr" ,attr)))
1215 (home-page "https://sites.google.com/site/fullycapable/")
1216 (synopsis "Library for working with POSIX capabilities")
1217 (description
35b9e423 1218 "Libcap2 provides a programming interface to POSIX capabilities on
c762e82e
LC
1219Linux-based operating systems.")
1220
1221 ;; License is BSD-3 or GPLv2, at the user's choice.
3ac73271 1222 (license license:gpl2)))
215b6431
LC
1223
1224(define-public bridge-utils
1225 (package
1226 (name "bridge-utils")
1227 (version "1.5")
1228 (source (origin
1229 (method url-fetch)
de67e922
LF
1230 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1231 "bridge-utils-" version ".tar.gz"))
215b6431
LC
1232 (sha256
1233 (base32
1234 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1235 (build-system gnu-build-system)
1236
1237 ;; The tarball lacks all the generated files.
1238 (native-inputs `(("autoconf" ,autoconf)
1239 ("automake" ,automake)))
1240 (arguments
722ec722
MW
1241 '(#:phases (alist-cons-after
1242 'unpack 'bootstrap
215b6431 1243 (lambda _
e5c8e4f3
DT
1244 ;; Fix "field ‘ip6’ has incomplete type" errors.
1245 (substitute* "libbridge/libbridge.h"
1246 (("#include <linux/if_bridge.h>")
1247 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1248
1249 ;; Ensure that the entire build fails if one of the
1250 ;; sub-Makefiles fails.
1251 (substitute* "Makefile.in"
1252 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1253 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1254
215b6431
LC
1255 (zero? (system* "autoreconf" "-vf")))
1256 %standard-phases)
1257 #:tests? #f)) ; no 'check' target
1258
1259 (home-page
1260 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1261 (synopsis "Manipulate Ethernet bridges")
1262 (description
1263 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1264to connect two Ethernet segments together in a protocol independent way.
1265Packets are forwarded based on Ethernet address, rather than IP address (like
1266a router). Since forwarding is done at Layer 2, all protocols can go
1267transparently through a bridge.")
3ac73271 1268 (license license:gpl2+)))
3cc20675
LC
1269
1270(define-public libnl
1271 (package
1272 (name "libnl")
bdac3d4b 1273 (version "3.2.25")
3cc20675
LC
1274 (source (origin
1275 (method url-fetch)
1276 (uri (string-append
1277 "http://www.infradead.org/~tgr/libnl/files/libnl-"
1278 version ".tar.gz"))
1279 (sha256
1280 (base32
bdac3d4b 1281 "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb"))))
3cc20675
LC
1282 (build-system gnu-build-system)
1283 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1284 (home-page "http://www.infradead.org/~tgr/libnl/")
1285 (synopsis "NetLink protocol library suite")
1286 (description
1287 "The libnl suite is a collection of libraries providing APIs to netlink
69b4ffcf 1288protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
3cc20675
LC
1289between the kernel and user space processes. It was designed to be a more
1290flexible successor to ioctl to provide mainly networking related kernel
1291configuration and monitoring interfaces.")
1292
1293 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1294 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
3ac73271 1295 (license license:gpl2)))
023fef7d 1296
65cd77db
MW
1297(define-public iw
1298 (package
1299 (name "iw")
72f0c5ea 1300 (version "4.9")
65cd77db
MW
1301 (source (origin
1302 (method url-fetch)
1303 (uri (string-append
2f9e312a 1304 "mirror://kernel.org/software/network/iw/iw-"
65cd77db
MW
1305 version ".tar.xz"))
1306 (sha256
1307 (base32
72f0c5ea 1308 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
65cd77db
MW
1309 (build-system gnu-build-system)
1310 (native-inputs `(("pkg-config" ,pkg-config)))
1311 (inputs `(("libnl" ,libnl)))
1312 (arguments
1313 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1314 "CC=gcc")
1315 #:phases (alist-delete 'configure %standard-phases)))
2f9e312a 1316 (home-page "https://wireless.wiki.kernel.org/")
65cd77db
MW
1317 (synopsis "Tool for configuring wireless devices")
1318 (description
1319 "iw is a new nl80211 based CLI configuration utility for wireless
2f9e312a 1320devices. It replaces @code{iwconfig}, which is deprecated.")
3ac73271 1321 (license license:isc)))
65cd77db 1322
023fef7d
LC
1323(define-public powertop
1324 (package
1325 (name "powertop")
ebacb0de 1326 (version "2.8")
023fef7d
LC
1327 (source
1328 (origin
1329 (method url-fetch)
1330 (uri (string-append
bd60e4e2 1331 "https://01.org/sites/default/files/downloads/powertop/powertop-"
023fef7d
LC
1332 version ".tar.gz"))
1333 (sha256
1334 (base32
ebacb0de 1335 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
023fef7d 1336 (build-system gnu-build-system)
4c48bf55
ML
1337 (arguments
1338 '(#:phases
1339 (modify-phases %standard-phases
1340 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1341 ;; allow calibrating the network interface in GuixSD.
1342 (add-after 'unpack 'patch-absolute-file-names
1343 (lambda* (#:key inputs #:allow-other-keys)
1344 (let ((kmod (assoc-ref inputs "kmod")))
1345 (substitute* (find-files "src" "\\.cpp$")
1346 ;; Give the right 'modprobe' file name so that essential
1347 ;; modules such as msr.ko can be loaded.
1348 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1349 ;; These programs are only needed to calibrate, so using
1350 ;; relative file names avoids adding extra inputs. When they
1351 ;; are missing powertop gracefully handles it.
1352 (("/usr/bin/hcitool") "hcitool")
1353 (("/usr/bin/xset") "xset")
1354 (("/usr/sbin/hciconfig") "hciconfig"))
1355 #t))))))
023fef7d 1356 (inputs
4c48bf55
ML
1357 `(("kmod" ,kmod)
1358 ("libnl" ,libnl)
023fef7d 1359 ("ncurses" ,ncurses)
4c48bf55
ML
1360 ("pciutils" ,pciutils)
1361 ("zlib" ,zlib)))
c4c4cc05 1362 (native-inputs
ebacb0de 1363 `(("pkg-config" ,pkg-config)))
023fef7d
LC
1364 (home-page "https://01.org/powertop/")
1365 (synopsis "Analyze power consumption on Intel-based laptops")
1366 (description
1367 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1368power management. In addition to being a diagnostic tool, PowerTOP also has
1369an interactive mode where the user can experiment various power management
1370settings for cases where the operating system has not enabled these
1371settings.")
3ac73271 1372 (license license:gpl2)))
6869e5c9
LC
1373
1374(define-public aumix
1375 (package
1376 (name "aumix")
1377 (version "2.9.1")
1378 (source (origin
1379 (method url-fetch)
1380 (uri (string-append
1381 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1382 version ".tar.bz2"))
1383 (sha256
1384 (base32
1385 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1386 (build-system gnu-build-system)
1387 (inputs `(("ncurses" ,ncurses)))
1388 (home-page "http://www.jpj.net/~trevor/aumix.html")
1389 (synopsis "Audio mixer for X and the console")
1390 (description
1391 "Aumix adjusts an audio mixer from X, the console, a terminal,
1392the command line or a script.")
3ac73271 1393 (license license:gpl2+)))
7c0dbe78
SHT
1394
1395(define-public iotop
1396 (package
1397 (name "iotop")
1398 (version "0.6")
1399 (source
1400 (origin
1401 (method url-fetch)
1402 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1403 version ".tar.gz"))
1404 (sha256 (base32
1405 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1406 (build-system python-build-system)
1407 (arguments
35cebf01 1408 ;; The setup.py script expects python-2.
7c0dbe78 1409 `(#:python ,python-2
35cebf01 1410 ;; There are currently no checks in the package.
7c0dbe78
SHT
1411 #:tests? #f))
1412 (native-inputs `(("python" ,python-2)))
1413 (home-page "http://guichaz.free.fr/iotop/")
1414 (synopsis
1415 "Displays the IO activity of running processes")
1416 (description
1417 "Iotop is a Python program with a top like user interface to show the
1418processes currently causing I/O.")
3ac73271 1419 (license license:gpl2+)))
e30835e2
LC
1420
1421(define-public fuse
1422 (package
1423 (name "fuse")
0e9bc883 1424 (version "2.9.6")
e30835e2
LC
1425 (source (origin
1426 (method url-fetch)
0e9bc883
LF
1427 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1428 "download/fuse-" version
1429 "/fuse-" version ".tar.gz"))
e30835e2
LC
1430 (sha256
1431 (base32
0e9bc883 1432 "0szi2vlsjxg03y4ji51jks34p269jqj5ify6l0ajsqq6f6y8pd0c"))))
e30835e2 1433 (build-system gnu-build-system)
b148bd71 1434 (inputs `(("util-linux" ,util-linux)))
e30835e2
LC
1435 (arguments
1436 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1437 (assoc-ref %outputs "out")
1438 "/sbin")
1439 (string-append "INIT_D_PATH="
1440 (assoc-ref %outputs "out")
1441 "/etc/init.d")
9a4efac9
LC
1442
1443 ;; The rule makes /dev/fuse 666.
e30835e2
LC
1444 (string-append "UDEV_RULES_PATH="
1445 (assoc-ref %outputs "out")
9a4efac9 1446 "/lib/udev/rules.d"))
b148bd71
LC
1447 #:phases (alist-cons-before
1448 'build 'set-file-names
1449 (lambda* (#:key inputs #:allow-other-keys)
1450 ;; libfuse calls out to mount(8) and umount(8). Make sure
1451 ;; it refers to the right ones.
1452 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1453 (("/bin/(u?)mount" _ maybe-u)
1454 (string-append (assoc-ref inputs "util-linux")
1455 "/bin/" maybe-u "mount")))
1456 (substitute* '("util/mount.fuse.c")
1457 (("/bin/sh")
bd663902
LC
1458 (which "sh")))
1459
1460 ;; This hack leads libfuse to search for 'fusermount' in
1461 ;; $PATH, where it may find a setuid-root binary, instead of
1462 ;; trying solely $out/sbin/fusermount and failing because
1463 ;; it's not setuid.
1464 (substitute* "lib/Makefile"
1465 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1466 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1467 %standard-phases)))
0e9bc883 1468 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
1469 (synopsis "Support file systems implemented in user space")
1470 (description
1471 "As a consequence of its monolithic design, file system code for Linux
1472normally goes into the kernel itself---which is not only a robustness issue,
1473but also an impediment to system extensibility. FUSE, for \"file systems in
1474user space\", is a kernel module and user-space library that tries to address
1475part of this problem by allowing users to run file system implementations as
1476user-space processes.")
3ac73271
LC
1477 (license (list license:lgpl2.1 ;library
1478 license:gpl2+)))) ;command-line utilities
220193ad
LC
1479
1480(define-public unionfs-fuse
1481 (package
1482 (name "unionfs-fuse")
1483 (version "0.26")
1484 (source (origin
1485 (method url-fetch)
1486 (uri (string-append
1487 "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-"
1488 version ".tar.xz"))
1489 (sha256
1490 (base32
1491 "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d"))))
1492 (build-system cmake-build-system)
1493 (inputs `(("fuse" ,fuse)))
1494 (arguments '(#:tests? #f)) ; no tests
1495 (home-page "http://podgorny.cz/moin/UnionFsFuse")
1496 (synopsis "User-space union file system")
1497 (description
1498 "UnionFS-FUSE is a flexible union file system implementation in user
1499space, using the FUSE library. Mounting a union file system allows you to
1500\"aggregate\" the contents of several directories into a single mount point.
1501UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 1502 (license license:bsd-3)))
ed748588 1503
0b7a0c20
LC
1504(define fuse-static
1505 (package (inherit fuse)
1506 (name "fuse-static")
1507 (source (origin (inherit (package-source fuse))
1508 (modules '((guix build utils)))
1509 (snippet
1510 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1511 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1512 ;; it doesn't do that, allowing us to remove the dependency on
1513 ;; util-linux (something that is useful in initrds.)
1514 '(substitute* '("lib/mount_util.c"
1515 "util/mount_util.c")
1516 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1517 "0")
1518 (("/bin/")
1519 "")))))))
1520
ed748588
LC
1521(define-public unionfs-fuse/static
1522 (package (inherit unionfs-fuse)
1523 (synopsis "User-space union file system (statically linked)")
1524 (name (string-append (package-name unionfs-fuse) "-static"))
1525 (source (origin (inherit (package-source unionfs-fuse))
1526 (modules '((guix build utils)))
1527 (snippet
1528 ;; Add -ldl to the libraries, because libfuse.a needs that.
1529 '(substitute* "src/CMakeLists.txt"
1530 (("target_link_libraries(.*)\\)" _ libs)
1531 (string-append "target_link_libraries"
1532 libs " dl)"))))))
1533 (arguments
1534 '(#:tests? #f
1456cff1
LC
1535 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1536 #:phases (alist-cons-after
1537 'install 'post-install
1538 (lambda* (#:key outputs #:allow-other-keys)
1539 (let* ((out (assoc-ref outputs "out"))
1540 (exe (string-append out "/bin/unionfs")))
1541 ;; By default, 'unionfs' keeps references to
1542 ;; $glibc/share/locale and similar stuff. Remove them.
1543 (remove-store-references exe)))
1544 %standard-phases)))
0b7a0c20 1545 (inputs `(("fuse" ,fuse-static)))))
67b66003 1546
db288efa
LC
1547(define-public sshfs-fuse
1548 (package
1549 (name "sshfs-fuse")
b58c1b2d 1550 (version "2.8")
db288efa
LC
1551 (source (origin
1552 (method url-fetch)
b58c1b2d
EF
1553 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1554 "download/sshfs_" version
1555 "/sshfs-" version ".tar.gz"))
db288efa
LC
1556 (sha256
1557 (base32
b58c1b2d 1558 "08mdd4rs7yys7hmyig6i08qlid76p17xlvrh64k7wsrfs1s92s3z"))))
db288efa
LC
1559 (build-system gnu-build-system)
1560 (inputs
1561 `(("fuse" ,fuse)
1562 ("glib" ,glib)))
1563 (native-inputs
1564 `(("pkg-config" ,pkg-config)))
1565 (home-page "http://fuse.sourceforge.net/sshfs.html")
1566 (synopsis "Mount remote file systems over SSH")
1567 (description
1568 "This is a file system client based on the SSH File Transfer Protocol.
1569Since most SSH servers already support this protocol it is very easy to set
1570up: on the server side there's nothing to do; on the client side mounting the
1571file system is as easy as logging into the server with an SSH client.")
3ac73271 1572 (license license:gpl2+)))
db288efa 1573
67b66003
LC
1574(define-public numactl
1575 (package
1576 (name "numactl")
e35dff97 1577 (version "2.0.11")
67b66003
LC
1578 (source (origin
1579 (method url-fetch)
1580 (uri (string-append
1581 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1582 version
1583 ".tar.gz"))
1584 (sha256
1585 (base32
e35dff97 1586 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
67b66003
LC
1587 (build-system gnu-build-system)
1588 (arguments
e35dff97 1589 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
1590 ;; to run, which we can't assume to have.
1591 #:tests? #f))
b0015064 1592
35dfcdd7
AE
1593 ;; NUMA is apparently not supported on armhf, see
1594 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1595 (supported-systems (delete "armhf-linux" %supported-systems))
67b66003
LC
1596 (home-page "http://oss.sgi.com/projects/libnuma/")
1597 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1598 (description
1599 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1600memory is not all in one place. The numactl program allows you to run your
1601application program on specific CPU's and memory nodes. It does this by
1602supplying a NUMA memory policy to the operating system before running your
1603program.
1604
1605The package contains other commands, such as numademo, numastat and memhog.
1606The numademo command provides a quick overview of NUMA performance on your
1607system.")
3ac73271
LC
1608 (license (list license:gpl2 ;programs
1609 license:lgpl2.1)))) ;library
b10e9ff6
LC
1610
1611(define-public kbd
1612 (package
1613 (name "kbd")
8555a609 1614 (version "2.0.4")
b10e9ff6
LC
1615 (source (origin
1616 (method url-fetch)
1617 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 1618 version ".tar.xz"))
b10e9ff6
LC
1619 (sha256
1620 (base32
8555a609 1621 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
c8f60748
LC
1622 (modules '((guix build utils)))
1623 (snippet
f2cdcafb
LC
1624 '(begin
1625 (substitute* "tests/Makefile.in"
1626 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1627 (("@VERSION@")
1628 "[@]VERSION[@]"))
1629 (substitute* '("src/unicode_start" "src/unicode_stop")
1630 ;; Assume the Coreutils are in $PATH.
1631 (("/usr/bin/tty")
1632 "tty"))))))
b10e9ff6
LC
1633 (build-system gnu-build-system)
1634 (arguments
5953d2b7
AK
1635 '(#:phases
1636 (modify-phases %standard-phases
1637 (add-before 'build 'pre-build
1638 (lambda* (#:key inputs #:allow-other-keys)
1639 (let ((gzip (assoc-ref %build-inputs "gzip"))
1640 (bzip2 (assoc-ref %build-inputs "bzip2")))
1641 (substitute* "src/libkeymap/findfile.c"
1642 (("gzip")
1643 (string-append gzip "/bin/gzip"))
1644 (("bzip2")
1645 (string-append bzip2 "/bin/bzip2"))))))
1646 (add-after 'install 'post-install
1647 (lambda* (#:key outputs #:allow-other-keys)
1648 ;; Make sure these programs find their comrades.
1649 (let* ((out (assoc-ref outputs "out"))
1650 (bin (string-append out "/bin")))
1651 (for-each (lambda (prog)
1652 (wrap-program (string-append bin "/" prog)
1653 `("PATH" ":" prefix (,bin))))
1654 '("unicode_start" "unicode_stop"))))))))
b10e9ff6 1655 (inputs `(("check" ,check)
f61e0e79
LC
1656 ("gzip" ,gzip)
1657 ("bzip2" ,bzip2)
b10e9ff6
LC
1658 ("pam" ,linux-pam)))
1659 (native-inputs `(("pkg-config" ,pkg-config)))
1660 (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/")
1661 (synopsis "Linux keyboard utilities and keyboard maps")
1662 (description
1663 "This package contains keytable files and keyboard utilities compatible
1664for systems using the Linux kernel. This includes commands such as
1665'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
3ac73271 1666 (license license:gpl2+)))
de0b620e
LC
1667
1668(define-public inotify-tools
1669 (package
1670 (name "inotify-tools")
1671 (version "3.13")
1672 (source (origin
1673 (method url-fetch)
1674 (uri (string-append
1675 "mirror://sourceforge/inotify-tools/inotify-tools/"
1676 version "/inotify-tools-" version ".tar.gz"))
1677 (sha256
1678 (base32
1679 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1680 (build-system gnu-build-system)
1681 (home-page "http://inotify-tools.sourceforge.net/")
1682 (synopsis "Monitor file accesses")
1683 (description
1684 "The inotify-tools packages provides a C library and command-line tools
1685to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 1686 (license license:gpl2+)))
e062d542
AE
1687
1688(define-public kmod
1689 (package
1690 (name "kmod")
45e38a07 1691 (version "23")
e062d542
AE
1692 (source (origin
1693 (method url-fetch)
1694 (uri
1695 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1696 "kmod-" version ".tar.xz"))
1697 (sha256
1698 (base32
45e38a07 1699 "0mc12sx06p8il1ym3hdmgxxb37apn9yv7xij26gddjdfkx8xa0yk"))
fc1adab1 1700 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
1701 (build-system gnu-build-system)
1702 (native-inputs
1703 `(("pkg-config" ,pkg-config)))
1704 (inputs
f61e0e79
LC
1705 `(("xz" ,xz)
1706 ("zlib" ,zlib)))
e062d542
AE
1707 (arguments
1708 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
1709 #:configure-flags '("--with-xz" "--with-zlib")
1710 #:phases (alist-cons-after
1711 'install 'install-modprobe&co
1712 (lambda* (#:key outputs #:allow-other-keys)
1713 (let* ((out (assoc-ref outputs "out"))
1714 (bin (string-append out "/bin")))
1715 (for-each (lambda (tool)
1716 (symlink "kmod"
1717 (string-append bin "/" tool)))
1718 '("insmod" "rmmod" "lsmod" "modprobe"
1719 "modinfo" "depmod"))))
1720 %standard-phases)))
e062d542
AE
1721 (home-page "https://www.kernel.org/")
1722 (synopsis "Kernel module tools")
35b9e423 1723 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
1724kernel modules like insert, remove, list, check properties, resolve
1725dependencies and aliases.
1726
1727These tools are designed on top of libkmod, a library that is shipped with
1728kmod. The aim is to be compatible with tools, configurations and indices
1729from the module-init-tools project.")
3ac73271 1730 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 1731
7fa715e7
LC
1732(define-public eudev
1733 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 1734 (package
7fa715e7 1735 (name "eudev")
2c6a1c67 1736 (version "3.2")
7fa715e7
LC
1737 (source (origin
1738 (method url-fetch)
1739 (uri (string-append
1740 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1741 version ".tar.gz"))
1742 (sha256
1743 (base32
2c6a1c67 1744 "099w62ncq78nxpxizf910mx18hc8x4qvzw3azjd00fir89wmyjnq"))
fc1adab1 1745 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7
MW
1746 (build-system gnu-build-system)
1747 (native-inputs
1748 `(("pkg-config" ,pkg-config)
e75230c1
SB
1749 ("perl" ,perl)
1750 ("gperf" ,gperf)))
fe32c7f7 1751 (inputs
255f7308
LC
1752 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1753 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1754 ;; which contains the rules to do that.
1755 `(("util-linux" ,util-linux) ;for blkid
1756 ("kmod" ,kmod)))
e1921a38 1757 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
1758 (synopsis "Userspace device management")
1759 (description "Udev is a daemon which dynamically creates and removes
1760device nodes from /dev/, handles hotplug events and loads drivers at boot
1761time.")
3ac73271 1762 (license license:gpl2+)))
7fa715e7 1763
e5d861f3
LC
1764(define-public eudev-with-hwdb
1765 ;; TODO: Merge with 'eudev'.
1766 (package
1767 (inherit eudev)
1768 (name "eudev-with-hwdb")
1769 (arguments
1770 '(#:phases (modify-phases %standard-phases
1771 (add-after 'install 'build-hwdb
1772 (lambda* (#:key outputs #:allow-other-keys)
1773 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1774 ;; similar tools to display product names.
1775 (let ((out (assoc-ref outputs "out")))
1776 (zero? (system* (string-append out "/bin/udevadm")
1777 "hwdb" "--update"))))))))))
1778
66269d47
LC
1779(define-public lvm2
1780 (package
1781 (name "lvm2")
5c2af899 1782 (version "2.02.168")
66269d47
LC
1783 (source (origin
1784 (method url-fetch)
1785 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1786 version ".tgz"))
1787 (sha256
1788 (base32
5c2af899 1789 "03b62hcsj9z37ckd8c21wwpm07s9zblq7grfh58yzcs1vp6x38r3"))
66269d47
LC
1790 (modules '((guix build utils)))
1791 (snippet
1792 '(begin
1793 (use-modules (guix build utils))
1794
1795 ;; Honor sysconfdir.
1796 (substitute* "make.tmpl.in"
1797 (("confdir = .*$")
1798 "confdir = @sysconfdir@\n")
1799 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
01f94cca
LC
1800 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1801 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
1802 (build-system gnu-build-system)
1803 (native-inputs
1804 `(("pkg-config" ,pkg-config)
1805 ("procps" ,procps))) ;tests use 'pgrep'
1806 (inputs
8fcaf8b1 1807 `(("udev" ,eudev)))
66269d47 1808 (arguments
3afbc6b3
LF
1809 '(#:phases
1810 (modify-phases %standard-phases
1811 (add-after 'configure 'set-makefile-shell
1812 (lambda _
1813 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1814 ;; expected.
1815 (setenv "SHELL" (which "sh"))
66269d47 1816
3afbc6b3
LF
1817 ;; Replace /bin/sh with the right file name.
1818 (patch-makefile-SHELL "make.tmpl")
7ca97fae
LF
1819 #t))
1820 (add-before 'strip 'make-objects-writable
1821 (lambda* (#:key outputs #:allow-other-keys)
1822 ;; Make compiled objects writable so they can be stripped.
1823 (let ((out (assoc-ref outputs "out")))
1824 (for-each (lambda (file)
1825 (chmod file #o755))
1826 (append
1827 (find-files (string-append out "/lib"))
1828 (find-files (string-append out "/sbin"))))
1829 #t))))
66269d47
LC
1830
1831 #:configure-flags (list (string-append "--sysconfdir="
1832 (assoc-ref %outputs "out")
1833 "/etc/lvm")
1834 "--enable-udev_sync"
f2817d43
LC
1835 "--enable-udev_rules"
1836
1837 ;; Make sure programs such as 'dmsetup' can
1838 ;; find libdevmapper.so.
1839 (string-append "LDFLAGS=-Wl,-rpath="
1840 (assoc-ref %outputs "out")
1841 "/lib"))
66269d47
LC
1842
1843 ;; The tests use 'mknod', which requires root access.
1844 #:tests? #f))
1845 (home-page "http://sourceware.org/lvm2/")
1846 (synopsis "Logical volume management for Linux")
1847 (description
1848 "LVM2 is the logical volume management tool set for Linux-based systems.
1849This package includes the user-space libraries and tools, including the device
1850mapper. Kernel components are part of Linux-libre.")
1851
1852 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
1853 ;; Command-line tools are GPLv2.
3ac73271 1854 (license (list license:gpl2 license:lgpl2.1))))
66269d47 1855
01f94cca
LC
1856(define-public lvm2-static
1857 (package
1858 (inherit lvm2)
1859 (name "lvm2-static")
1860
1861 ;; Propagate udev because libdevmapper.a depends on libudev.
1862 (inputs (alist-delete "udev" (package-inputs lvm2)))
1863 (propagated-inputs `(("udev" ,eudev)))
1864
1865 (arguments
1866 (substitute-keyword-arguments (package-arguments lvm2)
1867 ((#:configure-flags flags '())
1868 ;; LVM2 doesn't use Libtool, hence the custom option.
1869 `(cons "--enable-static_link" ,flags))))
1870 (synopsis "Logical volume management for Linux (statically linked)")))
1871
000f7559
DT
1872(define-public wireless-tools
1873 (package
1874 (name "wireless-tools")
1875 (version "30.pre9")
1876 (source (origin
1877 (method url-fetch)
1878 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
1879 version ".tar.gz"))
1880 (sha256
1881 (base32
ec01f22d 1882 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 1883 (snippet
c2099a4c
MW
1884 '(begin
1885 ;; Remove the older header files that are not free software.
1886 (for-each (lambda (n)
1887 (delete-file (format #f "wireless.~a.h" n)))
1888 '(10 11 12 13 14 15 16 17 18 19 20))
1889 #t))))
000f7559
DT
1890 (build-system gnu-build-system)
1891 (arguments
c2099a4c
MW
1892 `(#:make-flags
1893 (list (string-append "PREFIX=" %output)
1894 (string-append "INSTALL_MAN=" %output "/share/man")
1895 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
1896 "BUILD_STATIC=")
1897 #:phases (modify-phases %standard-phases
1898 (delete 'configure))
000f7559
DT
1899 #:tests? #f))
1900 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
1901 (description "Wireless Tools are used to manipulate the now-deprecated
1902Linux Wireless Extensions; consider using 'iw' instead. The Wireless
1903Extension was an interface allowing you to set Wireless LAN specific
1904parameters and get the specific stats. It is deprecated in favor the nl80211
1905interface.")
000f7559 1906 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
1907 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
1908 ;; other files are distributed under gpl2.
3ac73271 1909 (license (list license:gpl2 license:lgpl2.1+))))
30016044 1910
cc205dac
LC
1911(define-public crda
1912 (package
1913 (name "crda")
1914 (version "3.18")
1915 (source (origin
1916 (method url-fetch)
1917 (uri (string-append "mirror://kernel.org/software/network/crda/"
1918 "crda-" version ".tar.xz"))
1919 (sha256
1920 (base32
1921 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 1922 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
1923 (build-system gnu-build-system)
1924 (arguments
1925 '(#:phases (modify-phases %standard-phases
1926 (delete 'configure)
1927 (add-before
1928 'build 'no-werror-no-ldconfig
1929 (lambda _
1930 (substitute* "Makefile"
1931 (("-Werror") "")
1932 (("ldconfig") "true"))
1933 #t))
1934 (add-before
1935 'build 'set-regulator-db-file-name
1936 (lambda* (#:key inputs #:allow-other-keys)
1937 ;; Tell CRDA where to find our database.
1938 (let ((regdb (assoc-ref inputs "wireless-regdb")))
1939 (substitute* "crda.c"
1940 (("\"/lib/crda/regulatory.bin\"")
1941 (string-append "\"" regdb
1942 "/lib/crda/regulatory.bin\"")))
1943 #t))))
1944 #:test-target "verify"
1945 #:make-flags (let ((out (assoc-ref %outputs "out"))
1946 (regdb (assoc-ref %build-inputs "wireless-regdb")))
1947 (list "CC=gcc" "V=1"
1948
1949 ;; Disable signature-checking on 'regulatory.bin'.
1950 ;; The reason is that this simplifies maintenance
1951 ;; on our side (no need to manage a distro key
1952 ;; pair), and we can guarantee integrity of
1953 ;; 'regulatory.bin' by other means anyway, such as
1954 ;; 'guix gc --verify'. See
1955 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
1956 ;; for a discssion.
1957 "USE_OPENSSL=0"
1958
1959 (string-append "PREFIX=" out)
1960 (string-append "SBINDIR=" out "/sbin/")
1961 (string-append "UDEV_RULE_DIR="
1962 out "/lib/udev/rules.d")
1963 (string-append "LDFLAGS=-Wl,-rpath="
1964 out "/lib -L.")
1965 (string-append "REG_BIN=" regdb
1966 "/lib/crda/regulatory.bin")))))
1967 (native-inputs `(("pkg-config" ,pkg-config)
1968 ("python" ,python-2)
1969 ("wireless-regdb" ,wireless-regdb)))
1970 (inputs `(("libnl" ,libnl)))
1971 (home-page
1972 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
1973 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
1974 (description
1975 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
1976communication between the kernel Linux and user space for regulatory
1977compliance.")
3ac73271 1978 (license license:copyleft-next)))
cc205dac 1979
c80b4a3e
LC
1980(define-public wireless-regdb
1981 (package
1982 (name "wireless-regdb")
3232613e 1983 (version "2016.06.10")
c80b4a3e
LC
1984 (source (origin
1985 (method url-fetch)
1986 (uri (string-append
1987 "mirror://kernel.org/software/network/wireless-regdb/"
1988 "wireless-regdb-" version ".tar.xz"))
1989 (sha256
1990 (base32
3232613e 1991 "1dxqy7a7zpzya30ff00s8k1qgrlndrwys99gc0r8yg0vab1z3vfg"))
5568151f
LC
1992
1993 ;; We're building 'regulatory.bin' by ourselves.
1994 (snippet '(delete-file "regulatory.bin"))))
c80b4a3e
LC
1995 (build-system gnu-build-system)
1996 (arguments
1997 '(#:phases (modify-phases %standard-phases
1998 (delete 'configure))
5568151f
LC
1999
2000 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2001 ;; is computed and can be equal to 'maintainer-clean'; when that
2002 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2003 ;; just built. Thus, build things sequentially.
2004 #:parallel-build? #f
2005
c80b4a3e
LC
2006 #:tests? #f ;no tests
2007 #:make-flags (let ((out (assoc-ref %outputs "out")))
2008 (list (string-append "PREFIX=" out)
2009 (string-append "LSB_ID=GuixSD")
2010 (string-append "DISTRO_PUBKEY=/dev/null")
2011 (string-append "DISTRO_PRIVKEY=/dev/null")
2012 (string-append "REGDB_PUBKEY=/dev/null")
2013
2014 ;; Leave that empty so that db2bin.py doesn't try
2015 ;; to sign 'regulatory.bin'. This allows us to
2016 ;; avoid managing a key pair for the whole distro.
2017 (string-append "REGDB_PRIVKEY=")))))
2018 (native-inputs `(("python" ,python-2)))
2019 (home-page
2020 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2021 (synopsis "Wireless regulatory database")
2022 (description
2023 "This package contains the wireless regulatory database Central
2024Regulatory Database Agent (CRDA) daemon. The database contains information on
2025country-specific regulations for the wireless spectrum.")
3ac73271 2026 (license license:isc)))
c80b4a3e 2027
30016044
MW
2028(define-public lm-sensors
2029 (package
2030 (name "lm-sensors")
171091a8 2031 (version "3.4.0")
30016044
MW
2032 (source (origin
2033 (method url-fetch)
ee6a5d0e 2034 (uri (list (string-append
171091a8
AE
2035 "https://github.com/groeck/lm-sensors/archive/V"
2036 (string-join (string-split version #\.) "-")
2037 ".tar.gz")))
30016044
MW
2038 (sha256
2039 (base32
171091a8 2040 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
fc1adab1 2041 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
2042 (build-system gnu-build-system)
2043 (inputs `(("rrdtool" ,rrdtool)
2044 ("perl" ,perl)
2045 ("kmod" ,kmod)
2046 ("gnuplot" ,gnuplot)))
2047 (native-inputs `(("pkg-config" ,pkg-config)
2048 ("flex" ,flex)
2049 ("bison" ,bison)
2050 ("which" ,which)))
2051 (arguments
2052 `(#:tests? #f ; no 'check' target
2053 #:make-flags (list (string-append "PREFIX=" %output)
2054 (string-append "ETCDIR=" %output "/etc")
2055 (string-append "MANDIR=" %output "/share/man"))
2056 #:phases
2057 (alist-delete
2058 'configure
2059 (alist-cons-before
2060 'build 'patch-exec-paths
2061 (lambda* (#:key inputs outputs #:allow-other-keys)
2062 (substitute* "prog/detect/sensors-detect"
2063 (("`uname")
2064 (string-append "`" (assoc-ref inputs "coreutils")
2065 "/bin/uname"))
2066 (("(`|\")modprobe" all open-quote)
2067 (string-append open-quote
2068 (assoc-ref inputs "kmod")
2069 "/bin/modprobe")))
2070 (substitute* '("prog/pwm/pwmconfig"
2071 "prog/pwm/fancontrol")
2072 (("gnuplot")
2073 (string-append (assoc-ref inputs "gnuplot")
2074 "/bin/gnuplot"))
2075 (("cat ")
2076 (string-append (assoc-ref inputs "coreutils")
2077 "/bin/cat "))
2078 (("egrep ")
2079 (string-append (assoc-ref inputs "grep")
2080 "/bin/egrep "))
2081 (("sed -e")
2082 (string-append (assoc-ref inputs "sed")
2083 "/bin/sed -e"))
2084 (("cut -d")
2085 (string-append (assoc-ref inputs "coreutils")
2086 "/bin/cut -d"))
2087 (("sleep ")
2088 (string-append (assoc-ref inputs "coreutils")
2089 "/bin/sleep "))
2090 (("readlink -f")
2091 (string-append (assoc-ref inputs "coreutils")
2092 "/bin/readlink -f"))))
2093 %standard-phases))))
3a04d5d4 2094 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
2095 (synopsis "Utilities to read temperature/voltage/fan sensors")
2096 (description
35b9e423 2097 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
2098you to access information from temperature, voltage, and fan speed sensors.
2099It works with most newer systems.")
3ac73271 2100 (license license:gpl2+)))
b087d413 2101
f5b2a53d
RW
2102(define-public i2c-tools
2103 (package
2104 (name "i2c-tools")
2105 (version "3.1.1")
2106 (source (origin
2107 (method url-fetch)
2108 (uri (string-append
f32274a7 2109 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
2110 version ".tar.bz2"))
2111 (sha256
2112 (base32
2113 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2114 (build-system gnu-build-system)
2115 (arguments
2116 `(#:tests? #f ; no 'check' target
2117 #:make-flags (list (string-append "prefix=" %output)
2118 "CC=gcc")
2119 ;; no configure script
2120 #:phases (alist-delete 'configure %standard-phases)))
bccf27cb
RW
2121 (inputs
2122 `(("perl" ,perl)))
f32274a7 2123 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
2124 (synopsis "I2C tools for Linux")
2125 (description
2126 "The i2c-tools package contains a heterogeneous set of I2C tools for
2127Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2128EEPROM decoding scripts, EEPROM programming tools, and a python module for
2129SMBus access.")
3ac73271 2130 (license license:gpl2+)))
f5b2a53d 2131
b087d413
MW
2132(define-public xsensors
2133 (package
2134 (name "xsensors")
2135 (version "0.70")
2136 (source (origin
2137 (method url-fetch)
2138 (uri (string-append
2139 "http://www.linuxhardware.org/xsensors/xsensors-"
2140 version ".tar.gz"))
2141 (sha256
2142 (base32
2143 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2144 (build-system gnu-build-system)
2145 (inputs `(("lm-sensors" ,lm-sensors)
2146 ("gtk" ,gtk+-2)))
2147 (native-inputs `(("pkg-config" ,pkg-config)))
2148 (arguments
2149 `(#:phases (alist-cons-before
2150 'configure 'enable-deprecated
2151 (lambda _
2152 (substitute* "src/Makefile.in"
2153 (("-DGDK_DISABLE_DEPRECATED") "")
2154 (("-DGTK_DISABLE_DEPRECATED") "")))
2155 (alist-cons-before
2156 'configure 'remove-Werror
2157 (lambda _
2158 (substitute* '("configure" "src/Makefile.in")
2159 (("-Werror") "")))
2160 %standard-phases))))
2161 (home-page "http://www.linuxhardware.org/xsensors/")
2162 (synopsis "Hardware health information viewer")
2163 (description
35b9e423 2164 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
2165health such as temperature, voltage and fan speed and displays the information
2166in a digital read-out.")
3ac73271 2167 (license license:gpl2+)))
b62fe07f
LC
2168
2169(define-public perf
2170 (package
2171 (name "perf")
2172 (version (package-version linux-libre))
2173 (source (package-source linux-libre))
2174 (build-system gnu-build-system)
2175 (arguments
2176 '(#:phases (alist-replace
2177 'configure
2178 (lambda* (#:key inputs #:allow-other-keys)
2179 (setenv "SHELL_PATH" (which "bash"))
2180 (chdir "tools/perf"))
2181 %standard-phases)
2182 #:make-flags (list (string-append "DESTDIR="
2183 (assoc-ref %outputs "out"))
2af29d23
LC
2184 "WERROR=0"
2185
2186 ;; By default, 'config/Makefile' uses lib64 on
2187 ;; x86_64. Work around that.
2188 "lib=lib")
b62fe07f
LC
2189 #:tests? #f)) ;no tests
2190 (native-inputs
2191 `(("pkg-config" ,pkg-config)
2192 ("bison" ,bison)
2193 ("flex" ,flex)
2194
2195 ;; There are build scripts written in these languages.
2196 ("perl" ,perl)
2197 ("python" ,python-2)))
2198 (inputs
b1fb4b23 2199 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2200 ;; ("newt" ,newt)
6c030d10 2201 ("python" ,python-2) ;'perf' links against libpython
b62fe07f
LC
2202 ("elfutils" ,elfutils)
2203
d7ece67a
LC
2204 ;; Documentation.
2205 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2206 ("libxslt" ,libxslt)
2207 ("docbook-xml" ,docbook-xml)
2208 ("docbook-xsl" ,docbook-xsl)
2209 ("xmlto" ,xmlto)
2210 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2211 (home-page "https://perf.wiki.kernel.org/")
2212 (synopsis "Linux profiling with performance counters")
2213 (description
2214 "perf is a tool suite for profiling using hardware performance counters,
2215with support in the Linux kernel. perf can instrument CPU performance
2216counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2217of lightweight profiling. This package contains the user-land tools and in
2218particular the 'perf' command.")
2219 (license (package-license linux-libre))))
c09e60e4
DT
2220
2221(define-public pflask
2222 (package
2223 (name "pflask")
2224 (version "0.2")
2225 (source (origin
2226 (method url-fetch)
2227 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2228 version ".tar.gz"))
f586c877 2229 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2230 (sha256
2231 (base32
2232 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2233 (build-system cmake-build-system)
2234 (arguments
2235 '(#:tests? #f)) ; no tests
2236 (home-page "http://ghedo.github.io/pflask/")
2237 (synopsis "Simple tool for creating Linux namespace containers")
2238 (description "pflask is a simple tool for creating Linux namespace
2239containers. It can be used for running a command or even booting an OS inside
2240an isolated container, created with the help of Linux namespaces. It is
2241similar in functionality to chroot, although pflask provides better isolation
2242thanks to the use of namespaces.")
3ac73271 2243 (license license:bsd-2)))
288084d5
MW
2244
2245(define-public hdparm
2246 (package
2247 (name "hdparm")
2248 (version "9.45")
2249 (source (origin
2250 (method url-fetch)
de67e922 2251 (uri (string-append "mirror://sourceforge/" name "/" name "/"
288084d5
MW
2252 name "-" version ".tar.gz"))
2253 (sha256
2254 (base32
2255 "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13"))))
2256 (build-system gnu-build-system)
2257 (arguments
2258 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2259 (list (string-append "binprefix=" out)
2260 (string-append "manprefix=" out)
2261 "CC=gcc"))
2262 #:phases (alist-delete 'configure %standard-phases)
2263 #:tests? #f)) ; no test suite
3b3b60d0 2264 (home-page "https://sourceforge.net/projects/hdparm/")
e881752c 2265 (synopsis "Tune hard disk parameters for high performance")
288084d5
MW
2266 (description
2267 "Get/set device parameters for Linux SATA/IDE drives. It's primary use
e881752c 2268is for enabling irq-unmasking and IDE multiple-mode.")
3ac73271 2269 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2270
c755c854
MW
2271(define-public rfkill
2272 (package
2273 (name "rfkill")
2274 (version "0.5")
2275 (source (origin
2276 (method url-fetch)
2277 (uri (string-append "mirror://kernel.org/software/network/"
2278 name "/" name "-" version ".tar.xz"))
2279 (sha256
2280 (base32
2281 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2282 (build-system gnu-build-system)
2283 (arguments
2284 `(#:make-flags (list "CC=gcc"
2285 (string-append "PREFIX=" %output))
2286 #:phases (modify-phases %standard-phases
2287 (delete 'configure))
2288 #:tests? #f))
2289 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2290 (synopsis "Tool for enabling and disabling wireless devices")
2291 (description
2292 "rfkill is a simple tool for accessing the rfkill device interface,
2293which is used to enable and disable wireless networking devices, typically
2294WLAN, Bluetooth and mobile broadband.")
3ac73271
LC
2295 (license (license:non-copyleft "file://COPYING"
2296 "See COPYING in the distribution."))))
c755c854 2297
dc9bdb1e
ML
2298(define-public acpi
2299 (package
2300 (name "acpi")
2301 (version "1.7")
2302 (source (origin
2303 (method url-fetch)
de67e922
LF
2304 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2305 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
2306 (sha256
2307 (base32
2308 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2309 (build-system gnu-build-system)
2310 (home-page "http://acpiclient.sourceforge.net")
2311 (synopsis "Display information on ACPI devices")
2312 (description "@code{acpi} attempts to replicate the functionality of the
2313\"old\" @code{apm} command on ACPI systems, including battery and thermal
2314information. It does not support ACPI suspending, only displays information
2315about ACPI devices.")
2316 (license license:gpl2+)))
2317
57a516d3
LC
2318(define-public acpid
2319 (package
2320 (name "acpid")
2321 (version "2.0.23")
2322 (source (origin
2323 (method url-fetch)
2324 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2325 version ".tar.xz"))
2326 (sha256
2327 (base32
2328 "1vl7c6vc724v4jwki17czgj6lnrknnj1a6llm8gkl32i2gnam5j3"))))
2329 (build-system gnu-build-system)
3b3b60d0 2330 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
2331 (synopsis "Daemon for delivering ACPI events to user-space programs")
2332 (description
2333 "acpid is designed to notify user-space programs of Advanced
2334Configuration and Power Interface (ACPI) events. acpid should be started
2335during the system boot, and will run as a background process. When an ACPI
2336event is received from the kernel, acpid will examine the list of rules
2337specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2338 (license license:gpl2+)))
37f5caec
TUBK
2339
2340(define-public sysfsutils
2341 (package
2342 (name "sysfsutils")
2343 (version "2.1.0")
2344 (source
2345 (origin
2346 (method url-fetch)
2347 (uri
2348 (string-append
2349 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2350 version ".tar.gz"))
2351 (sha256
2352 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2353 (build-system gnu-build-system)
2354 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2355 (synopsis "System utilities based on Linux sysfs")
2356 (description
8f65585b 2357 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
2358Linux kernel versions 2.5+ that exposes a system's device tree. The package
2359also contains the libsysfs library.")
2360 ;; The library is under lgpl2.1+ (all files say "or any later version").
2361 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2362 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2363
2364(define-public sysfsutils-1
2365 (package
2366 (inherit sysfsutils)
2367 (version "1.3.0")
2368 (source
2369 (origin
2370 (method url-fetch)
2371 (uri
2372 (string-append
2373 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2374 "/sysfsutils-" version ".tar.gz"))
2375 (sha256
2376 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2377 (modules '((guix build utils)))
2378 (snippet
2379 '(begin
2380 (substitute* "Makefile.in"
2381 (("includedir = /usr/include/sysfs")
2382 "includedir = @includedir@"))
2383 (substitute* "configure"
2384 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2385 (string-append "includedir='" orig "/sysfs'")))))))
2386 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2387
2388(define-public cpufrequtils
2389 (package
2390 (name "cpufrequtils")
2391 (version "0.3")
2392 (source
2393 (origin
2394 (method url-fetch)
2395 (uri
2396 (string-append
2397 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2398 version ".tar.gz"))
2399 (sha256
2400 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2401 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2402 (build-system gnu-build-system)
2403 (native-inputs
2404 `(("sysfsutils" ,sysfsutils-1)))
2405 (arguments
2406 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2407 (assoc-ref %outputs "out") "/lib"))))
2408 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2409 (synopsis "Utilities to get and set CPU frequency on Linux")
2410 (description
e881752c 2411 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2412information, and set the CPU frequency if supported, using the cpufreq
2413capabilities of the Linux kernel.")
3ac73271 2414 (license license:gpl2)))
0a588bf9
SB
2415
2416(define-public libraw1394
2417 (package
2418 (name "libraw1394")
7c58c852 2419 (version "2.1.2")
0a588bf9
SB
2420 (source (origin
2421 (method url-fetch)
2422 (uri (string-append
2423 "mirror://kernel.org/linux/libs/ieee1394/"
2424 name "-" version ".tar.xz"))
2425 (sha256
2426 (base32
7c58c852 2427 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
2428 (build-system gnu-build-system)
2429 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2430 (synopsis "Interface library for the Linux IEEE1394 drivers")
2431 (description
2432 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2433the Linux IEEE-1394 subsystem, which provides direct access to the connected
24341394 buses to user space. Through libraw1394/raw1394, applications can directly
2435send to and receive from other nodes without requiring a kernel driver for the
2436protocol in question.")
3ac73271 2437 (license license:lgpl2.1+)))
68e3c29d
SB
2438
2439(define-public libavc1394
2440 (package
2441 (name "libavc1394")
2442 (version "0.5.4")
2443 (source (origin
2444 (method url-fetch)
de67e922 2445 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
2446 name "-" version ".tar.gz"))
2447 (sha256
2448 (base32
2449 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2450 (build-system gnu-build-system)
2451 (native-inputs
2452 `(("pkg-config" ,pkg-config)))
2453 (propagated-inputs
2454 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 2455 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
2456 (synopsis "AV/C protocol library for IEEE 1394")
2457 (description
2458 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2459the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2460 (license license:lgpl2.1+)))
3f7bf86a
SB
2461
2462(define-public libiec61883
2463 (package
2464 (name "libiec61883")
2465 (version "1.2.0")
2466 (source (origin
2467 (method url-fetch)
2468 (uri (string-append
2469 "mirror://kernel.org/linux/libs/ieee1394/"
2470 name "-" version ".tar.xz"))
2471 (sha256
2472 (base32
2473 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2474 (build-system gnu-build-system)
2475 (native-inputs
2476 `(("pkg-config" ,pkg-config)))
2477 (propagated-inputs
2478 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2479 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2480 (synopsis "Isochronous streaming media library for IEEE 1394")
2481 (description
2482 "The libiec61883 library provides a higher level API for streaming DV,
2483MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2484 (license license:lgpl2.1+)))
69159125
MW
2485
2486(define-public mdadm
2487 (package
2488 (name "mdadm")
fae88ae8 2489 (version "4.0")
69159125
MW
2490 (source (origin
2491 (method url-fetch)
2492 (uri (string-append
2493 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2494 version ".tar.xz"))
2495 (sha256
2496 (base32
fae88ae8 2497 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
69159125
MW
2498 (build-system gnu-build-system)
2499 (inputs
2500 `(("udev" ,eudev)))
2501 (arguments
2502 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
2503 (list "CC=gcc"
2504 "INSTALL=install"
69159125
MW
2505 "CHECK_RUN_DIR=0"
2506 ;; TODO: tell it where to find 'sendmail'
2507 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2508 (string-append "BINDIR=" out "/sbin")
2509 (string-append "MANDIR=" out "/share/man")
2510 (string-append "UDEVDIR=" out "/lib/udev")))
2511 #:phases (alist-cons-before
2512 'build 'patch-program-paths
2513 (lambda* (#:key inputs #:allow-other-keys)
2514 (let ((coreutils (assoc-ref inputs "coreutils")))
2515 (substitute* "udev-md-raid-arrays.rules"
2516 (("/usr/bin/(readlink|basename)" all program)
2517 (string-append coreutils "/bin/" program)))))
d76f44e8
LC
2518 (alist-cons-before
2519 'build 'remove-W-error
2520 (lambda _
2521 ;; We cannot build with -Werror on i686 due to a
2522 ;; 'sign-compare' warning in util.c.
2523 (substitute* "Makefile"
2524 (("-Werror") ""))
2525 #t)
2526 (alist-delete 'configure %standard-phases)))
69159125
MW
2527 ;;tests must be done as root
2528 #:tests? #f))
2529 (home-page "http://neil.brown.name/blog/mdadm")
2530 (synopsis "Tool for managing Linux Software RAID arrays")
2531 (description
2532 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2533assemble, report on, and monitor arrays. It can also move spares between raid
2534arrays when needed.")
3ac73271 2535 (license license:gpl2+)))
01ccdfb6 2536
631fda7e
LC
2537(define-public mdadm-static
2538 (package
2539 (inherit mdadm)
2540 (name "mdadm-static")
2541 (arguments
2542 (substitute-keyword-arguments (package-arguments mdadm)
2543 ((#:make-flags flags)
2544 `(cons "LDFLAGS = -static" ,flags))
2545 ((#:phases phases)
2546 `(modify-phases ,phases
2547 (add-after 'install 'remove-cruft
2548 (lambda* (#:key outputs #:allow-other-keys)
2549 (let* ((out (assoc-ref outputs "out"))
2550 (precious? (lambda (file)
2551 (member file '("." ".." "sbin"))))
2552 (directories (scandir out (negate precious?))))
2553 (with-directory-excursion out
2554 (for-each delete-file-recursively directories)
2555 (remove-store-references "sbin/mdadm")
2556 (delete-file "sbin/mdmon")
2557 #t))))))
2558 ((#:modules modules %gnu-build-system-modules)
2559 `((ice-9 ftw) ,@modules))
2560 ((#:strip-flags _ '())
2561 ''("--strip-all")) ;strip a few extra KiB
2562 ((#:allowed-references _ '("out"))
2563 '("out")))) ;refer only self
2564 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2565
01ccdfb6
SB
2566(define-public libaio
2567 (package
2568 (name "libaio")
2569 (version "0.3.110")
2570 (source (origin
2571 (method url-fetch)
2572 (uri (list
2573 (string-append "mirror://debian/pool/main/liba/libaio/"
2574 name "_" version ".orig.tar.gz")
2575 (string-append "https://fedorahosted.org/releases/l/i/libaio/"
2576 name "-" version ".tar.gz")))
2577 (sha256
2578 (base32
2579 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2580 (build-system gnu-build-system)
2581 (arguments
2582 '(#:make-flags
2583 (list "CC=gcc" (string-append "prefix=" %output))
2584 #:test-target "partcheck" ; need root for a full 'check'
2585 #:phases
2586 (alist-delete 'configure %standard-phases))) ; no configure script
2587 (home-page "http://lse.sourceforge.net/io/aio.html")
2588 (synopsis "Linux-native asynchronous I/O access library")
2589 (description
2590 "This library enables userspace to use Linux kernel asynchronous I/O
2591system calls, important for the performance of databases and other advanced
2592applications.")
3ac73271 2593 (license license:lgpl2.1+)))
eb7c43c3 2594
81b98756
RW
2595(define-public sbc
2596 (package
2597 (name "sbc")
2598 (version "1.3")
2599 (source (origin
2600 (method url-fetch)
2601 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2602 name "-" version ".tar.xz"))
2603 (sha256
2604 (base32
2605 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2606 (build-system gnu-build-system)
2607 (inputs
2608 `(("libsndfile" ,libsndfile)))
2609 (native-inputs
2610 `(("pkg-config" ,pkg-config)))
2611 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2612 (synopsis "Bluetooth subband audio codec")
2613 (description
2614 "The SBC is a digital audio encoder and decoder used to transfer data to
2615Bluetooth audio output devices like headphones or loudspeakers.")
2616 (license license:gpl2+)))
2617
eb7c43c3
DT
2618(define-public bluez
2619 (package
2620 (name "bluez")
a189ac71 2621 (version "5.43")
eb7c43c3
DT
2622 (source (origin
2623 (method url-fetch)
2624 (uri (string-append
e9eb24b1 2625 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
2626 version ".tar.xz"))
2627 (sha256
2628 (base32
a189ac71 2629 "05cdnpz0w2lwq2x5ba87q1h2wgb4lfnpbnbh6p7499hx59fw1j8n"))))
eb7c43c3
DT
2630 (build-system gnu-build-system)
2631 (arguments
2632 '(#:configure-flags
2633 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
2634 (list "--sysconfdir=/etc"
2635 "--localstatedir=/var"
2636 "--enable-library"
53142109 2637 "--disable-systemd"
eb7c43c3
DT
2638 ;; Install dbus/udev files to the correct location.
2639 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
2640 (string-append "--with-udevdir=" out "/lib/udev")))
2641 #:phases
2642 (modify-phases %standard-phases
2643 (add-after 'install 'post-install
2644 (lambda* (#:key inputs outputs #:allow-other-keys)
2645 (let* ((out (assoc-ref outputs "out"))
2646 (servicedir (string-append out "/share/dbus-1/services"))
2647 (service "obexd/src/org.bluez.obex.service")
2648 (rule (string-append
2649 out "/lib/udev/rules.d/97-hid2hci.rules")))
2650 ;; Install the obex dbus service file.
2651 (substitute* service
2652 (("/bin/false")
2653 (string-append out "/libexec/bluetooth/obexd")))
2654 (install-file service servicedir)
2655 ;; Fix paths in the udev rule.
2656 (substitute* rule
2657 (("hid2hci --method")
2658 (string-append out "/lib/udev/hid2hci --method"))
2659 (("/sbin/udevadm")
2660 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2661 #t))))))
eb7c43c3
DT
2662 (native-inputs
2663 `(("pkg-config" ,pkg-config)
b94a6ca0 2664 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
2665 (inputs
2666 `(("glib" ,glib)
2667 ("dbus" ,dbus)
2668 ("eudev" ,eudev)
2669 ("libical" ,libical)
2670 ("readline" ,readline)))
2671 (home-page "http://www.bluez.org/")
2672 (synopsis "Linux Bluetooth protocol stack")
2673 (description
2674 "BlueZ provides support for the core Bluetooth layers and protocols. It
2675is flexible, efficient and uses a modular implementation.")
3ac73271 2676 (license license:gpl2+)))
3d890318
LC
2677
2678(define-public fuse-exfat
2679 (package
2680 (name "fuse-exfat")
9ff04ff7 2681 (version "1.2.6")
3d890318
LC
2682 (source (origin
2683 (method url-fetch)
c0cc805e
TGR
2684 (uri (string-append
2685 "https://github.com/relan/exfat/releases/download/v"
2686 version "/" name "-" version ".tar.gz"))
3d890318
LC
2687 (sha256
2688 (base32
9ff04ff7 2689 "1rvq4hapy2anal1vg1yidv4x8rg4iw5sxfwqixkw0q2qsxb54471"))))
3d890318
LC
2690 (build-system gnu-build-system)
2691 (native-inputs
c0cc805e 2692 `(("pkg-config" ,pkg-config)))
3d890318
LC
2693 (inputs
2694 `(("fuse" ,fuse)))
c0cc805e 2695 (home-page "https://github.com/relan/exfat")
3d890318
LC
2696 (synopsis "Mount exFAT file systems")
2697 (description
2698 "This package provides a FUSE-based file system that provides read and
2699write access to exFAT devices.")
3ac73271 2700 (license license:gpl2+)))
53ec8d48
LC
2701
2702(define-public gpm
2703 (package
2704 (name "gpm")
2705 (version "1.20.7")
2706 (source (origin
2707 (method url-fetch)
2708 (uri (string-append
2709 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2710 version ".tar.bz2"))
2711 (sha256
2712 (base32
2713 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2714 (build-system gnu-build-system)
2715 (arguments
2716 '(#:phases (modify-phases %standard-phases
2717 (add-before 'configure 'bootstrap
2718 (lambda _
2719 ;; The tarball was not generated with 'make dist' so we
2720 ;; need to bootstrap things ourselves.
2721 (and (zero? (system* "./autogen.sh"))
2722 (begin
2723 (patch-makefile-SHELL "Makefile.include.in")
2724 #t)))))
2725
2726 ;; Make sure programs find libgpm.so.
2727 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2728 (assoc-ref %outputs "out")
2729 "/lib"))))
2730 (native-inputs
2731 `(("texinfo" ,texinfo)
2732 ("bison" ,bison)
2733 ("flex" ,flex)
2734 ("autoconf" ,autoconf)
2735 ("automake" ,automake)
2736 ("libtool" ,libtool)))
2737 (home-page "http://www.nico.schottelius.org/software/gpm/")
2738 (synopsis "Mouse support for the Linux console")
2739 (description
2740 "The GPM (general-purpose mouse) daemon is a mouse server for
2741applications running on the Linux console. It allows users to select items
2742and copy/paste text in the console and in xterm.")
3ac73271 2743 (license license:gpl2+)))
fc686f9a
TGR
2744
2745(define-public btrfs-progs
2746 (package
2747 (name "btrfs-progs")
eb714a10 2748 (version "4.9.1")
fc686f9a
TGR
2749 (source (origin
2750 (method url-fetch)
2751 (uri (string-append "mirror://kernel.org/linux/kernel/"
2752 "people/kdave/btrfs-progs/"
2753 "btrfs-progs-v" version ".tar.xz"))
2754 (sha256
2755 (base32
eb714a10 2756 "1ppy2y9vypxw9awchari21yd3s2d7w2a9q3f4jq7dnjy5gyrnjj6"))))
fc686f9a 2757 (build-system gnu-build-system)
7cad981d
TGR
2758 (outputs '("out"
2759 "static")) ; static versions of binaries in "out" (~16MiB!)
fc686f9a 2760 (arguments
7cad981d
TGR
2761 '(#:phases (modify-phases %standard-phases
2762 (add-after 'build 'build-static
2763 (lambda _ (zero? (system* "make" "static"))))
2764 (add-after 'install 'install-static
2765 (let ((staticbin (string-append (assoc-ref %outputs "static")
2766 "/bin")))
2767 (lambda _
2768 (zero? (system* "make"
2769 (string-append "bindir=" staticbin)
2770 "install-static"))))))
2771 #:test-target "test"
fc686f9a
TGR
2772 #:parallel-tests? #f)) ; tests fail when run in parallel
2773 (inputs `(("e2fsprogs" ,e2fsprogs)
2774 ("libblkid" ,util-linux)
7cad981d 2775 ("libblkid:static" ,util-linux "static")
fc686f9a 2776 ("libuuid" ,util-linux)
7cad981d 2777 ("libuuid:static" ,util-linux "static")
fc686f9a
TGR
2778 ("zlib" ,zlib)
2779 ("lzo" ,lzo)))
2780 (native-inputs `(("pkg-config" ,pkg-config)
2781 ("asciidoc" ,asciidoc)
2782 ("xmlto" ,xmlto)
41d23dd1 2783 ;; For building documentation.
fc686f9a
TGR
2784 ("libxml2" ,libxml2)
2785 ("docbook-xml" ,docbook-xml)
48b7e4a6 2786 ("docbook-xsl" ,docbook-xsl)
41d23dd1 2787 ;; For tests.
48b7e4a6 2788 ("which" ,which)))
fc686f9a
TGR
2789 (home-page "https://btrfs.wiki.kernel.org/")
2790 (synopsis "Create and manage btrfs copy-on-write file systems")
8f65585b 2791 (description "Btrfs is a copy-on-write (CoW) file system for Linux aimed at
fc686f9a
TGR
2792implementing advanced features while focusing on fault tolerance, repair and
2793easy administration.")
68bcac6b
LF
2794 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
2795 ;; GPL2: Everything else.
2796 (license (list license:gpl2 license:gpl2+))))
08e9daf5 2797
f3e44f5c
DC
2798(define-public btrfs-progs/static
2799 (package
2800 (name "btrfs-progs-static")
2801 (version (package-version btrfs-progs))
2802 (source #f)
2803 (build-system trivial-build-system)
2804 (inputs
2805 `(("btrfs-progs:static" ,btrfs-progs "static")))
2806 (arguments
2807 `(#:modules ((guix build utils))
2808 #:builder
2809 (begin
2810 (use-modules (guix build utils)
2811 (ice-9 ftw)
2812 (srfi srfi-26))
2813
2814 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
2815 (out (assoc-ref %outputs "out"))
2816 (source (string-append btrfs "/bin/btrfs.static"))
2817 (target (string-append out "/bin/btrfs")))
2818 (mkdir-p (dirname target))
2819 (copy-file source target)
2820 (remove-store-references target)
2821 (chmod target #o555)))))
2822 (home-page (package-home-page btrfs-progs))
2823 (synopsis "Statically-linked btrfs command from btrfsprogs")
2824 (description "This package provides statically-linked command of btrfs taken
2825from the btrfsprogs package. It is meant to be used in initrds.")
2826 (license (package-license btrfs-progs))))
2827
08e9daf5
TGR
2828(define-public freefall
2829 (package
2830 (name "freefall")
2831 (version (package-version linux-libre))
2832 (source (package-source linux-libre))
2833 (build-system gnu-build-system)
2834 (arguments
2835 '(#:phases (modify-phases %standard-phases
2836 (add-after 'unpack 'enter-subdirectory
2837 (lambda _
2838 (chdir "tools/laptop/freefall")))
2839 (delete 'configure)
2840 (add-before 'build 'increase-timeout
2841 (lambda _
2842 ;; The default of 2 seconds is too low: it assumes an
2843 ;; open lid and AC power without actually checking.
2844 (substitute* "freefall.c"
2845 (("alarm\\(2\\)") "alarm(5)")))))
2846 #:make-flags (list (string-append "PREFIX="
2847 (assoc-ref %outputs "out")))
2848 #:tests? #f)) ;no tests
2849 (home-page (package-home-page linux-libre))
2850 (synopsis "Free-fall protection for spinning laptop hard drives")
2851 (description
2852 "Prevents shock damage to the internal spinning hard drive(s) of some
2853HP and Dell laptops. When sudden movement is detected, all input/output
2854operations on the drive are suspended and its heads are parked on the ramp,
2855where they are less likely to cause damage to the spinning disc. Requires a
2856drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
2857feature, and a laptop with an accelerometer. It has no effect on SSDs.")
2858 (license license:gpl2)))
d17ae8c0
NG
2859
2860(define-public thinkfan
2861 (package
2862 (name "thinkfan")
2863 (version "0.9.3")
2864 (source (origin
2865 (method url-fetch)
2866 (uri (string-append "mirror://sourceforge/thinkfan/"
de67e922 2867 "/thinkfan-" version ".tar.gz"))
d17ae8c0
NG
2868 (sha256
2869 (base32
2870 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
2871 (modules '((guix build utils)))
2872 ;; Fix erroneous man page location in Makefile leading to
2873 ;; a compilation failure.
2874 (snippet
2875 '(substitute* "CMakeLists.txt"
2876 (("thinkfan\\.1") "src/thinkfan.1")))))
2877 (build-system cmake-build-system)
2878 (arguments
2879 `(#:modules ((guix build cmake-build-system)
2880 (guix build utils)
2881 (srfi srfi-26))
2882 #:tests? #f ;no test target
2883 #:configure-flags
2884 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
2885 `("-DUSE_ATASMART:BOOL=ON")
2886 #:phases
2887 (modify-phases %standard-phases
75e56aed
NG
2888 ;; Install scripts for various foreign init systems. Also fix
2889 ;; hard-coded path for daemon.
d17ae8c0
NG
2890 (add-after 'install 'install-rc-scripts
2891 (lambda* (#:key outputs #:allow-other-keys)
75e56aed
NG
2892 (let ((out (assoc-ref outputs "out"))
2893 (files (find-files
2894 (string-append "../thinkfan-" ,version "/rcscripts")
2895 ".*")))
2896 (substitute* files
2897 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
2898 (string-append out "/sbin/" name)))
2899 (for-each (cute install-file <>
2900 (string-append out "/share/thinkfan"))
2901 files))
d17ae8c0
NG
2902 #t)))))
2903 (inputs
2904 `(("libatasmart" ,libatasmart)))
2905 (home-page "http://thinkfan.sourceforge.net/")
2906 (synopsis "Simple fan control program")
2907 (description
2908 "Thinkfan is a simple fan control program. It reads temperatures,
2909checks them against configured limits and switches to appropriate (also
2910pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
2911other @code{hwmon} driver that enables temperature reading and fan control
2912from userspace.")
2913 (license license:gpl3+)))
91231156
LC
2914
2915(define-public ntfs-3g
2916 (package
2917 (name "ntfs-3g")
2918 (version "2016.2.22")
2919 (source (origin
2920 (method url-fetch)
2921 (uri (string-append "https://tuxera.com/opensource/"
2922 "ntfs-3g_ntfsprogs-" version ".tgz"))
2923 (sha256
2924 (base32
2925 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
2926 (modules '((guix build utils)))
1a82ba66 2927 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
91231156
LC
2928 (snippet
2929 ;; Install under $prefix.
2930 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
2931 (("/sbin")
2932 "@sbindir@")))))
2933 (build-system gnu-build-system)
2934 (inputs `(("util-linux" ,util-linux)
2935 ("fuse" ,fuse))) ;libuuid
2936 (native-inputs `(("pkg-config" ,pkg-config)))
2937 (arguments
2938 '(#:configure-flags (list "--exec-prefix=${prefix}"
2939 "--with-fuse=external" ;use our own FUSE
2940 "--enable-mount-helper"
2941 "--enable-posix-acls"
2942 "--enable-xattr-mappings")))
2943 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
2944 (synopsis "Read-write access to NTFS file systems")
2945 (description
2946 "NTFS-3G provides read-write access to NTFS file systems, which are
2947commonly found on Microsoft Windows. It is implemented as a FUSE file system.
2948The package provides additional NTFS tools.")
2949 (license license:gpl2+)))
9b0942c1
DC
2950
2951(define-public rng-tools
2952 (package
2953 (name "rng-tools")
2954 (version "5")
2955 (source (origin
2956 (method url-fetch)
2957 (uri (string-append
2958 "http://downloads.sourceforge.net/sourceforge/gkernel/"
2959 "rng-tools-" version ".tar.gz"))
2960 (sha256
2961 (base32
2962 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
2963 (build-system gnu-build-system)
2964 (synopsis "Random number generator daemon")
2965 (description
2966 "Monitor a hardware random number generator, and supply entropy
2967from that to the system kernel's @file{/dev/random} machinery.")
3b3b60d0 2968 (home-page "https://sourceforge.net/projects/gkernel")
9b0942c1
DC
2969 ;; The source package is offered under the GPL2+, but the files
2970 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
2971 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
2972
2973(define-public cpupower
2974 (package
2975 (name "cpupower")
2976 (version (package-version linux-libre))
2977 (source (package-source linux-libre))
2978 (build-system gnu-build-system)
2979 (arguments
2980 '(#:phases (modify-phases %standard-phases
2981 (add-after 'unpack 'enter-subdirectory
2982 (lambda _
2983 (chdir "tools/power/cpupower")))
2984 (delete 'configure)
2985 (add-before 'build 'fix-makefiles
2986 (lambda _
2987 (substitute* "Makefile"
2988 (("/usr/") "/")
2989 (("/bin/(install|pwd)" _ command) command))
2990 (substitute* "bench/Makefile"
2991 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
2992 #:make-flags (let ((out (assoc-ref %outputs "out")))
2993 (list (string-append "DESTDIR=" out)
2994 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
2995 "docdir=/share/doc/cpupower"
2996 "confdir=$(docdir)/examples"
2997 ;; The Makefile recommends the following changes
2998 "DEBUG=false"
2999 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3000 #:tests? #f)) ;no tests
b94a6ca0 3001 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
3002 (inputs `(("pciutils" ,pciutils)))
3003 (home-page (package-home-page linux-libre))
3004 (synopsis "CPU frequency and voltage scaling tools for Linux")
3005 (description
3006 "cpupower is a set of user-space tools that use the cpufreq feature of the
3007Linux kernel to retrieve and control processor features related to power saving,
3008such as frequency and voltage scaling.")
3009 (license license:gpl2)))
2b76f135
TGR
3010
3011(define-public haveged
3012 (package
3013 (name "haveged")
3014 (version "1.9.1")
3015 (source
3016 (origin
3017 (method url-fetch)
3018 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3019 version ".tar.gz"))
3020 (sha256
3021 (base32
3022 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3023 (build-system gnu-build-system)
3024 (home-page "http://www.issihosts.com/haveged")
3025 (synopsis "Entropy source for the Linux random number generator")
3026 (description
3027 "haveged generates an unpredictable stream of random numbers for use by
3028Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3029standard mechanisms for filling the entropy pool may not be sufficient for
3030systems with high needs or limited user interaction, such as headless servers.
3031@command{haveged} runs as a privileged daemon, harvesting randomness from the
3032indirect effects of hardware events on hidden processor state using the HArdware
3033Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3034its environment and provides the same built-in test suite for the output stream
3035as used on certified hardware security devices.")
3036 (license (list (license:non-copyleft "file://nist/mconf.h")
3037 (license:non-copyleft "file://nist/packtest.c")
3038 license:public-domain ; nist/dfft.c
3039 license:gpl3+)))) ; everything else
e385e957
TGR
3040
3041(define-public ecryptfs-utils
3042 (package
3043 (name "ecryptfs-utils")
3044 (version "111")
3045 (source
3046 (origin
3047 (method url-fetch)
3048 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3049 version "/+download/ecryptfs-utils_"
3050 version ".orig.tar.gz"))
3051 (sha256
3052 (base32
3053 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3054 (build-system gnu-build-system)
3055 (arguments
3056 `(#:configure-flags (list "--disable-pywrap")))
3057 (native-inputs
3058 `(("intltool" ,intltool)
3059 ("perl" ,perl) ; for pod2man
3060 ("pkg-config" ,pkg-config)))
3061 (inputs
3062 `(("keyutils" ,keyutils)
3063 ("linux-pam" ,linux-pam)
3064 ("nss" ,nss)))
3065 (home-page "http://ecryptfs.org/")
3066 (synopsis "eCryptfs cryptographic file system utilities")
3067 (description
3068 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3069Each file's cryptographic meta-data is stored inside the file itself, along
3070with the encrypted contents. This allows individual encrypted files to be
3071copied between hosts and still be decrypted with the proper key. eCryptfs is a
3072native Linux file system, and has been part of the Linux kernel since version
30732.6.19. This package contains the userland utilities to manage it.")
3074 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3075 ;; grant additional permission to link with OpenSSL.
3076 (license license:gpl2+)))
cff0adec
DC
3077
3078(define-public libnfsidmap
3079 (package
3080 (name "libnfsidmap")
3081 (version "0.25")
3082 (source (origin
3083 (method url-fetch)
3084 (uri (string-append
3085 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3086 name "/" name "-" version ".tar.gz"))
3087 (sha256
3088 (base32
3089 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3090 (build-system gnu-build-system)
3091 (arguments
3092 `(#:configure-flags (list
3093 (string-append "--with-pluginpath="
3094 (assoc-ref %outputs "out")
3095 "/lib/libnfsidmap"))))
3096 (home-page
3097 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3098 (synopsis
3099 "NFSv4 support library for name/ID mapping")
3100 (description "Libnfsidmap is a library holding mulitiple methods of
3101mapping names to ids and visa versa, mainly for NFSv4. It provides an
3102extensible array of mapping functions, currently consisting of two choices:
3103the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3104 (license (license:non-copyleft "file://COPYING"
3105 "See COPYING in the distribution."))))
035d3593
DC
3106
3107(define-public module-init-tools
3108 (package
3109 (name "module-init-tools")
3110 (version "3.16")
3111 (source (origin
3112 (method url-fetch)
3113 (uri (string-append
3114 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3115 "module-init-tools-" version ".tar.bz2"))
3116 (sha256
3117 (base32
3118 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3119 (patches (search-patches "module-init-tools-moduledir.patch"))))
3120 (build-system gnu-build-system)
3121 (arguments
3122 ;; FIXME: The upstream tarball lacks man pages, and building them would
3123 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3124 ;; but they vanished. In the meantime, fake it.
3125 '(#:phases (alist-cons-before
3126 'configure 'fake-docbook
3127 (lambda _
3128 (substitute* "Makefile.in"
3129 (("^DOCBOOKTOMAN.*$")
3130 "DOCBOOKTOMAN = true\n")))
3131 %standard-phases)))
3132 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3133 (synopsis "Tools for loading and managing Linux kernel modules")
3134 (description
3135 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3136`insmod', `lsmod', and more.")
3137 (license license:gpl2+)))
dd65f3b7
TGR
3138
3139(define-public mcelog
3140 (package
3141 (name "mcelog")
33a8687a 3142 (version "148")
dd65f3b7
TGR
3143 (source (origin
3144 (method url-fetch)
3145 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3146 "mcelog.git/snapshot/v" version ".tar.gz"))
3147 (sha256
3148 (base32
33a8687a 3149 "1d5g09ndfsnl56vyhb5xw0zxspnh0f937biw3agqhdfbvw40j9jr"))
dd65f3b7
TGR
3150 (file-name (string-append name "-" version ".tar.gz"))
3151 (modules '((guix build utils)))
3152 (snippet
3153 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3154 `(substitute* "Makefile"
3155 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3156 (build-system gnu-build-system)
3157 (arguments
3158 `(#:phases (modify-phases %standard-phases
3159 (delete 'configure)) ; no configure script
3160 #:make-flags (let ((out (assoc-ref %outputs "out")))
3161 (list "CC=gcc"
3162 (string-append "prefix=" out)
3163 (string-append "DOCDIR=" out "/share/doc/mcelog")
3164 "etcprefix=$(DOCDIR)/examples"))
3165 ;; The tests will only run as root on certain supported CPU models.
3166 #:tests? #f))
3167 (supported-systems (list "i686-linux" "x86_64-linux"))
3168 (home-page "http://mcelog.org/")
3169 (synopsis "Machine check monitor for x86 Linux systems")
3170 (description
3171 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3172and other hardware errors on x86 systems. It can also perform user-defined
3173tasks, such as bringing bad pages off-line, when configurable error thresholds
3174are exceeded.")
3175 (license license:gpl2)))
0c60cc53
DM
3176
3177(define-public mtd-utils
3178 (package
3179 (name "mtd-utils")
3180 (version "1.5.2")
3181 (source (origin
3182 (method url-fetch)
3183 (uri (string-append
3184 "ftp://ftp.infradead.org/pub/mtd-utils/"
3185 "mtd-utils-" version ".tar.bz2"))
3186 (sha256
3187 (base32
3188 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3189 (inputs
3190 `(("acl" ,acl)
3191 ("libuuid" ,util-linux)
3192 ("lzo", lzo)
3193 ("zlib" ,zlib)))
3194 (build-system gnu-build-system)
3195 (arguments
3196 `(#:test-target "tests"
3197 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3198 #:phases (modify-phases %standard-phases
3199 (delete 'configure))))
3200 (synopsis "MTD Flash Storage Utilities")
3201 (description "This package provides utilities for testing, partitioning, etc
3202of flash storage.")
3203 (home-page "http://www.linux-mtd.infradead.org/")
3204 (license
3205 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3206 license:mpl1.1 ; All ftl* files
3207 license:expat)))) ; libiniparser
def6213f
LF
3208
3209(define-public libseccomp
3210 (package
3211 (name "libseccomp")
3212 (version "2.3.1")
3213 (source (origin
3214 (method url-fetch)
3215 (uri (string-append "https://github.com/seccomp/libseccomp/"
3216 "releases/download/v" version
3217 "/libseccomp-" version ".tar.gz"))
3218 (sha256
3219 (base32
3220 "0asnlkzqms520r0dra08dzcz5hh6hs7lkajfw9wij3vrd0hxsnzz"))))
3221 (build-system gnu-build-system)
3222 (native-inputs
3223 `(("which" ,which)))
3224 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3225 (description "The libseccomp library provides an easy to use, platform
3226independent, interface to the Linux Kernel's syscall filtering mechanism. The
3227libseccomp API is designed to abstract away the underlying BPF based syscall
3228filter language and present a more conventional function-call based filtering
3229interface that should be familiar to, and easily adopted by, application
3230developers.")
3231 (home-page "https://github.com/seccomp/libseccomp")
3232 (license license:lgpl2.1)))
58c4f11e
TGR
3233
3234(define-public radeontop
3235 (package
3236 (name "radeontop")
3237 (version "0.9")
3238 (home-page "https://github.com/clbr/radeontop/")
3239 (source (origin
3240 (method url-fetch)
3241 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3242 (file-name (string-append name "-" version ".tar.gz"))
3243 (sha256
3244 (base32
3245 "07fnimn6wwablmdjw0av11hk9a6xilbryh09izq4b2ic4b8md2p7"))))
3246 (build-system gnu-build-system)
3247 (arguments
3248 `(#:phases (modify-phases %standard-phases
3249 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3250 ;; dependency, and doesn't even work on release(!) tarballs.
3251 (add-after 'unpack 'report-correct-version
3252 (lambda _ (substitute* "getver.sh"
3253 (("ver=unknown")
3254 (string-append "ver=" ,version)))))
3255 (delete 'configure)) ; no configure script
3256 #:make-flags (list "CC=gcc"
3257 (string-append "PREFIX=" %output))
3258 #:tests? #f)) ; no tests
3259 (native-inputs
7c90d0f4 3260 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
3261 ("pkg-config" ,pkg-config)))
3262 (inputs
3263 `(("libdrm" ,libdrm)
3264 ("libpciaccess" ,libpciaccess)
3265 ("ncurses" ,ncurses)))
3266 (synopsis "Usage monitor for AMD Radeon graphics")
3267 (description "RadeonTop monitors resource consumption on supported AMD
3268Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3269a terminal or saved to a file for further processing. It measures both the
3270activity of the GPU as a whole, which is also accurate during OpenCL
3271computations, as well as separate component statistics that are only meaningful
3272under OpenGL graphics workloads.")
3273 (license license:gpl3)))
0d74462a
MB
3274
3275(define-public efivar
3276 (package
3277 (name "efivar")
3278 (version "30")
3279 (source (origin
3280 (method url-fetch)
3281 (uri (string-append "https://github.com/rhinstaller/" name
3282 "/releases/download/" version "/" name
3283 "-" version ".tar.bz2"))
3284 (sha256
3285 (base32
3286 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3287 (build-system gnu-build-system)
3288 (arguments
3289 `(;; Tests require a UEFI system and is not detected in the chroot.
3290 #:tests? #f
3291 #:make-flags (list (string-append "prefix=" %output)
3292 (string-append "libdir=" %output "/lib")
3293 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3294 #:phases
3295 (modify-phases %standard-phases
3296 (delete 'configure))))
3297 (native-inputs
3298 `(("pkg-config" ,pkg-config)))
3299 (inputs
3300 `(("popt" ,popt)))
3301 (home-page "https://github.com/rhinstaller/efivar")
3302 (synopsis "Tool and library to manipulate EFI variables")
3303 (description "This package provides a library and a command line
3304interface to the variable facility of UEFI boot firmware.")
3305 (license license:lgpl2.1+)))
1581406e
MB
3306
3307(define-public efibootmgr
3308 (package
3309 (name "efibootmgr")
3310 (version "14")
3311 (source (origin
3312 (method url-fetch)
3313 (uri (string-append "https://github.com/rhinstaller/" name
3314 "/releases/download/" version "/" name
3315 "-" version ".tar.bz2"))
3316 (sha256
3317 (base32
3318 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3319 (build-system gnu-build-system)
3320 (arguments
3321 `(#:tests? #f ; No tests.
3322 #:make-flags (list (string-append "prefix=" %output)
3323 (string-append "libdir=" %output "/lib")
3324 ;; Override CFLAGS to add efivar include directory.
3325 (string-append "CFLAGS=-O2 -g -flto -I"
3326 (assoc-ref %build-inputs "efivar")
3327 "/include/efivar"))
3328 #:phases
3329 (modify-phases %standard-phases
3330 (add-after 'unpack 'branding
3331 ;; Replace default loader path with something more familiar.
3332 (lambda _
3333 (substitute* "src/efibootmgr.c"
3334 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3335 "EFI\\\\gnu"))
3336 #t))
3337 (delete 'configure))))
3338 (native-inputs
3339 `(("pkg-config" ,pkg-config)))
3340 (inputs
3341 `(("efivar" ,efivar)
3342 ("popt" ,popt)))
3343 (home-page "https://github.com/rhinstaller/efibootmgr")
3344 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3345 (description
3346 "@code{efibootmgr} is a user-space application to modify the Intel
3347Extensible Firmware Interface (EFI) Boot Manager. This application can
3348create and destroy boot entries, change the boot order, change the next
3349running boot option, and more.")
3350 (license license:gpl2+)))
6d3e08d4
LF
3351
3352(define-public sysstat
3353 (package
3354 (name "sysstat")
3355 (version "11.4.2")
3356 (source (origin
3357 (method url-fetch)
3358 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3359 "sysstat-" version ".tar.xz"))
3360 (sha256
3361 (base32
3362 "0f8gk1hma3bk198ziwrhh5jhisnbbgc1v4rxhny58n0zjzw0gm0z"))))
3363 (build-system gnu-build-system)
3364 (arguments
3365 `(#:tests? #f ; No test suite.
3366 ;; Without this flag, it tries to install the man pages with group 'root'
3367 ;; and fails because /etc/passwd lacks an entry for the root user.
3368 #:configure-flags
3369 (list "--disable-file-attr"
3370 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3371 #:phases
3372 (modify-phases %standard-phases
3373 ;; The build process tries to create '/var/lib/sa', so we skip that
3374 ;; instruction.
3375 (add-after 'build 'skip-touching-var
3376 (lambda _
3377 (substitute* "Makefile"
3378 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3379 ""))
3380 #t)))))
3381 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3382 (synopsis "Performance monitoring tools for Linux")
3383 (description "The sysstat utilities are a collection of performance
3384monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3385@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3386@code{sadf} and @code{sa}.")
3387 (license license:gpl2+)))
01be4f93
JMSG
3388
3389(define-public light
3390 (package
3391 (name "light")
3392 (version "1.0")
3393 (source (origin
3394 (method url-fetch)
3395 (uri (string-append "https://github.com/haikarainen/" name
3396 "/archive/v" version ".tar.gz"))
3397 (sha256
3398 (base32
3399 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3400 (file-name (string-append name "-" version ".tar.gz"))))
3401 (build-system gnu-build-system)
3402 (arguments
3403 '(#:tests? #f ; no tests
3404 #:make-flags (list "CC=gcc"
3405 (string-append "PREFIX=" %output))
3406 #:phases
3407 (modify-phases %standard-phases
3408 (delete 'configure)
3409 (add-after 'unpack 'patch-makefile
3410 (lambda _
3411 (substitute* "Makefile" (("chown") "#")))))))
3412 (native-inputs
3413 `(("help2man" ,help2man)))
3414 (home-page "https://haikarainen.github.io/light")
3415 (synopsis "GNU/Linux application to control backlights")
3416 (description
3417 "Light is a program to send commands to screen backlight controllers
3418under GNU/Linux. Features include:
3419
3420@itemize
3421@item It does not rely on X.
3422@item Light can automatically figure out the best controller to use, making
3423full use of underlying hardware.
3424@item It is possible to set a minimum brightness value, as some controllers
3425set the screen to be pitch black at a vaĺue of 0 (or higher).
3426@end itemize
3427
3428Light is the successor of lightscript.")
3429 (license license:gpl3+)))
189d8422 3430
c7adafa7
MO
3431(define-public tlp
3432 (package
3433 (name "tlp")
3434 (version "0.9")
3435 (source (origin
3436 (method url-fetch)
3437 (uri (string-append
3438 "https://github.com/linrunner/"
3439 (string-upcase name)
3440 "/archive/" version ".tar.gz"))
3441 (file-name (string-append name "-" version ".tar.gz"))
3442 (sha256
3443 (base32
3444 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3445 (inputs `(("bash" ,bash)
3446 ("dbus" ,dbus)
3447 ("ethtool" ,ethtool)
3448 ("eudev" ,eudev)
3449 ("grep" ,grep)
3450 ("hdparm" ,hdparm)
3451 ("inetutils" ,inetutils)
3452 ("iw" ,iw)
3453 ("kmod" ,kmod)
3454 ("pciutils" ,pciutils)
3455 ("perl" ,perl)
3456 ("rfkill" ,rfkill)
3457 ("sed" ,sed)
3458 ("usbutils" ,usbutils)
3459 ("util-linux" ,util-linux)
3460 ("wireless-tools" ,wireless-tools)))
3461 (build-system gnu-build-system)
3462 (arguments
3463 `(#:phases
3464 (modify-phases %standard-phases
3465 (delete 'configure)
3466 (add-before 'build 'setenv
3467 (lambda* (#:key outputs #:allow-other-keys)
3468 (let ((out (assoc-ref outputs "out")))
3469 (setenv "TLP_WITH_SYSTEMD" "0")
3470 (setenv "TLP_NO_INIT" "1")
3471 (setenv "TLP_NO_PMUTILS" "1")
3472 (setenv "TLP_SBIN" (string-append out "/bin"))
3473 (setenv "TLP_BIN" (string-append out "/bin"))
3474 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3475 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3476 (setenv "TLP_CONF" (string-append out "/etc/tlp"))
3477 (setenv "TLP_SHCPL"
3478 (string-append out "/share/bash-completion/completions"))
3479 (setenv "TLP_MAN" (string-append out "/share/man")))))
3480 (delete 'check)
3481 (replace 'install
3482 (lambda _
3483 (system "make install-tlp install-man")))
3484 (add-after 'install 'wrap
3485 (lambda* (#:key inputs outputs #:allow-other-keys)
3486 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3487 (bin-files (find-files bin ".*")))
3488 (define (bin-directory input-name)
3489 (string-append (assoc-ref inputs input-name) "/bin"))
3490 (define (sbin-directory input-name)
3491 (string-append (assoc-ref inputs input-name) "/sbin"))
3492 (for-each (lambda (program)
3493 (wrap-program program
3494 `("PATH" ":" prefix
3495 ,(append
3496 (map bin-directory '("bash"
3497 "coreutils"
3498 "dbus"
3499 "eudev"
3500 "grep"
3501 "inetutils"
3502 "kmod"
3503 "perl"
3504 "sed"
3505 "usbutils"
3506 "util-linux"))
3507 (map sbin-directory '("ethtool"
3508 "hdparm"
3509 "iw"
3510 "pciutils"
3511 "rfkill"
3512 "wireless-tools"))))))
3513 bin-files)))))))
3514 (home-page "http://linrunner.de/en/tlp/tlp.html")
3515 (synopsis "Power management tool for Linux")
3516 (description "TLP is a power management tool for Linux. It comes with
3517a default configuration already optimized for battery life. Nevertheless,
3518TLP is customizable to fulfil system requirements. TLP settings are applied
3519every time the power supply source is changed.")
3520
3521 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3522 ;; rest is GPLv2+.
3523 (license (list license:gpl2+ license:gpl3+))))
3524
189d8422
BG
3525(define-public lshw
3526 (package
3527 (name "lshw")
3528 (version "B.02.18")
3529 (source (origin
3530 (method url-fetch)
3531 (uri (string-append "https://www.ezix.org/software/"
3532 "files/lshw-" version
3533 ".tar.gz"))
3534 (sha256
3535 (base32
3536 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3537 (build-system gnu-build-system)
3538 (arguments
3539 `(#:phases (modify-phases %standard-phases (delete 'configure))
3540 #:tests? #f ; no tests
3541 #:make-flags
3542 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3543 (synopsis "List hardware information")
3544 (description
3545 "@command{lshw} (Hardware Lister) is a small tool to provide
3546detailed information on the hardware configuration of the machine.
3547It can report exact memory configuration, firmware version, mainboard
3548configuration, CPU version and speed, cache configuration, bus speed,
3549and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3550machines (PowerMac G4 is known to work).")
3551 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3552 (license license:gpl2+)))