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