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