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