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