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