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