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