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