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