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