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