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