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