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