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