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