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