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