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