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