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