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