maint: Disk image size is automatically guessed.
[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
91cf5fda
MW
366(define %linux-libre-version "4.11.7")
367(define %linux-libre-hash "0kliwdz4qqjz13pywhavxg19cy1mf6d1f52f6kgapc331309vad9")
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
65763656
MW
376 (make-linux-libre "4.9.34"
377 "00jm3338kvhfj850lg3mvk680fmfw34mvwaq41lvxgb1z2xqqlz1"
52d901da 378 %intel-compatible-systems
65763656 379 #:configuration-file kernel-config))
52d901da 380
75b314a6 381(define-public linux-libre-4.4
c75a3081
MW
382 (make-linux-libre "4.4.74"
383 "04x2ki3s2jsjkkk6bld0rd9rsk8qqvrfsxawxzfa26mkq6pv87r2"
3129b9c2 384 %intel-compatible-systems
c75a3081 385 #:configuration-file kernel-config))
75b314a6 386
adddd5ba 387(define-public linux-libre-4.1
5227d53a
MW
388 (make-linux-libre "4.1.41"
389 "02mqfl899jxvrmxlh8lvcgvm3klwd8wbsdz4rr2gpchbggj4vgb2"
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")
83090f6a 493 (version "2.29.2")
5a6a3ba4
LC
494 (source (origin
495 (method url-fetch)
496 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
497 name "/v" (version-major+minor version) "/"
498 name "-" version ".tar.xz"))
5a6a3ba4
LC
499 (sha256
500 (base32
83090f6a 501 "1qz81w8vzrmy8xn9yx7ls4amkbgwx6vr62pl6kv9g7r0g3ba9kmc"))
fc1adab1 502 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
503 (modules '((guix build utils)))
504 (snippet
ec2da92c
LC
505 ;; We take the 'logger' program from GNU Inetutils and 'kill'
506 ;; from GNU Coreutils.
8338c241
MW
507 '(begin
508 (substitute* "configure"
509 (("build_logger=yes") "build_logger=no")
510 (("build_kill=yes") "build_kill=no"))
511 #t))))
02b80c3f 512 (build-system gnu-build-system)
dd581e9a
TGR
513 (outputs '("out"
514 "static")) ; >2 MiB of static .a libraries
02b80c3f 515 (arguments
29ec55ee 516 `(#:configure-flags (list "--disable-use-tty-group"
d9804e50 517 "--enable-fs-paths-default=/run/current-system/profile/sbin"
29ec55ee
LC
518 ;; Install completions where our
519 ;; bash-completion package expects them.
520 (string-append "--with-bashcompletiondir="
521 (assoc-ref %outputs "out")
522 "/etc/bash_completion.d"))
1b9cf4ad 523 #:phases (modify-phases %standard-phases
7e512497
LC
524 (add-before
525 'build 'set-umount-file-name
526 (lambda* (#:key outputs #:allow-other-keys)
527 ;; Tell 'eject' the right file name of 'umount'.
528 (let ((out (assoc-ref outputs "out")))
529 (substitute* "sys-utils/eject.c"
530 (("\"/bin/umount\"")
531 (string-append "\"" out "/bin/umount\"")))
532 #t)))
1b9cf4ad
LC
533 (add-before
534 'check 'pre-check
535 (lambda* (#:key inputs outputs #:allow-other-keys)
536 (let ((out (assoc-ref outputs "out"))
537 (net (assoc-ref inputs "net-base")))
538 ;; Change the test to refer to the right file.
539 (substitute* "tests/ts/misc/mcookie"
540 (("/etc/services")
541 (string-append net "/etc/services")))
dd581e9a
TGR
542 #t)))
543 (add-after
544 'install 'move-static-libraries
545 (lambda* (#:key outputs #:allow-other-keys)
546 (let ((out (assoc-ref outputs "out"))
547 (static (assoc-ref outputs "static")))
548 (mkdir-p (string-append static "/lib"))
549 (with-directory-excursion out
550 (for-each (lambda (file)
551 (rename-file file
552 (string-append static "/"
553 file)))
554 (find-files "lib" "\\.a$")))
1b9cf4ad 555 #t))))))
f61e0e79 556 (inputs `(("zlib" ,zlib)
c4c4cc05
JD
557 ("ncurses" ,ncurses)))
558 (native-inputs
9f533d60
LC
559 `(("perl" ,perl)
560 ("net-base" ,net-base))) ;for tests
02b80c3f 561 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 562 (synopsis "Collection of utilities for the Linux kernel")
437d7286 563 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 564utilities. It provides dmesg and includes tools for working with file systems,
437d7286 565block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 566
02b80c3f 567 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 568 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 569 ;; explicitly defined license.
3ac73271
LC
570 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
571 license:bsd-4 license:public-domain))))
5d5c4278 572
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)
e5d861f3 657 ("eudev" ,eudev-with-hwdb)))
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")
5f3070a5 899 (version "1.1.3")
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
5f3070a5 907 "174n2psp0328xcy2f1ayls67598bxli6q9cf00d2qnac3012aa3i"))))
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")
37861864 1906 (version "3.2.1")
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
37861864 1914 "06gyyl90n85x8i7lfhns514y1kg1ians13l467admyzy3kjxkqsp"))
f0a01af5
LF
1915 (patches (search-patches "eudev-rules-directory.patch"
1916 "eudev-conflicting-declaration.patch"))))
fe32c7f7
MW
1917 (build-system gnu-build-system)
1918 (native-inputs
1919 `(("pkg-config" ,pkg-config)
e75230c1
SB
1920 ("perl" ,perl)
1921 ("gperf" ,gperf)))
fe32c7f7 1922 (inputs
255f7308
LC
1923 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1924 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1925 ;; which contains the rules to do that.
1926 `(("util-linux" ,util-linux) ;for blkid
1927 ("kmod" ,kmod)))
e1921a38 1928 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
1929 (synopsis "Userspace device management")
1930 (description "Udev is a daemon which dynamically creates and removes
1931device nodes from /dev/, handles hotplug events and loads drivers at boot
1932time.")
3ac73271 1933 (license license:gpl2+)))
7fa715e7 1934
e5d861f3
LC
1935(define-public eudev-with-hwdb
1936 ;; TODO: Merge with 'eudev'.
1937 (package
1938 (inherit eudev)
1939 (name "eudev-with-hwdb")
1940 (arguments
1941 '(#:phases (modify-phases %standard-phases
1942 (add-after 'install 'build-hwdb
1943 (lambda* (#:key outputs #:allow-other-keys)
1944 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1945 ;; similar tools to display product names.
1946 (let ((out (assoc-ref outputs "out")))
1947 (zero? (system* (string-append out "/bin/udevadm")
1948 "hwdb" "--update"))))))))))
1949
66269d47
LC
1950(define-public lvm2
1951 (package
1952 (name "lvm2")
62ec02bf 1953 (version "2.02.171")
66269d47
LC
1954 (source (origin
1955 (method url-fetch)
1956 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1957 version ".tgz"))
1958 (sha256
1959 (base32
62ec02bf 1960 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
66269d47
LC
1961 (modules '((guix build utils)))
1962 (snippet
1963 '(begin
1964 (use-modules (guix build utils))
1965
1966 ;; Honor sysconfdir.
1967 (substitute* "make.tmpl.in"
1968 (("confdir = .*$")
1969 "confdir = @sysconfdir@\n")
1970 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
01f94cca
LC
1971 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1972 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
1973 (build-system gnu-build-system)
1974 (native-inputs
1975 `(("pkg-config" ,pkg-config)
1976 ("procps" ,procps))) ;tests use 'pgrep'
1977 (inputs
8fcaf8b1 1978 `(("udev" ,eudev)))
66269d47 1979 (arguments
3afbc6b3
LF
1980 '(#:phases
1981 (modify-phases %standard-phases
1982 (add-after 'configure 'set-makefile-shell
1983 (lambda _
1984 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1985 ;; expected.
1986 (setenv "SHELL" (which "sh"))
66269d47 1987
3afbc6b3
LF
1988 ;; Replace /bin/sh with the right file name.
1989 (patch-makefile-SHELL "make.tmpl")
7ca97fae
LF
1990 #t))
1991 (add-before 'strip 'make-objects-writable
1992 (lambda* (#:key outputs #:allow-other-keys)
1993 ;; Make compiled objects writable so they can be stripped.
1994 (let ((out (assoc-ref outputs "out")))
1995 (for-each (lambda (file)
1996 (chmod file #o755))
1997 (append
1998 (find-files (string-append out "/lib"))
1999 (find-files (string-append out "/sbin"))))
2000 #t))))
66269d47
LC
2001
2002 #:configure-flags (list (string-append "--sysconfdir="
2003 (assoc-ref %outputs "out")
2004 "/etc/lvm")
2005 "--enable-udev_sync"
f2817d43
LC
2006 "--enable-udev_rules"
2007
2008 ;; Make sure programs such as 'dmsetup' can
2009 ;; find libdevmapper.so.
2010 (string-append "LDFLAGS=-Wl,-rpath="
2011 (assoc-ref %outputs "out")
2012 "/lib"))
66269d47
LC
2013
2014 ;; The tests use 'mknod', which requires root access.
2015 #:tests? #f))
62ec02bf 2016 (home-page "https://sourceware.org/lvm2/")
66269d47
LC
2017 (synopsis "Logical volume management for Linux")
2018 (description
2019 "LVM2 is the logical volume management tool set for Linux-based systems.
2020This package includes the user-space libraries and tools, including the device
2021mapper. Kernel components are part of Linux-libre.")
2022
2023 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2024 ;; Command-line tools are GPLv2.
3ac73271 2025 (license (list license:gpl2 license:lgpl2.1))))
66269d47 2026
01f94cca
LC
2027(define-public lvm2-static
2028 (package
2029 (inherit lvm2)
2030 (name "lvm2-static")
2031
2032 ;; Propagate udev because libdevmapper.a depends on libudev.
2033 (inputs (alist-delete "udev" (package-inputs lvm2)))
2034 (propagated-inputs `(("udev" ,eudev)))
2035
2036 (arguments
2037 (substitute-keyword-arguments (package-arguments lvm2)
2038 ((#:configure-flags flags '())
2039 ;; LVM2 doesn't use Libtool, hence the custom option.
2040 `(cons "--enable-static_link" ,flags))))
2041 (synopsis "Logical volume management for Linux (statically linked)")))
2042
000f7559
DT
2043(define-public wireless-tools
2044 (package
2045 (name "wireless-tools")
2046 (version "30.pre9")
2047 (source (origin
2048 (method url-fetch)
2049 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2050 version ".tar.gz"))
2051 (sha256
2052 (base32
ec01f22d 2053 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 2054 (snippet
c2099a4c
MW
2055 '(begin
2056 ;; Remove the older header files that are not free software.
2057 (for-each (lambda (n)
2058 (delete-file (format #f "wireless.~a.h" n)))
2059 '(10 11 12 13 14 15 16 17 18 19 20))
2060 #t))))
000f7559
DT
2061 (build-system gnu-build-system)
2062 (arguments
c2099a4c
MW
2063 `(#:make-flags
2064 (list (string-append "PREFIX=" %output)
2065 (string-append "INSTALL_MAN=" %output "/share/man")
2066 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2067 "BUILD_STATIC=")
2068 #:phases (modify-phases %standard-phases
2069 (delete 'configure))
000f7559
DT
2070 #:tests? #f))
2071 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
2072 (description "Wireless Tools are used to manipulate the now-deprecated
2073Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2074Extension was an interface allowing you to set Wireless LAN specific
2075parameters and get the specific stats. It is deprecated in favor the nl80211
2076interface.")
000f7559 2077 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
2078 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2079 ;; other files are distributed under gpl2.
3ac73271 2080 (license (list license:gpl2 license:lgpl2.1+))))
30016044 2081
cc205dac
LC
2082(define-public crda
2083 (package
2084 (name "crda")
2085 (version "3.18")
2086 (source (origin
2087 (method url-fetch)
2088 (uri (string-append "mirror://kernel.org/software/network/crda/"
2089 "crda-" version ".tar.xz"))
2090 (sha256
2091 (base32
2092 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 2093 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
2094 (build-system gnu-build-system)
2095 (arguments
2096 '(#:phases (modify-phases %standard-phases
2097 (delete 'configure)
2098 (add-before
2099 'build 'no-werror-no-ldconfig
2100 (lambda _
2101 (substitute* "Makefile"
2102 (("-Werror") "")
2103 (("ldconfig") "true"))
2104 #t))
2105 (add-before
2106 'build 'set-regulator-db-file-name
2107 (lambda* (#:key inputs #:allow-other-keys)
2108 ;; Tell CRDA where to find our database.
2109 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2110 (substitute* "crda.c"
2111 (("\"/lib/crda/regulatory.bin\"")
2112 (string-append "\"" regdb
2113 "/lib/crda/regulatory.bin\"")))
2114 #t))))
2115 #:test-target "verify"
2116 #:make-flags (let ((out (assoc-ref %outputs "out"))
2117 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2118 (list "CC=gcc" "V=1"
2119
2120 ;; Disable signature-checking on 'regulatory.bin'.
2121 ;; The reason is that this simplifies maintenance
2122 ;; on our side (no need to manage a distro key
2123 ;; pair), and we can guarantee integrity of
2124 ;; 'regulatory.bin' by other means anyway, such as
2125 ;; 'guix gc --verify'. See
2126 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2127 ;; for a discssion.
2128 "USE_OPENSSL=0"
2129
2130 (string-append "PREFIX=" out)
2131 (string-append "SBINDIR=" out "/sbin/")
2132 (string-append "UDEV_RULE_DIR="
2133 out "/lib/udev/rules.d")
2134 (string-append "LDFLAGS=-Wl,-rpath="
2135 out "/lib -L.")
2136 (string-append "REG_BIN=" regdb
2137 "/lib/crda/regulatory.bin")))))
2138 (native-inputs `(("pkg-config" ,pkg-config)
2139 ("python" ,python-2)
2140 ("wireless-regdb" ,wireless-regdb)))
2141 (inputs `(("libnl" ,libnl)))
2142 (home-page
2143 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2144 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2145 (description
2146 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2147communication between the kernel Linux and user space for regulatory
2148compliance.")
3ac73271 2149 (license license:copyleft-next)))
cc205dac 2150
c80b4a3e
LC
2151(define-public wireless-regdb
2152 (package
2153 (name "wireless-regdb")
a70782d3 2154 (version "2017.03.07")
c80b4a3e
LC
2155 (source (origin
2156 (method url-fetch)
2157 (uri (string-append
2158 "mirror://kernel.org/software/network/wireless-regdb/"
2159 "wireless-regdb-" version ".tar.xz"))
2160 (sha256
2161 (base32
a70782d3 2162 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
5568151f
LC
2163
2164 ;; We're building 'regulatory.bin' by ourselves.
2165 (snippet '(delete-file "regulatory.bin"))))
c80b4a3e
LC
2166 (build-system gnu-build-system)
2167 (arguments
2168 '(#:phases (modify-phases %standard-phases
2169 (delete 'configure))
5568151f
LC
2170
2171 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2172 ;; is computed and can be equal to 'maintainer-clean'; when that
2173 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2174 ;; just built. Thus, build things sequentially.
2175 #:parallel-build? #f
2176
c80b4a3e
LC
2177 #:tests? #f ;no tests
2178 #:make-flags (let ((out (assoc-ref %outputs "out")))
2179 (list (string-append "PREFIX=" out)
2180 (string-append "LSB_ID=GuixSD")
2181 (string-append "DISTRO_PUBKEY=/dev/null")
2182 (string-append "DISTRO_PRIVKEY=/dev/null")
2183 (string-append "REGDB_PUBKEY=/dev/null")
2184
2185 ;; Leave that empty so that db2bin.py doesn't try
2186 ;; to sign 'regulatory.bin'. This allows us to
2187 ;; avoid managing a key pair for the whole distro.
2188 (string-append "REGDB_PRIVKEY=")))))
2189 (native-inputs `(("python" ,python-2)))
2190 (home-page
2191 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2192 (synopsis "Wireless regulatory database")
2193 (description
2194 "This package contains the wireless regulatory database Central
2195Regulatory Database Agent (CRDA) daemon. The database contains information on
2196country-specific regulations for the wireless spectrum.")
3ac73271 2197 (license license:isc)))
c80b4a3e 2198
30016044
MW
2199(define-public lm-sensors
2200 (package
2201 (name "lm-sensors")
171091a8 2202 (version "3.4.0")
30016044
MW
2203 (source (origin
2204 (method url-fetch)
ee6a5d0e 2205 (uri (list (string-append
171091a8
AE
2206 "https://github.com/groeck/lm-sensors/archive/V"
2207 (string-join (string-split version #\.) "-")
2208 ".tar.gz")))
bc4a2b85 2209 (file-name (string-append name "-" version ".tar.gz"))
30016044
MW
2210 (sha256
2211 (base32
171091a8 2212 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
fc1adab1 2213 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
2214 (build-system gnu-build-system)
2215 (inputs `(("rrdtool" ,rrdtool)
2216 ("perl" ,perl)
2217 ("kmod" ,kmod)
2218 ("gnuplot" ,gnuplot)))
2219 (native-inputs `(("pkg-config" ,pkg-config)
2220 ("flex" ,flex)
2221 ("bison" ,bison)
2222 ("which" ,which)))
2223 (arguments
2224 `(#:tests? #f ; no 'check' target
2225 #:make-flags (list (string-append "PREFIX=" %output)
2226 (string-append "ETCDIR=" %output "/etc")
2227 (string-append "MANDIR=" %output "/share/man"))
2228 #:phases
2229 (alist-delete
2230 'configure
2231 (alist-cons-before
2232 'build 'patch-exec-paths
2233 (lambda* (#:key inputs outputs #:allow-other-keys)
2234 (substitute* "prog/detect/sensors-detect"
2235 (("`uname")
2236 (string-append "`" (assoc-ref inputs "coreutils")
2237 "/bin/uname"))
2238 (("(`|\")modprobe" all open-quote)
2239 (string-append open-quote
2240 (assoc-ref inputs "kmod")
2241 "/bin/modprobe")))
2242 (substitute* '("prog/pwm/pwmconfig"
2243 "prog/pwm/fancontrol")
2244 (("gnuplot")
2245 (string-append (assoc-ref inputs "gnuplot")
2246 "/bin/gnuplot"))
2247 (("cat ")
2248 (string-append (assoc-ref inputs "coreutils")
2249 "/bin/cat "))
2250 (("egrep ")
2251 (string-append (assoc-ref inputs "grep")
2252 "/bin/egrep "))
2253 (("sed -e")
2254 (string-append (assoc-ref inputs "sed")
2255 "/bin/sed -e"))
2256 (("cut -d")
2257 (string-append (assoc-ref inputs "coreutils")
2258 "/bin/cut -d"))
2259 (("sleep ")
2260 (string-append (assoc-ref inputs "coreutils")
2261 "/bin/sleep "))
2262 (("readlink -f")
2263 (string-append (assoc-ref inputs "coreutils")
2264 "/bin/readlink -f"))))
2265 %standard-phases))))
3a04d5d4 2266 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
2267 (synopsis "Utilities to read temperature/voltage/fan sensors")
2268 (description
35b9e423 2269 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
2270you to access information from temperature, voltage, and fan speed sensors.
2271It works with most newer systems.")
3ac73271 2272 (license license:gpl2+)))
b087d413 2273
f5b2a53d
RW
2274(define-public i2c-tools
2275 (package
2276 (name "i2c-tools")
2277 (version "3.1.1")
2278 (source (origin
2279 (method url-fetch)
2280 (uri (string-append
f32274a7 2281 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
2282 version ".tar.bz2"))
2283 (sha256
2284 (base32
2285 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2286 (build-system gnu-build-system)
2287 (arguments
2288 `(#:tests? #f ; no 'check' target
2289 #:make-flags (list (string-append "prefix=" %output)
2290 "CC=gcc")
2291 ;; no configure script
2292 #:phases (alist-delete 'configure %standard-phases)))
bccf27cb
RW
2293 (inputs
2294 `(("perl" ,perl)))
f32274a7 2295 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
2296 (synopsis "I2C tools for Linux")
2297 (description
2298 "The i2c-tools package contains a heterogeneous set of I2C tools for
2299Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2300EEPROM decoding scripts, EEPROM programming tools, and a python module for
2301SMBus access.")
3ac73271 2302 (license license:gpl2+)))
f5b2a53d 2303
b087d413
MW
2304(define-public xsensors
2305 (package
2306 (name "xsensors")
2307 (version "0.70")
2308 (source (origin
2309 (method url-fetch)
2310 (uri (string-append
2311 "http://www.linuxhardware.org/xsensors/xsensors-"
2312 version ".tar.gz"))
2313 (sha256
2314 (base32
2315 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2316 (build-system gnu-build-system)
2317 (inputs `(("lm-sensors" ,lm-sensors)
2318 ("gtk" ,gtk+-2)))
2319 (native-inputs `(("pkg-config" ,pkg-config)))
2320 (arguments
2321 `(#:phases (alist-cons-before
2322 'configure 'enable-deprecated
2323 (lambda _
2324 (substitute* "src/Makefile.in"
2325 (("-DGDK_DISABLE_DEPRECATED") "")
2326 (("-DGTK_DISABLE_DEPRECATED") "")))
2327 (alist-cons-before
2328 'configure 'remove-Werror
2329 (lambda _
2330 (substitute* '("configure" "src/Makefile.in")
2331 (("-Werror") "")))
2332 %standard-phases))))
2333 (home-page "http://www.linuxhardware.org/xsensors/")
2334 (synopsis "Hardware health information viewer")
2335 (description
35b9e423 2336 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
2337health such as temperature, voltage and fan speed and displays the information
2338in a digital read-out.")
3ac73271 2339 (license license:gpl2+)))
b62fe07f
LC
2340
2341(define-public perf
2342 (package
2343 (name "perf")
2344 (version (package-version linux-libre))
2345 (source (package-source linux-libre))
2346 (build-system gnu-build-system)
2347 (arguments
2348 '(#:phases (alist-replace
2349 'configure
2350 (lambda* (#:key inputs #:allow-other-keys)
2351 (setenv "SHELL_PATH" (which "bash"))
2352 (chdir "tools/perf"))
2353 %standard-phases)
2354 #:make-flags (list (string-append "DESTDIR="
2355 (assoc-ref %outputs "out"))
2af29d23
LC
2356 "WERROR=0"
2357
2358 ;; By default, 'config/Makefile' uses lib64 on
2359 ;; x86_64. Work around that.
2360 "lib=lib")
b62fe07f
LC
2361 #:tests? #f)) ;no tests
2362 (native-inputs
2363 `(("pkg-config" ,pkg-config)
2364 ("bison" ,bison)
2365 ("flex" ,flex)
2366
2367 ;; There are build scripts written in these languages.
2368 ("perl" ,perl)
2369 ("python" ,python-2)))
2370 (inputs
b1fb4b23 2371 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2372 ;; ("newt" ,newt)
6c030d10 2373 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 2374 ("elfutils" ,elfutils)
b25d3bd9 2375 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
b62fe07f 2376
d7ece67a
LC
2377 ;; Documentation.
2378 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
2379 ("docbook-xsl" ,docbook-xsl)
2380 ("xmlto" ,xmlto)
2381 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2382 (home-page "https://perf.wiki.kernel.org/")
2383 (synopsis "Linux profiling with performance counters")
2384 (description
2385 "perf is a tool suite for profiling using hardware performance counters,
2386with support in the Linux kernel. perf can instrument CPU performance
2387counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2388of lightweight profiling. This package contains the user-land tools and in
2389particular the 'perf' command.")
2390 (license (package-license linux-libre))))
c09e60e4
DT
2391
2392(define-public pflask
2393 (package
2394 (name "pflask")
2395 (version "0.2")
2396 (source (origin
2397 (method url-fetch)
2398 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2399 version ".tar.gz"))
f586c877 2400 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2401 (sha256
2402 (base32
2403 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2404 (build-system cmake-build-system)
2405 (arguments
2406 '(#:tests? #f)) ; no tests
2407 (home-page "http://ghedo.github.io/pflask/")
2408 (synopsis "Simple tool for creating Linux namespace containers")
2409 (description "pflask is a simple tool for creating Linux namespace
2410containers. It can be used for running a command or even booting an OS inside
2411an isolated container, created with the help of Linux namespaces. It is
2412similar in functionality to chroot, although pflask provides better isolation
2413thanks to the use of namespaces.")
3ac73271 2414 (license license:bsd-2)))
288084d5
MW
2415
2416(define-public hdparm
2417 (package
2418 (name "hdparm")
8a1bb378 2419 (version "9.52")
288084d5
MW
2420 (source (origin
2421 (method url-fetch)
de67e922 2422 (uri (string-append "mirror://sourceforge/" name "/" name "/"
288084d5
MW
2423 name "-" version ".tar.gz"))
2424 (sha256
2425 (base32
8a1bb378 2426 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
288084d5
MW
2427 (build-system gnu-build-system)
2428 (arguments
2429 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2430 (list (string-append "binprefix=" out)
2431 (string-append "manprefix=" out)
2432 "CC=gcc"))
ec238332
TGR
2433 #:phases
2434 (modify-phases %standard-phases
2435 (delete 'configure)) ; no configure script
2436 #:tests? #f)) ; no test suite
3b3b60d0 2437 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 2438 (synopsis "View and tune ATA disk drive parameters")
288084d5 2439 (description
02052b2c
TGR
2440 "@command{hdparm} is a command-line utility to control ATA controllers and
2441disk drives. It can increase performance and/or reliability by careful tuning
2442of hardware settings like power and acoustic management, DMA modes, and caching.
2443It can also display detailed device information, or be used as a simple
2444performance benchmarking tool.
2445
2446@command{hdparm} provides a command line interface to various Linux kernel
2447interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2448IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2449Command Translation} (SAT) are also supported.")
3ac73271 2450 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2451
c755c854
MW
2452(define-public rfkill
2453 (package
2454 (name "rfkill")
2455 (version "0.5")
2456 (source (origin
2457 (method url-fetch)
2458 (uri (string-append "mirror://kernel.org/software/network/"
2459 name "/" name "-" version ".tar.xz"))
2460 (sha256
2461 (base32
2462 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2463 (build-system gnu-build-system)
2464 (arguments
2465 `(#:make-flags (list "CC=gcc"
2466 (string-append "PREFIX=" %output))
2467 #:phases (modify-phases %standard-phases
2468 (delete 'configure))
2469 #:tests? #f))
2470 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2471 (synopsis "Tool for enabling and disabling wireless devices")
2472 (description
2473 "rfkill is a simple tool for accessing the rfkill device interface,
2474which is used to enable and disable wireless networking devices, typically
2475WLAN, Bluetooth and mobile broadband.")
3ac73271
LC
2476 (license (license:non-copyleft "file://COPYING"
2477 "See COPYING in the distribution."))))
c755c854 2478
dc9bdb1e
ML
2479(define-public acpi
2480 (package
2481 (name "acpi")
2482 (version "1.7")
2483 (source (origin
2484 (method url-fetch)
de67e922
LF
2485 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2486 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
2487 (sha256
2488 (base32
2489 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2490 (build-system gnu-build-system)
2491 (home-page "http://acpiclient.sourceforge.net")
2492 (synopsis "Display information on ACPI devices")
2493 (description "@code{acpi} attempts to replicate the functionality of the
2494\"old\" @code{apm} command on ACPI systems, including battery and thermal
2495information. It does not support ACPI suspending, only displays information
2496about ACPI devices.")
2497 (license license:gpl2+)))
2498
57a516d3
LC
2499(define-public acpid
2500 (package
2501 (name "acpid")
169a438c 2502 (version "2.0.28")
57a516d3
LC
2503 (source (origin
2504 (method url-fetch)
2505 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2506 version ".tar.xz"))
2507 (sha256
2508 (base32
169a438c 2509 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
57a516d3 2510 (build-system gnu-build-system)
3b3b60d0 2511 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
2512 (synopsis "Daemon for delivering ACPI events to user-space programs")
2513 (description
2514 "acpid is designed to notify user-space programs of Advanced
2515Configuration and Power Interface (ACPI) events. acpid should be started
2516during the system boot, and will run as a background process. When an ACPI
2517event is received from the kernel, acpid will examine the list of rules
2518specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2519 (license license:gpl2+)))
37f5caec
TUBK
2520
2521(define-public sysfsutils
2522 (package
2523 (name "sysfsutils")
2524 (version "2.1.0")
2525 (source
2526 (origin
2527 (method url-fetch)
2528 (uri
2529 (string-append
2530 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2531 version ".tar.gz"))
2532 (sha256
2533 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2534 (build-system gnu-build-system)
2535 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2536 (synopsis "System utilities based on Linux sysfs")
2537 (description
8f65585b 2538 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
2539Linux kernel versions 2.5+ that exposes a system's device tree. The package
2540also contains the libsysfs library.")
2541 ;; The library is under lgpl2.1+ (all files say "or any later version").
2542 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2543 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2544
2545(define-public sysfsutils-1
2546 (package
2547 (inherit sysfsutils)
2548 (version "1.3.0")
2549 (source
2550 (origin
2551 (method url-fetch)
2552 (uri
2553 (string-append
2554 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2555 "/sysfsutils-" version ".tar.gz"))
2556 (sha256
2557 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2558 (modules '((guix build utils)))
2559 (snippet
2560 '(begin
2561 (substitute* "Makefile.in"
2562 (("includedir = /usr/include/sysfs")
2563 "includedir = @includedir@"))
2564 (substitute* "configure"
2565 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2566 (string-append "includedir='" orig "/sysfs'")))))))
2567 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2568
2569(define-public cpufrequtils
2570 (package
2571 (name "cpufrequtils")
2572 (version "0.3")
2573 (source
2574 (origin
2575 (method url-fetch)
2576 (uri
2577 (string-append
2578 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2579 version ".tar.gz"))
2580 (sha256
2581 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2582 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2583 (build-system gnu-build-system)
2584 (native-inputs
2585 `(("sysfsutils" ,sysfsutils-1)))
2586 (arguments
2587 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2588 (assoc-ref %outputs "out") "/lib"))))
2589 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2590 (synopsis "Utilities to get and set CPU frequency on Linux")
2591 (description
e881752c 2592 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2593information, and set the CPU frequency if supported, using the cpufreq
2594capabilities of the Linux kernel.")
3ac73271 2595 (license license:gpl2)))
0a588bf9
SB
2596
2597(define-public libraw1394
2598 (package
2599 (name "libraw1394")
7c58c852 2600 (version "2.1.2")
0a588bf9
SB
2601 (source (origin
2602 (method url-fetch)
2603 (uri (string-append
2604 "mirror://kernel.org/linux/libs/ieee1394/"
2605 name "-" version ".tar.xz"))
2606 (sha256
2607 (base32
7c58c852 2608 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
2609 (build-system gnu-build-system)
2610 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2611 (synopsis "Interface library for the Linux IEEE1394 drivers")
2612 (description
2613 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2614the Linux IEEE-1394 subsystem, which provides direct access to the connected
26151394 buses to user space. Through libraw1394/raw1394, applications can directly
2616send to and receive from other nodes without requiring a kernel driver for the
2617protocol in question.")
3ac73271 2618 (license license:lgpl2.1+)))
68e3c29d
SB
2619
2620(define-public libavc1394
2621 (package
2622 (name "libavc1394")
2623 (version "0.5.4")
2624 (source (origin
2625 (method url-fetch)
de67e922 2626 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
2627 name "-" version ".tar.gz"))
2628 (sha256
2629 (base32
2630 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2631 (build-system gnu-build-system)
2632 (native-inputs
2633 `(("pkg-config" ,pkg-config)))
2634 (propagated-inputs
2635 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 2636 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
2637 (synopsis "AV/C protocol library for IEEE 1394")
2638 (description
2639 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2640the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2641 (license license:lgpl2.1+)))
3f7bf86a
SB
2642
2643(define-public libiec61883
2644 (package
2645 (name "libiec61883")
2646 (version "1.2.0")
2647 (source (origin
2648 (method url-fetch)
2649 (uri (string-append
2650 "mirror://kernel.org/linux/libs/ieee1394/"
2651 name "-" version ".tar.xz"))
2652 (sha256
2653 (base32
2654 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2655 (build-system gnu-build-system)
2656 (native-inputs
2657 `(("pkg-config" ,pkg-config)))
2658 (propagated-inputs
2659 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2660 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2661 (synopsis "Isochronous streaming media library for IEEE 1394")
2662 (description
2663 "The libiec61883 library provides a higher level API for streaming DV,
2664MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2665 (license license:lgpl2.1+)))
69159125
MW
2666
2667(define-public mdadm
2668 (package
2669 (name "mdadm")
fae88ae8 2670 (version "4.0")
69159125
MW
2671 (source (origin
2672 (method url-fetch)
2673 (uri (string-append
2674 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2675 version ".tar.xz"))
2676 (sha256
2677 (base32
fae88ae8 2678 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
69159125
MW
2679 (build-system gnu-build-system)
2680 (inputs
2681 `(("udev" ,eudev)))
2682 (arguments
2683 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
2684 (list "CC=gcc"
2685 "INSTALL=install"
69159125
MW
2686 "CHECK_RUN_DIR=0"
2687 ;; TODO: tell it where to find 'sendmail'
2688 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2689 (string-append "BINDIR=" out "/sbin")
2690 (string-append "MANDIR=" out "/share/man")
2691 (string-append "UDEVDIR=" out "/lib/udev")))
2692 #:phases (alist-cons-before
2693 'build 'patch-program-paths
2694 (lambda* (#:key inputs #:allow-other-keys)
2695 (let ((coreutils (assoc-ref inputs "coreutils")))
2696 (substitute* "udev-md-raid-arrays.rules"
2697 (("/usr/bin/(readlink|basename)" all program)
2698 (string-append coreutils "/bin/" program)))))
d76f44e8
LC
2699 (alist-cons-before
2700 'build 'remove-W-error
2701 (lambda _
2702 ;; We cannot build with -Werror on i686 due to a
2703 ;; 'sign-compare' warning in util.c.
2704 (substitute* "Makefile"
2705 (("-Werror") ""))
2706 #t)
2707 (alist-delete 'configure %standard-phases)))
69159125
MW
2708 ;;tests must be done as root
2709 #:tests? #f))
2710 (home-page "http://neil.brown.name/blog/mdadm")
2711 (synopsis "Tool for managing Linux Software RAID arrays")
2712 (description
2713 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2714assemble, report on, and monitor arrays. It can also move spares between raid
2715arrays when needed.")
3ac73271 2716 (license license:gpl2+)))
01ccdfb6 2717
631fda7e
LC
2718(define-public mdadm-static
2719 (package
2720 (inherit mdadm)
2721 (name "mdadm-static")
2722 (arguments
2723 (substitute-keyword-arguments (package-arguments mdadm)
2724 ((#:make-flags flags)
2725 `(cons "LDFLAGS = -static" ,flags))
2726 ((#:phases phases)
2727 `(modify-phases ,phases
2728 (add-after 'install 'remove-cruft
2729 (lambda* (#:key outputs #:allow-other-keys)
2730 (let* ((out (assoc-ref outputs "out"))
2731 (precious? (lambda (file)
2732 (member file '("." ".." "sbin"))))
2733 (directories (scandir out (negate precious?))))
2734 (with-directory-excursion out
2735 (for-each delete-file-recursively directories)
2736 (remove-store-references "sbin/mdadm")
2737 (delete-file "sbin/mdmon")
2738 #t))))))
2739 ((#:modules modules %gnu-build-system-modules)
2740 `((ice-9 ftw) ,@modules))
2741 ((#:strip-flags _ '())
2742 ''("--strip-all")) ;strip a few extra KiB
2743 ((#:allowed-references _ '("out"))
2744 '("out")))) ;refer only self
2745 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2746
b3ed50e6
MB
2747(define-public multipath-tools
2748 (package
2749 (name "multipath-tools")
7f412f33 2750 (version "0.7.1")
b3ed50e6
MB
2751 (source (origin
2752 (method url-fetch)
2753 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2754 ".git;a=snapshot;h=" version ";sf=tgz"))
2755 (file-name (string-append name "-" version ".tar.gz"))
2756 (sha256
2757 (base32
7f412f33 2758 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
b3ed50e6
MB
2759 (modules '((guix build utils)))
2760 (snippet
2761 '(begin
2762 ;; Drop bundled valgrind headers.
2763 (delete-file-recursively "third-party")
2764 (substitute* '("multipathd/main.c"
2765 "libmultipath/debug.c")
2766 (("#include \"../third-party/")
2767 "#include \""))
2768 #t))))
2769 (build-system gnu-build-system)
2770 (arguments
2771 '(#:tests? #f ; No tests.
2772 #:make-flags (list (string-append "DESTDIR="
2773 (assoc-ref %outputs "out"))
b5fb9430 2774 "SYSTEMDPATH=lib"
b3ed50e6
MB
2775 (string-append "LDFLAGS=-Wl,-rpath="
2776 (assoc-ref %outputs "out")
2777 "/lib"))
2778 #:phases
2779 (modify-phases %standard-phases
b5fb9430 2780 (add-after 'unpack 'patch-source
7f412f33
MB
2781 (lambda* (#:key inputs #:allow-other-keys)
2782 (let ((lvm2 (assoc-ref inputs "lvm2"))
2783 (udev (assoc-ref inputs "udev")))
2784 (substitute* "Makefile.inc"
2785 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2786 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2787 (("/usr/include/libdevmapper.h")
2788 (string-append lvm2 "/include/libdevmapper.h"))
2789 (("/usr/include/libudev.h")
2790 (string-append udev "/include/libudev.h")))
2791 #t)))
b3ed50e6
MB
2792 (delete 'configure)
2793 (add-before 'build 'set-CC
2794 (lambda _
2795 (setenv "CC" "gcc")
2796 #t)))))
2797 (native-inputs
7f412f33
MB
2798 `(("perl" ,perl)
2799 ("pkg-config" ,pkg-config)
2800 ("valgrind" ,valgrind)))
b3ed50e6
MB
2801 (inputs
2802 `(("ceph:lib" ,ceph "lib")
7f412f33 2803 ("json-c" ,json-c)
b3ed50e6
MB
2804 ("libaio" ,libaio)
2805 ("liburcu" ,liburcu)
2806 ("lvm2" ,lvm2)
2807 ("readline" ,readline)
2808 ("udev" ,eudev)))
2809 (home-page "http://christophe.varoqui.free.fr/")
2810 (synopsis "Access block devices through multiple paths")
2811 (description
2812 "This package provides the following binaries to drive the
2813Linux Device Mapper multipathing driver:
2814@enumerate
2815@item @command{multipath} - Device mapper target autoconfig.
2816@item @command{multipathd} - Multipath daemon.
2817@item @command{mpathpersist} - Manages SCSI persistent reservations on
2818@code{dm} multipath devices.
2819@item @command{kpartx} - Create device maps from partition tables.
2820@end enumerate")
2821 (license (list license:gpl2+ ; Main distribution.
2822 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2823
01ccdfb6
SB
2824(define-public libaio
2825 (package
2826 (name "libaio")
2827 (version "0.3.110")
2828 (source (origin
2829 (method url-fetch)
2830 (uri (list
2831 (string-append "mirror://debian/pool/main/liba/libaio/"
4929a061 2832 name "_" version ".orig.tar.gz")))
01ccdfb6
SB
2833 (sha256
2834 (base32
2835 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2836 (build-system gnu-build-system)
2837 (arguments
2838 '(#:make-flags
2839 (list "CC=gcc" (string-append "prefix=" %output))
2840 #:test-target "partcheck" ; need root for a full 'check'
2841 #:phases
2842 (alist-delete 'configure %standard-phases))) ; no configure script
2843 (home-page "http://lse.sourceforge.net/io/aio.html")
2844 (synopsis "Linux-native asynchronous I/O access library")
2845 (description
2846 "This library enables userspace to use Linux kernel asynchronous I/O
2847system calls, important for the performance of databases and other advanced
2848applications.")
3ac73271 2849 (license license:lgpl2.1+)))
eb7c43c3 2850
81b98756
RW
2851(define-public sbc
2852 (package
2853 (name "sbc")
2854 (version "1.3")
2855 (source (origin
2856 (method url-fetch)
2857 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2858 name "-" version ".tar.xz"))
2859 (sha256
2860 (base32
2861 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2862 (build-system gnu-build-system)
2863 (inputs
2864 `(("libsndfile" ,libsndfile)))
2865 (native-inputs
2866 `(("pkg-config" ,pkg-config)))
2867 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2868 (synopsis "Bluetooth subband audio codec")
2869 (description
2870 "The SBC is a digital audio encoder and decoder used to transfer data to
2871Bluetooth audio output devices like headphones or loudspeakers.")
2872 (license license:gpl2+)))
2873
eb7c43c3
DT
2874(define-public bluez
2875 (package
2876 (name "bluez")
3590a6b5 2877 (version "5.45")
eb7c43c3
DT
2878 (source (origin
2879 (method url-fetch)
2880 (uri (string-append
e9eb24b1 2881 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
2882 version ".tar.xz"))
2883 (sha256
2884 (base32
3590a6b5 2885 "1sb4aflgyrl7apricjipa8wx95qm69yja0lmn2f19g560c3v1b2c"))))
eb7c43c3
DT
2886 (build-system gnu-build-system)
2887 (arguments
2888 '(#:configure-flags
2889 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
2890 (list "--sysconfdir=/etc"
2891 "--localstatedir=/var"
2892 "--enable-library"
53142109 2893 "--disable-systemd"
eb7c43c3
DT
2894 ;; Install dbus/udev files to the correct location.
2895 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
2896 (string-append "--with-udevdir=" out "/lib/udev")))
2897 #:phases
2898 (modify-phases %standard-phases
2899 (add-after 'install 'post-install
2900 (lambda* (#:key inputs outputs #:allow-other-keys)
2901 (let* ((out (assoc-ref outputs "out"))
2902 (servicedir (string-append out "/share/dbus-1/services"))
2903 (service "obexd/src/org.bluez.obex.service")
2904 (rule (string-append
2905 out "/lib/udev/rules.d/97-hid2hci.rules")))
2906 ;; Install the obex dbus service file.
2907 (substitute* service
2908 (("/bin/false")
2909 (string-append out "/libexec/bluetooth/obexd")))
2910 (install-file service servicedir)
2911 ;; Fix paths in the udev rule.
2912 (substitute* rule
2913 (("hid2hci --method")
2914 (string-append out "/lib/udev/hid2hci --method"))
2915 (("/sbin/udevadm")
2916 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2917 #t))))))
eb7c43c3
DT
2918 (native-inputs
2919 `(("pkg-config" ,pkg-config)
b94a6ca0 2920 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
2921 (inputs
2922 `(("glib" ,glib)
2923 ("dbus" ,dbus)
2924 ("eudev" ,eudev)
2925 ("libical" ,libical)
2926 ("readline" ,readline)))
2927 (home-page "http://www.bluez.org/")
2928 (synopsis "Linux Bluetooth protocol stack")
2929 (description
2930 "BlueZ provides support for the core Bluetooth layers and protocols. It
2931is flexible, efficient and uses a modular implementation.")
3ac73271 2932 (license license:gpl2+)))
3d890318
LC
2933
2934(define-public fuse-exfat
2935 (package
2936 (name "fuse-exfat")
be900082 2937 (version "1.2.7")
3d890318
LC
2938 (source (origin
2939 (method url-fetch)
c0cc805e
TGR
2940 (uri (string-append
2941 "https://github.com/relan/exfat/releases/download/v"
2942 version "/" name "-" version ".tar.gz"))
3d890318
LC
2943 (sha256
2944 (base32
be900082 2945 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
3d890318
LC
2946 (build-system gnu-build-system)
2947 (native-inputs
c0cc805e 2948 `(("pkg-config" ,pkg-config)))
3d890318
LC
2949 (inputs
2950 `(("fuse" ,fuse)))
c0cc805e 2951 (home-page "https://github.com/relan/exfat")
3d890318
LC
2952 (synopsis "Mount exFAT file systems")
2953 (description
2954 "This package provides a FUSE-based file system that provides read and
2955write access to exFAT devices.")
3ac73271 2956 (license license:gpl2+)))
53ec8d48
LC
2957
2958(define-public gpm
2959 (package
2960 (name "gpm")
2961 (version "1.20.7")
2962 (source (origin
2963 (method url-fetch)
2964 (uri (string-append
2965 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2966 version ".tar.bz2"))
2967 (sha256
2968 (base32
2969 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2970 (build-system gnu-build-system)
2971 (arguments
2972 '(#:phases (modify-phases %standard-phases
2973 (add-before 'configure 'bootstrap
2974 (lambda _
2975 ;; The tarball was not generated with 'make dist' so we
2976 ;; need to bootstrap things ourselves.
2977 (and (zero? (system* "./autogen.sh"))
2978 (begin
2979 (patch-makefile-SHELL "Makefile.include.in")
2980 #t)))))
2981
2982 ;; Make sure programs find libgpm.so.
2983 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2984 (assoc-ref %outputs "out")
2985 "/lib"))))
2986 (native-inputs
2987 `(("texinfo" ,texinfo)
2988 ("bison" ,bison)
2989 ("flex" ,flex)
2990 ("autoconf" ,autoconf)
2991 ("automake" ,automake)
2992 ("libtool" ,libtool)))
2993 (home-page "http://www.nico.schottelius.org/software/gpm/")
2994 (synopsis "Mouse support for the Linux console")
2995 (description
2996 "The GPM (general-purpose mouse) daemon is a mouse server for
2997applications running on the Linux console. It allows users to select items
2998and copy/paste text in the console and in xterm.")
3ac73271 2999 (license license:gpl2+)))
fc686f9a
TGR
3000
3001(define-public btrfs-progs
3002 (package
3003 (name "btrfs-progs")
acf82a11 3004 (version "4.11")
fc686f9a
TGR
3005 (source (origin
3006 (method url-fetch)
3007 (uri (string-append "mirror://kernel.org/linux/kernel/"
3008 "people/kdave/btrfs-progs/"
3009 "btrfs-progs-v" version ".tar.xz"))
3010 (sha256
3011 (base32
acf82a11 3012 "03mzv89f08gdsqv4ima793g44kdavcfyjialf5dr0zd2ab66hyp1"))))
fc686f9a 3013 (build-system gnu-build-system)
7cad981d
TGR
3014 (outputs '("out"
3015 "static")) ; static versions of binaries in "out" (~16MiB!)
fc686f9a 3016 (arguments
7cad981d
TGR
3017 '(#:phases (modify-phases %standard-phases
3018 (add-after 'build 'build-static
3019 (lambda _ (zero? (system* "make" "static"))))
3020 (add-after 'install 'install-static
3021 (let ((staticbin (string-append (assoc-ref %outputs "static")
3022 "/bin")))
3023 (lambda _
3024 (zero? (system* "make"
3025 (string-append "bindir=" staticbin)
3026 "install-static"))))))
3027 #:test-target "test"
fc686f9a
TGR
3028 #:parallel-tests? #f)) ; tests fail when run in parallel
3029 (inputs `(("e2fsprogs" ,e2fsprogs)
3030 ("libblkid" ,util-linux)
7cad981d 3031 ("libblkid:static" ,util-linux "static")
fc686f9a 3032 ("libuuid" ,util-linux)
7cad981d 3033 ("libuuid:static" ,util-linux "static")
fc686f9a
TGR
3034 ("zlib" ,zlib)
3035 ("lzo" ,lzo)))
3036 (native-inputs `(("pkg-config" ,pkg-config)
3037 ("asciidoc" ,asciidoc)
3038 ("xmlto" ,xmlto)
41d23dd1 3039 ;; For building documentation.
fc686f9a 3040 ("libxml2" ,libxml2)
48b7e4a6 3041 ("docbook-xsl" ,docbook-xsl)
41d23dd1 3042 ;; For tests.
48b7e4a6 3043 ("which" ,which)))
fc686f9a
TGR
3044 (home-page "https://btrfs.wiki.kernel.org/")
3045 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
3046 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3047aimed at implementing advanced features while focusing on fault tolerance,
3048repair and easy administration.")
68bcac6b
LF
3049 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3050 ;; GPL2: Everything else.
3051 (license (list license:gpl2 license:gpl2+))))
08e9daf5 3052
f3e44f5c
DC
3053(define-public btrfs-progs/static
3054 (package
3055 (name "btrfs-progs-static")
3056 (version (package-version btrfs-progs))
3057 (source #f)
3058 (build-system trivial-build-system)
3059 (inputs
3060 `(("btrfs-progs:static" ,btrfs-progs "static")))
3061 (arguments
3062 `(#:modules ((guix build utils))
3063 #:builder
3064 (begin
3065 (use-modules (guix build utils)
3066 (ice-9 ftw)
3067 (srfi srfi-26))
3068
3069 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3070 (out (assoc-ref %outputs "out"))
3071 (source (string-append btrfs "/bin/btrfs.static"))
3072 (target (string-append out "/bin/btrfs")))
3073 (mkdir-p (dirname target))
3074 (copy-file source target)
3075 (remove-store-references target)
3076 (chmod target #o555)))))
3077 (home-page (package-home-page btrfs-progs))
ff797172
TGR
3078 (synopsis "Statically-linked btrfs command from btrfs-progs")
3079 (description "This package provides the statically-linked @command{btrfs}
3080from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
3081 (license (package-license btrfs-progs))))
3082
08e9daf5
TGR
3083(define-public freefall
3084 (package
3085 (name "freefall")
3086 (version (package-version linux-libre))
3087 (source (package-source linux-libre))
3088 (build-system gnu-build-system)
3089 (arguments
3090 '(#:phases (modify-phases %standard-phases
3091 (add-after 'unpack 'enter-subdirectory
3092 (lambda _
3093 (chdir "tools/laptop/freefall")))
3094 (delete 'configure)
3095 (add-before 'build 'increase-timeout
3096 (lambda _
3097 ;; The default of 2 seconds is too low: it assumes an
3098 ;; open lid and AC power without actually checking.
3099 (substitute* "freefall.c"
3100 (("alarm\\(2\\)") "alarm(5)")))))
3101 #:make-flags (list (string-append "PREFIX="
3102 (assoc-ref %outputs "out")))
3103 #:tests? #f)) ;no tests
3104 (home-page (package-home-page linux-libre))
3105 (synopsis "Free-fall protection for spinning laptop hard drives")
3106 (description
3107 "Prevents shock damage to the internal spinning hard drive(s) of some
3108HP and Dell laptops. When sudden movement is detected, all input/output
3109operations on the drive are suspended and its heads are parked on the ramp,
3110where they are less likely to cause damage to the spinning disc. Requires a
3111drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3112feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3113 (license license:gpl2)))
d17ae8c0
NG
3114
3115(define-public thinkfan
3116 (package
3117 (name "thinkfan")
3118 (version "0.9.3")
3119 (source (origin
3120 (method url-fetch)
3121 (uri (string-append "mirror://sourceforge/thinkfan/"
de67e922 3122 "/thinkfan-" version ".tar.gz"))
d17ae8c0
NG
3123 (sha256
3124 (base32
3125 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3126 (modules '((guix build utils)))
3127 ;; Fix erroneous man page location in Makefile leading to
3128 ;; a compilation failure.
3129 (snippet
3130 '(substitute* "CMakeLists.txt"
3131 (("thinkfan\\.1") "src/thinkfan.1")))))
3132 (build-system cmake-build-system)
3133 (arguments
3134 `(#:modules ((guix build cmake-build-system)
3135 (guix build utils)
3136 (srfi srfi-26))
3137 #:tests? #f ;no test target
3138 #:configure-flags
3139 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3140 `("-DUSE_ATASMART:BOOL=ON")
3141 #:phases
3142 (modify-phases %standard-phases
75e56aed
NG
3143 ;; Install scripts for various foreign init systems. Also fix
3144 ;; hard-coded path for daemon.
d17ae8c0
NG
3145 (add-after 'install 'install-rc-scripts
3146 (lambda* (#:key outputs #:allow-other-keys)
75e56aed
NG
3147 (let ((out (assoc-ref outputs "out"))
3148 (files (find-files
3149 (string-append "../thinkfan-" ,version "/rcscripts")
3150 ".*")))
3151 (substitute* files
3152 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3153 (string-append out "/sbin/" name)))
3154 (for-each (cute install-file <>
3155 (string-append out "/share/thinkfan"))
3156 files))
d17ae8c0
NG
3157 #t)))))
3158 (inputs
3159 `(("libatasmart" ,libatasmart)))
3160 (home-page "http://thinkfan.sourceforge.net/")
3161 (synopsis "Simple fan control program")
3162 (description
3163 "Thinkfan is a simple fan control program. It reads temperatures,
3164checks them against configured limits and switches to appropriate (also
3165pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3166other @code{hwmon} driver that enables temperature reading and fan control
3167from userspace.")
3168 (license license:gpl3+)))
91231156
LC
3169
3170(define-public ntfs-3g
3171 (package
3172 (name "ntfs-3g")
3173 (version "2016.2.22")
3174 (source (origin
3175 (method url-fetch)
3176 (uri (string-append "https://tuxera.com/opensource/"
3177 "ntfs-3g_ntfsprogs-" version ".tgz"))
3178 (sha256
3179 (base32
3180 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3181 (modules '((guix build utils)))
1a82ba66 3182 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
91231156
LC
3183 (snippet
3184 ;; Install under $prefix.
3185 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3186 (("/sbin")
3187 "@sbindir@")))))
3188 (build-system gnu-build-system)
3189 (inputs `(("util-linux" ,util-linux)
3190 ("fuse" ,fuse))) ;libuuid
3191 (native-inputs `(("pkg-config" ,pkg-config)))
3192 (arguments
3193 '(#:configure-flags (list "--exec-prefix=${prefix}"
3194 "--with-fuse=external" ;use our own FUSE
3195 "--enable-mount-helper"
3196 "--enable-posix-acls"
3197 "--enable-xattr-mappings")))
3198 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3199 (synopsis "Read-write access to NTFS file systems")
3200 (description
3201 "NTFS-3G provides read-write access to NTFS file systems, which are
3202commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3203The package provides additional NTFS tools.")
3204 (license license:gpl2+)))
9b0942c1 3205
f8f44dd7
MB
3206(define-public rdma-core
3207 (package
3208 (name "rdma-core")
3209 (version "13")
3210 (source (origin
3211 (method url-fetch)
3212 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3213 "/releases/download/v" version "/rdma-core-"
3214 version ".tar.gz"))
3215 (sha256
3216 (base32
3217 "15qdfqkia22vab1dh41s88vgi70yifi40ar5s4x7a456rpbhy8z5"))))
3218 (build-system cmake-build-system)
3219 (arguments
3220 '(#:tests? #f ; no tests
3221 ;; Upstream uses the "ninja" build system and encourage distros
3222 ;; to do the same for consistency. They also recommend using the
3223 ;; "Release" build type.
3224 #:configure-flags (list "-GNinja"
3225 ;; Defaults to "lib64" on 64-bit archs.
3226 (string-append "-DCMAKE_INSTALL_LIBDIR="
3227 (assoc-ref %outputs "out") "/lib")
3228 "-DCMAKE_BUILD_TYPE=Release")
3229 #:phases
3230 (modify-phases %standard-phases
3231 (replace 'build
3232 (lambda _
3233 (zero? (system* "ninja"
3234 "-j" (number->string (parallel-job-count))))))
3235 (replace 'install
3236 (lambda _
3237 (zero? (system* "ninja" "install")))))))
3238 (native-inputs
3239 `(("ninja" ,ninja)
3240 ("pkg-config" ,pkg-config)
3241 ("python" ,python-wrapper)))
3242 (inputs
3243 `(("libnl" ,libnl)
3244 ("udev" ,eudev)))
3245 (home-page "https://github.com/linux-rdma/rdma-core")
3246 (synopsis "Utilities and libraries for working with RDMA devices")
3247 (description
3248 "This package provides userspace components for the InfiniBand
3249subsystem of the Linux kernel. Specifically it contains userspace
3250libraries for the following device nodes:
3251
3252@enumerate
3253@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3254@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3255@item @file{/dev/infiniband/umadX} (@code{libibumad})
3256@end enumerate
3257
3258The following service daemons are also provided:
3259@enumerate
3260@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3261@item @code{iwpmd} (for iWARP kernel providers)
3262@item @code{ibacm} (for InfiniBand communication management assistant)
3263@end enumerate")
3264 ;; All library code is dual licensed under GPL2 and a custom MIT
3265 ;; variant. The package also includes some components covered by
3266 ;; other licenses. Consult COPYING.md for full details.
3267 (license
3268 (list license:gpl2
3269 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3270 license:bsd-2 ; Files referring to COPYING.BSD_FB
3271 license:cc0 ; most files in ccan/
3272 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3273
9b0942c1
DC
3274(define-public rng-tools
3275 (package
3276 (name "rng-tools")
3277 (version "5")
3278 (source (origin
3279 (method url-fetch)
3280 (uri (string-append
3281 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3282 "rng-tools-" version ".tar.gz"))
3283 (sha256
3284 (base32
3285 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3286 (build-system gnu-build-system)
3287 (synopsis "Random number generator daemon")
3288 (description
3289 "Monitor a hardware random number generator, and supply entropy
3290from that to the system kernel's @file{/dev/random} machinery.")
3b3b60d0 3291 (home-page "https://sourceforge.net/projects/gkernel")
9b0942c1
DC
3292 ;; The source package is offered under the GPL2+, but the files
3293 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3294 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
3295
3296(define-public cpupower
3297 (package
3298 (name "cpupower")
3299 (version (package-version linux-libre))
3300 (source (package-source linux-libre))
3301 (build-system gnu-build-system)
3302 (arguments
3303 '(#:phases (modify-phases %standard-phases
3304 (add-after 'unpack 'enter-subdirectory
3305 (lambda _
3306 (chdir "tools/power/cpupower")))
3307 (delete 'configure)
3308 (add-before 'build 'fix-makefiles
3309 (lambda _
3310 (substitute* "Makefile"
3311 (("/usr/") "/")
3312 (("/bin/(install|pwd)" _ command) command))
3313 (substitute* "bench/Makefile"
3314 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3315 #:make-flags (let ((out (assoc-ref %outputs "out")))
3316 (list (string-append "DESTDIR=" out)
3317 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3318 "docdir=/share/doc/cpupower"
3319 "confdir=$(docdir)/examples"
3320 ;; The Makefile recommends the following changes
3321 "DEBUG=false"
3322 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3323 #:tests? #f)) ;no tests
b94a6ca0 3324 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
3325 (inputs `(("pciutils" ,pciutils)))
3326 (home-page (package-home-page linux-libre))
3327 (synopsis "CPU frequency and voltage scaling tools for Linux")
3328 (description
3329 "cpupower is a set of user-space tools that use the cpufreq feature of the
3330Linux kernel to retrieve and control processor features related to power saving,
3331such as frequency and voltage scaling.")
3332 (license license:gpl2)))
2b76f135
TGR
3333
3334(define-public haveged
3335 (package
3336 (name "haveged")
3337 (version "1.9.1")
3338 (source
3339 (origin
3340 (method url-fetch)
3341 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3342 version ".tar.gz"))
3343 (sha256
3344 (base32
3345 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3346 (build-system gnu-build-system)
3347 (home-page "http://www.issihosts.com/haveged")
3348 (synopsis "Entropy source for the Linux random number generator")
3349 (description
3350 "haveged generates an unpredictable stream of random numbers for use by
3351Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3352standard mechanisms for filling the entropy pool may not be sufficient for
3353systems with high needs or limited user interaction, such as headless servers.
3354@command{haveged} runs as a privileged daemon, harvesting randomness from the
3355indirect effects of hardware events on hidden processor state using the HArdware
3356Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3357its environment and provides the same built-in test suite for the output stream
3358as used on certified hardware security devices.")
3359 (license (list (license:non-copyleft "file://nist/mconf.h")
3360 (license:non-copyleft "file://nist/packtest.c")
3361 license:public-domain ; nist/dfft.c
3362 license:gpl3+)))) ; everything else
e385e957
TGR
3363
3364(define-public ecryptfs-utils
3365 (package
3366 (name "ecryptfs-utils")
3367 (version "111")
3368 (source
3369 (origin
3370 (method url-fetch)
3371 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3372 version "/+download/ecryptfs-utils_"
3373 version ".orig.tar.gz"))
3374 (sha256
3375 (base32
3376 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3377 (build-system gnu-build-system)
3378 (arguments
3379 `(#:configure-flags (list "--disable-pywrap")))
3380 (native-inputs
3381 `(("intltool" ,intltool)
3382 ("perl" ,perl) ; for pod2man
3383 ("pkg-config" ,pkg-config)))
3384 (inputs
3385 `(("keyutils" ,keyutils)
3386 ("linux-pam" ,linux-pam)
3387 ("nss" ,nss)))
3388 (home-page "http://ecryptfs.org/")
3389 (synopsis "eCryptfs cryptographic file system utilities")
3390 (description
3391 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3392Each file's cryptographic meta-data is stored inside the file itself, along
3393with the encrypted contents. This allows individual encrypted files to be
3394copied between hosts and still be decrypted with the proper key. eCryptfs is a
3395native Linux file system, and has been part of the Linux kernel since version
33962.6.19. This package contains the userland utilities to manage it.")
3397 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3398 ;; grant additional permission to link with OpenSSL.
3399 (license license:gpl2+)))
cff0adec
DC
3400
3401(define-public libnfsidmap
3402 (package
3403 (name "libnfsidmap")
3404 (version "0.25")
3405 (source (origin
3406 (method url-fetch)
3407 (uri (string-append
3408 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3409 name "/" name "-" version ".tar.gz"))
3410 (sha256
3411 (base32
3412 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3413 (build-system gnu-build-system)
3414 (arguments
3415 `(#:configure-flags (list
3416 (string-append "--with-pluginpath="
3417 (assoc-ref %outputs "out")
3418 "/lib/libnfsidmap"))))
3419 (home-page
3420 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3421 (synopsis
3422 "NFSv4 support library for name/ID mapping")
3423 (description "Libnfsidmap is a library holding mulitiple methods of
3424mapping names to ids and visa versa, mainly for NFSv4. It provides an
3425extensible array of mapping functions, currently consisting of two choices:
3426the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3427 (license (license:non-copyleft "file://COPYING"
3428 "See COPYING in the distribution."))))
035d3593
DC
3429
3430(define-public module-init-tools
3431 (package
3432 (name "module-init-tools")
3433 (version "3.16")
3434 (source (origin
3435 (method url-fetch)
3436 (uri (string-append
3437 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3438 "module-init-tools-" version ".tar.bz2"))
3439 (sha256
3440 (base32
3441 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3442 (patches (search-patches "module-init-tools-moduledir.patch"))))
3443 (build-system gnu-build-system)
3444 (arguments
3445 ;; FIXME: The upstream tarball lacks man pages, and building them would
3446 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3447 ;; but they vanished. In the meantime, fake it.
3448 '(#:phases (alist-cons-before
3449 'configure 'fake-docbook
3450 (lambda _
3451 (substitute* "Makefile.in"
3452 (("^DOCBOOKTOMAN.*$")
3453 "DOCBOOKTOMAN = true\n")))
3454 %standard-phases)))
3455 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3456 (synopsis "Tools for loading and managing Linux kernel modules")
3457 (description
3458 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3459`insmod', `lsmod', and more.")
3460 (license license:gpl2+)))
dd65f3b7
TGR
3461
3462(define-public mcelog
3463 (package
3464 (name "mcelog")
783467ae 3465 (version "153")
dd65f3b7
TGR
3466 (source (origin
3467 (method url-fetch)
3468 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3469 "mcelog.git/snapshot/v" version ".tar.gz"))
3470 (sha256
3471 (base32
783467ae 3472 "0q40d60p1klzg0aznvxhxgjlddwcxfj2q59s4q86sf9ild6rcdhl"))
dd65f3b7
TGR
3473 (file-name (string-append name "-" version ".tar.gz"))
3474 (modules '((guix build utils)))
3475 (snippet
3476 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3477 `(substitute* "Makefile"
3478 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3479 (build-system gnu-build-system)
3480 (arguments
3481 `(#:phases (modify-phases %standard-phases
3482 (delete 'configure)) ; no configure script
3483 #:make-flags (let ((out (assoc-ref %outputs "out")))
3484 (list "CC=gcc"
3485 (string-append "prefix=" out)
3486 (string-append "DOCDIR=" out "/share/doc/mcelog")
3487 "etcprefix=$(DOCDIR)/examples"))
3488 ;; The tests will only run as root on certain supported CPU models.
3489 #:tests? #f))
3490 (supported-systems (list "i686-linux" "x86_64-linux"))
3491 (home-page "http://mcelog.org/")
3492 (synopsis "Machine check monitor for x86 Linux systems")
3493 (description
3494 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3495and other hardware errors on x86 systems. It can also perform user-defined
3496tasks, such as bringing bad pages off-line, when configurable error thresholds
3497are exceeded.")
3498 (license license:gpl2)))
0c60cc53
DM
3499
3500(define-public mtd-utils
3501 (package
3502 (name "mtd-utils")
3503 (version "1.5.2")
3504 (source (origin
3505 (method url-fetch)
3506 (uri (string-append
3507 "ftp://ftp.infradead.org/pub/mtd-utils/"
3508 "mtd-utils-" version ".tar.bz2"))
3509 (sha256
3510 (base32
3511 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3512 (inputs
3513 `(("acl" ,acl)
3514 ("libuuid" ,util-linux)
3515 ("lzo", lzo)
3516 ("zlib" ,zlib)))
3517 (build-system gnu-build-system)
3518 (arguments
3519 `(#:test-target "tests"
3520 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3521 #:phases (modify-phases %standard-phases
3522 (delete 'configure))))
3523 (synopsis "MTD Flash Storage Utilities")
3524 (description "This package provides utilities for testing, partitioning, etc
3525of flash storage.")
3526 (home-page "http://www.linux-mtd.infradead.org/")
3527 (license
3528 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3529 license:mpl1.1 ; All ftl* files
3530 license:expat)))) ; libiniparser
def6213f
LF
3531
3532(define-public libseccomp
3533 (package
3534 (name "libseccomp")
488a3734 3535 (version "2.3.2")
def6213f
LF
3536 (source (origin
3537 (method url-fetch)
3538 (uri (string-append "https://github.com/seccomp/libseccomp/"
3539 "releases/download/v" version
3540 "/libseccomp-" version ".tar.gz"))
3541 (sha256
3542 (base32
488a3734 3543 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
def6213f
LF
3544 (build-system gnu-build-system)
3545 (native-inputs
3546 `(("which" ,which)))
3547 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3548 (description "The libseccomp library provides an easy to use, platform
3549independent, interface to the Linux Kernel's syscall filtering mechanism. The
3550libseccomp API is designed to abstract away the underlying BPF based syscall
3551filter language and present a more conventional function-call based filtering
3552interface that should be familiar to, and easily adopted by, application
3553developers.")
3554 (home-page "https://github.com/seccomp/libseccomp")
3555 (license license:lgpl2.1)))
58c4f11e
TGR
3556
3557(define-public radeontop
3558 (package
3559 (name "radeontop")
a7c61512 3560 (version "1.0")
58c4f11e
TGR
3561 (home-page "https://github.com/clbr/radeontop/")
3562 (source (origin
3563 (method url-fetch)
a7c61512 3564 (uri (string-append home-page "archive/v" version ".tar.gz"))
58c4f11e
TGR
3565 (file-name (string-append name "-" version ".tar.gz"))
3566 (sha256
3567 (base32
a7c61512 3568 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
58c4f11e
TGR
3569 (build-system gnu-build-system)
3570 (arguments
3571 `(#:phases (modify-phases %standard-phases
3572 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3573 ;; dependency, and doesn't even work on release(!) tarballs.
3574 (add-after 'unpack 'report-correct-version
3575 (lambda _ (substitute* "getver.sh"
3576 (("ver=unknown")
3577 (string-append "ver=" ,version)))))
3578 (delete 'configure)) ; no configure script
3579 #:make-flags (list "CC=gcc"
3580 (string-append "PREFIX=" %output))
3581 #:tests? #f)) ; no tests
3582 (native-inputs
7c90d0f4 3583 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
3584 ("pkg-config" ,pkg-config)))
3585 (inputs
3586 `(("libdrm" ,libdrm)
3587 ("libpciaccess" ,libpciaccess)
a7c61512 3588 ("libxcb" ,libxcb)
58c4f11e
TGR
3589 ("ncurses" ,ncurses)))
3590 (synopsis "Usage monitor for AMD Radeon graphics")
3591 (description "RadeonTop monitors resource consumption on supported AMD
3592Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3593a terminal or saved to a file for further processing. It measures both the
3594activity of the GPU as a whole, which is also accurate during OpenCL
3595computations, as well as separate component statistics that are only meaningful
3596under OpenGL graphics workloads.")
3597 (license license:gpl3)))
0d74462a
MB
3598
3599(define-public efivar
3600 (package
3601 (name "efivar")
3602 (version "30")
3603 (source (origin
3604 (method url-fetch)
3605 (uri (string-append "https://github.com/rhinstaller/" name
3606 "/releases/download/" version "/" name
3607 "-" version ".tar.bz2"))
3608 (sha256
3609 (base32
3610 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3611 (build-system gnu-build-system)
3612 (arguments
3613 `(;; Tests require a UEFI system and is not detected in the chroot.
3614 #:tests? #f
3615 #:make-flags (list (string-append "prefix=" %output)
3616 (string-append "libdir=" %output "/lib")
3617 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3618 #:phases
3619 (modify-phases %standard-phases
3620 (delete 'configure))))
3621 (native-inputs
3622 `(("pkg-config" ,pkg-config)))
3623 (inputs
3624 `(("popt" ,popt)))
3625 (home-page "https://github.com/rhinstaller/efivar")
3626 (synopsis "Tool and library to manipulate EFI variables")
3627 (description "This package provides a library and a command line
3628interface to the variable facility of UEFI boot firmware.")
3629 (license license:lgpl2.1+)))
1581406e
MB
3630
3631(define-public efibootmgr
3632 (package
3633 (name "efibootmgr")
3634 (version "14")
3635 (source (origin
3636 (method url-fetch)
3637 (uri (string-append "https://github.com/rhinstaller/" name
3638 "/releases/download/" version "/" name
3639 "-" version ".tar.bz2"))
3640 (sha256
3641 (base32
3642 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3643 (build-system gnu-build-system)
3644 (arguments
3645 `(#:tests? #f ; No tests.
3646 #:make-flags (list (string-append "prefix=" %output)
3647 (string-append "libdir=" %output "/lib")
3648 ;; Override CFLAGS to add efivar include directory.
3649 (string-append "CFLAGS=-O2 -g -flto -I"
3650 (assoc-ref %build-inputs "efivar")
3651 "/include/efivar"))
3652 #:phases
3653 (modify-phases %standard-phases
3654 (add-after 'unpack 'branding
3655 ;; Replace default loader path with something more familiar.
3656 (lambda _
3657 (substitute* "src/efibootmgr.c"
3658 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3659 "EFI\\\\gnu"))
3660 #t))
3661 (delete 'configure))))
3662 (native-inputs
3663 `(("pkg-config" ,pkg-config)))
3664 (inputs
3665 `(("efivar" ,efivar)
3666 ("popt" ,popt)))
3667 (home-page "https://github.com/rhinstaller/efibootmgr")
3668 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3669 (description
3670 "@code{efibootmgr} is a user-space application to modify the Intel
3671Extensible Firmware Interface (EFI) Boot Manager. This application can
3672create and destroy boot entries, change the boot order, change the next
3673running boot option, and more.")
3674 (license license:gpl2+)))
6d3e08d4
LF
3675
3676(define-public sysstat
3677 (package
3678 (name "sysstat")
70443013 3679 (version "11.4.3")
6d3e08d4
LF
3680 (source (origin
3681 (method url-fetch)
3682 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3683 "sysstat-" version ".tar.xz"))
3684 (sha256
3685 (base32
70443013 3686 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
6d3e08d4
LF
3687 (build-system gnu-build-system)
3688 (arguments
3689 `(#:tests? #f ; No test suite.
3690 ;; Without this flag, it tries to install the man pages with group 'root'
3691 ;; and fails because /etc/passwd lacks an entry for the root user.
3692 #:configure-flags
3693 (list "--disable-file-attr"
3694 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3695 #:phases
3696 (modify-phases %standard-phases
3697 ;; The build process tries to create '/var/lib/sa', so we skip that
3698 ;; instruction.
3699 (add-after 'build 'skip-touching-var
3700 (lambda _
3701 (substitute* "Makefile"
3702 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3703 ""))
3704 #t)))))
3705 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3706 (synopsis "Performance monitoring tools for Linux")
3707 (description "The sysstat utilities are a collection of performance
3708monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3709@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3710@code{sadf} and @code{sa}.")
3711 (license license:gpl2+)))
01be4f93
JMSG
3712
3713(define-public light
3714 (package
3715 (name "light")
3716 (version "1.0")
3717 (source (origin
3718 (method url-fetch)
3719 (uri (string-append "https://github.com/haikarainen/" name
3720 "/archive/v" version ".tar.gz"))
3721 (sha256
3722 (base32
3723 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3724 (file-name (string-append name "-" version ".tar.gz"))))
3725 (build-system gnu-build-system)
3726 (arguments
3727 '(#:tests? #f ; no tests
3728 #:make-flags (list "CC=gcc"
3729 (string-append "PREFIX=" %output))
3730 #:phases
3731 (modify-phases %standard-phases
3732 (delete 'configure)
3733 (add-after 'unpack 'patch-makefile
3734 (lambda _
3735 (substitute* "Makefile" (("chown") "#")))))))
3736 (native-inputs
3737 `(("help2man" ,help2man)))
3738 (home-page "https://haikarainen.github.io/light")
3739 (synopsis "GNU/Linux application to control backlights")
3740 (description
3741 "Light is a program to send commands to screen backlight controllers
3742under GNU/Linux. Features include:
3743
3744@itemize
3745@item It does not rely on X.
3746@item Light can automatically figure out the best controller to use, making
3747full use of underlying hardware.
3748@item It is possible to set a minimum brightness value, as some controllers
3749set the screen to be pitch black at a vaĺue of 0 (or higher).
3750@end itemize
3751
3752Light is the successor of lightscript.")
3753 (license license:gpl3+)))
189d8422 3754
c7adafa7
MO
3755(define-public tlp
3756 (package
3757 (name "tlp")
3758 (version "0.9")
3759 (source (origin
3760 (method url-fetch)
3761 (uri (string-append
3762 "https://github.com/linrunner/"
3763 (string-upcase name)
3764 "/archive/" version ".tar.gz"))
3765 (file-name (string-append name "-" version ".tar.gz"))
3766 (sha256
3767 (base32
3768 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3769 (inputs `(("bash" ,bash)
3770 ("dbus" ,dbus)
3771 ("ethtool" ,ethtool)
3772 ("eudev" ,eudev)
3773 ("grep" ,grep)
3774 ("hdparm" ,hdparm)
3775 ("inetutils" ,inetutils)
3776 ("iw" ,iw)
3777 ("kmod" ,kmod)
3778 ("pciutils" ,pciutils)
3779 ("perl" ,perl)
3780 ("rfkill" ,rfkill)
3781 ("sed" ,sed)
3782 ("usbutils" ,usbutils)
3783 ("util-linux" ,util-linux)
3784 ("wireless-tools" ,wireless-tools)))
3785 (build-system gnu-build-system)
3786 (arguments
3787 `(#:phases
3788 (modify-phases %standard-phases
cef3f146 3789 (delete 'configure) ; no configure script
c7adafa7
MO
3790 (add-before 'build 'setenv
3791 (lambda* (#:key outputs #:allow-other-keys)
3792 (let ((out (assoc-ref outputs "out")))
3793 (setenv "TLP_WITH_SYSTEMD" "0")
3794 (setenv "TLP_NO_INIT" "1")
3795 (setenv "TLP_NO_PMUTILS" "1")
3796 (setenv "TLP_SBIN" (string-append out "/bin"))
3797 (setenv "TLP_BIN" (string-append out "/bin"))
3798 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3799 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
32e75b48 3800 (setenv "TLP_CONF" "/etc/tlp")
c7adafa7
MO
3801 (setenv "TLP_SHCPL"
3802 (string-append out "/share/bash-completion/completions"))
3803 (setenv "TLP_MAN" (string-append out "/share/man")))))
cef3f146
TGR
3804 (delete 'check) ; no tests
3805 (add-before 'install 'fix-installation
3806 (lambda _
3807 ;; Stop the Makefile from trying to create system directories.
3808 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
c7adafa7
MO
3809 (replace 'install
3810 (lambda _
cef3f146 3811 (zero? (system* "make" "install-tlp" "install-man"))))
c7adafa7
MO
3812 (add-after 'install 'wrap
3813 (lambda* (#:key inputs outputs #:allow-other-keys)
3814 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3815 (bin-files (find-files bin ".*")))
3816 (define (bin-directory input-name)
3817 (string-append (assoc-ref inputs input-name) "/bin"))
3818 (define (sbin-directory input-name)
3819 (string-append (assoc-ref inputs input-name) "/sbin"))
3820 (for-each (lambda (program)
3821 (wrap-program program
3822 `("PATH" ":" prefix
3823 ,(append
3824 (map bin-directory '("bash"
3825 "coreutils"
3826 "dbus"
3827 "eudev"
3828 "grep"
3829 "inetutils"
3830 "kmod"
3831 "perl"
3832 "sed"
3833 "usbutils"
3834 "util-linux"))
3835 (map sbin-directory '("ethtool"
3836 "hdparm"
3837 "iw"
3838 "pciutils"
3839 "rfkill"
3840 "wireless-tools"))))))
3841 bin-files)))))))
3842 (home-page "http://linrunner.de/en/tlp/tlp.html")
3843 (synopsis "Power management tool for Linux")
3844 (description "TLP is a power management tool for Linux. It comes with
3845a default configuration already optimized for battery life. Nevertheless,
3846TLP is customizable to fulfil system requirements. TLP settings are applied
3847every time the power supply source is changed.")
3848
3849 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3850 ;; rest is GPLv2+.
3851 (license (list license:gpl2+ license:gpl3+))))
3852
189d8422
BG
3853(define-public lshw
3854 (package
3855 (name "lshw")
3856 (version "B.02.18")
3857 (source (origin
3858 (method url-fetch)
3859 (uri (string-append "https://www.ezix.org/software/"
3860 "files/lshw-" version
3861 ".tar.gz"))
3862 (sha256
3863 (base32
3864 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3865 (build-system gnu-build-system)
3866 (arguments
3867 `(#:phases (modify-phases %standard-phases (delete 'configure))
3868 #:tests? #f ; no tests
3869 #:make-flags
3870 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3871 (synopsis "List hardware information")
3872 (description
3873 "@command{lshw} (Hardware Lister) is a small tool to provide
3874detailed information on the hardware configuration of the machine.
3875It can report exact memory configuration, firmware version, mainboard
3876configuration, CPU version and speed, cache configuration, bus speed,
3877and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3878machines (PowerMac G4 is known to work).")
3879 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3880 (license license:gpl2+)))
2f4a58b5
LF
3881
3882(define-public libmnl
3883 (package
3884 (name "libmnl")
3885 (version "1.0.4")
3886 (source
3887 (origin
3888 (method url-fetch)
f11ae44f 3889 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
3890 "libmnl-" version ".tar.bz2"))
3891 (sha256
3892 (base32
3893 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
3894 (build-system gnu-build-system)
3895 (home-page "https://www.netfilter.org/projects/libmnl/")
3896 (synopsis "Netlink utility library")
3897 (description "Libmnl is a minimalistic user-space library oriented to
3898Netlink developers. There are a lot of common tasks in parsing, validating,
3899constructing of both the Netlink header and TLVs that are repetitive and easy to
3900get wrong. This library aims to provide simple helpers that allows you to
3901re-use code and to avoid re-inventing the wheel.")
3902 (license license:lgpl2.1+)))
b754c612
LF
3903
3904(define-public libnftnl
3905 (package
3906 (name "libnftnl")
3907 (version "1.0.7")
3908 (source
3909 (origin
3910 (method url-fetch)
f11ae44f 3911 (uri (string-append "mirror://netfilter.org/libnftnl/"
b754c612
LF
3912 "libnftnl-" version ".tar.bz2"))
3913 (sha256
3914 (base32
3915 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
3916 (build-system gnu-build-system)
3917 (native-inputs
3918 `(("pkg-config" ,pkg-config)))
3919 (inputs
3920 `(("libmnl" ,libmnl)))
3921 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
3922 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
3923 (description "Libnftnl is a userspace library providing a low-level netlink
3924programming interface to the in-kernel nf_tables subsystem. The library
3925libnftnl has been previously known as libnftables. This library is currently
3926used by nftables.")
3927 (license license:gpl2+)))
62b28c0e 3928
dfe93c9a
RH
3929(define-public nftables
3930 (package
3931 (name "nftables")
3932 (version "0.7")
3933 (source
3934 (origin
3935 (method url-fetch)
3936 (uri (string-append "http://www.nftables.org/projects/nftables"
3937 "/files/nftables-" version ".tar.bz2"))
3938 (sha256
3939 (base32
3940 "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy"))))
3941 (build-system gnu-build-system)
3942 (inputs `(("bison", bison)
3943 ("flex", flex)
3944 ("gmp", gmp)
3945 ("libmnl", libmnl)
3946 ("libnftnl", libnftnl)
3947 ("readline", readline)))
3948 (native-inputs `(("pkg-config", pkg-config)))
3949 (home-page "http://www.nftables.org")
3950 (synopsis "Userspace utility for Linux packet filtering")
3951 (description "nftables is the project that aims to replace the existing
3952{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
3953filtering framework, a new userspace utility and also a compatibility layer for
3954{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
3955infrastructure such as the existing hooks, the connection tracking system, the
3956userspace queueing component and the logging subsystem.")
3957 (license license:gpl2)))
3958
62b28c0e
LC
3959(define-public proot
3960 (package
3961 (name "proot")
3962 (version "5.1.0")
3963 (home-page "https://github.com/proot-me/PRoot")
3964 (source (origin
3965 (method url-fetch)
3966 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3967 (file-name (string-append name "-" version ".tar.gz"))
3968 (sha256
3969 (base32
3970 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
3971 (patches (search-patches "proot-test-fhs.patch"))))
3972 (build-system gnu-build-system)
3973 (arguments
3974 '(#:make-flags '("-C" "src")
3975
3976 #:phases (modify-phases %standard-phases
3977 (delete 'configure)
3978 (add-before 'build 'set-shell-file-name
3979 (lambda* (#:key inputs #:allow-other-keys)
3980 (substitute* (find-files "src" "\\.[ch]$")
3981 (("\"/bin/sh\"")
3982 (string-append "\""
3983 (assoc-ref inputs "bash")
3984 "/bin/sh\"")))
3985 #t))
3986 (add-before 'check 'fix-fhs-assumptions-in-tests
3987 (lambda _
3988 (substitute* "tests/test-c6b77b77.mk"
3989 (("/bin/bash") (which "bash"))
3990 (("/usr/bin/test") (which "test")))
3991 (substitute* '("tests/test-16573e73.c")
3992 (("/bin/([a-z-]+)" _ program)
3993 (which program)))
3994
3995 (substitute* (find-files "tests" "\\.sh$")
3996 ;; Some of the tests try to "bind-mount" /bin/true.
3997 (("-b /bin/true:")
3998 (string-append "-b " (which "true") ":"))
3999 ;; Likewise for /bin.
4000 (("-b /bin:") "-b /gnu:")
4001 ;; Others try to run /bin/sh.
4002 (("/bin/sh") (which "sh"))
4003 ;; Others assume /etc/fstab exists.
4004 (("/etc/fstab") "/etc/passwd"))
4005
4006 (substitute* "tests/GNUmakefile"
4007 (("-b /bin:") "-b /gnu:"))
4008
4009 ;; XXX: This test fails in an obscure corner case, just
4010 ;; skip it.
4011 (delete-file "tests/test-kkkkkkkk.c")
4012
4013 #t))
4014 (replace 'check
4015 (lambda _
4016 (let ((n (parallel-job-count)))
4017 ;; For some reason we get lots of segfaults with
4018 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4019 (setenv "PROOT_NO_SECCOMP" "1")
4020
4021 ;; Most of the tests expect "/bin" to be in $PATH so
4022 ;; they can run things that live in $ROOTFS/bin.
4023 (setenv "PATH"
4024 (string-append (getenv "PATH") ":/bin"))
4025
4026 (zero? (system* "make" "check" "-C" "tests"
4027 ;;"V=1"
4028 "-j" (number->string n))))))
4029 (replace 'install
4030 (lambda* (#:key outputs #:allow-other-keys)
4031 ;; The 'install' rule does nearly nothing.
4032 (let ((out (assoc-ref outputs "out")))
4033 (and (zero?
4034 ;; TODO: 'make install-care' (does not even
4035 ;; build currently.)
4036 (system* "make" "-C" "src" "install"
4037 (string-append "PREFIX=" out)))
02084762
LC
4038 (let ((man1 (string-append out
4039 "/share/man/man1")))
4040 (mkdir-p man1)
4041 (copy-file "doc/proot/man.1"
4042 (string-append man1 "/proot.1"))
62b28c0e
LC
4043 #t))))))))
4044 (native-inputs `(("which" ,which)
4045
4046 ;; For 'mcookie', used by some of the tests.
4047 ("util-linux" ,util-linux)))
4048 (inputs `(("talloc" ,talloc)))
4049 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4050 (description
4051 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4052and @code{binfmt_misc}. This means that users don't need any privileges or
4053setup to do things like using an arbitrary directory as the new root
4054filesystem, making files accessible somewhere else in the file system
4055hierarchy, or executing programs built for another CPU architecture
4056transparently through QEMU user-mode. Also, developers can use PRoot as a
4057generic process instrumentation engine thanks to its extension mechanism.
4058Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4059available in the kernel Linux.")
4060 (license license:gpl2+)))
b9048a14
LC
4061
4062(define-public proot-static
4063 (package
4064 (inherit proot)
4065 (name "proot-static")
4066 (synopsis
4067 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4068 (inputs `(("talloc" ,talloc/static)))
4069 (arguments
4070 (substitute-keyword-arguments (package-arguments proot)
4071 ((#:make-flags flags)
4072 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4073 ((#:phases phases)
4074 `(modify-phases ,phases
4075 (add-after 'strip 'remove-store-references
4076 (lambda* (#:key outputs #:allow-other-keys)
4077 (let* ((out (assoc-ref outputs "out")))
4078 (with-directory-excursion out
4079 (remove-store-references "bin/proot")
4080 #t))))))
4081 ((#:allowed-references _ '("out"))
4082 '("out"))))))
1113386b
CL
4083
4084(define-public cpuid
4085 (package
4086 (name "cpuid")
4087 (version "20170122")
4088 (source (origin
4089 (method url-fetch)
4090 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4091 version ".src.tar.gz"))
4092 (sha256
4093 (base32
4094 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4095 (build-system gnu-build-system)
4096 (arguments
4097 '(#:make-flags '("CC=gcc")
4098 #:tests? #f ; no tests
4099 #:phases (modify-phases %standard-phases
4100 (delete 'configure)
4101 (add-before 'install 'fix-makefile
4102 (lambda* (#:key outputs #:allow-other-keys)
4103 (substitute* "Makefile"
4104 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4105 ;; Make the compressed manpages writable so that the
4106 ;; reset-gzip-timestamps phase does not error out.
4107 (substitute* "Makefile"
4108 (("-m 444") "-m 644"))
4109 #t)))))
4110 (inputs `(("perl" ,perl)))
4111 (supported-systems '("i686-linux" "x86_64-linux"))
4112 (home-page "http://www.etallen.com/cpuid.html")
4113 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4114 (description "cpuid dumps detailed information about the CPU(s) gathered
4115from the CPUID instruction, and also determines the exact model of CPU(s). It
4116supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4117NexGen, Rise, and SiS CPUs.")
4118 (license license:gpl2+)))
afc9d8ec
LF
4119
4120(define-public jmtpfs
4121 (package
4122 (name "jmtpfs")
4123 (version "0.5")
4124 (source
4125 (origin
4126 (method url-fetch)
4127 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4128 version ".tar.gz"))
4129 (file-name (string-append name "-" version ".tar.gz"))
4130 (sha256
4131 (base32
4132 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4133 (build-system gnu-build-system)
4134 (inputs
4135 `(("file" ,file)
4136 ("fuse" ,fuse)
4137 ("libmtp" ,libmtp)))
4138 (native-inputs
4139 `(("pkg-config" ,pkg-config)))
4140 (home-page "https://github.com/JasonFerrara/jmtpfs")
4141 (synopsis "Use a FUSE filesystem to access data over MTP")
4142 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4143to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4144the MTP device as a filesystem.")
4145 (license license:gpl3)))
a73e7dd3
DL
4146
4147(define-public procenv
4148 (package
4149 (name "procenv")
4150 (version "0.49")
4151 (source
4152 (origin
4153 (method url-fetch)
4154 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4155 version ".tar.gz"))
4156 (file-name (string-append name "-" version ".tar.gz"))
4157 (sha256
4158 (base32 "0brzf6185hb76imw107cl21c8lzwiywkxi3jknihrk86bvvicd0d"))))
4159 (build-system gnu-build-system)
4160 (arguments `(#:configure-flags '("--disable-silent-rules")))
4161 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4162 ("groff" ,groff) ; for tests
4163 ("libselinux" ,libselinux)))
4164 (synopsis "Utility to show process environment")
4165 (description "Procenv is a command-line tool that displays as much detail about
4166itself and its environment as possible. It can be used as a test
4167tool, to understand the type of environment a process runs in, and for
4168comparing system environments.")
4169 (home-page "http://github.com/jamesodhunt/procenv/")
4170 (license license:gpl3+)))