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