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