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