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