gnu: foomatic-filters: Add missing patches.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
74d21291 2;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
35dfcdd7 3;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
233e7676 4;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
75fd35b6 5;;; Copyright © 2014, 2015, 2016, 2017 Mark H Weaver <mhw@netris.org>
31aa4379 6;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
e1e27737 7;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
e77fe950 8;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
1348185a 9;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
cd7caa3e 10;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me@tobias.gr>
7994250f 11;;; Copyright © 2016, 2017 Alex Kost <alezost@gmail.com>
96e9f097 12;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
dc9bdb1e 13;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
d17ae8c0 14;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
81b98756 15;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
9b0942c1 16;;; Copyright © 2016 David Craven <david@craven.ch>
594d740d 17;;; Copyright © 2016 John Darrington <jmd@gnu.org>
f8f44dd7 18;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
411264c2 19;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
440a3143 20;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
fd7000fe 21;;; Copyright © 2016, 2017 ng0 <ng0@no-reply.pragmatique.xyz>
6d3e08d4 22;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
01be4f93 23;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
189d8422 24;;; Copyright © 2017 Gábor Boskovits <boskovits@gmail.com>
c7adafa7 25;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
1113386b 26;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
1eacffb9 27;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
3116c8b5 28;;; Copyright © 2017 nee <nee-git@hidamari.blue>
a73e7dd3 29;;; Copyright © 2017 Dave Love <fx@gnu.org>
fd76c904 30;;;
233e7676 31;;; This file is part of GNU Guix.
fd76c904 32;;;
233e7676 33;;; GNU Guix is free software; you can redistribute it and/or modify it
fd76c904
LC
34;;; under the terms of the GNU General Public License as published by
35;;; the Free Software Foundation; either version 3 of the License, or (at
36;;; your option) any later version.
37;;;
233e7676 38;;; GNU Guix is distributed in the hope that it will be useful, but
fd76c904
LC
39;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41;;; GNU General Public License for more details.
42;;;
43;;; You should have received a copy of the GNU General Public License
233e7676 44;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fd76c904 45
1ffa7090 46(define-module (gnu packages linux)
59a43334 47 #:use-module (gnu packages)
0c60cc53 48 #:use-module (gnu packages acl)
75750abb
DC
49 #:use-module (gnu packages admin)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages attr)
52 #:use-module (gnu packages autotools)
1eacffb9 53 #:use-module (gnu packages backup)
75750abb 54 #:use-module (gnu packages base)
c7adafa7 55 #:use-module (gnu packages bash)
75750abb
DC
56 #:use-module (gnu packages bison)
57 #:use-module (gnu packages calendar)
58 #:use-module (gnu packages check)
e385e957 59 #:use-module (gnu packages crypto)
f61e0e79 60 #:use-module (gnu packages compression)
75750abb 61 #:use-module (gnu packages databases)
b3ed50e6 62 #:use-module (gnu packages datastructures)
75750abb
DC
63 #:use-module (gnu packages docbook)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages elf)
1ffa7090 66 #:use-module (gnu packages flex)
afc9d8ec 67 #:use-module (gnu packages file)
75750abb
DC
68 #:use-module (gnu packages freedesktop)
69 #:use-module (gnu packages gcc)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages glib)
e385e957 72 #:use-module (gnu packages gnuzilla)
d7d42d6b 73 #:use-module (gnu packages gperf)
75750abb 74 #:use-module (gnu packages gtk)
1ffa7090 75 #:use-module (gnu packages libusb)
01be4f93 76 #:use-module (gnu packages man)
75750abb 77 #:use-module (gnu packages maths)
dfe93c9a 78 #:use-module (gnu packages multiprecision)
1ffa7090 79 #:use-module (gnu packages ncurses)
c7adafa7 80 #:use-module (gnu packages networking)
f8f44dd7 81 #:use-module (gnu packages ninja)
1ffa7090 82 #:use-module (gnu packages perl)
75750abb 83 #:use-module (gnu packages pciutils)
1ffa7090 84 #:use-module (gnu packages pkg-config)
0d74462a 85 #:use-module (gnu packages popt)
75750abb 86 #:use-module (gnu packages pulseaudio)
7c0dbe78 87 #:use-module (gnu packages python)
75750abb
DC
88 #:use-module (gnu packages readline)
89 #:use-module (gnu packages rrdtool)
62b28c0e 90 #:use-module (gnu packages samba)
b1fb4b23 91 #:use-module (gnu packages slang)
b3ed50e6 92 #:use-module (gnu packages storage)
f57d2639 93 #:use-module (gnu packages texinfo)
75343704 94 #:use-module (gnu packages tls)
b3ed50e6 95 #:use-module (gnu packages valgrind)
7d2511bc 96 #:use-module (gnu packages video)
7f412f33 97 #:use-module (gnu packages web)
7d2511bc 98 #:use-module (gnu packages xiph)
75750abb 99 #:use-module (gnu packages xml)
58c4f11e
TGR
100 #:use-module (gnu packages xdisorg)
101 #:use-module (gnu packages xorg)
a73e7dd3
DL
102 #:use-module (gnu packages groff)
103 #:use-module (gnu packages selinux)
3eb7c000 104 #:use-module (gnu packages swig)
220193ad 105 #:use-module (guix build-system cmake)
75750abb 106 #:use-module (guix build-system gnu)
e102f940 107 #:use-module (guix build-system python)
a94546ec 108 #:use-module (guix build-system trivial)
75750abb 109 #:use-module (guix download)
6d31c175 110 #:use-module (guix git-download)
75750abb
DC
111 #:use-module ((guix licenses) #:prefix license:)
112 #:use-module (guix packages)
113 #:use-module (guix utils)
adddd5ba 114 #:use-module (srfi srfi-1)
17db0706 115 #:use-module (srfi srfi-2)
a94546ec
LC
116 #:use-module (srfi srfi-26)
117 #:use-module (ice-9 match))
fd76c904 118
aaf4cb20
LC
119(define-public (system->linux-architecture arch)
120 "Return the Linux architecture name for ARCH, a Guix system name such as
6d7ef2aa 121\"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
618cea69
NK
122 (let ((arch (car (string-split arch #\-))))
123 (cond ((string=? arch "i686") "i386")
124 ((string-prefix? "mips" arch) "mips")
aaf4cb20 125 ((string-prefix? "arm" arch) "arm")
503275e9 126 ((string-prefix? "aarch64" arch) "arm64")
605fec78 127 ((string-prefix? "alpha" arch) "alpha")
c89e2107 128 ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le"
618cea69
NK
129 (else arch))))
130
440a3143
CSLL
131(define-public (system->defconfig system)
132 "Some systems (notably powerpc-linux) require a special target for kernel
133defconfig. Return the appropiate make target if applicable, otherwise return
134\"defconfig\"."
135 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
c89e2107 136 ((string-prefix? "powerpc64le-" system) "ppc64_defconfig")
440a3143
CSLL
137 (else "defconfig")))
138
6023cc74
LC
139(define (linux-libre-urls version)
140 "Return a list of URLs for Linux-Libre VERSION."
141 (list (string-append
142 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
143 version "-gnu/linux-libre-" version "-gnu.tar.xz")
144
145 ;; XXX: Work around <http://bugs.gnu.org/14851>.
146 (string-append
147 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
148 version "-gnu.tar.xz")
149
150 ;; Maybe this URL will become valid eventually.
151 (string-append
152 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
153 version "-gnu.tar.xz")))
154
80fe5c60 155(define-public linux-libre-headers
b450d2b4
DC
156 (package
157 (name "linux-libre-headers")
e77fe950 158 (version "4.4.47")
b450d2b4
DC
159 (source (origin
160 (method url-fetch)
161 (uri (linux-libre-urls version))
162 (sha256
163 (base32
e77fe950 164 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
b450d2b4
DC
165 (build-system gnu-build-system)
166 (native-inputs `(("perl" ,perl)))
167 (arguments
168 `(#:modules ((guix build gnu-build-system)
169 (guix build utils)
170 (srfi srfi-1))
171 #:phases
172 (modify-phases %standard-phases
173 (delete 'configure)
174 (replace 'build
175 (lambda _
176 (let ((arch ,(system->linux-architecture
177 (or (%current-target-system)
440a3143
CSLL
178 (%current-system))))
179 (defconfig ,(system->defconfig
180 (or (%current-target-system)
181 (%current-system)))))
b450d2b4 182 (setenv "ARCH" arch)
618cea69 183 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
440a3143 184 (and (zero? (system* "make" defconfig))
618cea69 185 (zero? (system* "make" "mrproper" "headers_check"))))))
b450d2b4
DC
186 (replace 'install
187 (lambda* (#:key outputs #:allow-other-keys)
80fe5c60
LC
188 (let ((out (assoc-ref outputs "out")))
189 (and (zero? (system* "make"
190 (string-append "INSTALL_HDR_PATH=" out)
191 "headers_install"))
b15389e1
LC
192 (begin
193 (mkdir (string-append out "/include/config"))
194 (call-with-output-file
195 (string-append out
196 "/include/config/kernel.release")
197 (lambda (p)
198 (format p "~a-default~%" ,version)))
199
200 ;; Remove the '.install' and '..install.cmd' files; the
201 ;; latter contains store paths, which pulls in bootstrap
202 ;; binaries in the build environment, and prevents bit
203 ;; reproducibility for the bootstrap binaries.
204 (for-each delete-file (find-files out "\\.install"))
205
206 #t))))))
b15389e1 207 #:allowed-references ()
80fe5c60 208 #:tests? #f))
6fd52309 209 (home-page "https://www.gnu.org/software/linux-libre/")
80fe5c60
LC
210 (synopsis "GNU Linux-Libre kernel headers")
211 (description "Headers of the Linux-Libre kernel.")
b450d2b4 212 (license license:gpl2)))
80fe5c60 213
ac47a7c2
LC
214(define %boot-logo-patch
215 ;; Linux-Libre boot logo featuring Freedo and a gnu.
216 (origin
217 (method url-fetch)
218 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
74dde9e9 219 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
ac47a7c2
LC
220 (sha256
221 (base32
222 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
223
c258807a 224(define* (kernel-config arch #:key variant)
a94546ec 225 "Return the absolute file name of the Linux-Libre build configuration file
c258807a 226for ARCH and optionally VARIANT, or #f if there is no such configuration."
7994250f 227 (let* ((name (string-append (if variant (string-append variant "-") "")
25847b32 228 (if (string=? "i386" arch) "i686" arch) ".conf"))
7994250f
AK
229 (file (string-append "linux-libre/" name)))
230 (search-auxiliary-file file)))
a94546ec 231
90c18c32 232(define %default-extra-linux-options
50dbc036 233 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
b9f7895d
DC
234 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
235 ;; Modules required for initrd:
236 ("CONFIG_NET_9P" . m)
237 ("CONFIG_NET_9P_VIRTIO" . m)
238 ("CONFIG_VIRTIO_BLK" . m)
239 ("CONFIG_VIRTIO_NET" . m)
240 ("CONFIG_VIRTIO_PCI" . m)
241 ("CONFIG_VIRTIO_BALLOON" . m)
242 ("CONFIG_VIRTIO_MMIO" . m)
243 ("CONFIG_FUSE_FS" . m)
244 ("CONFIG_CIFS" . m)
245 ("CONFIG_9P_FS" . m)))
90c18c32
DC
246
247(define (config->string options)
248 (string-join (map (match-lambda
249 ((option . 'm)
250 (string-append option "=m"))
251 ((option . #t)
252 (string-append option "=y"))
253 ((option . #f)
254 (string-append option "=n")))
255 options)
256 "\n"))
257
3129b9c2 258(define* (make-linux-libre version hash supported-systems
c258807a
DC
259 #:key
260 ;; A function that takes an arch and a variant.
261 ;; See kernel-config for an example.
a6d01325 262 (extra-version #f)
c258807a 263 (configuration-file #f)
90c18c32 264 (defconfig "defconfig")
64de7d1c
MW
265 (extra-options %default-extra-linux-options)
266 (patches (list %boot-logo-patch)))
614d1738 267 (package
a6d01325
DC
268 (name (if extra-version
269 (string-append "linux-libre-" extra-version)
270 "linux-libre"))
c258807a 271 (version version)
614d1738
DC
272 (source (origin
273 (method url-fetch)
274 (uri (linux-libre-urls version))
c258807a 275 (sha256 (base32 hash))
64de7d1c 276 (patches patches)))
3129b9c2 277 (supported-systems supported-systems)
614d1738 278 (build-system gnu-build-system)
614d1738
DC
279 (native-inputs
280 `(("perl" ,perl)
281 ("bc" ,bc)
282 ("openssl" ,openssl)
78edcccc 283 ("kmod" ,kmod)
64b5e413
LC
284 ,@(match (and configuration-file
285 (configuration-file
286 (system->linux-architecture
287 (or (%current-target-system) (%current-system)))
288 #:variant (version-major+minor version)))
289 (#f ;no config for this platform
290 '())
291 ((? string? config)
292 `(("kconfig" ,config))))))
614d1738
DC
293 (arguments
294 `(#:modules ((guix build gnu-build-system)
295 (guix build utils)
296 (srfi srfi-1)
297 (ice-9 match))
298 #:phases
299 (modify-phases %standard-phases
9416459b 300 (replace 'configure
4b42703e 301 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
96e9f097
RN
302 ;; Avoid introducing timestamps
303 (setenv "KCONFIG_NOTIMESTAMP" "1")
304 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
305
4b42703e 306 ;; Set ARCH and CROSS_COMPILE
6d7ef2aa
DC
307 (let ((arch ,(system->linux-architecture
308 (or (%current-target-system)
309 (%current-system)))))
4b42703e
DC
310 (setenv "ARCH" arch)
311 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
6d7ef2aa 312
4b42703e
DC
313 (when target
314 (setenv "CROSS_COMPILE" (string-append target "-"))
315 (format #t "`CROSS_COMPILE' set to `~a'~%"
316 (getenv "CROSS_COMPILE"))))
beacfcab 317
a6d01325
DC
318 (setenv "EXTRA_VERSION" ,extra-version)
319
a94546ec
LC
320 (let ((build (assoc-ref %standard-phases 'build))
321 (config (assoc-ref inputs "kconfig")))
1650dd8a 322
e4e9c0a0
DC
323 ;; Use a custom kernel configuration file or a default
324 ;; configuration file.
1650dd8a
LC
325 (if config
326 (begin
327 (copy-file config ".config")
328 (chmod ".config" #o666))
c258807a 329 (system* "make" ,defconfig))
a94546ec
LC
330
331 ;; Appending works even when the option wasn't in the
332 ;; file. The last one prevails if duplicated.
90c18c32
DC
333 (let ((port (open-file ".config" "a"))
334 (extra-configuration ,(config->string extra-options)))
335 (display extra-configuration port)
a94546ec
LC
336 (close-port port))
337
9416459b 338 (zero? (system* "make" "oldconfig")))))
614d1738 339 (replace 'install
4b42703e 340 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
beacfcab
LC
341 (let* ((out (assoc-ref outputs "out"))
342 (moddir (string-append out "/lib/modules"))
e4e9c0a0
DC
343 (dtbdir (string-append out "/lib/dtbs"))
344 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
345 ;; Install kernel image, kernel configuration and link map.
346 (for-each (lambda (file) (install-file file out))
fd900d68 347 (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map)$"))
e4e9c0a0
DC
348 ;; Install device tree files
349 (for-each (lambda (file) (install-file file dtbdir))
350 (find-files "." "\\.dtb$"))
351 ;; Install kernel modules
beacfcab 352 (mkdir-p moddir)
beacfcab 353 (zero? (system* "make"
78edcccc 354 (string-append "DEPMOD=" kmod "/bin/depmod")
beacfcab
LC
355 (string-append "MODULE_DIR=" moddir)
356 (string-append "INSTALL_PATH=" out)
357 (string-append "INSTALL_MOD_PATH=" out)
cda3d81e 358 "INSTALL_MOD_STRIP=1"
beacfcab 359 "modules_install"))))))
beacfcab 360 #:tests? #f))
6fd52309 361 (home-page "https://www.gnu.org/software/linux-libre//")
f50d2669 362 (synopsis "100% free redistribution of a cleaned Linux kernel")
a22dc0c4 363 (description
79c311b8
LC
364 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
365It has been modified to remove all non-free binary blobs.")
614d1738 366 (license license:gpl2)))
beacfcab 367
3129b9c2
DC
368(define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
369
6bd1c41e
MW
370(define %linux-libre-version "4.13")
371(define %linux-libre-hash "07mxcya7ml1v34pbg4mjh1sq80r3b4dsxbcs41fm50jnhq7p1w4v")
76e62ef7 372
c258807a 373(define-public linux-libre
76e62ef7
MW
374 (make-linux-libre %linux-libre-version
375 %linux-libre-hash
3129b9c2 376 %intel-compatible-systems
91cf5fda 377 #:configuration-file kernel-config))
c258807a 378
52d901da 379(define-public linux-libre-4.9
b3a63e69
MW
380 (make-linux-libre "4.9.48"
381 "0xm7fr4z3k8cxdybk4q0n7iv5c44y7a8zsqvcmn9wznymq37663r"
52d901da 382 %intel-compatible-systems
65763656 383 #:configuration-file kernel-config))
52d901da 384
75b314a6 385(define-public linux-libre-4.4
5c6f434d
MW
386 (make-linux-libre "4.4.87"
387 "0yiqs4i4ydgb2kg8xdyqk9rkhymrnd2dw7jf9wnn5kxfwc2nbqpj"
3129b9c2 388 %intel-compatible-systems
c75a3081 389 #:configuration-file kernel-config))
75b314a6 390
adddd5ba 391(define-public linux-libre-4.1
c36e27d5
MW
392 (make-linux-libre "4.1.43"
393 "0ycqmvczj7lm7czilnwpyp14n2lzilyx7m43rsq1qdm2m5rp4q2w"
3129b9c2 394 %intel-compatible-systems
5227d53a 395 #:configuration-file kernel-config))
adddd5ba 396
cde7c23f
DC
397(define-public linux-libre-arm-generic
398 (make-linux-libre %linux-libre-version
399 %linux-libre-hash
400 '("armhf-linux")
401 #:defconfig "multi_v7_defconfig"
91cf5fda 402 #:extra-version "arm-generic"))
cde7c23f 403
97121c2a 404\f
c84d0eca
LC
405;;;
406;;; Pluggable authentication modules (PAM).
407;;;
408
fd76c904
LC
409(define-public linux-pam
410 (package
411 (name "linux-pam")
7483230f 412 (version "1.3.0")
fd76c904
LC
413 (source
414 (origin
415 (method url-fetch)
7483230f
DC
416 (uri (string-append
417 "http://www.linux-pam.org/library/"
418 "Linux-PAM-" version ".tar.bz2"))
fd76c904
LC
419 (sha256
420 (base32
411264c2
RS
421 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
422 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
423
fd76c904 424 (build-system gnu-build-system)
c4c4cc05 425 (native-inputs
fd76c904
LC
426 `(("flex" ,flex)
427
428 ;; TODO: optional dependencies
429 ;; ("libxcrypt" ,libxcrypt)
430 ;; ("cracklib" ,cracklib)
431 ))
432 (arguments
ed8111ea 433 `(;; Most users, such as `shadow', expect the headers to be under
c134056a
LC
434 ;; `security'.
435 #:configure-flags (list (string-append "--includedir="
436 (assoc-ref %outputs "out")
ed8111ea
LC
437 "/include/security")
438
439 ;; XXX: <rpc/rpc.h> is missing from glibc when
440 ;; cross-compiling, so we have to disable NIS
441 ;; support altogether.
442 ,@(if (%current-target-system)
443 '("--disable-nis")
444 '()))
c134056a
LC
445
446 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
447 ;; isn't available.
448 #:tests? #f))
fd76c904
LC
449 (home-page "http://www.linux-pam.org/")
450 (synopsis "Pluggable authentication modules for Linux")
451 (description
452 "A *Free* project to implement OSF's RFC 86.0.
453Pluggable authentication modules are small shared object files that can
454be used through the PAM API to perform tasks, like authenticating a user
e881752c 455at login. Local and dynamic reconfiguration are its key features.")
3ac73271 456 (license license:bsd-3)))
686f14e8 457
4c93ce42
EF
458(define-public linux-pam-1.2
459 (package
460 (inherit linux-pam)
4c93ce42
EF
461 (version "1.2.1")
462 (source
463 (origin
464 (method url-fetch)
465 (uri (string-append
466 "http://www.linux-pam.org/library/"
467 "Linux-PAM-" version ".tar.bz2"))
468 (sha256
469 (base32
411264c2
RS
470 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
471 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
4c93ce42 472
53142109 473
c84d0eca
LC
474;;;
475;;; Miscellaneous.
476;;;
477
686f14e8
LC
478(define-public psmisc
479 (package
480 (name "psmisc")
aa9c221f 481 (version "22.21")
686f14e8
LC
482 (source
483 (origin
484 (method url-fetch)
485 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
486 version ".tar.gz"))
487 (sha256
488 (base32
aa9c221f 489 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
686f14e8
LC
490 (build-system gnu-build-system)
491 (inputs `(("ncurses" ,ncurses)))
aa9c221f 492 (home-page "https://gitlab.com/psmisc/psmisc")
686f14e8 493 (synopsis
8f65585b 494 "Small utilities that use the proc file system")
686f14e8
LC
495 (description
496 "This PSmisc package is a set of some small useful utilities that
8f65585b 497use the proc file system. We're not about changing the world, but
686f14e8 498providing the system administrator with some help in common tasks.")
3ac73271 499 (license license:gpl2+)))
02b80c3f
NK
500
501(define-public util-linux
502 (package
503 (name "util-linux")
81b959c4 504 (version "2.30")
5a6a3ba4
LC
505 (source (origin
506 (method url-fetch)
507 (uri (string-append "mirror://kernel.org/linux/utils/"
9f533d60
LC
508 name "/v" (version-major+minor version) "/"
509 name "-" version ".tar.xz"))
5a6a3ba4
LC
510 (sha256
511 (base32
81b959c4 512 "13d0ax8bcapga8phj2nclx86w57ddqxbr98ajibpzjq6d7zs8262"))
fc1adab1 513 (patches (search-patches "util-linux-tests.patch"))
9d77da2a
LC
514 (modules '((guix build utils)))
515 (snippet
ec2da92c
LC
516 ;; We take the 'logger' program from GNU Inetutils and 'kill'
517 ;; from GNU Coreutils.
8338c241
MW
518 '(begin
519 (substitute* "configure"
520 (("build_logger=yes") "build_logger=no")
521 (("build_kill=yes") "build_kill=no"))
522 #t))))
02b80c3f 523 (build-system gnu-build-system)
dd581e9a
TGR
524 (outputs '("out"
525 "static")) ; >2 MiB of static .a libraries
02b80c3f 526 (arguments
29ec55ee 527 `(#:configure-flags (list "--disable-use-tty-group"
d9804e50 528 "--enable-fs-paths-default=/run/current-system/profile/sbin"
29ec55ee
LC
529 ;; Install completions where our
530 ;; bash-completion package expects them.
531 (string-append "--with-bashcompletiondir="
532 (assoc-ref %outputs "out")
533 "/etc/bash_completion.d"))
1b9cf4ad 534 #:phases (modify-phases %standard-phases
7e512497
LC
535 (add-before
536 'build 'set-umount-file-name
537 (lambda* (#:key outputs #:allow-other-keys)
538 ;; Tell 'eject' the right file name of 'umount'.
539 (let ((out (assoc-ref outputs "out")))
540 (substitute* "sys-utils/eject.c"
541 (("\"/bin/umount\"")
542 (string-append "\"" out "/bin/umount\"")))
543 #t)))
1b9cf4ad
LC
544 (add-before
545 'check 'pre-check
546 (lambda* (#:key inputs outputs #:allow-other-keys)
547 (let ((out (assoc-ref outputs "out"))
548 (net (assoc-ref inputs "net-base")))
549 ;; Change the test to refer to the right file.
550 (substitute* "tests/ts/misc/mcookie"
551 (("/etc/services")
552 (string-append net "/etc/services")))
dd581e9a
TGR
553 #t)))
554 (add-after
555 'install 'move-static-libraries
556 (lambda* (#:key outputs #:allow-other-keys)
557 (let ((out (assoc-ref outputs "out"))
558 (static (assoc-ref outputs "static")))
559 (mkdir-p (string-append static "/lib"))
560 (with-directory-excursion out
561 (for-each (lambda (file)
562 (rename-file file
563 (string-append static "/"
564 file)))
565 (find-files "lib" "\\.a$")))
1b9cf4ad 566 #t))))))
f61e0e79 567 (inputs `(("zlib" ,zlib)
ba4aca3a
LC
568 ("ncurses" ,ncurses)
569
570 ;; XXX: This is so that the 'pre-check' phase can find it.
571 ,@(if (%current-target-system)
572 `(("net-base" ,net-base))
573 '())))
c4c4cc05 574 (native-inputs
9f533d60
LC
575 `(("perl" ,perl)
576 ("net-base" ,net-base))) ;for tests
02b80c3f 577 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 578 (synopsis "Collection of utilities for the Linux kernel")
437d7286 579 (description "Util-linux is a diverse collection of Linux kernel
8f65585b 580utilities. It provides dmesg and includes tools for working with file systems,
437d7286 581block devices, UUIDs, TTYs, and many other tools.")
fe8ccfcc 582
02b80c3f 583 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 584 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 585 ;; explicitly defined license.
3ac73271
LC
586 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
587 license:bsd-4 license:public-domain))))
5d5c4278 588
3116c8b5 589(define-public ddate
590 (package
591 (name "ddate")
592 (version "0.2.2")
593 (source (origin
594 (method url-fetch)
595 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
596 version ".tar.gz"))
597 (file-name (string-append name "-" version ".tar.gz"))
598 (sha256
599 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
600 (build-system cmake-build-system)
601 (arguments '(#:tests? #f))
602 (home-page "https://github.com/bo0ts/ddate")
603 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
604 (description
605 "ddate displays the Discordian date and holidays of a given date.
606The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
607by Robert Shea and Robert Anton Wilson.")
608 (license license:public-domain)))
609
e47e3eff
LC
610(define-public procps
611 (package
612 (name "procps")
74a3c4bb 613 (version "3.3.12")
e47e3eff 614 (source (origin
0cc22848
SB
615 (method url-fetch)
616 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
617 "procps-ng-" version ".tar.xz"))
618 (sha256
619 (base32
74a3c4bb 620 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
e47e3eff 621 (build-system gnu-build-system)
e47e3eff 622 (arguments
80393eed
LC
623 '(#:modules ((guix build utils)
624 (guix build gnu-build-system)
625 (srfi srfi-1)
626 (srfi srfi-26))
0cc22848
SB
627 #:phases
628 (modify-phases %standard-phases
241826b5
LC
629 (add-before 'check 'disable-strtod-test
630 (lambda _
631 ;; Disable the 'strtod' test, which fails on 32-bit systems.
632 ;; This is what upstream does:
633 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
634 (substitute* "Makefile"
635 (("^(TESTS|check_PROGRAMS) = .*$" all)
636 (string-append "# " all "\n")))
637 #t))
0cc22848
SB
638 (add-after
639 'install 'post-install
640 ;; Remove commands and man pages redudant with
641 ;; Coreutils.
642 (lambda* (#:key outputs #:allow-other-keys)
643 (let* ((out (assoc-ref outputs "out"))
644 (dup (append-map (cut find-files out <>)
645 '("^kill" "^uptime"))))
646 (for-each delete-file dup)
647 #t))))))
648 (inputs `(("ncurses" ,ncurses)))
649 (home-page "https://gitlab.com/procps-ng/procps/")
35ec07c7 650 (synopsis "Utilities that give information about processes")
e47e3eff 651 (description
35b9e423 652 "Procps is the package that has a bunch of small useful utilities
e47e3eff
LC
653that give information about processes using the Linux /proc file system.
654The package includes the programs ps, top, vmstat, w, kill, free,
655slabtop, and skill.")
3ac73271 656 (license license:gpl2)))
e47e3eff 657
5d5c4278
NK
658(define-public usbutils
659 (package
660 (name "usbutils")
e8a463e6 661 (version "008")
5d5c4278
NK
662 (source
663 (origin
664 (method url-fetch)
665 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
666 "usbutils-" version ".tar.xz"))
667 (sha256
668 (base32
e8a463e6 669 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
5d5c4278
NK
670 (build-system gnu-build-system)
671 (inputs
e8a463e6 672 `(("libusb" ,libusb)
4e859e92 673 ("eudev" ,eudev)))
c4c4cc05
JD
674 (native-inputs
675 `(("pkg-config" ,pkg-config)))
5d5c4278
NK
676 (home-page "http://www.linux-usb.org/")
677 (synopsis
678 "Tools for working with USB devices, such as lsusb")
679 (description
680 "Tools for working with USB devices, such as lsusb.")
3ac73271 681 (license license:gpl2+)))
0750452a
LC
682
683(define-public e2fsprogs
684 (package
685 (name "e2fsprogs")
f28fea1c 686 (version "1.43.5")
0750452a
LC
687 (source (origin
688 (method url-fetch)
7409c8d4
MW
689 (uri (string-append
690 "mirror://kernel.org/linux/kernel/people/tytso/"
691 name "/v" version "/"
692 name "-" version ".tar.xz"))
f28fea1c 693 (patches (search-patches "e2fsprogs-32bit-quota-warnings.patch"))
0750452a
LC
694 (sha256
695 (base32
f28fea1c 696 "05ssjpmy0fpv2ik6ibm1f47wr6794nf0q50r581vygrqvsd3s7r6"))))
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")
79937f72 864 (version "4.18")
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
79937f72 871 "026agy9nq238nx3ynhmi8h3vx96yra4xacfsm2ybs9k23ry8ibc9"))))
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
722ec722
MW
1428 '(#:phases (alist-cons-after
1429 'unpack 'bootstrap
215b6431 1430 (lambda _
e5c8e4f3
DT
1431 ;; Fix "field ‘ip6’ has incomplete type" errors.
1432 (substitute* "libbridge/libbridge.h"
1433 (("#include <linux/if_bridge.h>")
1434 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1435
1436 ;; Ensure that the entire build fails if one of the
1437 ;; sub-Makefiles fails.
1438 (substitute* "Makefile.in"
1439 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1440 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1441
215b6431
LC
1442 (zero? (system* "autoreconf" "-vf")))
1443 %standard-phases)
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")
a2265ea3 1460 (version "3.3.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
a2265ea3 1469 "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
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
1484 (base32 "0srab805yj8wb13l64qjyp3mdbqapxg5vk46v3zlhhzpmxqw8j7r"))))))
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")
1548 #:phases (alist-delete 'configure %standard-phases)))
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")
ebacb0de 1559 (version "2.8")
023fef7d
LC
1560 (source
1561 (origin
1562 (method url-fetch)
1563 (uri (string-append
bd60e4e2 1564 "https://01.org/sites/default/files/downloads/powertop/powertop-"
023fef7d
LC
1565 version ".tar.gz"))
1566 (sha256
1567 (base32
ebacb0de 1568 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
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"))
b148bd71
LC
1681 #:phases (alist-cons-before
1682 'build 'set-file-names
1683 (lambda* (#:key inputs #:allow-other-keys)
1684 ;; libfuse calls out to mount(8) and umount(8). Make sure
1685 ;; it refers to the right ones.
1686 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1687 (("/bin/(u?)mount" _ maybe-u)
1688 (string-append (assoc-ref inputs "util-linux")
1689 "/bin/" maybe-u "mount")))
1690 (substitute* '("util/mount.fuse.c")
1691 (("/bin/sh")
bd663902
LC
1692 (which "sh")))
1693
1694 ;; This hack leads libfuse to search for 'fusermount' in
1695 ;; $PATH, where it may find a setuid-root binary, instead of
1696 ;; trying solely $out/sbin/fusermount and failing because
1697 ;; it's not setuid.
1698 (substitute* "lib/Makefile"
1699 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1700 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
b148bd71 1701 %standard-phases)))
0e9bc883 1702 (home-page "https://github.com/libfuse/libfuse")
e30835e2
LC
1703 (synopsis "Support file systems implemented in user space")
1704 (description
1705 "As a consequence of its monolithic design, file system code for Linux
1706normally goes into the kernel itself---which is not only a robustness issue,
1707but also an impediment to system extensibility. FUSE, for \"file systems in
1708user space\", is a kernel module and user-space library that tries to address
1709part of this problem by allowing users to run file system implementations as
1710user-space processes.")
3ac73271
LC
1711 (license (list license:lgpl2.1 ;library
1712 license:gpl2+)))) ;command-line utilities
220193ad
LC
1713
1714(define-public unionfs-fuse
1715 (package
1716 (name "unionfs-fuse")
2f861edf 1717 (version "2.0")
220193ad
LC
1718 (source (origin
1719 (method url-fetch)
1720 (uri (string-append
2f861edf
EF
1721 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1722 version ".tar.gz"))
1723 (file-name (string-append name "-" version ".tar.gz"))
220193ad
LC
1724 (sha256
1725 (base32
2f861edf 1726 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
220193ad 1727 (build-system cmake-build-system)
094f4b53
EF
1728 (native-inputs
1729 `(("python" ,python)
1730 ("python-pytest" ,python-pytest)))
220193ad 1731 (inputs `(("fuse" ,fuse)))
094f4b53
EF
1732 (arguments
1733 '(#:phases
1734 (modify-phases %standard-phases
1735 (replace 'check
1736 ;; Borrowed from the Makefile
1737 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
2f861edf 1738 (home-page "https://github.com/rpodgorny/unionfs-fuse")
220193ad
LC
1739 (synopsis "User-space union file system")
1740 (description
1741 "UnionFS-FUSE is a flexible union file system implementation in user
1742space, using the FUSE library. Mounting a union file system allows you to
1743\"aggregate\" the contents of several directories into a single mount point.
1744UnionFS-FUSE additionally supports copy-on-write.")
3ac73271 1745 (license license:bsd-3)))
ed748588 1746
0b7a0c20
LC
1747(define fuse-static
1748 (package (inherit fuse)
1749 (name "fuse-static")
1750 (source (origin (inherit (package-source fuse))
1751 (modules '((guix build utils)))
1752 (snippet
1753 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1754 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1755 ;; it doesn't do that, allowing us to remove the dependency on
1756 ;; util-linux (something that is useful in initrds.)
1757 '(substitute* '("lib/mount_util.c"
1758 "util/mount_util.c")
1759 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1760 "0")
1761 (("/bin/")
1762 "")))))))
1763
ed748588
LC
1764(define-public unionfs-fuse/static
1765 (package (inherit unionfs-fuse)
1766 (synopsis "User-space union file system (statically linked)")
1767 (name (string-append (package-name unionfs-fuse) "-static"))
1768 (source (origin (inherit (package-source unionfs-fuse))
1769 (modules '((guix build utils)))
1770 (snippet
1771 ;; Add -ldl to the libraries, because libfuse.a needs that.
1772 '(substitute* "src/CMakeLists.txt"
1773 (("target_link_libraries(.*)\\)" _ libs)
1774 (string-append "target_link_libraries"
1775 libs " dl)"))))))
1776 (arguments
1777 '(#:tests? #f
1456cff1
LC
1778 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1779 #:phases (alist-cons-after
1780 'install 'post-install
1781 (lambda* (#:key outputs #:allow-other-keys)
1782 (let* ((out (assoc-ref outputs "out"))
1783 (exe (string-append out "/bin/unionfs")))
1784 ;; By default, 'unionfs' keeps references to
1785 ;; $glibc/share/locale and similar stuff. Remove them.
9f8d6eb2
LC
1786 (remove-store-references exe)
1787
1788 ;; 'unionfsctl' has references to glibc as well. Since
1789 ;; we don't need it, remove it.
1790 (delete-file (string-append out "/bin/unionfsctl"))
1791 #t))
1456cff1 1792 %standard-phases)))
0b7a0c20 1793 (inputs `(("fuse" ,fuse-static)))))
67b66003 1794
db288efa
LC
1795(define-public sshfs-fuse
1796 (package
1797 (name "sshfs-fuse")
20f8d1dd 1798 (version "2.10")
db288efa
LC
1799 (source (origin
1800 (method url-fetch)
b58c1b2d 1801 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
f5c6edd6
TGR
1802 "download/sshfs-" version "/sshfs-" version
1803 ".tar.gz"))
db288efa
LC
1804 (sha256
1805 (base32
20f8d1dd 1806 "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h"))))
db288efa
LC
1807 (build-system gnu-build-system)
1808 (inputs
1809 `(("fuse" ,fuse)
1810 ("glib" ,glib)))
1811 (native-inputs
1812 `(("pkg-config" ,pkg-config)))
f5c6edd6 1813 (home-page "https://github.com/libfuse/sshfs")
db288efa
LC
1814 (synopsis "Mount remote file systems over SSH")
1815 (description
1816 "This is a file system client based on the SSH File Transfer Protocol.
1817Since most SSH servers already support this protocol it is very easy to set
1818up: on the server side there's nothing to do; on the client side mounting the
1819file system is as easy as logging into the server with an SSH client.")
3ac73271 1820 (license license:gpl2+)))
db288efa 1821
1eacffb9
RH
1822(define-public archivemount
1823 (package
1824 (name "archivemount")
1825 (version "0.8.7")
1826 (source
1827 (origin
1828 (method url-fetch)
1829 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1830 "archivemount-" version ".tar.gz"))
1831 (sha256
1832 (base32
1833 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1834 (build-system gnu-build-system)
1835 (inputs `(("fuse", fuse)
1836 ("libarchive", libarchive)))
1837 (native-inputs `(("pkg-config", pkg-config)))
1838 (home-page "http://www.cybernoia.de/software/archivemount")
1839 (synopsis "Tool for mounting archive files with FUSE")
1840 (description "archivemount is a FUSE-based file system for Unix variants,
1841including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1842mount point where it can be read from or written to as with any other file
1843system. This makes accessing the contents of the archive, which may be
1844compressed, transparent to other programs, without decompressing them.")
1845 (license license:lgpl2.0+)))
1846
67b66003
LC
1847(define-public numactl
1848 (package
1849 (name "numactl")
e35dff97 1850 (version "2.0.11")
67b66003
LC
1851 (source (origin
1852 (method url-fetch)
1853 (uri (string-append
1854 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1855 version
1856 ".tar.gz"))
1857 (sha256
1858 (base32
e35dff97 1859 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
67b66003
LC
1860 (build-system gnu-build-system)
1861 (arguments
e35dff97 1862 '(;; There's a 'test' target, but it requires NUMA support in the kernel
67b66003
LC
1863 ;; to run, which we can't assume to have.
1864 #:tests? #f))
b0015064 1865
35dfcdd7
AE
1866 ;; NUMA is apparently not supported on armhf, see
1867 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1868 (supported-systems (delete "armhf-linux" %supported-systems))
67b66003
LC
1869 (home-page "http://oss.sgi.com/projects/libnuma/")
1870 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1871 (description
1872 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1873memory is not all in one place. The numactl program allows you to run your
1874application program on specific CPU's and memory nodes. It does this by
1875supplying a NUMA memory policy to the operating system before running your
1876program.
1877
1878The package contains other commands, such as numademo, numastat and memhog.
1879The numademo command provides a quick overview of NUMA performance on your
1880system.")
3ac73271
LC
1881 (license (list license:gpl2 ;programs
1882 license:lgpl2.1)))) ;library
b10e9ff6 1883
103b7e79 1884(define-public kbd-neo
1885 (package
1886 (name "kbd-neo")
1887 (version "2486")
1888 (source
1889 (origin
1890 (method url-fetch)
1891 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1892 version "/linux/console/neo.map"))
1893 (file-name (string-append name "-" version ".map"))
1894 (sha256
1895 (base32
1896 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1897 (build-system trivial-build-system)
1898 (arguments
1899 `(#:modules ((guix build utils))
1900 #:builder (begin
1901 (use-modules (guix build utils))
1902 (let ((out (string-append %output "/share/keymaps"))
1903 (source (assoc-ref %build-inputs "source")))
1904 (mkdir-p out)
1905 (copy-file source (string-append out "/neo.map"))
1906 #t))))
1907 (home-page "https://neo-layout.org")
1908 (synopsis "Neo2 console layout")
1909 (description
1910 "Kbd-neo provides the Neo2 keyboard layout for use with
1911@command{loadkeys(1)} from @code{kbd(4)}.")
1912 ;; The file is located in an svn directory, the entire content of
1913 ;; the directory is licensed as GPL3.
1914 (license license:gpl3+)))
1915
b10e9ff6
LC
1916(define-public kbd
1917 (package
1918 (name "kbd")
8555a609 1919 (version "2.0.4")
b10e9ff6
LC
1920 (source (origin
1921 (method url-fetch)
1922 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
710b4928 1923 version ".tar.xz"))
b10e9ff6
LC
1924 (sha256
1925 (base32
8555a609 1926 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
c8f60748
LC
1927 (modules '((guix build utils)))
1928 (snippet
f2cdcafb
LC
1929 '(begin
1930 (substitute* "tests/Makefile.in"
1931 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1932 (("@VERSION@")
1933 "[@]VERSION[@]"))
1934 (substitute* '("src/unicode_start" "src/unicode_stop")
1935 ;; Assume the Coreutils are in $PATH.
1936 (("/usr/bin/tty")
1937 "tty"))))))
b10e9ff6
LC
1938 (build-system gnu-build-system)
1939 (arguments
5953d2b7
AK
1940 '(#:phases
1941 (modify-phases %standard-phases
1942 (add-before 'build 'pre-build
1943 (lambda* (#:key inputs #:allow-other-keys)
1944 (let ((gzip (assoc-ref %build-inputs "gzip"))
1945 (bzip2 (assoc-ref %build-inputs "bzip2")))
1946 (substitute* "src/libkeymap/findfile.c"
1947 (("gzip")
1948 (string-append gzip "/bin/gzip"))
1949 (("bzip2")
1950 (string-append bzip2 "/bin/bzip2"))))))
1951 (add-after 'install 'post-install
1952 (lambda* (#:key outputs #:allow-other-keys)
1953 ;; Make sure these programs find their comrades.
1954 (let* ((out (assoc-ref outputs "out"))
1955 (bin (string-append out "/bin")))
1956 (for-each (lambda (prog)
1957 (wrap-program (string-append bin "/" prog)
1958 `("PATH" ":" prefix (,bin))))
1959 '("unicode_start" "unicode_stop"))))))))
b10e9ff6 1960 (inputs `(("check" ,check)
f61e0e79
LC
1961 ("gzip" ,gzip)
1962 ("bzip2" ,bzip2)
b10e9ff6 1963 ("pam" ,linux-pam)))
fd7000fe 1964 (native-search-paths
1965 (list (search-path-specification
1966 (variable "LOADKEYS_KEYMAP_PATH")
674d4e13
TGR
1967 ;; Append ‘/**’ to recursively search all directories. One can then
1968 ;; run (for example) ‘loadkeys en-latin9’ instead of having to find
1969 ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard.
1970 (files (list "share/keymaps/**")))))
b10e9ff6 1971 (native-inputs `(("pkg-config" ,pkg-config)))
0ed81d04 1972 (home-page "http://kbd-project.org/")
b10e9ff6
LC
1973 (synopsis "Linux keyboard utilities and keyboard maps")
1974 (description
1975 "This package contains keytable files and keyboard utilities compatible
1976for systems using the Linux kernel. This includes commands such as
1977'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
3ac73271 1978 (license license:gpl2+)))
de0b620e
LC
1979
1980(define-public inotify-tools
1981 (package
1982 (name "inotify-tools")
1983 (version "3.13")
1984 (source (origin
1985 (method url-fetch)
1986 (uri (string-append
1987 "mirror://sourceforge/inotify-tools/inotify-tools/"
1988 version "/inotify-tools-" version ".tar.gz"))
1989 (sha256
1990 (base32
1991 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1992 (build-system gnu-build-system)
1993 (home-page "http://inotify-tools.sourceforge.net/")
1994 (synopsis "Monitor file accesses")
1995 (description
1996 "The inotify-tools packages provides a C library and command-line tools
1997to use Linux' inotify mechanism, which allows file accesses to be monitored.")
3ac73271 1998 (license license:gpl2+)))
e062d542
AE
1999
2000(define-public kmod
2001 (package
2002 (name "kmod")
b9375d89 2003 (version "24")
e062d542
AE
2004 (source (origin
2005 (method url-fetch)
2006 (uri
2007 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
2008 "kmod-" version ".tar.xz"))
2009 (sha256
2010 (base32
b9375d89 2011 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
fc1adab1 2012 (patches (search-patches "kmod-module-directory.patch"))))
e062d542
AE
2013 (build-system gnu-build-system)
2014 (native-inputs
2015 `(("pkg-config" ,pkg-config)))
2016 (inputs
f61e0e79
LC
2017 `(("xz" ,xz)
2018 ("zlib" ,zlib)))
e062d542
AE
2019 (arguments
2020 `(#:tests? #f ; FIXME: Investigate test failures
4a8b4c25
LC
2021 #:configure-flags '("--with-xz" "--with-zlib")
2022 #:phases (alist-cons-after
2023 'install 'install-modprobe&co
2024 (lambda* (#:key outputs #:allow-other-keys)
2025 (let* ((out (assoc-ref outputs "out"))
2026 (bin (string-append out "/bin")))
2027 (for-each (lambda (tool)
2028 (symlink "kmod"
2029 (string-append bin "/" tool)))
2030 '("insmod" "rmmod" "lsmod" "modprobe"
2031 "modinfo" "depmod"))))
2032 %standard-phases)))
e062d542
AE
2033 (home-page "https://www.kernel.org/")
2034 (synopsis "Kernel module tools")
35b9e423 2035 (description "Kmod is a set of tools to handle common tasks with Linux
e062d542
AE
2036kernel modules like insert, remove, list, check properties, resolve
2037dependencies and aliases.
2038
2039These tools are designed on top of libkmod, a library that is shipped with
2040kmod. The aim is to be compatible with tools, configurations and indices
2041from the module-init-tools project.")
3ac73271 2042 (license license:gpl2+))) ; library under lgpl2.1+
d7d42d6b 2043
7fa715e7
LC
2044(define-public eudev
2045 ;; The post-systemd fork, maintained by Gentoo.
fe32c7f7 2046 (package
7fa715e7 2047 (name "eudev")
202342fd 2048 (version "3.2.2")
7fa715e7
LC
2049 (source (origin
2050 (method url-fetch)
2051 (uri (string-append
2052 "http://dev.gentoo.org/~blueness/eudev/eudev-"
2053 version ".tar.gz"))
2054 (sha256
2055 (base32
202342fd
LC
2056 "0qqgbgpm5wdllk0s04pf80nwc8pr93xazwri1bylm1f15zn5ck1y"))
2057 (patches (search-patches "eudev-rules-directory.patch"))))
fe32c7f7 2058 (build-system gnu-build-system)
4e859e92
LC
2059 (arguments
2060 '(#:phases (modify-phases %standard-phases
2061 (add-after 'install 'build-hwdb
2062 (lambda* (#:key outputs #:allow-other-keys)
2063 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
2064 ;; similar tools to display product names.
2065 (let ((out (assoc-ref outputs "out")))
2066 (zero? (system* (string-append out "/bin/udevadm")
2067 "hwdb" "--update"))))))))
fe32c7f7
MW
2068 (native-inputs
2069 `(("pkg-config" ,pkg-config)
e75230c1
SB
2070 ("perl" ,perl)
2071 ("gperf" ,gperf)))
fe32c7f7 2072 (inputs
255f7308
LC
2073 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
2074 ;; and similar; it also installs the '60-persistent-storage.rules' file,
2075 ;; which contains the rules to do that.
2076 `(("util-linux" ,util-linux) ;for blkid
2077 ("kmod" ,kmod)))
e1921a38 2078 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
fe32c7f7
MW
2079 (synopsis "Userspace device management")
2080 (description "Udev is a daemon which dynamically creates and removes
2081device nodes from /dev/, handles hotplug events and loads drivers at boot
2082time.")
3ac73271 2083 (license license:gpl2+)))
7fa715e7 2084
e5d861f3 2085(define-public eudev-with-hwdb
4e859e92 2086 (deprecated-package "eudev-with-hwdb" eudev))
e5d861f3 2087
66269d47
LC
2088(define-public lvm2
2089 (package
2090 (name "lvm2")
62ec02bf 2091 (version "2.02.171")
66269d47
LC
2092 (source (origin
2093 (method url-fetch)
2094 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
2095 version ".tgz"))
2096 (sha256
2097 (base32
62ec02bf 2098 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
66269d47
LC
2099 (modules '((guix build utils)))
2100 (snippet
2101 '(begin
2102 (use-modules (guix build utils))
2103
2104 ;; Honor sysconfdir.
2105 (substitute* "make.tmpl.in"
2106 (("confdir = .*$")
2107 "confdir = @sysconfdir@\n")
2108 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
01f94cca
LC
2109 "DEFAULT_SYS_DIR = @sysconfdir@"))))
2110 (patches (search-patches "lvm2-static-link.patch"))))
66269d47
LC
2111 (build-system gnu-build-system)
2112 (native-inputs
2113 `(("pkg-config" ,pkg-config)
2114 ("procps" ,procps))) ;tests use 'pgrep'
2115 (inputs
8fcaf8b1 2116 `(("udev" ,eudev)))
66269d47 2117 (arguments
3afbc6b3
LF
2118 '(#:phases
2119 (modify-phases %standard-phases
2120 (add-after 'configure 'set-makefile-shell
2121 (lambda _
2122 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
2123 ;; expected.
2124 (setenv "SHELL" (which "sh"))
66269d47 2125
3afbc6b3
LF
2126 ;; Replace /bin/sh with the right file name.
2127 (patch-makefile-SHELL "make.tmpl")
7ca97fae
LF
2128 #t))
2129 (add-before 'strip 'make-objects-writable
2130 (lambda* (#:key outputs #:allow-other-keys)
2131 ;; Make compiled objects writable so they can be stripped.
2132 (let ((out (assoc-ref outputs "out")))
2133 (for-each (lambda (file)
2134 (chmod file #o755))
2135 (append
2136 (find-files (string-append out "/lib"))
2137 (find-files (string-append out "/sbin"))))
2138 #t))))
66269d47
LC
2139
2140 #:configure-flags (list (string-append "--sysconfdir="
2141 (assoc-ref %outputs "out")
2142 "/etc/lvm")
2143 "--enable-udev_sync"
f2817d43
LC
2144 "--enable-udev_rules"
2145
2146 ;; Make sure programs such as 'dmsetup' can
2147 ;; find libdevmapper.so.
2148 (string-append "LDFLAGS=-Wl,-rpath="
2149 (assoc-ref %outputs "out")
2150 "/lib"))
66269d47
LC
2151
2152 ;; The tests use 'mknod', which requires root access.
2153 #:tests? #f))
62ec02bf 2154 (home-page "https://sourceware.org/lvm2/")
66269d47
LC
2155 (synopsis "Logical volume management for Linux")
2156 (description
2157 "LVM2 is the logical volume management tool set for Linux-based systems.
2158This package includes the user-space libraries and tools, including the device
2159mapper. Kernel components are part of Linux-libre.")
2160
2161 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2162 ;; Command-line tools are GPLv2.
3ac73271 2163 (license (list license:gpl2 license:lgpl2.1))))
66269d47 2164
01f94cca
LC
2165(define-public lvm2-static
2166 (package
2167 (inherit lvm2)
2168 (name "lvm2-static")
2169
2170 ;; Propagate udev because libdevmapper.a depends on libudev.
2171 (inputs (alist-delete "udev" (package-inputs lvm2)))
2172 (propagated-inputs `(("udev" ,eudev)))
2173
2174 (arguments
2175 (substitute-keyword-arguments (package-arguments lvm2)
2176 ((#:configure-flags flags '())
2177 ;; LVM2 doesn't use Libtool, hence the custom option.
2178 `(cons "--enable-static_link" ,flags))))
2179 (synopsis "Logical volume management for Linux (statically linked)")))
2180
000f7559
DT
2181(define-public wireless-tools
2182 (package
2183 (name "wireless-tools")
2184 (version "30.pre9")
2185 (source (origin
2186 (method url-fetch)
2187 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2188 version ".tar.gz"))
2189 (sha256
2190 (base32
ec01f22d 2191 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
ec01f22d 2192 (snippet
c2099a4c
MW
2193 '(begin
2194 ;; Remove the older header files that are not free software.
2195 (for-each (lambda (n)
2196 (delete-file (format #f "wireless.~a.h" n)))
2197 '(10 11 12 13 14 15 16 17 18 19 20))
2198 #t))))
000f7559
DT
2199 (build-system gnu-build-system)
2200 (arguments
c2099a4c
MW
2201 `(#:make-flags
2202 (list (string-append "PREFIX=" %output)
2203 (string-append "INSTALL_MAN=" %output "/share/man")
2204 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2205 "BUILD_STATIC=")
2206 #:phases (modify-phases %standard-phases
2207 (delete 'configure))
000f7559
DT
2208 #:tests? #f))
2209 (synopsis "Tools for manipulating Linux Wireless Extensions")
fb9b7ce2
LC
2210 (description "Wireless Tools are used to manipulate the now-deprecated
2211Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2212Extension was an interface allowing you to set Wireless LAN specific
2213parameters and get the specific stats. It is deprecated in favor the nl80211
2214interface.")
000f7559 2215 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
c2099a4c
MW
2216 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2217 ;; other files are distributed under gpl2.
3ac73271 2218 (license (list license:gpl2 license:lgpl2.1+))))
30016044 2219
cc205dac
LC
2220(define-public crda
2221 (package
2222 (name "crda")
2223 (version "3.18")
2224 (source (origin
2225 (method url-fetch)
2226 (uri (string-append "mirror://kernel.org/software/network/crda/"
2227 "crda-" version ".tar.xz"))
2228 (sha256
2229 (base32
2230 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
fc1adab1 2231 (patches (search-patches "crda-optional-gcrypt.patch"))))
cc205dac
LC
2232 (build-system gnu-build-system)
2233 (arguments
2234 '(#:phases (modify-phases %standard-phases
2235 (delete 'configure)
2236 (add-before
2237 'build 'no-werror-no-ldconfig
2238 (lambda _
2239 (substitute* "Makefile"
2240 (("-Werror") "")
2241 (("ldconfig") "true"))
2242 #t))
2243 (add-before
2244 'build 'set-regulator-db-file-name
2245 (lambda* (#:key inputs #:allow-other-keys)
2246 ;; Tell CRDA where to find our database.
2247 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2248 (substitute* "crda.c"
2249 (("\"/lib/crda/regulatory.bin\"")
2250 (string-append "\"" regdb
2251 "/lib/crda/regulatory.bin\"")))
2252 #t))))
2253 #:test-target "verify"
2254 #:make-flags (let ((out (assoc-ref %outputs "out"))
2255 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2256 (list "CC=gcc" "V=1"
2257
2258 ;; Disable signature-checking on 'regulatory.bin'.
2259 ;; The reason is that this simplifies maintenance
2260 ;; on our side (no need to manage a distro key
2261 ;; pair), and we can guarantee integrity of
2262 ;; 'regulatory.bin' by other means anyway, such as
2263 ;; 'guix gc --verify'. See
2264 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2265 ;; for a discssion.
2266 "USE_OPENSSL=0"
2267
2268 (string-append "PREFIX=" out)
2269 (string-append "SBINDIR=" out "/sbin/")
2270 (string-append "UDEV_RULE_DIR="
2271 out "/lib/udev/rules.d")
2272 (string-append "LDFLAGS=-Wl,-rpath="
2273 out "/lib -L.")
2274 (string-append "REG_BIN=" regdb
2275 "/lib/crda/regulatory.bin")))))
2276 (native-inputs `(("pkg-config" ,pkg-config)
2277 ("python" ,python-2)
2278 ("wireless-regdb" ,wireless-regdb)))
2279 (inputs `(("libnl" ,libnl)))
2280 (home-page
2281 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2282 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2283 (description
2284 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2285communication between the kernel Linux and user space for regulatory
2286compliance.")
3ac73271 2287 (license license:copyleft-next)))
cc205dac 2288
c80b4a3e
LC
2289(define-public wireless-regdb
2290 (package
2291 (name "wireless-regdb")
a70782d3 2292 (version "2017.03.07")
c80b4a3e
LC
2293 (source (origin
2294 (method url-fetch)
2295 (uri (string-append
2296 "mirror://kernel.org/software/network/wireless-regdb/"
2297 "wireless-regdb-" version ".tar.xz"))
2298 (sha256
2299 (base32
a70782d3 2300 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
5568151f
LC
2301
2302 ;; We're building 'regulatory.bin' by ourselves.
2303 (snippet '(delete-file "regulatory.bin"))))
c80b4a3e
LC
2304 (build-system gnu-build-system)
2305 (arguments
2306 '(#:phases (modify-phases %standard-phases
2307 (delete 'configure))
5568151f
LC
2308
2309 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2310 ;; is computed and can be equal to 'maintainer-clean'; when that
2311 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2312 ;; just built. Thus, build things sequentially.
2313 #:parallel-build? #f
2314
c80b4a3e
LC
2315 #:tests? #f ;no tests
2316 #:make-flags (let ((out (assoc-ref %outputs "out")))
2317 (list (string-append "PREFIX=" out)
2318 (string-append "LSB_ID=GuixSD")
2319 (string-append "DISTRO_PUBKEY=/dev/null")
2320 (string-append "DISTRO_PRIVKEY=/dev/null")
2321 (string-append "REGDB_PUBKEY=/dev/null")
2322
2323 ;; Leave that empty so that db2bin.py doesn't try
2324 ;; to sign 'regulatory.bin'. This allows us to
2325 ;; avoid managing a key pair for the whole distro.
2326 (string-append "REGDB_PRIVKEY=")))))
2327 (native-inputs `(("python" ,python-2)))
2328 (home-page
2329 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2330 (synopsis "Wireless regulatory database")
2331 (description
2332 "This package contains the wireless regulatory database Central
2333Regulatory Database Agent (CRDA) daemon. The database contains information on
2334country-specific regulations for the wireless spectrum.")
3ac73271 2335 (license license:isc)))
c80b4a3e 2336
30016044
MW
2337(define-public lm-sensors
2338 (package
2339 (name "lm-sensors")
171091a8 2340 (version "3.4.0")
30016044
MW
2341 (source (origin
2342 (method url-fetch)
ee6a5d0e 2343 (uri (list (string-append
171091a8
AE
2344 "https://github.com/groeck/lm-sensors/archive/V"
2345 (string-join (string-split version #\.) "-")
2346 ".tar.gz")))
bc4a2b85 2347 (file-name (string-append name "-" version ".tar.gz"))
30016044
MW
2348 (sha256
2349 (base32
171091a8 2350 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
fc1adab1 2351 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
30016044
MW
2352 (build-system gnu-build-system)
2353 (inputs `(("rrdtool" ,rrdtool)
2354 ("perl" ,perl)
2355 ("kmod" ,kmod)
2356 ("gnuplot" ,gnuplot)))
2357 (native-inputs `(("pkg-config" ,pkg-config)
2358 ("flex" ,flex)
2359 ("bison" ,bison)
2360 ("which" ,which)))
2361 (arguments
2362 `(#:tests? #f ; no 'check' target
2363 #:make-flags (list (string-append "PREFIX=" %output)
2364 (string-append "ETCDIR=" %output "/etc")
2365 (string-append "MANDIR=" %output "/share/man"))
2366 #:phases
2367 (alist-delete
2368 'configure
2369 (alist-cons-before
2370 'build 'patch-exec-paths
2371 (lambda* (#:key inputs outputs #:allow-other-keys)
2372 (substitute* "prog/detect/sensors-detect"
2373 (("`uname")
2374 (string-append "`" (assoc-ref inputs "coreutils")
2375 "/bin/uname"))
2376 (("(`|\")modprobe" all open-quote)
2377 (string-append open-quote
2378 (assoc-ref inputs "kmod")
2379 "/bin/modprobe")))
2380 (substitute* '("prog/pwm/pwmconfig"
2381 "prog/pwm/fancontrol")
2382 (("gnuplot")
2383 (string-append (assoc-ref inputs "gnuplot")
2384 "/bin/gnuplot"))
2385 (("cat ")
2386 (string-append (assoc-ref inputs "coreutils")
2387 "/bin/cat "))
2388 (("egrep ")
2389 (string-append (assoc-ref inputs "grep")
2390 "/bin/egrep "))
2391 (("sed -e")
2392 (string-append (assoc-ref inputs "sed")
2393 "/bin/sed -e"))
2394 (("cut -d")
2395 (string-append (assoc-ref inputs "coreutils")
2396 "/bin/cut -d"))
2397 (("sleep ")
2398 (string-append (assoc-ref inputs "coreutils")
2399 "/bin/sleep "))
2400 (("readlink -f")
2401 (string-append (assoc-ref inputs "coreutils")
2402 "/bin/readlink -f"))))
2403 %standard-phases))))
3a04d5d4 2404 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
30016044
MW
2405 (synopsis "Utilities to read temperature/voltage/fan sensors")
2406 (description
35b9e423 2407 "Lm-sensors is a hardware health monitoring package for Linux. It allows
30016044
MW
2408you to access information from temperature, voltage, and fan speed sensors.
2409It works with most newer systems.")
3ac73271 2410 (license license:gpl2+)))
b087d413 2411
f5b2a53d
RW
2412(define-public i2c-tools
2413 (package
2414 (name "i2c-tools")
2415 (version "3.1.1")
2416 (source (origin
2417 (method url-fetch)
2418 (uri (string-append
f32274a7 2419 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
f5b2a53d
RW
2420 version ".tar.bz2"))
2421 (sha256
2422 (base32
2423 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2424 (build-system gnu-build-system)
2425 (arguments
2426 `(#:tests? #f ; no 'check' target
2427 #:make-flags (list (string-append "prefix=" %output)
2428 "CC=gcc")
2429 ;; no configure script
2430 #:phases (alist-delete 'configure %standard-phases)))
bccf27cb
RW
2431 (inputs
2432 `(("perl" ,perl)))
f32274a7 2433 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
f5b2a53d
RW
2434 (synopsis "I2C tools for Linux")
2435 (description
2436 "The i2c-tools package contains a heterogeneous set of I2C tools for
2437Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2438EEPROM decoding scripts, EEPROM programming tools, and a python module for
2439SMBus access.")
3ac73271 2440 (license license:gpl2+)))
f5b2a53d 2441
b087d413
MW
2442(define-public xsensors
2443 (package
2444 (name "xsensors")
2445 (version "0.70")
2446 (source (origin
2447 (method url-fetch)
2448 (uri (string-append
2449 "http://www.linuxhardware.org/xsensors/xsensors-"
2450 version ".tar.gz"))
2451 (sha256
2452 (base32
2453 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2454 (build-system gnu-build-system)
2455 (inputs `(("lm-sensors" ,lm-sensors)
2456 ("gtk" ,gtk+-2)))
2457 (native-inputs `(("pkg-config" ,pkg-config)))
2458 (arguments
2459 `(#:phases (alist-cons-before
2460 'configure 'enable-deprecated
2461 (lambda _
2462 (substitute* "src/Makefile.in"
2463 (("-DGDK_DISABLE_DEPRECATED") "")
2464 (("-DGTK_DISABLE_DEPRECATED") "")))
2465 (alist-cons-before
2466 'configure 'remove-Werror
2467 (lambda _
2468 (substitute* '("configure" "src/Makefile.in")
2469 (("-Werror") "")))
2470 %standard-phases))))
2471 (home-page "http://www.linuxhardware.org/xsensors/")
2472 (synopsis "Hardware health information viewer")
2473 (description
35b9e423 2474 "Xsensors reads data from the libsensors library regarding hardware
b087d413
MW
2475health such as temperature, voltage and fan speed and displays the information
2476in a digital read-out.")
3ac73271 2477 (license license:gpl2+)))
b62fe07f
LC
2478
2479(define-public perf
2480 (package
2481 (name "perf")
2482 (version (package-version linux-libre))
2483 (source (package-source linux-libre))
2484 (build-system gnu-build-system)
2485 (arguments
2486 '(#:phases (alist-replace
2487 'configure
2488 (lambda* (#:key inputs #:allow-other-keys)
2489 (setenv "SHELL_PATH" (which "bash"))
2490 (chdir "tools/perf"))
2491 %standard-phases)
2492 #:make-flags (list (string-append "DESTDIR="
2493 (assoc-ref %outputs "out"))
2af29d23
LC
2494 "WERROR=0"
2495
2496 ;; By default, 'config/Makefile' uses lib64 on
2497 ;; x86_64. Work around that.
2498 "lib=lib")
b62fe07f
LC
2499 #:tests? #f)) ;no tests
2500 (native-inputs
2501 `(("pkg-config" ,pkg-config)
2502 ("bison" ,bison)
2503 ("flex" ,flex)
2504
2505 ;; There are build scripts written in these languages.
2506 ("perl" ,perl)
2507 ("python" ,python-2)))
2508 (inputs
b1fb4b23 2509 `(("slang" ,slang) ;for the interactive TUI
b62fe07f 2510 ;; ("newt" ,newt)
6c030d10 2511 ("python" ,python-2) ;'perf' links against libpython
b62fe07f 2512 ("elfutils" ,elfutils)
b25d3bd9 2513 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
b62fe07f 2514
d7ece67a
LC
2515 ;; Documentation.
2516 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
d7ece67a
LC
2517 ("docbook-xsl" ,docbook-xsl)
2518 ("xmlto" ,xmlto)
2519 ("asciidoc" ,asciidoc)))
b62fe07f
LC
2520 (home-page "https://perf.wiki.kernel.org/")
2521 (synopsis "Linux profiling with performance counters")
2522 (description
2523 "perf is a tool suite for profiling using hardware performance counters,
2524with support in the Linux kernel. perf can instrument CPU performance
2525counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2526of lightweight profiling. This package contains the user-land tools and in
2527particular the 'perf' command.")
2528 (license (package-license linux-libre))))
c09e60e4
DT
2529
2530(define-public pflask
2531 (package
2532 (name "pflask")
2533 (version "0.2")
2534 (source (origin
2535 (method url-fetch)
2536 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2537 version ".tar.gz"))
f586c877 2538 (file-name (string-append name "-" version ".tar.gz"))
c09e60e4
DT
2539 (sha256
2540 (base32
2541 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2542 (build-system cmake-build-system)
2543 (arguments
2544 '(#:tests? #f)) ; no tests
2545 (home-page "http://ghedo.github.io/pflask/")
2546 (synopsis "Simple tool for creating Linux namespace containers")
2547 (description "pflask is a simple tool for creating Linux namespace
2548containers. It can be used for running a command or even booting an OS inside
2549an isolated container, created with the help of Linux namespaces. It is
2550similar in functionality to chroot, although pflask provides better isolation
2551thanks to the use of namespaces.")
3ac73271 2552 (license license:bsd-2)))
288084d5
MW
2553
2554(define-public hdparm
2555 (package
2556 (name "hdparm")
8a1bb378 2557 (version "9.52")
288084d5
MW
2558 (source (origin
2559 (method url-fetch)
de67e922 2560 (uri (string-append "mirror://sourceforge/" name "/" name "/"
288084d5
MW
2561 name "-" version ".tar.gz"))
2562 (sha256
2563 (base32
8a1bb378 2564 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
288084d5
MW
2565 (build-system gnu-build-system)
2566 (arguments
2567 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2568 (list (string-append "binprefix=" out)
2569 (string-append "manprefix=" out)
2570 "CC=gcc"))
ec238332
TGR
2571 #:phases
2572 (modify-phases %standard-phases
2573 (delete 'configure)) ; no configure script
2574 #:tests? #f)) ; no test suite
3b3b60d0 2575 (home-page "https://sourceforge.net/projects/hdparm/")
02052b2c 2576 (synopsis "View and tune ATA disk drive parameters")
288084d5 2577 (description
02052b2c
TGR
2578 "@command{hdparm} is a command-line utility to control ATA controllers and
2579disk drives. It can increase performance and/or reliability by careful tuning
2580of hardware settings like power and acoustic management, DMA modes, and caching.
2581It can also display detailed device information, or be used as a simple
2582performance benchmarking tool.
2583
2584@command{hdparm} provides a command line interface to various Linux kernel
2585interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2586IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2587Command Translation} (SAT) are also supported.")
3ac73271 2588 (license (license:non-copyleft "file://LICENSE.TXT"))))
288084d5 2589
c755c854
MW
2590(define-public rfkill
2591 (package
2592 (name "rfkill")
2593 (version "0.5")
2594 (source (origin
2595 (method url-fetch)
2596 (uri (string-append "mirror://kernel.org/software/network/"
2597 name "/" name "-" version ".tar.xz"))
2598 (sha256
2599 (base32
2600 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2601 (build-system gnu-build-system)
2602 (arguments
2603 `(#:make-flags (list "CC=gcc"
2604 (string-append "PREFIX=" %output))
2605 #:phases (modify-phases %standard-phases
2606 (delete 'configure))
2607 #:tests? #f))
2608 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2609 (synopsis "Tool for enabling and disabling wireless devices")
2610 (description
2611 "rfkill is a simple tool for accessing the rfkill device interface,
2612which is used to enable and disable wireless networking devices, typically
2613WLAN, Bluetooth and mobile broadband.")
3ac73271
LC
2614 (license (license:non-copyleft "file://COPYING"
2615 "See COPYING in the distribution."))))
c755c854 2616
dc9bdb1e
ML
2617(define-public acpi
2618 (package
2619 (name "acpi")
2620 (version "1.7")
2621 (source (origin
2622 (method url-fetch)
de67e922
LF
2623 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2624 version "/" name "-" version ".tar.gz"))
dc9bdb1e
ML
2625 (sha256
2626 (base32
2627 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2628 (build-system gnu-build-system)
2629 (home-page "http://acpiclient.sourceforge.net")
2630 (synopsis "Display information on ACPI devices")
2631 (description "@code{acpi} attempts to replicate the functionality of the
2632\"old\" @code{apm} command on ACPI systems, including battery and thermal
2633information. It does not support ACPI suspending, only displays information
2634about ACPI devices.")
2635 (license license:gpl2+)))
2636
57a516d3
LC
2637(define-public acpid
2638 (package
2639 (name "acpid")
169a438c 2640 (version "2.0.28")
57a516d3
LC
2641 (source (origin
2642 (method url-fetch)
2643 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2644 version ".tar.xz"))
2645 (sha256
2646 (base32
169a438c 2647 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
57a516d3 2648 (build-system gnu-build-system)
3b3b60d0 2649 (home-page "https://sourceforge.net/projects/acpid2/")
57a516d3
LC
2650 (synopsis "Daemon for delivering ACPI events to user-space programs")
2651 (description
2652 "acpid is designed to notify user-space programs of Advanced
2653Configuration and Power Interface (ACPI) events. acpid should be started
2654during the system boot, and will run as a background process. When an ACPI
2655event is received from the kernel, acpid will examine the list of rules
2656specified in /etc/acpi/events and execute the rules that match the event.")
3ac73271 2657 (license license:gpl2+)))
37f5caec
TUBK
2658
2659(define-public sysfsutils
2660 (package
2661 (name "sysfsutils")
2662 (version "2.1.0")
2663 (source
2664 (origin
2665 (method url-fetch)
2666 (uri
2667 (string-append
2668 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2669 version ".tar.gz"))
2670 (sha256
2671 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2672 (build-system gnu-build-system)
2673 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2674 (synopsis "System utilities based on Linux sysfs")
2675 (description
8f65585b 2676 "These are a set of utilities built upon sysfs, a virtual file system in
37f5caec
TUBK
2677Linux kernel versions 2.5+ that exposes a system's device tree. The package
2678also contains the libsysfs library.")
2679 ;; The library is under lgpl2.1+ (all files say "or any later version").
2680 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
3ac73271 2681 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
a9a1a40b
TUBK
2682
2683(define-public sysfsutils-1
2684 (package
2685 (inherit sysfsutils)
2686 (version "1.3.0")
2687 (source
2688 (origin
2689 (method url-fetch)
2690 (uri
2691 (string-append
2692 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2693 "/sysfsutils-" version ".tar.gz"))
2694 (sha256
2695 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2696 (modules '((guix build utils)))
2697 (snippet
2698 '(begin
2699 (substitute* "Makefile.in"
2700 (("includedir = /usr/include/sysfs")
2701 "includedir = @includedir@"))
2702 (substitute* "configure"
2703 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2704 (string-append "includedir='" orig "/sysfs'")))))))
2705 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
e6caa52d
TUBK
2706
2707(define-public cpufrequtils
2708 (package
2709 (name "cpufrequtils")
2710 (version "0.3")
2711 (source
2712 (origin
2713 (method url-fetch)
2714 (uri
2715 (string-append
2716 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2717 version ".tar.gz"))
2718 (sha256
2719 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
fc1adab1 2720 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
e6caa52d
TUBK
2721 (build-system gnu-build-system)
2722 (native-inputs
2723 `(("sysfsutils" ,sysfsutils-1)))
2724 (arguments
2725 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2726 (assoc-ref %outputs "out") "/lib"))))
2727 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2728 (synopsis "Utilities to get and set CPU frequency on Linux")
2729 (description
e881752c 2730 "The cpufrequtils suite contains utilities to retrieve CPU frequency
e6caa52d
TUBK
2731information, and set the CPU frequency if supported, using the cpufreq
2732capabilities of the Linux kernel.")
3ac73271 2733 (license license:gpl2)))
0a588bf9
SB
2734
2735(define-public libraw1394
2736 (package
2737 (name "libraw1394")
7c58c852 2738 (version "2.1.2")
0a588bf9
SB
2739 (source (origin
2740 (method url-fetch)
2741 (uri (string-append
2742 "mirror://kernel.org/linux/libs/ieee1394/"
2743 name "-" version ".tar.xz"))
2744 (sha256
2745 (base32
7c58c852 2746 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
0a588bf9
SB
2747 (build-system gnu-build-system)
2748 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2749 (synopsis "Interface library for the Linux IEEE1394 drivers")
2750 (description
2751 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2752the Linux IEEE-1394 subsystem, which provides direct access to the connected
27531394 buses to user space. Through libraw1394/raw1394, applications can directly
2754send to and receive from other nodes without requiring a kernel driver for the
2755protocol in question.")
3ac73271 2756 (license license:lgpl2.1+)))
68e3c29d
SB
2757
2758(define-public libavc1394
2759 (package
2760 (name "libavc1394")
2761 (version "0.5.4")
2762 (source (origin
2763 (method url-fetch)
de67e922 2764 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
68e3c29d
SB
2765 name "-" version ".tar.gz"))
2766 (sha256
2767 (base32
2768 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2769 (build-system gnu-build-system)
2770 (native-inputs
2771 `(("pkg-config" ,pkg-config)))
2772 (propagated-inputs
2773 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
3b3b60d0 2774 (home-page "https://sourceforge.net/projects/libavc1394/")
68e3c29d
SB
2775 (synopsis "AV/C protocol library for IEEE 1394")
2776 (description
2777 "Libavc1394 is a programming interface to the AV/C specification from
69b4ffcf 2778the 1394 Trade Association. AV/C stands for Audio/Video Control.")
3ac73271 2779 (license license:lgpl2.1+)))
3f7bf86a
SB
2780
2781(define-public libiec61883
2782 (package
2783 (name "libiec61883")
2784 (version "1.2.0")
2785 (source (origin
2786 (method url-fetch)
2787 (uri (string-append
2788 "mirror://kernel.org/linux/libs/ieee1394/"
2789 name "-" version ".tar.xz"))
2790 (sha256
2791 (base32
2792 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2793 (build-system gnu-build-system)
2794 (native-inputs
2795 `(("pkg-config" ,pkg-config)))
2796 (propagated-inputs
2797 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2798 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2799 (synopsis "Isochronous streaming media library for IEEE 1394")
2800 (description
2801 "The libiec61883 library provides a higher level API for streaming DV,
2802MPEG-2 and audio over Linux IEEE 1394.")
3ac73271 2803 (license license:lgpl2.1+)))
69159125
MW
2804
2805(define-public mdadm
2806 (package
2807 (name "mdadm")
fae88ae8 2808 (version "4.0")
69159125
MW
2809 (source (origin
2810 (method url-fetch)
2811 (uri (string-append
2812 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2813 version ".tar.xz"))
2814 (sha256
2815 (base32
fae88ae8 2816 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
69159125
MW
2817 (build-system gnu-build-system)
2818 (inputs
2819 `(("udev" ,eudev)))
2820 (arguments
2821 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
fae88ae8
LC
2822 (list "CC=gcc"
2823 "INSTALL=install"
69159125
MW
2824 "CHECK_RUN_DIR=0"
2825 ;; TODO: tell it where to find 'sendmail'
2826 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2827 (string-append "BINDIR=" out "/sbin")
2828 (string-append "MANDIR=" out "/share/man")
2829 (string-append "UDEVDIR=" out "/lib/udev")))
2830 #:phases (alist-cons-before
2831 'build 'patch-program-paths
2832 (lambda* (#:key inputs #:allow-other-keys)
2833 (let ((coreutils (assoc-ref inputs "coreutils")))
2834 (substitute* "udev-md-raid-arrays.rules"
2835 (("/usr/bin/(readlink|basename)" all program)
2836 (string-append coreutils "/bin/" program)))))
d76f44e8
LC
2837 (alist-cons-before
2838 'build 'remove-W-error
2839 (lambda _
2840 ;; We cannot build with -Werror on i686 due to a
2841 ;; 'sign-compare' warning in util.c.
2842 (substitute* "Makefile"
2843 (("-Werror") ""))
2844 #t)
2845 (alist-delete 'configure %standard-phases)))
69159125
MW
2846 ;;tests must be done as root
2847 #:tests? #f))
2848 (home-page "http://neil.brown.name/blog/mdadm")
2849 (synopsis "Tool for managing Linux Software RAID arrays")
2850 (description
2851 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2852assemble, report on, and monitor arrays. It can also move spares between raid
2853arrays when needed.")
3ac73271 2854 (license license:gpl2+)))
01ccdfb6 2855
631fda7e
LC
2856(define-public mdadm-static
2857 (package
2858 (inherit mdadm)
2859 (name "mdadm-static")
2860 (arguments
2861 (substitute-keyword-arguments (package-arguments mdadm)
2862 ((#:make-flags flags)
2863 `(cons "LDFLAGS = -static" ,flags))
2864 ((#:phases phases)
2865 `(modify-phases ,phases
2866 (add-after 'install 'remove-cruft
2867 (lambda* (#:key outputs #:allow-other-keys)
2868 (let* ((out (assoc-ref outputs "out"))
2869 (precious? (lambda (file)
2870 (member file '("." ".." "sbin"))))
2871 (directories (scandir out (negate precious?))))
2872 (with-directory-excursion out
2873 (for-each delete-file-recursively directories)
2874 (remove-store-references "sbin/mdadm")
2875 (delete-file "sbin/mdmon")
2876 #t))))))
2877 ((#:modules modules %gnu-build-system-modules)
2878 `((ice-9 ftw) ,@modules))
2879 ((#:strip-flags _ '())
2880 ''("--strip-all")) ;strip a few extra KiB
2881 ((#:allowed-references _ '("out"))
2882 '("out")))) ;refer only self
2883 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2884
b3ed50e6
MB
2885(define-public multipath-tools
2886 (package
2887 (name "multipath-tools")
7f412f33 2888 (version "0.7.1")
b3ed50e6
MB
2889 (source (origin
2890 (method url-fetch)
2891 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2892 ".git;a=snapshot;h=" version ";sf=tgz"))
2893 (file-name (string-append name "-" version ".tar.gz"))
2894 (sha256
2895 (base32
7f412f33 2896 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
b3ed50e6
MB
2897 (modules '((guix build utils)))
2898 (snippet
2899 '(begin
2900 ;; Drop bundled valgrind headers.
2901 (delete-file-recursively "third-party")
2902 (substitute* '("multipathd/main.c"
2903 "libmultipath/debug.c")
2904 (("#include \"../third-party/")
2905 "#include \""))
2906 #t))))
2907 (build-system gnu-build-system)
2908 (arguments
2909 '(#:tests? #f ; No tests.
2910 #:make-flags (list (string-append "DESTDIR="
2911 (assoc-ref %outputs "out"))
b5fb9430 2912 "SYSTEMDPATH=lib"
b3ed50e6
MB
2913 (string-append "LDFLAGS=-Wl,-rpath="
2914 (assoc-ref %outputs "out")
2915 "/lib"))
2916 #:phases
2917 (modify-phases %standard-phases
b5fb9430 2918 (add-after 'unpack 'patch-source
7f412f33
MB
2919 (lambda* (#:key inputs #:allow-other-keys)
2920 (let ((lvm2 (assoc-ref inputs "lvm2"))
2921 (udev (assoc-ref inputs "udev")))
2922 (substitute* "Makefile.inc"
2923 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2924 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2925 (("/usr/include/libdevmapper.h")
2926 (string-append lvm2 "/include/libdevmapper.h"))
2927 (("/usr/include/libudev.h")
2928 (string-append udev "/include/libudev.h")))
2929 #t)))
b3ed50e6
MB
2930 (delete 'configure)
2931 (add-before 'build 'set-CC
2932 (lambda _
2933 (setenv "CC" "gcc")
2934 #t)))))
2935 (native-inputs
7f412f33
MB
2936 `(("perl" ,perl)
2937 ("pkg-config" ,pkg-config)
2938 ("valgrind" ,valgrind)))
b3ed50e6
MB
2939 (inputs
2940 `(("ceph:lib" ,ceph "lib")
7f412f33 2941 ("json-c" ,json-c)
b3ed50e6
MB
2942 ("libaio" ,libaio)
2943 ("liburcu" ,liburcu)
2944 ("lvm2" ,lvm2)
2945 ("readline" ,readline)
2946 ("udev" ,eudev)))
2947 (home-page "http://christophe.varoqui.free.fr/")
2948 (synopsis "Access block devices through multiple paths")
2949 (description
2950 "This package provides the following binaries to drive the
2951Linux Device Mapper multipathing driver:
2952@enumerate
2953@item @command{multipath} - Device mapper target autoconfig.
2954@item @command{multipathd} - Multipath daemon.
2955@item @command{mpathpersist} - Manages SCSI persistent reservations on
2956@code{dm} multipath devices.
2957@item @command{kpartx} - Create device maps from partition tables.
2958@end enumerate")
2959 (license (list license:gpl2+ ; Main distribution.
2960 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2961
01ccdfb6
SB
2962(define-public libaio
2963 (package
2964 (name "libaio")
2965 (version "0.3.110")
2966 (source (origin
2967 (method url-fetch)
2968 (uri (list
2969 (string-append "mirror://debian/pool/main/liba/libaio/"
4929a061 2970 name "_" version ".orig.tar.gz")))
01ccdfb6
SB
2971 (sha256
2972 (base32
2973 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2974 (build-system gnu-build-system)
2975 (arguments
2976 '(#:make-flags
2977 (list "CC=gcc" (string-append "prefix=" %output))
2978 #:test-target "partcheck" ; need root for a full 'check'
2979 #:phases
2980 (alist-delete 'configure %standard-phases))) ; no configure script
2981 (home-page "http://lse.sourceforge.net/io/aio.html")
2982 (synopsis "Linux-native asynchronous I/O access library")
2983 (description
2984 "This library enables userspace to use Linux kernel asynchronous I/O
2985system calls, important for the performance of databases and other advanced
2986applications.")
3ac73271 2987 (license license:lgpl2.1+)))
eb7c43c3 2988
81b98756
RW
2989(define-public sbc
2990 (package
2991 (name "sbc")
2992 (version "1.3")
2993 (source (origin
2994 (method url-fetch)
2995 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2996 name "-" version ".tar.xz"))
2997 (sha256
2998 (base32
2999 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
3000 (build-system gnu-build-system)
3001 (inputs
3002 `(("libsndfile" ,libsndfile)))
3003 (native-inputs
3004 `(("pkg-config" ,pkg-config)))
3005 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
3006 (synopsis "Bluetooth subband audio codec")
3007 (description
3008 "The SBC is a digital audio encoder and decoder used to transfer data to
3009Bluetooth audio output devices like headphones or loudspeakers.")
3010 (license license:gpl2+)))
3011
eb7c43c3
DT
3012(define-public bluez
3013 (package
3014 (name "bluez")
3590a6b5 3015 (version "5.45")
eb7c43c3
DT
3016 (source (origin
3017 (method url-fetch)
3018 (uri (string-append
e9eb24b1 3019 "mirror://kernel.org/linux/bluetooth/bluez-"
eb7c43c3
DT
3020 version ".tar.xz"))
3021 (sha256
3022 (base32
3590a6b5 3023 "1sb4aflgyrl7apricjipa8wx95qm69yja0lmn2f19g560c3v1b2c"))))
eb7c43c3
DT
3024 (build-system gnu-build-system)
3025 (arguments
90ea83ee 3026 `(#:configure-flags
eb7c43c3 3027 (let ((out (assoc-ref %outputs "out")))
f3dbc626
SB
3028 (list "--sysconfdir=/etc"
3029 "--localstatedir=/var"
3030 "--enable-library"
53142109 3031 "--disable-systemd"
eb7c43c3
DT
3032 ;; Install dbus/udev files to the correct location.
3033 (string-append "--with-dbusconfdir=" out "/etc")
87a16de7
SB
3034 (string-append "--with-udevdir=" out "/lib/udev")))
3035 #:phases
3036 (modify-phases %standard-phases
3037 (add-after 'install 'post-install
3038 (lambda* (#:key inputs outputs #:allow-other-keys)
3039 (let* ((out (assoc-ref outputs "out"))
3040 (servicedir (string-append out "/share/dbus-1/services"))
3041 (service "obexd/src/org.bluez.obex.service")
3042 (rule (string-append
3043 out "/lib/udev/rules.d/97-hid2hci.rules")))
3044 ;; Install the obex dbus service file.
3045 (substitute* service
3046 (("/bin/false")
3047 (string-append out "/libexec/bluetooth/obexd")))
3048 (install-file service servicedir)
3049 ;; Fix paths in the udev rule.
3050 (substitute* rule
3051 (("hid2hci --method")
3052 (string-append out "/lib/udev/hid2hci --method"))
3053 (("/sbin/udevadm")
3054 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
90ea83ee
LC
3055 #t))))
3056
3057 ;; FIXME: Skip one test that segfaults on ARM.
3058 ,@(if (string=? (%current-system) "armhf-linux")
3059 '(#:make-flags '("XFAIL_TESTS=unit/test-gatt"))
3060 '())))
eb7c43c3
DT
3061 (native-inputs
3062 `(("pkg-config" ,pkg-config)
b94a6ca0 3063 ("gettext" ,gettext-minimal)))
eb7c43c3
DT
3064 (inputs
3065 `(("glib" ,glib)
3066 ("dbus" ,dbus)
3067 ("eudev" ,eudev)
3068 ("libical" ,libical)
3069 ("readline" ,readline)))
3070 (home-page "http://www.bluez.org/")
3071 (synopsis "Linux Bluetooth protocol stack")
3072 (description
3073 "BlueZ provides support for the core Bluetooth layers and protocols. It
3074is flexible, efficient and uses a modular implementation.")
3ac73271 3075 (license license:gpl2+)))
3d890318
LC
3076
3077(define-public fuse-exfat
3078 (package
3079 (name "fuse-exfat")
be900082 3080 (version "1.2.7")
3d890318
LC
3081 (source (origin
3082 (method url-fetch)
c0cc805e
TGR
3083 (uri (string-append
3084 "https://github.com/relan/exfat/releases/download/v"
3085 version "/" name "-" version ".tar.gz"))
3d890318
LC
3086 (sha256
3087 (base32
be900082 3088 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
3d890318
LC
3089 (build-system gnu-build-system)
3090 (native-inputs
c0cc805e 3091 `(("pkg-config" ,pkg-config)))
3d890318
LC
3092 (inputs
3093 `(("fuse" ,fuse)))
c0cc805e 3094 (home-page "https://github.com/relan/exfat")
3d890318
LC
3095 (synopsis "Mount exFAT file systems")
3096 (description
3097 "This package provides a FUSE-based file system that provides read and
3098write access to exFAT devices.")
3ac73271 3099 (license license:gpl2+)))
53ec8d48
LC
3100
3101(define-public gpm
3102 (package
3103 (name "gpm")
3104 (version "1.20.7")
3105 (source (origin
3106 (method url-fetch)
3107 (uri (string-append
3108 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
3109 version ".tar.bz2"))
3110 (sha256
3111 (base32
3112 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
3113 (build-system gnu-build-system)
3114 (arguments
3115 '(#:phases (modify-phases %standard-phases
d10092b8 3116 (add-after 'unpack 'bootstrap
53ec8d48
LC
3117 (lambda _
3118 ;; The tarball was not generated with 'make dist' so we
3119 ;; need to bootstrap things ourselves.
77bb6c22
EF
3120 (substitute* "autogen.sh"
3121 (("/bin/sh") (which "sh")))
53ec8d48
LC
3122 (and (zero? (system* "./autogen.sh"))
3123 (begin
3124 (patch-makefile-SHELL "Makefile.include.in")
3125 #t)))))
3126
3127 ;; Make sure programs find libgpm.so.
3128 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
3129 (assoc-ref %outputs "out")
3130 "/lib"))))
3131 (native-inputs
3132 `(("texinfo" ,texinfo)
3133 ("bison" ,bison)
3134 ("flex" ,flex)
3135 ("autoconf" ,autoconf)
3136 ("automake" ,automake)
3137 ("libtool" ,libtool)))
3138 (home-page "http://www.nico.schottelius.org/software/gpm/")
3139 (synopsis "Mouse support for the Linux console")
3140 (description
3141 "The GPM (general-purpose mouse) daemon is a mouse server for
3142applications running on the Linux console. It allows users to select items
3143and copy/paste text in the console and in xterm.")
3ac73271 3144 (license license:gpl2+)))
fc686f9a
TGR
3145
3146(define-public btrfs-progs
3147 (package
3148 (name "btrfs-progs")
c4b006ba 3149 (version "4.12")
fc686f9a
TGR
3150 (source (origin
3151 (method url-fetch)
3152 (uri (string-append "mirror://kernel.org/linux/kernel/"
3153 "people/kdave/btrfs-progs/"
3154 "btrfs-progs-v" version ".tar.xz"))
3155 (sha256
3156 (base32
c4b006ba 3157 "1kif8xw2dbyc70ygkp0wyq4x96p1mkwdv4430f99qllx9b410xwi"))))
fc686f9a 3158 (build-system gnu-build-system)
7cad981d 3159 (outputs '("out"
c4b006ba 3160 "static")) ; static versions of the binaries in "out"
fc686f9a 3161 (arguments
7cad981d
TGR
3162 '(#:phases (modify-phases %standard-phases
3163 (add-after 'build 'build-static
3164 (lambda _ (zero? (system* "make" "static"))))
3165 (add-after 'install 'install-static
3166 (let ((staticbin (string-append (assoc-ref %outputs "static")
3167 "/bin")))
3168 (lambda _
3169 (zero? (system* "make"
3170 (string-append "bindir=" staticbin)
3171 "install-static"))))))
3172 #:test-target "test"
fc686f9a
TGR
3173 #:parallel-tests? #f)) ; tests fail when run in parallel
3174 (inputs `(("e2fsprogs" ,e2fsprogs)
3175 ("libblkid" ,util-linux)
7cad981d 3176 ("libblkid:static" ,util-linux "static")
fc686f9a 3177 ("libuuid" ,util-linux)
7cad981d 3178 ("libuuid:static" ,util-linux "static")
fc686f9a
TGR
3179 ("zlib" ,zlib)
3180 ("lzo" ,lzo)))
3181 (native-inputs `(("pkg-config" ,pkg-config)
3182 ("asciidoc" ,asciidoc)
3183 ("xmlto" ,xmlto)
41d23dd1 3184 ;; For building documentation.
fc686f9a 3185 ("libxml2" ,libxml2)
48b7e4a6 3186 ("docbook-xsl" ,docbook-xsl)
41d23dd1 3187 ;; For tests.
48b7e4a6 3188 ("which" ,which)))
fc686f9a
TGR
3189 (home-page "https://btrfs.wiki.kernel.org/")
3190 (synopsis "Create and manage btrfs copy-on-write file systems")
039601e0
TGR
3191 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3192aimed at implementing advanced features while focusing on fault tolerance,
3193repair and easy administration.")
68bcac6b
LF
3194 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3195 ;; GPL2: Everything else.
3196 (license (list license:gpl2 license:gpl2+))))
08e9daf5 3197
f3e44f5c
DC
3198(define-public btrfs-progs/static
3199 (package
3200 (name "btrfs-progs-static")
3201 (version (package-version btrfs-progs))
3202 (source #f)
3203 (build-system trivial-build-system)
3204 (inputs
3205 `(("btrfs-progs:static" ,btrfs-progs "static")))
3206 (arguments
3207 `(#:modules ((guix build utils))
3208 #:builder
3209 (begin
3210 (use-modules (guix build utils)
3211 (ice-9 ftw)
3212 (srfi srfi-26))
3213
3214 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3215 (out (assoc-ref %outputs "out"))
3216 (source (string-append btrfs "/bin/btrfs.static"))
3217 (target (string-append out "/bin/btrfs")))
3218 (mkdir-p (dirname target))
3219 (copy-file source target)
3220 (remove-store-references target)
3221 (chmod target #o555)))))
3222 (home-page (package-home-page btrfs-progs))
ff797172
TGR
3223 (synopsis "Statically-linked btrfs command from btrfs-progs")
3224 (description "This package provides the statically-linked @command{btrfs}
3225from the btrfs-progs package. It is meant to be used in initrds.")
f3e44f5c
DC
3226 (license (package-license btrfs-progs))))
3227
2e456982
MB
3228(define-public f2fs-tools
3229 (package
3230 (name "f2fs-tools")
3231 (version "1.8.0")
3232 (source (origin
3233 (method url-fetch)
3234 (uri (string-append
3235 "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk"
3236 "/f2fs-tools.git/snapshot/" name "-" version ".tar.gz"))
3237 (sha256
3238 (base32
3239 "1bir9ladb58ijlcvrjrq1fb1xv5ys50zdjaq0yzliib0apsyrnyl"))))
3240 (build-system gnu-build-system)
3241 (arguments
3242 `(#:phases
3243 (modify-phases %standard-phases
3244 (add-after 'unpack 'bootstrap
3245 (lambda _
3246 (zero? (system* "autoreconf" "-vif")))))))
3247 (native-inputs
3248 `(("autoconf" ,autoconf)
3249 ("automake" ,automake)
3250 ("libtool" ,libtool)
3251 ("pkg-config" ,pkg-config)))
3252 (inputs
3253 `(("libuuid" ,util-linux)))
3254 (home-page "https://f2fs.wiki.kernel.org/")
3255 (synopsis "Userland tools for f2fs")
3256 (description
3257 "F2FS, the Flash-Friendly File System, is a modern file system
3258designed to be fast and durable on flash devices such as solid-state
3259disks and SD cards. This package provides the userland utilities.")
3260 ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual
3261 ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'.
3262 (license (list license:gpl2 license:lgpl2.1))))
3263
08e9daf5
TGR
3264(define-public freefall
3265 (package
3266 (name "freefall")
3267 (version (package-version linux-libre))
3268 (source (package-source linux-libre))
3269 (build-system gnu-build-system)
3270 (arguments
3271 '(#:phases (modify-phases %standard-phases
3272 (add-after 'unpack 'enter-subdirectory
3273 (lambda _
3274 (chdir "tools/laptop/freefall")))
3275 (delete 'configure)
3276 (add-before 'build 'increase-timeout
3277 (lambda _
3278 ;; The default of 2 seconds is too low: it assumes an
3279 ;; open lid and AC power without actually checking.
3280 (substitute* "freefall.c"
3281 (("alarm\\(2\\)") "alarm(5)")))))
3282 #:make-flags (list (string-append "PREFIX="
3283 (assoc-ref %outputs "out")))
3284 #:tests? #f)) ;no tests
3285 (home-page (package-home-page linux-libre))
3286 (synopsis "Free-fall protection for spinning laptop hard drives")
3287 (description
3288 "Prevents shock damage to the internal spinning hard drive(s) of some
3289HP and Dell laptops. When sudden movement is detected, all input/output
3290operations on the drive are suspended and its heads are parked on the ramp,
3291where they are less likely to cause damage to the spinning disc. Requires a
3292drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3293feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3294 (license license:gpl2)))
d17ae8c0
NG
3295
3296(define-public thinkfan
3297 (package
3298 (name "thinkfan")
3299 (version "0.9.3")
3300 (source (origin
3301 (method url-fetch)
3302 (uri (string-append "mirror://sourceforge/thinkfan/"
de67e922 3303 "/thinkfan-" version ".tar.gz"))
d17ae8c0
NG
3304 (sha256
3305 (base32
3306 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3307 (modules '((guix build utils)))
3308 ;; Fix erroneous man page location in Makefile leading to
3309 ;; a compilation failure.
3310 (snippet
3311 '(substitute* "CMakeLists.txt"
3312 (("thinkfan\\.1") "src/thinkfan.1")))))
3313 (build-system cmake-build-system)
3314 (arguments
3315 `(#:modules ((guix build cmake-build-system)
3316 (guix build utils)
3317 (srfi srfi-26))
3318 #:tests? #f ;no test target
3319 #:configure-flags
3320 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3321 `("-DUSE_ATASMART:BOOL=ON")
3322 #:phases
3323 (modify-phases %standard-phases
75e56aed
NG
3324 ;; Install scripts for various foreign init systems. Also fix
3325 ;; hard-coded path for daemon.
d17ae8c0
NG
3326 (add-after 'install 'install-rc-scripts
3327 (lambda* (#:key outputs #:allow-other-keys)
75e56aed
NG
3328 (let ((out (assoc-ref outputs "out"))
3329 (files (find-files
3330 (string-append "../thinkfan-" ,version "/rcscripts")
3331 ".*")))
3332 (substitute* files
3333 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3334 (string-append out "/sbin/" name)))
3335 (for-each (cute install-file <>
3336 (string-append out "/share/thinkfan"))
3337 files))
d17ae8c0
NG
3338 #t)))))
3339 (inputs
3340 `(("libatasmart" ,libatasmart)))
3341 (home-page "http://thinkfan.sourceforge.net/")
3342 (synopsis "Simple fan control program")
3343 (description
3344 "Thinkfan is a simple fan control program. It reads temperatures,
3345checks them against configured limits and switches to appropriate (also
3346pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3347other @code{hwmon} driver that enables temperature reading and fan control
3348from userspace.")
3349 (license license:gpl3+)))
91231156
LC
3350
3351(define-public ntfs-3g
3352 (package
3353 (name "ntfs-3g")
d8af4f6d 3354 (version "2017.3.23")
91231156
LC
3355 (source (origin
3356 (method url-fetch)
3357 (uri (string-append "https://tuxera.com/opensource/"
3358 "ntfs-3g_ntfsprogs-" version ".tgz"))
3359 (sha256
3360 (base32
d8af4f6d 3361 "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy"))
91231156
LC
3362 (modules '((guix build utils)))
3363 (snippet
3364 ;; Install under $prefix.
3365 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3366 (("/sbin")
3367 "@sbindir@")))))
3368 (build-system gnu-build-system)
3369 (inputs `(("util-linux" ,util-linux)
3370 ("fuse" ,fuse))) ;libuuid
3371 (native-inputs `(("pkg-config" ,pkg-config)))
3372 (arguments
3373 '(#:configure-flags (list "--exec-prefix=${prefix}"
3374 "--with-fuse=external" ;use our own FUSE
3375 "--enable-mount-helper"
3376 "--enable-posix-acls"
3377 "--enable-xattr-mappings")))
8bad0c0b 3378 (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/")
91231156
LC
3379 (synopsis "Read-write access to NTFS file systems")
3380 (description
3381 "NTFS-3G provides read-write access to NTFS file systems, which are
3382commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3383The package provides additional NTFS tools.")
3384 (license license:gpl2+)))
9b0942c1 3385
f8f44dd7
MB
3386(define-public rdma-core
3387 (package
3388 (name "rdma-core")
5826e7b1 3389 (version "14")
f8f44dd7
MB
3390 (source (origin
3391 (method url-fetch)
3392 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3393 "/releases/download/v" version "/rdma-core-"
3394 version ".tar.gz"))
3395 (sha256
3396 (base32
5826e7b1 3397 "0w03zd49k96bmly44qc8l0s9l671sd26k4wrilsp13xaspy048kd"))))
f8f44dd7
MB
3398 (build-system cmake-build-system)
3399 (arguments
3400 '(#:tests? #f ; no tests
3401 ;; Upstream uses the "ninja" build system and encourage distros
3402 ;; to do the same for consistency. They also recommend using the
3403 ;; "Release" build type.
3404 #:configure-flags (list "-GNinja"
3405 ;; Defaults to "lib64" on 64-bit archs.
3406 (string-append "-DCMAKE_INSTALL_LIBDIR="
3407 (assoc-ref %outputs "out") "/lib")
3408 "-DCMAKE_BUILD_TYPE=Release")
3409 #:phases
3410 (modify-phases %standard-phases
3411 (replace 'build
3412 (lambda _
3413 (zero? (system* "ninja"
3414 "-j" (number->string (parallel-job-count))))))
3415 (replace 'install
3416 (lambda _
3417 (zero? (system* "ninja" "install")))))))
3418 (native-inputs
3419 `(("ninja" ,ninja)
3420 ("pkg-config" ,pkg-config)
3421 ("python" ,python-wrapper)))
3422 (inputs
3423 `(("libnl" ,libnl)
3424 ("udev" ,eudev)))
3425 (home-page "https://github.com/linux-rdma/rdma-core")
3426 (synopsis "Utilities and libraries for working with RDMA devices")
3427 (description
3428 "This package provides userspace components for the InfiniBand
3429subsystem of the Linux kernel. Specifically it contains userspace
3430libraries for the following device nodes:
3431
3432@enumerate
3433@item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3434@item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3435@item @file{/dev/infiniband/umadX} (@code{libibumad})
3436@end enumerate
3437
3438The following service daemons are also provided:
3439@enumerate
3440@item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3441@item @code{iwpmd} (for iWARP kernel providers)
3442@item @code{ibacm} (for InfiniBand communication management assistant)
3443@end enumerate")
3444 ;; All library code is dual licensed under GPL2 and a custom MIT
3445 ;; variant. The package also includes some components covered by
3446 ;; other licenses. Consult COPYING.md for full details.
3447 (license
3448 (list license:gpl2
3449 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3450 license:bsd-2 ; Files referring to COPYING.BSD_FB
3451 license:cc0 ; most files in ccan/
3452 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3453
9b0942c1
DC
3454(define-public rng-tools
3455 (package
3456 (name "rng-tools")
3457 (version "5")
3458 (source (origin
3459 (method url-fetch)
3460 (uri (string-append
3461 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3462 "rng-tools-" version ".tar.gz"))
3463 (sha256
3464 (base32
3465 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3466 (build-system gnu-build-system)
3467 (synopsis "Random number generator daemon")
3468 (description
3469 "Monitor a hardware random number generator, and supply entropy
3470from that to the system kernel's @file{/dev/random} machinery.")
3b3b60d0 3471 (home-page "https://sourceforge.net/projects/gkernel")
9b0942c1
DC
3472 ;; The source package is offered under the GPL2+, but the files
3473 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3474 (license (list license:gpl2 license:gpl2+))))
58d6a1f2
TGR
3475
3476(define-public cpupower
3477 (package
3478 (name "cpupower")
3479 (version (package-version linux-libre))
3480 (source (package-source linux-libre))
3481 (build-system gnu-build-system)
3482 (arguments
3483 '(#:phases (modify-phases %standard-phases
3484 (add-after 'unpack 'enter-subdirectory
3485 (lambda _
3486 (chdir "tools/power/cpupower")))
3487 (delete 'configure)
3488 (add-before 'build 'fix-makefiles
3489 (lambda _
3490 (substitute* "Makefile"
3491 (("/usr/") "/")
3492 (("/bin/(install|pwd)" _ command) command))
3493 (substitute* "bench/Makefile"
3494 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3495 #:make-flags (let ((out (assoc-ref %outputs "out")))
3496 (list (string-append "DESTDIR=" out)
3497 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3498 "docdir=/share/doc/cpupower"
3499 "confdir=$(docdir)/examples"
3500 ;; The Makefile recommends the following changes
3501 "DEBUG=false"
3502 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3503 #:tests? #f)) ;no tests
b94a6ca0 3504 (native-inputs `(("gettext" ,gettext-minimal)))
58d6a1f2
TGR
3505 (inputs `(("pciutils" ,pciutils)))
3506 (home-page (package-home-page linux-libre))
3507 (synopsis "CPU frequency and voltage scaling tools for Linux")
3508 (description
3509 "cpupower is a set of user-space tools that use the cpufreq feature of the
3510Linux kernel to retrieve and control processor features related to power saving,
3511such as frequency and voltage scaling.")
3512 (license license:gpl2)))
2b76f135
TGR
3513
3514(define-public haveged
3515 (package
3516 (name "haveged")
3517 (version "1.9.1")
3518 (source
3519 (origin
3520 (method url-fetch)
3521 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3522 version ".tar.gz"))
3523 (sha256
3524 (base32
3525 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3526 (build-system gnu-build-system)
3527 (home-page "http://www.issihosts.com/haveged")
3528 (synopsis "Entropy source for the Linux random number generator")
3529 (description
3530 "haveged generates an unpredictable stream of random numbers for use by
3531Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3532standard mechanisms for filling the entropy pool may not be sufficient for
3533systems with high needs or limited user interaction, such as headless servers.
3534@command{haveged} runs as a privileged daemon, harvesting randomness from the
3535indirect effects of hardware events on hidden processor state using the HArdware
3536Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3537its environment and provides the same built-in test suite for the output stream
3538as used on certified hardware security devices.")
3539 (license (list (license:non-copyleft "file://nist/mconf.h")
3540 (license:non-copyleft "file://nist/packtest.c")
3541 license:public-domain ; nist/dfft.c
3542 license:gpl3+)))) ; everything else
e385e957
TGR
3543
3544(define-public ecryptfs-utils
3545 (package
3546 (name "ecryptfs-utils")
3547 (version "111")
3548 (source
3549 (origin
3550 (method url-fetch)
3551 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3552 version "/+download/ecryptfs-utils_"
3553 version ".orig.tar.gz"))
3554 (sha256
3555 (base32
3556 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3557 (build-system gnu-build-system)
3558 (arguments
3559 `(#:configure-flags (list "--disable-pywrap")))
3560 (native-inputs
3561 `(("intltool" ,intltool)
3562 ("perl" ,perl) ; for pod2man
3563 ("pkg-config" ,pkg-config)))
3564 (inputs
3565 `(("keyutils" ,keyutils)
3566 ("linux-pam" ,linux-pam)
3567 ("nss" ,nss)))
3568 (home-page "http://ecryptfs.org/")
3569 (synopsis "eCryptfs cryptographic file system utilities")
3570 (description
3571 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3572Each file's cryptographic meta-data is stored inside the file itself, along
3573with the encrypted contents. This allows individual encrypted files to be
3574copied between hosts and still be decrypted with the proper key. eCryptfs is a
3575native Linux file system, and has been part of the Linux kernel since version
35762.6.19. This package contains the userland utilities to manage it.")
3577 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3578 ;; grant additional permission to link with OpenSSL.
3579 (license license:gpl2+)))
cff0adec
DC
3580
3581(define-public libnfsidmap
3582 (package
3583 (name "libnfsidmap")
3584 (version "0.25")
3585 (source (origin
3586 (method url-fetch)
3587 (uri (string-append
3588 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3589 name "/" name "-" version ".tar.gz"))
3590 (sha256
3591 (base32
3592 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3593 (build-system gnu-build-system)
3594 (arguments
3595 `(#:configure-flags (list
3596 (string-append "--with-pluginpath="
3597 (assoc-ref %outputs "out")
3598 "/lib/libnfsidmap"))))
3599 (home-page
3600 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3601 (synopsis
3602 "NFSv4 support library for name/ID mapping")
3603 (description "Libnfsidmap is a library holding mulitiple methods of
3604mapping names to ids and visa versa, mainly for NFSv4. It provides an
3605extensible array of mapping functions, currently consisting of two choices:
3606the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3607 (license (license:non-copyleft "file://COPYING"
3608 "See COPYING in the distribution."))))
035d3593
DC
3609
3610(define-public module-init-tools
3611 (package
3612 (name "module-init-tools")
3613 (version "3.16")
3614 (source (origin
3615 (method url-fetch)
3616 (uri (string-append
3617 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3618 "module-init-tools-" version ".tar.bz2"))
3619 (sha256
3620 (base32
3621 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3622 (patches (search-patches "module-init-tools-moduledir.patch"))))
3623 (build-system gnu-build-system)
3624 (arguments
3625 ;; FIXME: The upstream tarball lacks man pages, and building them would
3626 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3627 ;; but they vanished. In the meantime, fake it.
3628 '(#:phases (alist-cons-before
3629 'configure 'fake-docbook
3630 (lambda _
3631 (substitute* "Makefile.in"
3632 (("^DOCBOOKTOMAN.*$")
3633 "DOCBOOKTOMAN = true\n")))
3634 %standard-phases)))
3635 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3636 (synopsis "Tools for loading and managing Linux kernel modules")
3637 (description
3638 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3639`insmod', `lsmod', and more.")
3640 (license license:gpl2+)))
dd65f3b7
TGR
3641
3642(define-public mcelog
3643 (package
3644 (name "mcelog")
783467ae 3645 (version "153")
dd65f3b7
TGR
3646 (source (origin
3647 (method url-fetch)
3648 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3649 "mcelog.git/snapshot/v" version ".tar.gz"))
3650 (sha256
3651 (base32
783467ae 3652 "0q40d60p1klzg0aznvxhxgjlddwcxfj2q59s4q86sf9ild6rcdhl"))
dd65f3b7
TGR
3653 (file-name (string-append name "-" version ".tar.gz"))
3654 (modules '((guix build utils)))
3655 (snippet
3656 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3657 `(substitute* "Makefile"
3658 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3659 (build-system gnu-build-system)
3660 (arguments
3661 `(#:phases (modify-phases %standard-phases
3662 (delete 'configure)) ; no configure script
3663 #:make-flags (let ((out (assoc-ref %outputs "out")))
3664 (list "CC=gcc"
3665 (string-append "prefix=" out)
3666 (string-append "DOCDIR=" out "/share/doc/mcelog")
3667 "etcprefix=$(DOCDIR)/examples"))
3668 ;; The tests will only run as root on certain supported CPU models.
3669 #:tests? #f))
3670 (supported-systems (list "i686-linux" "x86_64-linux"))
3671 (home-page "http://mcelog.org/")
3672 (synopsis "Machine check monitor for x86 Linux systems")
3673 (description
3674 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3675and other hardware errors on x86 systems. It can also perform user-defined
3676tasks, such as bringing bad pages off-line, when configurable error thresholds
3677are exceeded.")
3678 (license license:gpl2)))
0c60cc53
DM
3679
3680(define-public mtd-utils
3681 (package
3682 (name "mtd-utils")
3683 (version "1.5.2")
3684 (source (origin
3685 (method url-fetch)
3686 (uri (string-append
3687 "ftp://ftp.infradead.org/pub/mtd-utils/"
3688 "mtd-utils-" version ".tar.bz2"))
3689 (sha256
3690 (base32
3691 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3692 (inputs
3693 `(("acl" ,acl)
3694 ("libuuid" ,util-linux)
3695 ("lzo", lzo)
3696 ("zlib" ,zlib)))
3697 (build-system gnu-build-system)
3698 (arguments
3699 `(#:test-target "tests"
3700 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3701 #:phases (modify-phases %standard-phases
3702 (delete 'configure))))
3703 (synopsis "MTD Flash Storage Utilities")
3704 (description "This package provides utilities for testing, partitioning, etc
3705of flash storage.")
3706 (home-page "http://www.linux-mtd.infradead.org/")
3707 (license
3708 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3709 license:mpl1.1 ; All ftl* files
3710 license:expat)))) ; libiniparser
def6213f
LF
3711
3712(define-public libseccomp
3713 (package
3714 (name "libseccomp")
488a3734 3715 (version "2.3.2")
def6213f
LF
3716 (source (origin
3717 (method url-fetch)
3718 (uri (string-append "https://github.com/seccomp/libseccomp/"
3719 "releases/download/v" version
3720 "/libseccomp-" version ".tar.gz"))
3721 (sha256
3722 (base32
488a3734 3723 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
def6213f
LF
3724 (build-system gnu-build-system)
3725 (native-inputs
3726 `(("which" ,which)))
3727 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3728 (description "The libseccomp library provides an easy to use, platform
3729independent, interface to the Linux Kernel's syscall filtering mechanism. The
3730libseccomp API is designed to abstract away the underlying BPF based syscall
3731filter language and present a more conventional function-call based filtering
3732interface that should be familiar to, and easily adopted by, application
3733developers.")
3734 (home-page "https://github.com/seccomp/libseccomp")
3735 (license license:lgpl2.1)))
58c4f11e
TGR
3736
3737(define-public radeontop
3738 (package
3739 (name "radeontop")
a7c61512 3740 (version "1.0")
58c4f11e
TGR
3741 (home-page "https://github.com/clbr/radeontop/")
3742 (source (origin
3743 (method url-fetch)
a7c61512 3744 (uri (string-append home-page "archive/v" version ".tar.gz"))
58c4f11e
TGR
3745 (file-name (string-append name "-" version ".tar.gz"))
3746 (sha256
3747 (base32
a7c61512 3748 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
58c4f11e
TGR
3749 (build-system gnu-build-system)
3750 (arguments
3751 `(#:phases (modify-phases %standard-phases
3752 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3753 ;; dependency, and doesn't even work on release(!) tarballs.
3754 (add-after 'unpack 'report-correct-version
3755 (lambda _ (substitute* "getver.sh"
3756 (("ver=unknown")
3757 (string-append "ver=" ,version)))))
3758 (delete 'configure)) ; no configure script
3759 #:make-flags (list "CC=gcc"
3760 (string-append "PREFIX=" %output))
3761 #:tests? #f)) ; no tests
3762 (native-inputs
7c90d0f4 3763 `(("gettext" ,gettext-minimal)
58c4f11e
TGR
3764 ("pkg-config" ,pkg-config)))
3765 (inputs
3766 `(("libdrm" ,libdrm)
3767 ("libpciaccess" ,libpciaccess)
a7c61512 3768 ("libxcb" ,libxcb)
58c4f11e
TGR
3769 ("ncurses" ,ncurses)))
3770 (synopsis "Usage monitor for AMD Radeon graphics")
3771 (description "RadeonTop monitors resource consumption on supported AMD
3772Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3773a terminal or saved to a file for further processing. It measures both the
3774activity of the GPU as a whole, which is also accurate during OpenCL
3775computations, as well as separate component statistics that are only meaningful
3776under OpenGL graphics workloads.")
3777 (license license:gpl3)))
0d74462a
MB
3778
3779(define-public efivar
3780 (package
3781 (name "efivar")
3782 (version "30")
3783 (source (origin
3784 (method url-fetch)
3785 (uri (string-append "https://github.com/rhinstaller/" name
3786 "/releases/download/" version "/" name
3787 "-" version ".tar.bz2"))
3788 (sha256
3789 (base32
3790 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3791 (build-system gnu-build-system)
3792 (arguments
3793 `(;; Tests require a UEFI system and is not detected in the chroot.
3794 #:tests? #f
3795 #:make-flags (list (string-append "prefix=" %output)
3796 (string-append "libdir=" %output "/lib")
3797 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3798 #:phases
3799 (modify-phases %standard-phases
3800 (delete 'configure))))
3801 (native-inputs
3802 `(("pkg-config" ,pkg-config)))
3803 (inputs
3804 `(("popt" ,popt)))
3805 (home-page "https://github.com/rhinstaller/efivar")
3806 (synopsis "Tool and library to manipulate EFI variables")
3807 (description "This package provides a library and a command line
3808interface to the variable facility of UEFI boot firmware.")
3809 (license license:lgpl2.1+)))
1581406e
MB
3810
3811(define-public efibootmgr
3812 (package
3813 (name "efibootmgr")
3814 (version "14")
3815 (source (origin
3816 (method url-fetch)
3817 (uri (string-append "https://github.com/rhinstaller/" name
3818 "/releases/download/" version "/" name
3819 "-" version ".tar.bz2"))
3820 (sha256
3821 (base32
3822 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3823 (build-system gnu-build-system)
3824 (arguments
3825 `(#:tests? #f ; No tests.
3826 #:make-flags (list (string-append "prefix=" %output)
3827 (string-append "libdir=" %output "/lib")
3828 ;; Override CFLAGS to add efivar include directory.
3829 (string-append "CFLAGS=-O2 -g -flto -I"
3830 (assoc-ref %build-inputs "efivar")
3831 "/include/efivar"))
3832 #:phases
3833 (modify-phases %standard-phases
3834 (add-after 'unpack 'branding
3835 ;; Replace default loader path with something more familiar.
3836 (lambda _
3837 (substitute* "src/efibootmgr.c"
3838 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3839 "EFI\\\\gnu"))
3840 #t))
3841 (delete 'configure))))
3842 (native-inputs
3843 `(("pkg-config" ,pkg-config)))
3844 (inputs
3845 `(("efivar" ,efivar)
3846 ("popt" ,popt)))
3847 (home-page "https://github.com/rhinstaller/efibootmgr")
3848 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3849 (description
3850 "@code{efibootmgr} is a user-space application to modify the Intel
3851Extensible Firmware Interface (EFI) Boot Manager. This application can
3852create and destroy boot entries, change the boot order, change the next
3853running boot option, and more.")
3854 (license license:gpl2+)))
6d3e08d4
LF
3855
3856(define-public sysstat
3857 (package
3858 (name "sysstat")
70443013 3859 (version "11.4.3")
6d3e08d4
LF
3860 (source (origin
3861 (method url-fetch)
3862 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3863 "sysstat-" version ".tar.xz"))
3864 (sha256
3865 (base32
70443013 3866 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
6d3e08d4
LF
3867 (build-system gnu-build-system)
3868 (arguments
3869 `(#:tests? #f ; No test suite.
3870 ;; Without this flag, it tries to install the man pages with group 'root'
3871 ;; and fails because /etc/passwd lacks an entry for the root user.
3872 #:configure-flags
3873 (list "--disable-file-attr"
3874 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3875 #:phases
3876 (modify-phases %standard-phases
3877 ;; The build process tries to create '/var/lib/sa', so we skip that
3878 ;; instruction.
3879 (add-after 'build 'skip-touching-var
3880 (lambda _
3881 (substitute* "Makefile"
3882 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3883 ""))
3884 #t)))))
3885 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3886 (synopsis "Performance monitoring tools for Linux")
3887 (description "The sysstat utilities are a collection of performance
3888monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3889@code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3890@code{sadf} and @code{sa}.")
3891 (license license:gpl2+)))
01be4f93
JMSG
3892
3893(define-public light
3894 (package
3895 (name "light")
3896 (version "1.0")
3897 (source (origin
3898 (method url-fetch)
3899 (uri (string-append "https://github.com/haikarainen/" name
3900 "/archive/v" version ".tar.gz"))
3901 (sha256
3902 (base32
3903 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3904 (file-name (string-append name "-" version ".tar.gz"))))
3905 (build-system gnu-build-system)
3906 (arguments
3907 '(#:tests? #f ; no tests
3908 #:make-flags (list "CC=gcc"
3909 (string-append "PREFIX=" %output))
3910 #:phases
3911 (modify-phases %standard-phases
3912 (delete 'configure)
3913 (add-after 'unpack 'patch-makefile
3914 (lambda _
3915 (substitute* "Makefile" (("chown") "#")))))))
3916 (native-inputs
3917 `(("help2man" ,help2man)))
3918 (home-page "https://haikarainen.github.io/light")
3919 (synopsis "GNU/Linux application to control backlights")
3920 (description
3921 "Light is a program to send commands to screen backlight controllers
3922under GNU/Linux. Features include:
3923
3924@itemize
3925@item It does not rely on X.
3926@item Light can automatically figure out the best controller to use, making
3927full use of underlying hardware.
3928@item It is possible to set a minimum brightness value, as some controllers
3929set the screen to be pitch black at a vaĺue of 0 (or higher).
3930@end itemize
3931
3932Light is the successor of lightscript.")
3933 (license license:gpl3+)))
189d8422 3934
c7adafa7
MO
3935(define-public tlp
3936 (package
3937 (name "tlp")
c48fa0ad 3938 (version "1.0")
c7adafa7
MO
3939 (source (origin
3940 (method url-fetch)
3941 (uri (string-append
3942 "https://github.com/linrunner/"
3943 (string-upcase name)
3944 "/archive/" version ".tar.gz"))
3945 (file-name (string-append name "-" version ".tar.gz"))
3946 (sha256
3947 (base32
c48fa0ad 3948 "1v3qpj9kp4rxwqapayd0i9419wwv4bikyrzjvqn0r9xkgnr1f9v4"))))
c7adafa7
MO
3949 (inputs `(("bash" ,bash)
3950 ("dbus" ,dbus)
3951 ("ethtool" ,ethtool)
3952 ("eudev" ,eudev)
3953 ("grep" ,grep)
3954 ("hdparm" ,hdparm)
3955 ("inetutils" ,inetutils)
3956 ("iw" ,iw)
3957 ("kmod" ,kmod)
3958 ("pciutils" ,pciutils)
3959 ("perl" ,perl)
3960 ("rfkill" ,rfkill)
3961 ("sed" ,sed)
3962 ("usbutils" ,usbutils)
3963 ("util-linux" ,util-linux)
3964 ("wireless-tools" ,wireless-tools)))
3965 (build-system gnu-build-system)
3966 (arguments
3967 `(#:phases
3968 (modify-phases %standard-phases
cef3f146 3969 (delete 'configure) ; no configure script
c7adafa7
MO
3970 (add-before 'build 'setenv
3971 (lambda* (#:key outputs #:allow-other-keys)
3972 (let ((out (assoc-ref outputs "out")))
3973 (setenv "TLP_WITH_SYSTEMD" "0")
3974 (setenv "TLP_NO_INIT" "1")
3975 (setenv "TLP_NO_PMUTILS" "1")
3976 (setenv "TLP_SBIN" (string-append out "/bin"))
3977 (setenv "TLP_BIN" (string-append out "/bin"))
3978 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3979 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
32e75b48 3980 (setenv "TLP_CONF" "/etc/tlp")
c7adafa7
MO
3981 (setenv "TLP_SHCPL"
3982 (string-append out "/share/bash-completion/completions"))
3983 (setenv "TLP_MAN" (string-append out "/share/man")))))
cef3f146
TGR
3984 (delete 'check) ; no tests
3985 (add-before 'install 'fix-installation
3986 (lambda _
3987 ;; Stop the Makefile from trying to create system directories.
3988 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
c7adafa7
MO
3989 (replace 'install
3990 (lambda _
cef3f146 3991 (zero? (system* "make" "install-tlp" "install-man"))))
c7adafa7
MO
3992 (add-after 'install 'wrap
3993 (lambda* (#:key inputs outputs #:allow-other-keys)
3994 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3995 (bin-files (find-files bin ".*")))
3996 (define (bin-directory input-name)
3997 (string-append (assoc-ref inputs input-name) "/bin"))
3998 (define (sbin-directory input-name)
3999 (string-append (assoc-ref inputs input-name) "/sbin"))
4000 (for-each (lambda (program)
4001 (wrap-program program
4002 `("PATH" ":" prefix
4003 ,(append
4004 (map bin-directory '("bash"
4005 "coreutils"
4006 "dbus"
4007 "eudev"
4008 "grep"
4009 "inetutils"
4010 "kmod"
4011 "perl"
4012 "sed"
4013 "usbutils"
4014 "util-linux"))
4015 (map sbin-directory '("ethtool"
4016 "hdparm"
4017 "iw"
4018 "pciutils"
4019 "rfkill"
4020 "wireless-tools"))))))
4021 bin-files)))))))
4022 (home-page "http://linrunner.de/en/tlp/tlp.html")
4023 (synopsis "Power management tool for Linux")
4024 (description "TLP is a power management tool for Linux. It comes with
4025a default configuration already optimized for battery life. Nevertheless,
4026TLP is customizable to fulfil system requirements. TLP settings are applied
4027every time the power supply source is changed.")
4028
4029 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
4030 ;; rest is GPLv2+.
4031 (license (list license:gpl2+ license:gpl3+))))
4032
189d8422
BG
4033(define-public lshw
4034 (package
4035 (name "lshw")
4036 (version "B.02.18")
4037 (source (origin
4038 (method url-fetch)
4039 (uri (string-append "https://www.ezix.org/software/"
4040 "files/lshw-" version
4041 ".tar.gz"))
4042 (sha256
4043 (base32
4044 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
4045 (build-system gnu-build-system)
4046 (arguments
4047 `(#:phases (modify-phases %standard-phases (delete 'configure))
4048 #:tests? #f ; no tests
4049 #:make-flags
4050 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
4051 (synopsis "List hardware information")
4052 (description
4053 "@command{lshw} (Hardware Lister) is a small tool to provide
4054detailed information on the hardware configuration of the machine.
4055It can report exact memory configuration, firmware version, mainboard
4056configuration, CPU version and speed, cache configuration, bus speed,
4057and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
4058machines (PowerMac G4 is known to work).")
4059 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
4060 (license license:gpl2+)))
2f4a58b5
LF
4061
4062(define-public libmnl
4063 (package
4064 (name "libmnl")
4065 (version "1.0.4")
4066 (source
4067 (origin
4068 (method url-fetch)
f11ae44f 4069 (uri (string-append "mirror://netfilter.org/libmnl/"
2f4a58b5
LF
4070 "libmnl-" version ".tar.bz2"))
4071 (sha256
4072 (base32
4073 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
4074 (build-system gnu-build-system)
4075 (home-page "https://www.netfilter.org/projects/libmnl/")
4076 (synopsis "Netlink utility library")
4077 (description "Libmnl is a minimalistic user-space library oriented to
4078Netlink developers. There are a lot of common tasks in parsing, validating,
4079constructing of both the Netlink header and TLVs that are repetitive and easy to
4080get wrong. This library aims to provide simple helpers that allows you to
4081re-use code and to avoid re-inventing the wheel.")
4082 (license license:lgpl2.1+)))
b754c612
LF
4083
4084(define-public libnftnl
4085 (package
4086 (name "libnftnl")
4087 (version "1.0.7")
4088 (source
4089 (origin
4090 (method url-fetch)
f11ae44f 4091 (uri (string-append "mirror://netfilter.org/libnftnl/"
b754c612
LF
4092 "libnftnl-" version ".tar.bz2"))
4093 (sha256
4094 (base32
4095 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
4096 (build-system gnu-build-system)
4097 (native-inputs
4098 `(("pkg-config" ,pkg-config)))
4099 (inputs
4100 `(("libmnl" ,libmnl)))
4101 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
4102 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
4103 (description "Libnftnl is a userspace library providing a low-level netlink
4104programming interface to the in-kernel nf_tables subsystem. The library
4105libnftnl has been previously known as libnftables. This library is currently
4106used by nftables.")
4107 (license license:gpl2+)))
62b28c0e 4108
dfe93c9a
RH
4109(define-public nftables
4110 (package
4111 (name "nftables")
4112 (version "0.7")
4113 (source
4114 (origin
4115 (method url-fetch)
4116 (uri (string-append "http://www.nftables.org/projects/nftables"
4117 "/files/nftables-" version ".tar.bz2"))
4118 (sha256
4119 (base32
4120 "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy"))))
4121 (build-system gnu-build-system)
4122 (inputs `(("bison", bison)
4123 ("flex", flex)
4124 ("gmp", gmp)
4125 ("libmnl", libmnl)
4126 ("libnftnl", libnftnl)
4127 ("readline", readline)))
4128 (native-inputs `(("pkg-config", pkg-config)))
4129 (home-page "http://www.nftables.org")
4130 (synopsis "Userspace utility for Linux packet filtering")
4131 (description "nftables is the project that aims to replace the existing
4132{ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
4133filtering framework, a new userspace utility and also a compatibility layer for
4134{ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
4135infrastructure such as the existing hooks, the connection tracking system, the
4136userspace queueing component and the logging subsystem.")
4137 (license license:gpl2)))
4138
62b28c0e
LC
4139(define-public proot
4140 (package
4141 (name "proot")
4142 (version "5.1.0")
4143 (home-page "https://github.com/proot-me/PRoot")
4144 (source (origin
4145 (method url-fetch)
4146 (uri (string-append home-page "/archive/v" version ".tar.gz"))
4147 (file-name (string-append name "-" version ".tar.gz"))
4148 (sha256
4149 (base32
4150 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
4151 (patches (search-patches "proot-test-fhs.patch"))))
4152 (build-system gnu-build-system)
4153 (arguments
4154 '(#:make-flags '("-C" "src")
4155
4156 #:phases (modify-phases %standard-phases
4157 (delete 'configure)
4158 (add-before 'build 'set-shell-file-name
4159 (lambda* (#:key inputs #:allow-other-keys)
4160 (substitute* (find-files "src" "\\.[ch]$")
4161 (("\"/bin/sh\"")
4162 (string-append "\""
4163 (assoc-ref inputs "bash")
4164 "/bin/sh\"")))
4165 #t))
4166 (add-before 'check 'fix-fhs-assumptions-in-tests
4167 (lambda _
4168 (substitute* "tests/test-c6b77b77.mk"
4169 (("/bin/bash") (which "bash"))
4170 (("/usr/bin/test") (which "test")))
4171 (substitute* '("tests/test-16573e73.c")
4172 (("/bin/([a-z-]+)" _ program)
4173 (which program)))
4174
4175 (substitute* (find-files "tests" "\\.sh$")
4176 ;; Some of the tests try to "bind-mount" /bin/true.
4177 (("-b /bin/true:")
4178 (string-append "-b " (which "true") ":"))
4179 ;; Likewise for /bin.
4180 (("-b /bin:") "-b /gnu:")
4181 ;; Others try to run /bin/sh.
4182 (("/bin/sh") (which "sh"))
4183 ;; Others assume /etc/fstab exists.
4184 (("/etc/fstab") "/etc/passwd"))
4185
4186 (substitute* "tests/GNUmakefile"
4187 (("-b /bin:") "-b /gnu:"))
4188
4189 ;; XXX: This test fails in an obscure corner case, just
4190 ;; skip it.
4191 (delete-file "tests/test-kkkkkkkk.c")
4192
4193 #t))
4194 (replace 'check
4195 (lambda _
4196 (let ((n (parallel-job-count)))
4197 ;; For some reason we get lots of segfaults with
4198 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4199 (setenv "PROOT_NO_SECCOMP" "1")
4200
4201 ;; Most of the tests expect "/bin" to be in $PATH so
4202 ;; they can run things that live in $ROOTFS/bin.
4203 (setenv "PATH"
4204 (string-append (getenv "PATH") ":/bin"))
4205
4206 (zero? (system* "make" "check" "-C" "tests"
4207 ;;"V=1"
4208 "-j" (number->string n))))))
4209 (replace 'install
4210 (lambda* (#:key outputs #:allow-other-keys)
4211 ;; The 'install' rule does nearly nothing.
4212 (let ((out (assoc-ref outputs "out")))
4213 (and (zero?
4214 ;; TODO: 'make install-care' (does not even
4215 ;; build currently.)
4216 (system* "make" "-C" "src" "install"
4217 (string-append "PREFIX=" out)))
02084762
LC
4218 (let ((man1 (string-append out
4219 "/share/man/man1")))
4220 (mkdir-p man1)
4221 (copy-file "doc/proot/man.1"
4222 (string-append man1 "/proot.1"))
62b28c0e
LC
4223 #t))))))))
4224 (native-inputs `(("which" ,which)
4225
4226 ;; For 'mcookie', used by some of the tests.
4227 ("util-linux" ,util-linux)))
4228 (inputs `(("talloc" ,talloc)))
4229 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4230 (description
4231 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4232and @code{binfmt_misc}. This means that users don't need any privileges or
4233setup to do things like using an arbitrary directory as the new root
4234filesystem, making files accessible somewhere else in the file system
4235hierarchy, or executing programs built for another CPU architecture
4236transparently through QEMU user-mode. Also, developers can use PRoot as a
4237generic process instrumentation engine thanks to its extension mechanism.
4238Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4239available in the kernel Linux.")
4240 (license license:gpl2+)))
b9048a14
LC
4241
4242(define-public proot-static
4243 (package
4244 (inherit proot)
4245 (name "proot-static")
4246 (synopsis
4247 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4248 (inputs `(("talloc" ,talloc/static)))
4249 (arguments
4250 (substitute-keyword-arguments (package-arguments proot)
4251 ((#:make-flags flags)
4252 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4253 ((#:phases phases)
4254 `(modify-phases ,phases
4255 (add-after 'strip 'remove-store-references
4256 (lambda* (#:key outputs #:allow-other-keys)
4257 (let* ((out (assoc-ref outputs "out")))
4258 (with-directory-excursion out
4259 (remove-store-references "bin/proot")
4260 #t))))))
4261 ((#:allowed-references _ '("out"))
4262 '("out"))))))
1113386b
CL
4263
4264(define-public cpuid
4265 (package
4266 (name "cpuid")
4267 (version "20170122")
4268 (source (origin
4269 (method url-fetch)
4270 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4271 version ".src.tar.gz"))
4272 (sha256
4273 (base32
4274 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4275 (build-system gnu-build-system)
4276 (arguments
4277 '(#:make-flags '("CC=gcc")
4278 #:tests? #f ; no tests
4279 #:phases (modify-phases %standard-phases
4280 (delete 'configure)
4281 (add-before 'install 'fix-makefile
4282 (lambda* (#:key outputs #:allow-other-keys)
4283 (substitute* "Makefile"
4284 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4285 ;; Make the compressed manpages writable so that the
4286 ;; reset-gzip-timestamps phase does not error out.
4287 (substitute* "Makefile"
4288 (("-m 444") "-m 644"))
4289 #t)))))
4290 (inputs `(("perl" ,perl)))
4291 (supported-systems '("i686-linux" "x86_64-linux"))
4292 (home-page "http://www.etallen.com/cpuid.html")
4293 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4294 (description "cpuid dumps detailed information about the CPU(s) gathered
4295from the CPUID instruction, and also determines the exact model of CPU(s). It
4296supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4297NexGen, Rise, and SiS CPUs.")
4298 (license license:gpl2+)))
afc9d8ec
LF
4299
4300(define-public jmtpfs
4301 (package
4302 (name "jmtpfs")
4303 (version "0.5")
4304 (source
4305 (origin
4306 (method url-fetch)
4307 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4308 version ".tar.gz"))
4309 (file-name (string-append name "-" version ".tar.gz"))
4310 (sha256
4311 (base32
4312 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4313 (build-system gnu-build-system)
4314 (inputs
4315 `(("file" ,file)
4316 ("fuse" ,fuse)
4317 ("libmtp" ,libmtp)))
4318 (native-inputs
4319 `(("pkg-config" ,pkg-config)))
4320 (home-page "https://github.com/JasonFerrara/jmtpfs")
4321 (synopsis "Use a FUSE filesystem to access data over MTP")
4322 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4323to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4324the MTP device as a filesystem.")
4325 (license license:gpl3)))
a73e7dd3
DL
4326
4327(define-public procenv
4328 (package
4329 (name "procenv")
4330 (version "0.49")
4331 (source
4332 (origin
4333 (method url-fetch)
4334 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4335 version ".tar.gz"))
4336 (file-name (string-append name "-" version ".tar.gz"))
4337 (sha256
4338 (base32 "0brzf6185hb76imw107cl21c8lzwiywkxi3jknihrk86bvvicd0d"))))
4339 (build-system gnu-build-system)
4340 (arguments `(#:configure-flags '("--disable-silent-rules")))
4341 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4342 ("groff" ,groff) ; for tests
4343 ("libselinux" ,libselinux)))
4344 (synopsis "Utility to show process environment")
4345 (description "Procenv is a command-line tool that displays as much detail about
4346itself and its environment as possible. It can be used as a test
4347tool, to understand the type of environment a process runs in, and for
4348comparing system environments.")
4349 (home-page "http://github.com/jamesodhunt/procenv/")
4350 (license license:gpl3+)))
ae5947b0
DL
4351
4352(define-public libfabric
4353 (package
4354 (name "libfabric")
4355 (version "1.4.1")
4356 (source
4357 (origin
4358 (method url-fetch)
4359 (uri
4360 (string-append "https://github.com/ofiwg/libfabric/releases/download/v"
4361 version "/libfabric-" version ".tar.bz2"))
4362 (sha256
4363 (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv"))))
4364 (build-system gnu-build-system)
4365 (inputs `(("rdma-core" ,rdma-core)
4366 ;; TODO: add psm, psm(2).
4367 ("libnl" ,libnl)))
4368 (home-page "https://ofiwg.github.io/libfabric/")
4369 (synopsis "Open Fabric Interfaces")
4370 (description
4371 "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric
4372communication services to applications. OFI is best described as a collection
4373of libraries and applications used to export fabric services. The key
4374components of OFI are: application interfaces, provider libraries, kernel
4375services, daemons, and test applications.
4376
4377Libfabric is a core component of OFI. It is the library that defines and
4378exports the user-space API of OFI, and is typically the only software that
4379applications deal with directly. It works in conjunction with provider
4380libraries, which are often integrated directly into libfabric.")
4381 (license (list license:bsd-2 license:gpl2)))) ;dual