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