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