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