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