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