Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / linux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017 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 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 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org>
10 ;;; Copyright © 2016, 2017 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 Nicolas Goaziou <mail@nicolasgoaziou.fr>
15 ;;; Copyright © 2016 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 Marius Bakke <mbakke@fastmail.com>
19 ;;; Copyright © 2016 Rene Saavedra <rennes@openmailbox.org>
20 ;;; Copyright © 2016 Carlos Sánchez de La Lama <csanchezdll@gmail.com>
21 ;;; Copyright © 2016, 2017 ng0 <ng0@no-reply.pragmatique.xyz>
22 ;;; Copyright © 2017 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 Rutger Helling <rhelling@mykolab.com>
28 ;;; Copyright © 2017 nee <nee-git@hidamari.blue>
29 ;;; Copyright © 2017 Dave Love <fx@gnu.org>
30 ;;;
31 ;;; This file is part of GNU Guix.
32 ;;;
33 ;;; GNU Guix is free software; you can redistribute it and/or modify it
34 ;;; under the terms of the GNU General Public License as published by
35 ;;; the Free Software Foundation; either version 3 of the License, or (at
36 ;;; your option) any later version.
37 ;;;
38 ;;; GNU Guix is distributed in the hope that it will be useful, but
39 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
40 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 ;;; GNU General Public License for more details.
42 ;;;
43 ;;; You should have received a copy of the GNU General Public License
44 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
45
46 (define-module (gnu packages linux)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages acl)
49 #:use-module (gnu packages admin)
50 #:use-module (gnu packages algebra)
51 #:use-module (gnu packages attr)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages base)
55 #:use-module (gnu packages bash)
56 #:use-module (gnu packages bison)
57 #:use-module (gnu packages calendar)
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages crypto)
60 #:use-module (gnu packages compression)
61 #:use-module (gnu packages databases)
62 #:use-module (gnu packages datastructures)
63 #:use-module (gnu packages docbook)
64 #:use-module (gnu packages documentation)
65 #:use-module (gnu packages elf)
66 #:use-module (gnu packages flex)
67 #:use-module (gnu packages file)
68 #:use-module (gnu packages freedesktop)
69 #:use-module (gnu packages gcc)
70 #:use-module (gnu packages gettext)
71 #:use-module (gnu packages glib)
72 #:use-module (gnu packages gnuzilla)
73 #:use-module (gnu packages gperf)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages libusb)
76 #:use-module (gnu packages man)
77 #:use-module (gnu packages maths)
78 #:use-module (gnu packages multiprecision)
79 #:use-module (gnu packages ncurses)
80 #:use-module (gnu packages networking)
81 #:use-module (gnu packages ninja)
82 #:use-module (gnu packages perl)
83 #:use-module (gnu packages pciutils)
84 #:use-module (gnu packages pkg-config)
85 #:use-module (gnu packages popt)
86 #:use-module (gnu packages pulseaudio)
87 #:use-module (gnu packages python)
88 #:use-module (gnu packages readline)
89 #:use-module (gnu packages rrdtool)
90 #:use-module (gnu packages samba)
91 #:use-module (gnu packages slang)
92 #:use-module (gnu packages storage)
93 #:use-module (gnu packages texinfo)
94 #:use-module (gnu packages tls)
95 #:use-module (gnu packages valgrind)
96 #:use-module (gnu packages video)
97 #:use-module (gnu packages web)
98 #:use-module (gnu packages xiph)
99 #:use-module (gnu packages xml)
100 #:use-module (gnu packages xdisorg)
101 #:use-module (gnu packages xorg)
102 #:use-module (gnu packages groff)
103 #:use-module (gnu packages selinux)
104 #:use-module (guix build-system cmake)
105 #:use-module (guix build-system gnu)
106 #:use-module (guix build-system python)
107 #:use-module (guix build-system trivial)
108 #:use-module (guix download)
109 #:use-module ((guix licenses) #:prefix license:)
110 #:use-module (guix packages)
111 #:use-module (guix utils)
112 #:use-module (srfi srfi-1)
113 #:use-module (srfi srfi-2)
114 #:use-module (srfi srfi-26)
115 #:use-module (ice-9 match))
116
117 (define-public (system->linux-architecture arch)
118 "Return the Linux architecture name for ARCH, a Guix system name such as
119 \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"."
120 (let ((arch (car (string-split arch #\-))))
121 (cond ((string=? arch "i686") "i386")
122 ((string-prefix? "mips" arch) "mips")
123 ((string-prefix? "arm" arch) "arm")
124 ((string-prefix? "aarch64" arch) "arm64")
125 ((string-prefix? "alpha" arch) "alpha")
126 (else arch))))
127
128 (define-public (system->defconfig system)
129 "Some systems (notably powerpc-linux) require a special target for kernel
130 defconfig. Return the appropiate make target if applicable, otherwise return
131 \"defconfig\"."
132 (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig")
133 (else "defconfig")))
134
135 (define (linux-libre-urls version)
136 "Return a list of URLs for Linux-Libre VERSION."
137 (list (string-append
138 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
139 version "-gnu/linux-libre-" version "-gnu.tar.xz")
140
141 ;; XXX: Work around <http://bugs.gnu.org/14851>.
142 (string-append
143 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
144 version "-gnu.tar.xz")
145
146 ;; Maybe this URL will become valid eventually.
147 (string-append
148 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
149 version "-gnu.tar.xz")))
150
151 (define-public linux-libre-headers
152 (package
153 (name "linux-libre-headers")
154 (version "4.4.47")
155 (source (origin
156 (method url-fetch)
157 (uri (linux-libre-urls version))
158 (sha256
159 (base32
160 "00zdq7swhvzbbnnhzizq6m34q5k4fycpcp215bmkbxh1ic76v7bs"))))
161 (build-system gnu-build-system)
162 (native-inputs `(("perl" ,perl)))
163 (arguments
164 `(#:modules ((guix build gnu-build-system)
165 (guix build utils)
166 (srfi srfi-1))
167 #:phases
168 (modify-phases %standard-phases
169 (delete 'configure)
170 (replace 'build
171 (lambda _
172 (let ((arch ,(system->linux-architecture
173 (or (%current-target-system)
174 (%current-system))))
175 (defconfig ,(system->defconfig
176 (or (%current-target-system)
177 (%current-system)))))
178 (setenv "ARCH" arch)
179 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
180 (and (zero? (system* "make" defconfig))
181 (zero? (system* "make" "mrproper" "headers_check"))))))
182 (replace 'install
183 (lambda* (#:key outputs #:allow-other-keys)
184 (let ((out (assoc-ref outputs "out")))
185 (and (zero? (system* "make"
186 (string-append "INSTALL_HDR_PATH=" out)
187 "headers_install"))
188 (begin
189 (mkdir (string-append out "/include/config"))
190 (call-with-output-file
191 (string-append out
192 "/include/config/kernel.release")
193 (lambda (p)
194 (format p "~a-default~%" ,version)))
195
196 ;; Remove the '.install' and '..install.cmd' files; the
197 ;; latter contains store paths, which pulls in bootstrap
198 ;; binaries in the build environment, and prevents bit
199 ;; reproducibility for the bootstrap binaries.
200 (for-each delete-file (find-files out "\\.install"))
201
202 #t))))))
203 #:allowed-references ()
204 #:tests? #f))
205 (home-page "https://www.gnu.org/software/linux-libre/")
206 (synopsis "GNU Linux-Libre kernel headers")
207 (description "Headers of the Linux-Libre kernel.")
208 (license license:gpl2)))
209
210 (define %boot-logo-patch
211 ;; Linux-Libre boot logo featuring Freedo and a gnu.
212 (origin
213 (method url-fetch)
214 (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/"
215 "lemote/gnewsense/branches/3.16/100gnu+freedo.patch"))
216 (sha256
217 (base32
218 "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06"))))
219
220 (define* (kernel-config arch #:key variant)
221 "Return the absolute file name of the Linux-Libre build configuration file
222 for ARCH and optionally VARIANT, or #f if there is no such configuration."
223 (let* ((name (string-append (if variant (string-append variant "-") "")
224 (if (string=? "i386" arch) "i686" arch) ".conf"))
225 (file (string-append "linux-libre/" name)))
226 (search-auxiliary-file file)))
227
228 (define %default-extra-linux-options
229 `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html
230 ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)
231 ;; Modules required for initrd:
232 ("CONFIG_NET_9P" . m)
233 ("CONFIG_NET_9P_VIRTIO" . m)
234 ("CONFIG_VIRTIO_BLK" . m)
235 ("CONFIG_VIRTIO_NET" . m)
236 ("CONFIG_VIRTIO_PCI" . m)
237 ("CONFIG_VIRTIO_BALLOON" . m)
238 ("CONFIG_VIRTIO_MMIO" . m)
239 ("CONFIG_FUSE_FS" . m)
240 ("CONFIG_CIFS" . m)
241 ("CONFIG_9P_FS" . m)))
242
243 (define (config->string options)
244 (string-join (map (match-lambda
245 ((option . 'm)
246 (string-append option "=m"))
247 ((option . #t)
248 (string-append option "=y"))
249 ((option . #f)
250 (string-append option "=n")))
251 options)
252 "\n"))
253
254 (define* (make-linux-libre version hash supported-systems
255 #:key
256 ;; A function that takes an arch and a variant.
257 ;; See kernel-config for an example.
258 (extra-version #f)
259 (configuration-file #f)
260 (defconfig "defconfig")
261 (extra-options %default-extra-linux-options)
262 (patches (list %boot-logo-patch)))
263 (package
264 (name (if extra-version
265 (string-append "linux-libre-" extra-version)
266 "linux-libre"))
267 (version version)
268 (source (origin
269 (method url-fetch)
270 (uri (linux-libre-urls version))
271 (sha256 (base32 hash))
272 (patches patches)))
273 (supported-systems supported-systems)
274 (build-system gnu-build-system)
275 (native-inputs
276 `(("perl" ,perl)
277 ("bc" ,bc)
278 ("openssl" ,openssl)
279 ("kmod" ,kmod)
280 ,@(match (and configuration-file
281 (configuration-file
282 (system->linux-architecture
283 (or (%current-target-system) (%current-system)))
284 #:variant (version-major+minor version)))
285 (#f ;no config for this platform
286 '())
287 ((? string? config)
288 `(("kconfig" ,config))))))
289 (arguments
290 `(#:modules ((guix build gnu-build-system)
291 (guix build utils)
292 (srfi srfi-1)
293 (ice-9 match))
294 #:phases
295 (modify-phases %standard-phases
296 (replace 'configure
297 (lambda* (#:key inputs native-inputs target #:allow-other-keys)
298 ;; Avoid introducing timestamps
299 (setenv "KCONFIG_NOTIMESTAMP" "1")
300 (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH"))
301
302 ;; Set ARCH and CROSS_COMPILE
303 (let ((arch ,(system->linux-architecture
304 (or (%current-target-system)
305 (%current-system)))))
306 (setenv "ARCH" arch)
307 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
308
309 (when target
310 (setenv "CROSS_COMPILE" (string-append target "-"))
311 (format #t "`CROSS_COMPILE' set to `~a'~%"
312 (getenv "CROSS_COMPILE"))))
313
314 (setenv "EXTRA_VERSION" ,extra-version)
315
316 (let ((build (assoc-ref %standard-phases 'build))
317 (config (assoc-ref inputs "kconfig")))
318
319 ;; Use a custom kernel configuration file or a default
320 ;; configuration file.
321 (if config
322 (begin
323 (copy-file config ".config")
324 (chmod ".config" #o666))
325 (system* "make" ,defconfig))
326
327 ;; Appending works even when the option wasn't in the
328 ;; file. The last one prevails if duplicated.
329 (let ((port (open-file ".config" "a"))
330 (extra-configuration ,(config->string extra-options)))
331 (display extra-configuration port)
332 (close-port port))
333
334 (zero? (system* "make" "oldconfig")))))
335 (replace 'install
336 (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
337 (let* ((out (assoc-ref outputs "out"))
338 (moddir (string-append out "/lib/modules"))
339 (dtbdir (string-append out "/lib/dtbs"))
340 (kmod (assoc-ref (or native-inputs inputs) "kmod")))
341 ;; Install kernel image, kernel configuration and link map.
342 (for-each (lambda (file) (install-file file out))
343 (find-files "." "^(\\.config|bzImage|zImage|vmlinuz|System\\.map)$"))
344 ;; Install device tree files
345 (for-each (lambda (file) (install-file file dtbdir))
346 (find-files "." "\\.dtb$"))
347 ;; Install kernel modules
348 (mkdir-p moddir)
349 (zero? (system* "make"
350 (string-append "DEPMOD=" kmod "/bin/depmod")
351 (string-append "MODULE_DIR=" moddir)
352 (string-append "INSTALL_PATH=" out)
353 (string-append "INSTALL_MOD_PATH=" out)
354 "INSTALL_MOD_STRIP=1"
355 "modules_install"))))))
356 #:tests? #f))
357 (home-page "https://www.gnu.org/software/linux-libre//")
358 (synopsis "100% free redistribution of a cleaned Linux kernel")
359 (description
360 "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel.
361 It has been modified to remove all non-free binary blobs.")
362 (license license:gpl2)))
363
364 (define %intel-compatible-systems '("x86_64-linux" "i686-linux"))
365
366 (define %linux-libre-version "4.11.7")
367 (define %linux-libre-hash "0kliwdz4qqjz13pywhavxg19cy1mf6d1f52f6kgapc331309vad9")
368
369 (define-public linux-libre
370 (make-linux-libre %linux-libre-version
371 %linux-libre-hash
372 %intel-compatible-systems
373 #:configuration-file kernel-config))
374
375 (define-public linux-libre-4.9
376 (make-linux-libre "4.9.34"
377 "00jm3338kvhfj850lg3mvk680fmfw34mvwaq41lvxgb1z2xqqlz1"
378 %intel-compatible-systems
379 #:configuration-file kernel-config))
380
381 (define-public linux-libre-4.4
382 (make-linux-libre "4.4.74"
383 "04x2ki3s2jsjkkk6bld0rd9rsk8qqvrfsxawxzfa26mkq6pv87r2"
384 %intel-compatible-systems
385 #:configuration-file kernel-config))
386
387 (define-public linux-libre-4.1
388 (make-linux-libre "4.1.41"
389 "02mqfl899jxvrmxlh8lvcgvm3klwd8wbsdz4rr2gpchbggj4vgb2"
390 %intel-compatible-systems
391 #:configuration-file kernel-config))
392
393 (define-public linux-libre-arm-generic
394 (make-linux-libre %linux-libre-version
395 %linux-libre-hash
396 '("armhf-linux")
397 #:defconfig "multi_v7_defconfig"
398 #:extra-version "arm-generic"))
399
400 \f
401 ;;;
402 ;;; Pluggable authentication modules (PAM).
403 ;;;
404
405 (define-public linux-pam
406 (package
407 (name "linux-pam")
408 (version "1.3.0")
409 (source
410 (origin
411 (method url-fetch)
412 (uri (string-append
413 "http://www.linux-pam.org/library/"
414 "Linux-PAM-" version ".tar.bz2"))
415 (sha256
416 (base32
417 "1fyi04d5nsh8ivd0rn2y0z83ylgc0licz7kifbb6xxi2ylgfs6i4"))
418 (patches (search-patches "linux-pam-no-setfsuid.patch"))))
419
420 (build-system gnu-build-system)
421 (native-inputs
422 `(("flex" ,flex)
423
424 ;; TODO: optional dependencies
425 ;; ("libxcrypt" ,libxcrypt)
426 ;; ("cracklib" ,cracklib)
427 ))
428 (arguments
429 '(;; Most users, such as `shadow', expect the headers to be under
430 ;; `security'.
431 #:configure-flags (list (string-append "--includedir="
432 (assoc-ref %outputs "out")
433 "/include/security"))
434
435 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
436 ;; isn't available.
437 #:tests? #f))
438 (home-page "http://www.linux-pam.org/")
439 (synopsis "Pluggable authentication modules for Linux")
440 (description
441 "A *Free* project to implement OSF's RFC 86.0.
442 Pluggable authentication modules are small shared object files that can
443 be used through the PAM API to perform tasks, like authenticating a user
444 at login. Local and dynamic reconfiguration are its key features.")
445 (license license:bsd-3)))
446
447 (define-public linux-pam-1.2
448 (package
449 (inherit linux-pam)
450 (version "1.2.1")
451 (source
452 (origin
453 (method url-fetch)
454 (uri (string-append
455 "http://www.linux-pam.org/library/"
456 "Linux-PAM-" version ".tar.bz2"))
457 (sha256
458 (base32
459 "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl"))
460 (patches (search-patches "linux-pam-no-setfsuid.patch"))))))
461
462
463 ;;;
464 ;;; Miscellaneous.
465 ;;;
466
467 (define-public psmisc
468 (package
469 (name "psmisc")
470 (version "22.21")
471 (source
472 (origin
473 (method url-fetch)
474 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
475 version ".tar.gz"))
476 (sha256
477 (base32
478 "0nhlm1vrrwn4a845p6y4nnnb4liq70n74zbdd5dq844jc6nkqclp"))))
479 (build-system gnu-build-system)
480 (inputs `(("ncurses" ,ncurses)))
481 (home-page "https://gitlab.com/psmisc/psmisc")
482 (synopsis
483 "Small utilities that use the proc file system")
484 (description
485 "This PSmisc package is a set of some small useful utilities that
486 use the proc file system. We're not about changing the world, but
487 providing the system administrator with some help in common tasks.")
488 (license license:gpl2+)))
489
490 (define-public util-linux
491 (package
492 (name "util-linux")
493 (version "2.30")
494 (source (origin
495 (method url-fetch)
496 (uri (string-append "mirror://kernel.org/linux/utils/"
497 name "/v" (version-major+minor version) "/"
498 name "-" version ".tar.xz"))
499 (sha256
500 (base32
501 "13d0ax8bcapga8phj2nclx86w57ddqxbr98ajibpzjq6d7zs8262"))
502 (patches (search-patches "util-linux-tests.patch"))
503 (modules '((guix build utils)))
504 (snippet
505 ;; We take the 'logger' program from GNU Inetutils and 'kill'
506 ;; from GNU Coreutils.
507 '(begin
508 (substitute* "configure"
509 (("build_logger=yes") "build_logger=no")
510 (("build_kill=yes") "build_kill=no"))
511 #t))))
512 (build-system gnu-build-system)
513 (outputs '("out"
514 "static")) ; >2 MiB of static .a libraries
515 (arguments
516 `(#:configure-flags (list "--disable-use-tty-group"
517 "--enable-fs-paths-default=/run/current-system/profile/sbin"
518 ;; Install completions where our
519 ;; bash-completion package expects them.
520 (string-append "--with-bashcompletiondir="
521 (assoc-ref %outputs "out")
522 "/etc/bash_completion.d"))
523 #:phases (modify-phases %standard-phases
524 (add-before
525 'build 'set-umount-file-name
526 (lambda* (#:key outputs #:allow-other-keys)
527 ;; Tell 'eject' the right file name of 'umount'.
528 (let ((out (assoc-ref outputs "out")))
529 (substitute* "sys-utils/eject.c"
530 (("\"/bin/umount\"")
531 (string-append "\"" out "/bin/umount\"")))
532 #t)))
533 (add-before
534 'check 'pre-check
535 (lambda* (#:key inputs outputs #:allow-other-keys)
536 (let ((out (assoc-ref outputs "out"))
537 (net (assoc-ref inputs "net-base")))
538 ;; Change the test to refer to the right file.
539 (substitute* "tests/ts/misc/mcookie"
540 (("/etc/services")
541 (string-append net "/etc/services")))
542 #t)))
543 (add-after
544 'install 'move-static-libraries
545 (lambda* (#:key outputs #:allow-other-keys)
546 (let ((out (assoc-ref outputs "out"))
547 (static (assoc-ref outputs "static")))
548 (mkdir-p (string-append static "/lib"))
549 (with-directory-excursion out
550 (for-each (lambda (file)
551 (rename-file file
552 (string-append static "/"
553 file)))
554 (find-files "lib" "\\.a$")))
555 #t))))))
556 (inputs `(("zlib" ,zlib)
557 ("ncurses" ,ncurses)))
558 (native-inputs
559 `(("perl" ,perl)
560 ("net-base" ,net-base))) ;for tests
561 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
562 (synopsis "Collection of utilities for the Linux kernel")
563 (description "Util-linux is a diverse collection of Linux kernel
564 utilities. It provides dmesg and includes tools for working with file systems,
565 block devices, UUIDs, TTYs, and many other tools.")
566
567 ;; Note that util-linux doesn't use the same license for all the
568 ;; code. GPLv2+ is the default license for a code without an
569 ;; explicitly defined license.
570 (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+
571 license:bsd-4 license:public-domain))))
572
573 (define-public ddate
574 (package
575 (name "ddate")
576 (version "0.2.2")
577 (source (origin
578 (method url-fetch)
579 (uri (string-append "https://github.com/bo0ts/ddate/archive/v"
580 version ".tar.gz"))
581 (file-name (string-append name "-" version ".tar.gz"))
582 (sha256
583 (base32 "1bbqqq8mswj4bp9083gxjaky5ysfznax4cynsqwmy125z053yg6m"))))
584 (build-system cmake-build-system)
585 (arguments '(#:tests? #f))
586 (home-page "https://github.com/bo0ts/ddate")
587 (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR")
588 (description
589 "ddate displays the Discordian date and holidays of a given date.
590 The Discordian calendar was made popular by the \"Illuminatus!\" trilogy
591 by Robert Shea and Robert Anton Wilson.")
592 (license license:public-domain)))
593
594 (define-public procps
595 (package
596 (name "procps")
597 (version "3.3.12")
598 (source (origin
599 (method url-fetch)
600 (uri (string-append "mirror://sourceforge/procps-ng/Production/"
601 "procps-ng-" version ".tar.xz"))
602 (sha256
603 (base32
604 "1m57w6jmry84njd5sgk5afycbglql0al80grx027kwqqcfw5mmkf"))))
605 (build-system gnu-build-system)
606 (arguments
607 '(#:modules ((guix build utils)
608 (guix build gnu-build-system)
609 (srfi srfi-1)
610 (srfi srfi-26))
611 #:phases
612 (modify-phases %standard-phases
613 (add-before 'check 'disable-strtod-test
614 (lambda _
615 ;; Disable the 'strtod' test, which fails on 32-bit systems.
616 ;; This is what upstream does:
617 ;; <https://gitlab.com/procps-ng/procps/commit/100afbc1491be388f1429021ff65d969f4b1e08f>.
618 (substitute* "Makefile"
619 (("^(TESTS|check_PROGRAMS) = .*$" all)
620 (string-append "# " all "\n")))
621 #t))
622 (add-after
623 'install 'post-install
624 ;; Remove commands and man pages redudant with
625 ;; Coreutils.
626 (lambda* (#:key outputs #:allow-other-keys)
627 (let* ((out (assoc-ref outputs "out"))
628 (dup (append-map (cut find-files out <>)
629 '("^kill" "^uptime"))))
630 (for-each delete-file dup)
631 #t))))))
632 (inputs `(("ncurses" ,ncurses)))
633 (home-page "https://gitlab.com/procps-ng/procps/")
634 (synopsis "Utilities that give information about processes")
635 (description
636 "Procps is the package that has a bunch of small useful utilities
637 that give information about processes using the Linux /proc file system.
638 The package includes the programs ps, top, vmstat, w, kill, free,
639 slabtop, and skill.")
640 (license license:gpl2)))
641
642 (define-public usbutils
643 (package
644 (name "usbutils")
645 (version "008")
646 (source
647 (origin
648 (method url-fetch)
649 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
650 "usbutils-" version ".tar.xz"))
651 (sha256
652 (base32
653 "132clk14j4nm8crln2jymdbbc2vhzar2j2hnxyh05m79pbq1lx24"))))
654 (build-system gnu-build-system)
655 (inputs
656 `(("libusb" ,libusb)
657 ("eudev" ,eudev)))
658 (native-inputs
659 `(("pkg-config" ,pkg-config)))
660 (home-page "http://www.linux-usb.org/")
661 (synopsis
662 "Tools for working with USB devices, such as lsusb")
663 (description
664 "Tools for working with USB devices, such as lsusb.")
665 (license license:gpl2+)))
666
667 (define-public e2fsprogs
668 (package
669 (name "e2fsprogs")
670 (version "1.43.4")
671 (source (origin
672 (method url-fetch)
673 (uri (string-append
674 "mirror://kernel.org/linux/kernel/people/tytso/"
675 name "/v" version "/"
676 name "-" version ".tar.xz"))
677 (sha256
678 (base32
679 "092absr4vrlqrkdf9nwh4ykj40ab6hhwrkdr6sjsccd54c8z5csl"))))
680 (build-system gnu-build-system)
681 (inputs `(("util-linux" ,util-linux)))
682 (native-inputs `(("pkg-config" ,pkg-config)
683 ("texinfo" ,texinfo) ;for the libext2fs Info manual
684
685 ;; For tests.
686 ("perl" ,perl)
687 ("procps" ,procps)))
688 (arguments
689 '(;; util-linux is the preferred source for some of the libraries and
690 ;; commands, so disable them (see, e.g.,
691 ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.)
692 #:configure-flags (list "--disable-libblkid"
693 "--disable-libuuid" "--disable-uuidd"
694 "--disable-fsck"
695
696 ;; Use symlinks instead of hard links for
697 ;; 'fsck.extN' etc. This makes the resulting nar
698 ;; smaller and is preserved across copies.
699 "--enable-symlink-install"
700
701 (string-append "LDFLAGS=-Wl,-rpath="
702 (assoc-ref %outputs "out")
703 "/lib")
704
705 ;; Install libext2fs et al.
706 "--enable-elf-shlibs")
707
708 #:phases
709 (modify-phases %standard-phases
710 (add-before 'configure 'patch-shells
711 (lambda _
712 (substitute* "configure"
713 (("/bin/sh (.*)parse-types.sh" _ dir)
714 (string-append (which "sh") " " dir
715 "parse-types.sh")))
716 (substitute* "MCONFIG.in"
717 (("INSTALL_SYMLINK = /bin/sh")
718 "INSTALL_SYMLINK = sh"))
719 (substitute* (find-files "." "^Makefile.in$")
720 (("#!/bin/sh")
721 (string-append "#!" (which "sh"))))
722 #t))
723 (add-after 'install 'install-libs
724 (lambda* (#:key outputs #:allow-other-keys)
725 (let* ((out (assoc-ref outputs "out"))
726 (lib (string-append out "/lib")))
727 (and (zero? (system* "make" "install-libs"))
728
729 ;; Make the .a writable so that 'strip' works.
730 ;; Failing to do that, due to debug symbols, we
731 ;; retain a reference to the final
732 ;; linux-libre-headers, which refer to the
733 ;; bootstrap binaries.
734 (let ((archives (find-files lib "\\.a$")))
735 (for-each (lambda (file)
736 (chmod file #o666))
737 archives)
738 #t))))))))
739 (home-page "http://e2fsprogs.sourceforge.net/")
740 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
741 (description
742 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
743 (license (list license:gpl2 ;programs
744 license:lgpl2.0 ;libext2fs
745 license:x11)))) ;libuuid
746
747 (define e2fsprogs/static
748 (static-package
749 (package (inherit e2fsprogs)
750 (arguments
751 ;; Do not build shared libraries.
752 (substitute-keyword-arguments (package-arguments e2fsprogs)
753 ((#:configure-flags _)
754 '(list "--disable-blkid"))
755 ((#:make-flags _)
756 '(list)))))))
757
758 (define-public e2fsck/static
759 (package
760 (name "e2fsck-static")
761 (version (package-version e2fsprogs))
762 (build-system trivial-build-system)
763 (source #f)
764 (inputs
765 `(("e2fsprogs" ,e2fsprogs/static)))
766 (arguments
767 `(#:modules ((guix build utils))
768 #:builder
769 (begin
770 (use-modules (guix build utils)
771 (ice-9 ftw)
772 (srfi srfi-26))
773
774 (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs")
775 "/sbin/e2fsck"))
776 (bin (string-append (assoc-ref %outputs "out") "/sbin")))
777 (mkdir-p bin)
778 (with-directory-excursion bin
779 (copy-file e2fsck "e2fsck")
780 (remove-store-references "e2fsck")
781 (chmod "e2fsck" #o555))))))
782 (home-page (package-home-page e2fsprogs))
783 (synopsis "Statically-linked e2fsck command from e2fsprogs")
784 (description "This package provides statically-linked e2fsck command taken
785 from the e2fsprogs package. It is meant to be used in initrds.")
786 (license (package-license e2fsprogs))))
787
788 (define-public extundelete
789 (package
790 (name "extundelete")
791 (version "0.2.4")
792 (source (origin
793 (method url-fetch)
794 (uri (string-append "mirror://sourceforge/extundelete/"
795 "extundelete/" version "/extundelete-"
796 version ".tar.bz2"))
797 (sha256
798 (base32
799 "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1"))))
800 (build-system gnu-build-system)
801 (inputs `(("e2fsprogs" ,e2fsprogs)))
802 (home-page "http://extundelete.sourceforge.net/")
803 (synopsis "Recover deleted files from ext2/3/4 partitions")
804 (description
805 "Extundelete is a set of tools that can recover deleted files from an
806 ext3 or ext4 partition.")
807 (license license:gpl2)))
808
809 (define-public zerofree
810 (package
811 (name "zerofree")
812 (version "1.0.3")
813 (home-page "http://intgat.tigress.co.uk/rmy/uml/")
814 (source (origin
815 (method url-fetch)
816 (uri (string-append home-page name "-" version
817 ".tgz"))
818 (sha256
819 (base32
820 "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs"))))
821 (build-system gnu-build-system)
822 (arguments
823 '(#:phases (alist-replace
824 'install
825 (lambda* (#:key outputs #:allow-other-keys)
826 (let* ((out (assoc-ref outputs "out"))
827 (bin (string-append out "/bin")))
828 (mkdir-p bin)
829 (copy-file "zerofree"
830 (string-append bin "/zerofree"))
831 (chmod (string-append bin "/zerofree")
832 #o555)
833 #t))
834 (alist-delete 'configure %standard-phases))
835 #:tests? #f)) ;no tests
836 (inputs `(("libext2fs" ,e2fsprogs)))
837 (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems")
838 (description
839 "The zerofree command scans the free blocks in an ext2 file system and
840 fills any non-zero blocks with zeroes. This is a useful way to make disk
841 images more compressible.")
842 (license license:gpl2)))
843
844 (define-public strace
845 (package
846 (name "strace")
847 (version "4.17")
848 (source (origin
849 (method url-fetch)
850 (uri (string-append "mirror://sourceforge/strace/strace/" version
851 "/strace-" version ".tar.xz"))
852 (sha256
853 (base32
854 "06bl4dld5fk4a3iiq4pyrkm6sh63599ah8dmds0glg5vbw45pww1"))))
855 (build-system gnu-build-system)
856 (arguments
857 '(#:phases
858 (modify-phases %standard-phases
859 (add-after 'unpack 'patch-/bin/sh
860 (lambda _
861 (substitute* "strace.c"
862 (("/bin/sh") (which "sh")))
863 #t)))))
864 (native-inputs `(("perl" ,perl)))
865 (home-page "https://strace.io/")
866 (synopsis "System call tracer for Linux")
867 (description
868 "strace is a system call tracer, i.e. a debugging tool which prints out a
869 trace of all the system calls made by a another process/program.")
870 (license license:bsd-3)))
871
872 (define-public ltrace
873 (package
874 (name "ltrace")
875 (version "0.7.3")
876 (source (origin
877 (method url-fetch)
878 (uri (string-append "http://www.ltrace.org/ltrace_" version
879 ".orig.tar.bz2"))
880 (sha256
881 (base32
882 "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf"))))
883 (build-system gnu-build-system)
884 (inputs `(("libelf" ,libelf)))
885 (arguments
886 ;; Compilation uses -Werror by default, but it fails.
887 '(#:configure-flags '("--disable-werror")))
888 (home-page "http://www.ltrace.org/")
889 (synopsis "Library call tracer for Linux")
890 (description
891 "ltrace intercepts and records dynamic library calls which are called by
892 an executed process and the signals received by that process. It can also
893 intercept and print the system calls executed by the program.")
894 (license license:gpl2+)))
895
896 (define-public alsa-lib
897 (package
898 (name "alsa-lib")
899 (version "1.1.4.1")
900 (source (origin
901 (method url-fetch)
902 (uri (string-append
903 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
904 version ".tar.bz2"))
905 (sha256
906 (base32
907 "0xjvi381105gldhv0z872a0x58sghznyx19j45lw5iyi2h68gfwi"))))
908 (build-system gnu-build-system)
909 (home-page "https://www.alsa-project.org/")
910 (synopsis "The Advanced Linux Sound Architecture libraries")
911 (description
912 "The Advanced Linux Sound Architecture (ALSA) provides audio and
913 MIDI functionality to the Linux-based operating system.")
914 (license license:lgpl2.1+)))
915
916 (define-public alsa-utils
917 (package
918 (name "alsa-utils")
919 (version "1.1.4")
920 (source (origin
921 (method url-fetch)
922 (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/"
923 name "-" version ".tar.bz2"))
924 (sha256
925 (base32
926 "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7"))))
927 (build-system gnu-build-system)
928 (arguments
929 ;; XXX: Disable man page creation until we have DocBook.
930 '(#:configure-flags (list "--disable-xmlto"
931
932 ;; The udev rule is responsible for restoring
933 ;; the volume.
934 (string-append "--with-udev-rules-dir="
935 (assoc-ref %outputs "out")
936 "/lib/udev/rules.d"))
937 #:phases
938 (modify-phases %standard-phases
939 (add-before
940 'install 'pre-install
941 (lambda _
942 ;; Don't try to mkdir /var/lib/alsa.
943 (substitute* "Makefile"
944 (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*")
945 "true\n"))
946 #t)))))
947 (inputs
948 `(("libsamplerate" ,libsamplerate)
949 ("ncurses" ,ncurses)
950 ("alsa-lib" ,alsa-lib)
951 ("xmlto" ,xmlto)
952 ("gettext" ,gettext-minimal)))
953 (home-page "http://www.alsa-project.org/")
954 (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)")
955 (description
956 "The Advanced Linux Sound Architecture (ALSA) provides audio and
957 MIDI functionality to the Linux-based operating system.")
958
959 ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are
960 ;; GPLv2-only.
961 (license license:gpl2)))
962
963 (define-public alsa-plugins
964 (package
965 (name "alsa-plugins")
966 (version "1.1.4")
967 (source (origin
968 (method url-fetch)
969 (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/"
970 name "-" version ".tar.bz2"))
971 (sha256
972 (base32
973 "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak"))))
974 (build-system gnu-build-system)
975 ;; TODO: Split libavcodec and speex if possible. It looks like they can not
976 ;; be split, there are references to both in files.
977 ;; TODO: Remove OSS related plugins, they add support to run native
978 ;; ALSA applications on OSS however we do not offer OSS and OSS is
979 ;; obsolete.
980 (outputs '("out" "pulseaudio"))
981 (arguments
982 `(#:phases
983 (modify-phases %standard-phases
984 (add-after 'install 'split
985 (lambda* (#:key inputs outputs #:allow-other-keys)
986 ;; Distribute the binaries to the various outputs.
987 (let* ((out (assoc-ref outputs "out"))
988 (pua (assoc-ref outputs "pulseaudio"))
989 (pualib (string-append pua "/lib/alsa-lib"))
990 (puaconf (string-append pua "/share/alsa/alsa.conf.d")))
991 (mkdir-p puaconf)
992 (mkdir-p pualib)
993 (chdir (string-append out "/share"))
994 (for-each (lambda (file)
995 (rename-file file (string-append puaconf "/" (basename file))))
996 (find-files out "\\.(conf|example)"))
997 (for-each (lambda (file)
998 (rename-file file (string-append pualib "/" (basename file))))
999 (find-files out ".*pulse\\.(la|so)"))
1000 (chdir "..")
1001 ;; We have moved the files to output pulsaudio, the
1002 ;; directory is now empty.
1003 (delete-file-recursively (string-append out "/share"))
1004 #t))))))
1005 (inputs
1006 `(("alsa-lib" ,alsa-lib)
1007 ("speex" ,speex) ; libspeexdsp resampling plugin
1008 ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin
1009 ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin
1010 ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin
1011 (native-inputs
1012 `(("pkg-config" ,pkg-config)))
1013 (home-page "http://www.alsa-project.org/")
1014 (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)")
1015 (description
1016 "The Advanced Linux Sound Architecture (ALSA) provides audio and
1017 MIDI functionality to the Linux-based operating system. This package enhances ALSA
1018 by providing additional plugins which include: upmixing, downmixing, jackd and
1019 pulseaudio support for native alsa applications, format conversion (s16 to a52), and
1020 external rate conversion.")
1021 (license (list license:gpl2+
1022 ;; `rate/rate_samplerate.c': LGPL v2.1 or later.
1023 license:lgpl2.1+))))
1024
1025 (define-public iptables
1026 (package
1027 (name "iptables")
1028 (version "1.6.1")
1029 (source (origin
1030 (method url-fetch)
1031 (uri (string-append
1032 "mirror://netfilter.org/iptables/iptables-"
1033 version ".tar.bz2"))
1034 (sha256
1035 (base32
1036 "1x8c9y340x79djsq54bc1674ryv59jfphrk4f88i7qbvbnyxghhg"))))
1037 (build-system gnu-build-system)
1038 (native-inputs
1039 `(("pkg-config" ,pkg-config)
1040 ("flex" ,flex)
1041 ("bison" ,bison)))
1042 (inputs
1043 `(("libmnl" ,libmnl)
1044 ("libnftnl" ,libnftnl)))
1045 (arguments
1046 '(#:tests? #f ; no test suite
1047 #:configure-flags ; add $libdir to the RUNPATH of executables
1048 (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))))
1049 (home-page "https://www.netfilter.org/projects/iptables/index.html")
1050 (synopsis "Program to configure the Linux IP packet filtering rules")
1051 (description
1052 "iptables is the userspace command line program used to configure the
1053 Linux 2.4.x and later IPv4 packet filtering ruleset (firewall). It is targeted at
1054 system administrators. Since Network Address Translation is also configured
1055 from the packet filter ruleset, iptables is used for this, too. The iptables
1056 package also includes ip6tables. ip6tables is used for configuring the IPv6
1057 packet filter.")
1058 (license license:gpl2+)))
1059
1060 (define-public ebtables
1061 (package
1062 (name "ebtables")
1063 (version "2.0.10-4")
1064 (source (origin
1065 (method url-fetch)
1066 (uri (string-append
1067 "mirror://netfilter.org/ebtables/ebtables-v"
1068 version ".tar.gz"))
1069 (sha256
1070 (base32
1071 "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw"))))
1072 (build-system gnu-build-system)
1073 (arguments
1074 '(#:tests? #f ; no test suite
1075 #:make-flags
1076 (let* ((out (assoc-ref %outputs "out"))
1077 (bin (string-append out "/sbin"))
1078 (lib (string-append out "/lib"))
1079 (man (string-append out "/share/man"))
1080 (iptables (assoc-ref %build-inputs "iptables"))
1081 (ethertypes (string-append iptables "/etc/ethertypes")))
1082 (list (string-append "LIBDIR=" lib)
1083 (string-append "MANDIR=" man)
1084 (string-append "BINDIR=" bin)
1085 (string-append "ETHERTYPESFILE=" ethertypes)
1086 ;; With the default CFLAGS, it falis with:
1087 ;; communication.c:259:58: error: variable ‘ret’ set but not
1088 ;; used [-Werror=unused-but-set-variable]
1089 "CFLAGS=-Wall"))
1090 #:phases
1091 (modify-phases %standard-phases
1092 (replace 'configure
1093 ;; no configure script
1094 (lambda _
1095 (substitute* "Makefile"
1096 ;; Remove user and group options from install commands,
1097 ;; otherwise it fails with: invalid user 'root'.
1098 (("-o root -g root") "")
1099 ;; Remove 'ethertypes' from the install target.
1100 (("install: .*")
1101 "install: $(MANDIR)/man8/ebtables.8 exec scripts\n"))
1102 #t)))))
1103 (inputs
1104 `(("perl" ,perl)
1105 ("iptables" ,iptables)))
1106 (synopsis "Ethernet bridge frame table administration")
1107 (home-page "http://ebtables.netfilter.org/")
1108 (description
1109 "ebtables is an application program used to set up and maintain the
1110 tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is
1111 analogous to the iptables application, but less complicated, due to the fact
1112 that the Ethernet protocol is much simpler than the IP protocol.")
1113 (license license:gpl2+)))
1114
1115 (define-public iproute
1116 (package
1117 (name "iproute2")
1118 (version "4.11.0")
1119 (source (origin
1120 (method url-fetch)
1121 (uri (string-append
1122 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
1123 version ".tar.xz"))
1124 (sha256
1125 (base32
1126 "09l0phf09mw17bn3xlzfr80sbhw14mq8xv28iz5x15m6pll10rvj"))))
1127 (build-system gnu-build-system)
1128 (arguments
1129 `(#:tests? #f ; no test suite
1130 #:make-flags (let ((out (assoc-ref %outputs "out")))
1131 (list "DESTDIR="
1132 (string-append "BASH_COMPDIR=" out
1133 "/etc/bash_completion.d")
1134 (string-append "LIBDIR=" out "/lib")
1135 (string-append "HDRDIR=" out "/include")
1136 (string-append "SBINDIR=" out "/sbin")
1137 (string-append "CONFDIR=" out "/etc")
1138 (string-append "DOCDIR=" out "/share/doc/"
1139 ,name "-" ,version)
1140 (string-append "MANDIR=" out "/share/man")))
1141 #:phases (modify-phases %standard-phases
1142 (add-before 'install 'pre-install
1143 (lambda _
1144 ;; Don't attempt to create /var/lib/arpd.
1145 (substitute* "Makefile"
1146 (("^.*ARPDDIR.*$") "")))))))
1147 (inputs
1148 `(("iptables" ,iptables)
1149 ("db4" ,bdb)))
1150 (native-inputs
1151 `(("pkg-config" ,pkg-config)
1152 ("flex" ,flex)
1153 ("bison" ,bison)))
1154 (home-page
1155 "https://wiki.linuxfoundation.org/networking/iproute2")
1156 (synopsis
1157 "Utilities for controlling TCP/IP networking and traffic in Linux")
1158 (description
1159 "Iproute2 is a collection of utilities for controlling TCP/IP
1160 networking and traffic with the Linux kernel.
1161
1162 Most network configuration manuals still refer to ifconfig and route as the
1163 primary network configuration tools, but ifconfig is known to behave
1164 inadequately in modern network environments. They should be deprecated, but
1165 most distros still include them. Most network configuration systems make use
1166 of ifconfig and thus provide a limited feature set. The /etc/net project aims
1167 to support most modern network technologies, as it doesn't use ifconfig and
1168 allows a system administrator to make use of all iproute2 features, including
1169 traffic control.
1170
1171 iproute2 is usually shipped in a package called iproute or iproute2 and
1172 consists of several tools, of which the most important are @command{ip} and
1173 @command{tc}. @command{ip} controls IPv4 and IPv6 configuration and
1174 @command{tc} stands for traffic control. Both tools print detailed usage
1175 messages and are accompanied by a set of manpages.")
1176 (license license:gpl2+)))
1177
1178 (define-public net-tools
1179 ;; XXX: This package is basically unmaintained, but it provides a few
1180 ;; commands not yet provided by Inetutils, such as 'route', so we have to
1181 ;; live with it.
1182 (package
1183 (name "net-tools")
1184 (version "1.60")
1185 (home-page "http://net-tools.sourceforge.net/")
1186 (source (origin
1187 (method url-fetch)
1188 (uri (list (string-append
1189 "mirror://sourceforge/net-tools/net-tools-"
1190 version ".tar.bz2")
1191 (string-append
1192 "http://distro.ibiblio.org/rootlinux/rootlinux-ports"
1193 "/base/net-tools/net-tools-1.60.tar.bz2")))
1194 (sha256
1195 (base32
1196 "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s"))
1197 (patches (search-patches "net-tools-bitrot.patch"))))
1198 (build-system gnu-build-system)
1199 (arguments
1200 '(#:modules ((guix build gnu-build-system)
1201 (guix build utils)
1202 (srfi srfi-1)
1203 (srfi srfi-26))
1204 #:phases (alist-cons-after
1205 'unpack 'patch
1206 (lambda* (#:key inputs #:allow-other-keys)
1207 (define (apply-patch file)
1208 (zero? (system* "patch" "-p1" "--force"
1209 "--input" file)))
1210
1211 (let ((patch.gz (assoc-ref inputs "patch")))
1212 (format #t "applying Debian patch set '~a'...~%"
1213 patch.gz)
1214 (system (string-append "gunzip < " patch.gz " > the-patch"))
1215 (and (apply-patch "the-patch")
1216 (for-each apply-patch
1217 (find-files "debian/patches"
1218 "\\.patch")))))
1219 (alist-replace
1220 'configure
1221 (lambda* (#:key outputs #:allow-other-keys)
1222 (let ((out (assoc-ref outputs "out")))
1223 (mkdir-p (string-append out "/bin"))
1224 (mkdir-p (string-append out "/sbin"))
1225
1226 ;; Pretend we have everything...
1227 (system "yes | make config")
1228
1229 ;; ... except for the things we don't have.
1230 ;; HAVE_AFDECnet requires libdnet, which we don't have.
1231 ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers
1232 ;; that have been removed.
1233 (substitute* '("config.make" "config.h")
1234 (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR)[ =]1.*$") ""))))
1235 (alist-cons-after
1236 'install 'remove-redundant-commands
1237 (lambda* (#:key outputs #:allow-other-keys)
1238 ;; Remove commands and man pages redundant with
1239 ;; Inetutils.
1240 (let* ((out (assoc-ref outputs "out"))
1241 (dup (append-map (cut find-files out <>)
1242 '("^hostname"
1243 "^(yp|nis|dns)?domainname"))))
1244 (for-each delete-file dup)
1245 #t))
1246 %standard-phases)))
1247
1248 ;; Binaries that depend on libnet-tools.a don't declare that
1249 ;; dependency, making it parallel-unsafe.
1250 #:parallel-build? #f
1251
1252 #:tests? #f ; no test suite
1253 #:make-flags (let ((out (assoc-ref %outputs "out")))
1254 (list "CC=gcc"
1255 (string-append "BASEDIR=" out)
1256 (string-append "INSTALLNLSDIR=" out "/share/locale")
1257 (string-append "mandir=/share/man")))))
1258
1259 ;; Use the big Debian patch set (the thing does not even compile out of
1260 ;; the box.)
1261 (inputs `(("patch" ,(origin
1262 (method url-fetch)
1263 (uri
1264 "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz")
1265 (sha256
1266 (base32
1267 "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p"))))))
1268 (native-inputs `(("gettext" ,gettext-minimal)))
1269
1270 (synopsis "Tools for controlling the network subsystem in Linux")
1271 (description
1272 "This package includes the important tools for controlling the network
1273 subsystem of the Linux kernel. This includes arp, hostname, ifconfig,
1274 netstat, rarp and route. Additionally, this package contains utilities
1275 relating to particular network hardware types (plipconfig, slattach) and
1276 advanced aspects of IP configuration (iptunnel, ipmaddr).")
1277 (license license:gpl2+)))
1278
1279 (define-public libcap
1280 (package
1281 (name "libcap")
1282 (version "2.25")
1283 (source (origin
1284 (method url-fetch)
1285 (uri (string-append
1286 "mirror://kernel.org/linux/libs/security/linux-privs/"
1287 "libcap2/libcap-" version ".tar.xz"))
1288 (sha256
1289 (base32
1290 "0qjiqc5pknaal57453nxcbz3mn1r4hkyywam41wfcglq3v2qlg39"))))
1291 (build-system gnu-build-system)
1292 (arguments '(#:phases
1293 (modify-phases %standard-phases
1294 (replace 'configure
1295 ;; Add $libdir to the RUNPATH of executables.
1296 (lambda _
1297 (substitute* "Make.Rules"
1298 (("LDFLAGS := #-g")
1299 (string-append "LDFLAGS := -Wl,-rpath="
1300 %output "/lib"))))))
1301 #:tests? #f ; no 'check' target
1302 #:make-flags (list "lib=lib"
1303 (string-append "prefix="
1304 (assoc-ref %outputs "out"))
1305 "RAISE_SETFCAP=no")))
1306 (native-inputs `(("perl" ,perl)))
1307 (inputs `(("attr" ,attr)))
1308 (home-page "https://sites.google.com/site/fullycapable/")
1309 (synopsis "Library for working with POSIX capabilities")
1310 (description
1311 "Libcap2 provides a programming interface to POSIX capabilities on
1312 Linux-based operating systems.")
1313
1314 ;; License is BSD-3 or GPLv2, at the user's choice.
1315 (license license:gpl2)))
1316
1317 (define-public bridge-utils
1318 (package
1319 (name "bridge-utils")
1320 (version "1.5")
1321 (source (origin
1322 (method url-fetch)
1323 (uri (string-append "mirror://sourceforge/bridge/bridge/"
1324 "bridge-utils-" version ".tar.gz"))
1325 (sha256
1326 (base32
1327 "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2"))))
1328 (build-system gnu-build-system)
1329
1330 ;; The tarball lacks all the generated files.
1331 (native-inputs `(("autoconf" ,autoconf)
1332 ("automake" ,automake)))
1333 (arguments
1334 '(#:phases (alist-cons-after
1335 'unpack 'bootstrap
1336 (lambda _
1337 ;; Fix "field ‘ip6’ has incomplete type" errors.
1338 (substitute* "libbridge/libbridge.h"
1339 (("#include <linux/if_bridge.h>")
1340 "#include <linux/in6.h>\n#include <linux/if_bridge.h>"))
1341
1342 ;; Ensure that the entire build fails if one of the
1343 ;; sub-Makefiles fails.
1344 (substitute* "Makefile.in"
1345 (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;")
1346 "$(MAKE) $(MFLAGS) -C $$x || exit 1;"))
1347
1348 (zero? (system* "autoreconf" "-vf")))
1349 %standard-phases)
1350 #:tests? #f)) ; no 'check' target
1351
1352 (home-page
1353 "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge")
1354 (synopsis "Manipulate Ethernet bridges")
1355 (description
1356 "Utilities for Linux's Ethernet bridging facilities. A bridge is a way
1357 to connect two Ethernet segments together in a protocol independent way.
1358 Packets are forwarded based on Ethernet address, rather than IP address (like
1359 a router). Since forwarding is done at Layer 2, all protocols can go
1360 transparently through a bridge.")
1361 (license license:gpl2+)))
1362
1363 (define-public libnl
1364 (package
1365 (name "libnl")
1366 (version "3.3.0")
1367 (source (origin
1368 (method url-fetch)
1369 (uri (string-append
1370 "https://github.com/thom311/libnl/releases/download/"
1371 "libnl" (string-join (string-split version #\.) "_")
1372 "/libnl-" version ".tar.gz"))
1373 (sha256
1374 (base32
1375 "1r3lw3hjvqxi5zqyq2w1qadm3gisd9nlf71dkl4yplacmssnhm3h"))))
1376 (build-system gnu-build-system)
1377 (native-inputs `(("flex" ,flex) ("bison" ,bison)))
1378 (home-page "http://www.infradead.org/~tgr/libnl/")
1379 (synopsis "NetLink protocol library suite")
1380 (description
1381 "The libnl suite is a collection of libraries providing APIs to netlink
1382 protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily
1383 between the kernel and user space processes. It was designed to be a more
1384 flexible successor to ioctl to provide mainly networking related kernel
1385 configuration and monitoring interfaces.")
1386
1387 ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like
1388 ;; 'nl-addr-add.c'), so the result is GPLv2-only.
1389 (license license:gpl2)))
1390
1391 (define-public iw
1392 (package
1393 (name "iw")
1394 (version "4.9")
1395 (source (origin
1396 (method url-fetch)
1397 (uri (string-append
1398 "mirror://kernel.org/software/network/iw/iw-"
1399 version ".tar.xz"))
1400 (sha256
1401 (base32
1402 "1klpvv98bnx1zm6aqalnri2vd7w80scmdaxr2qnblb6mz82whk1j"))))
1403 (build-system gnu-build-system)
1404 (native-inputs `(("pkg-config" ,pkg-config)))
1405 (inputs `(("libnl" ,libnl)))
1406 (arguments
1407 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
1408 "CC=gcc")
1409 #:phases (alist-delete 'configure %standard-phases)))
1410 (home-page "https://wireless.wiki.kernel.org/")
1411 (synopsis "Tool for configuring wireless devices")
1412 (description
1413 "iw is a new nl80211 based CLI configuration utility for wireless
1414 devices. It replaces @code{iwconfig}, which is deprecated.")
1415 (license license:isc)))
1416
1417 (define-public powertop
1418 (package
1419 (name "powertop")
1420 (version "2.8")
1421 (source
1422 (origin
1423 (method url-fetch)
1424 (uri (string-append
1425 "https://01.org/sites/default/files/downloads/powertop/powertop-"
1426 version ".tar.gz"))
1427 (sha256
1428 (base32
1429 "0nlwazxbnn0k6q5f5b09wdhw0f194lpzkp3l7vxansqhfczmcyx8"))))
1430 (build-system gnu-build-system)
1431 (arguments
1432 '(#:phases
1433 (modify-phases %standard-phases
1434 ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to
1435 ;; allow calibrating the network interface in GuixSD.
1436 (add-after 'unpack 'patch-absolute-file-names
1437 (lambda* (#:key inputs #:allow-other-keys)
1438 (let ((kmod (assoc-ref inputs "kmod")))
1439 (substitute* (find-files "src" "\\.cpp$")
1440 ;; Give the right 'modprobe' file name so that essential
1441 ;; modules such as msr.ko can be loaded.
1442 (("/sbin/modprobe") (string-append kmod "/bin/modprobe"))
1443 ;; These programs are only needed to calibrate, so using
1444 ;; relative file names avoids adding extra inputs. When they
1445 ;; are missing powertop gracefully handles it.
1446 (("/usr/bin/hcitool") "hcitool")
1447 (("/usr/bin/xset") "xset")
1448 (("/usr/sbin/hciconfig") "hciconfig"))
1449 #t))))))
1450 (inputs
1451 `(("kmod" ,kmod)
1452 ("libnl" ,libnl)
1453 ("ncurses" ,ncurses)
1454 ("pciutils" ,pciutils)
1455 ("zlib" ,zlib)))
1456 (native-inputs
1457 `(("pkg-config" ,pkg-config)))
1458 (home-page "https://01.org/powertop/")
1459 (synopsis "Analyze power consumption on Intel-based laptops")
1460 (description
1461 "PowerTOP is a Linux tool to diagnose issues with power consumption and
1462 power management. In addition to being a diagnostic tool, PowerTOP also has
1463 an interactive mode where the user can experiment various power management
1464 settings for cases where the operating system has not enabled these
1465 settings.")
1466 (license license:gpl2)))
1467
1468 (define-public aumix
1469 (package
1470 (name "aumix")
1471 (version "2.9.1")
1472 (source (origin
1473 (method url-fetch)
1474 (uri (string-append
1475 "http://www.jpj.net/~trevor/aumix/releases/aumix-"
1476 version ".tar.bz2"))
1477 (sha256
1478 (base32
1479 "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj"))))
1480 (build-system gnu-build-system)
1481 (inputs `(("ncurses" ,ncurses)))
1482 (home-page "http://www.jpj.net/~trevor/aumix.html")
1483 (synopsis "Audio mixer for X and the console")
1484 (description
1485 "Aumix adjusts an audio mixer from X, the console, a terminal,
1486 the command line or a script.")
1487 (license license:gpl2+)))
1488
1489 (define-public iotop
1490 (package
1491 (name "iotop")
1492 (version "0.6")
1493 (source
1494 (origin
1495 (method url-fetch)
1496 (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-"
1497 version ".tar.gz"))
1498 (sha256 (base32
1499 "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s"))))
1500 (build-system python-build-system)
1501 (arguments
1502 ;; The setup.py script expects python-2.
1503 `(#:python ,python-2
1504 ;; There are currently no checks in the package.
1505 #:tests? #f))
1506 (native-inputs `(("python" ,python-2)))
1507 (home-page "http://guichaz.free.fr/iotop/")
1508 (synopsis
1509 "Displays the IO activity of running processes")
1510 (description
1511 "Iotop is a Python program with a top like user interface to show the
1512 processes currently causing I/O.")
1513 (license license:gpl2+)))
1514
1515 (define-public fuse
1516 (package
1517 (name "fuse")
1518 (version "2.9.7")
1519 (source (origin
1520 (method url-fetch)
1521 (uri (string-append "https://github.com/libfuse/libfuse/releases/"
1522 "download/fuse-" version
1523 "/fuse-" version ".tar.gz"))
1524 (sha256
1525 (base32
1526 "0x486nri30f7cgy0acj87v9sjxsjrr0cymrvw4h3r0sgmp8k4943"))
1527 (patches (search-patches "fuse-overlapping-headers.patch"))))
1528 (build-system gnu-build-system)
1529 (inputs `(("util-linux" ,util-linux)))
1530 (arguments
1531 '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH="
1532 (assoc-ref %outputs "out")
1533 "/sbin")
1534 (string-append "INIT_D_PATH="
1535 (assoc-ref %outputs "out")
1536 "/etc/init.d")
1537
1538 ;; The rule makes /dev/fuse 666.
1539 (string-append "UDEV_RULES_PATH="
1540 (assoc-ref %outputs "out")
1541 "/lib/udev/rules.d"))
1542 #:phases (alist-cons-before
1543 'build 'set-file-names
1544 (lambda* (#:key inputs #:allow-other-keys)
1545 ;; libfuse calls out to mount(8) and umount(8). Make sure
1546 ;; it refers to the right ones.
1547 (substitute* '("lib/mount_util.c" "util/mount_util.c")
1548 (("/bin/(u?)mount" _ maybe-u)
1549 (string-append (assoc-ref inputs "util-linux")
1550 "/bin/" maybe-u "mount")))
1551 (substitute* '("util/mount.fuse.c")
1552 (("/bin/sh")
1553 (which "sh")))
1554
1555 ;; This hack leads libfuse to search for 'fusermount' in
1556 ;; $PATH, where it may find a setuid-root binary, instead of
1557 ;; trying solely $out/sbin/fusermount and failing because
1558 ;; it's not setuid.
1559 (substitute* "lib/Makefile"
1560 (("-DFUSERMOUNT_DIR=[[:graph:]]+")
1561 "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")))
1562 %standard-phases)))
1563 (home-page "https://github.com/libfuse/libfuse")
1564 (synopsis "Support file systems implemented in user space")
1565 (description
1566 "As a consequence of its monolithic design, file system code for Linux
1567 normally goes into the kernel itself---which is not only a robustness issue,
1568 but also an impediment to system extensibility. FUSE, for \"file systems in
1569 user space\", is a kernel module and user-space library that tries to address
1570 part of this problem by allowing users to run file system implementations as
1571 user-space processes.")
1572 (license (list license:lgpl2.1 ;library
1573 license:gpl2+)))) ;command-line utilities
1574
1575 (define-public unionfs-fuse
1576 (package
1577 (name "unionfs-fuse")
1578 (version "2.0")
1579 (source (origin
1580 (method url-fetch)
1581 (uri (string-append
1582 "https://github.com/rpodgorny/unionfs-fuse/archive/v"
1583 version ".tar.gz"))
1584 (file-name (string-append name "-" version ".tar.gz"))
1585 (sha256
1586 (base32
1587 "0hsn8l1iblvx27bpd4dvnvnbh9ri3sv2f9xzpsnfz3379kb7skgj"))))
1588 (build-system cmake-build-system)
1589 (native-inputs
1590 `(("python" ,python)
1591 ("python-pytest" ,python-pytest)))
1592 (inputs `(("fuse" ,fuse)))
1593 (arguments
1594 '(#:phases
1595 (modify-phases %standard-phases
1596 (replace 'check
1597 ;; Borrowed from the Makefile
1598 (lambda _ (zero? (system* "python3" "-m" "pytest")))))))
1599 (home-page "https://github.com/rpodgorny/unionfs-fuse")
1600 (synopsis "User-space union file system")
1601 (description
1602 "UnionFS-FUSE is a flexible union file system implementation in user
1603 space, using the FUSE library. Mounting a union file system allows you to
1604 \"aggregate\" the contents of several directories into a single mount point.
1605 UnionFS-FUSE additionally supports copy-on-write.")
1606 (license license:bsd-3)))
1607
1608 (define fuse-static
1609 (package (inherit fuse)
1610 (name "fuse-static")
1611 (source (origin (inherit (package-source fuse))
1612 (modules '((guix build utils)))
1613 (snippet
1614 ;; Normally libfuse invokes mount(8) so that /etc/mtab is
1615 ;; updated. Change calls to 'mtab_needs_update' to 0 so that
1616 ;; it doesn't do that, allowing us to remove the dependency on
1617 ;; util-linux (something that is useful in initrds.)
1618 '(substitute* '("lib/mount_util.c"
1619 "util/mount_util.c")
1620 (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)")
1621 "0")
1622 (("/bin/")
1623 "")))))))
1624
1625 (define-public unionfs-fuse/static
1626 (package (inherit unionfs-fuse)
1627 (synopsis "User-space union file system (statically linked)")
1628 (name (string-append (package-name unionfs-fuse) "-static"))
1629 (source (origin (inherit (package-source unionfs-fuse))
1630 (modules '((guix build utils)))
1631 (snippet
1632 ;; Add -ldl to the libraries, because libfuse.a needs that.
1633 '(substitute* "src/CMakeLists.txt"
1634 (("target_link_libraries(.*)\\)" _ libs)
1635 (string-append "target_link_libraries"
1636 libs " dl)"))))))
1637 (arguments
1638 '(#:tests? #f
1639 #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static")
1640 #:phases (alist-cons-after
1641 'install 'post-install
1642 (lambda* (#:key outputs #:allow-other-keys)
1643 (let* ((out (assoc-ref outputs "out"))
1644 (exe (string-append out "/bin/unionfs")))
1645 ;; By default, 'unionfs' keeps references to
1646 ;; $glibc/share/locale and similar stuff. Remove them.
1647 (remove-store-references exe)
1648
1649 ;; 'unionfsctl' has references to glibc as well. Since
1650 ;; we don't need it, remove it.
1651 (delete-file (string-append out "/bin/unionfsctl"))
1652 #t))
1653 %standard-phases)))
1654 (inputs `(("fuse" ,fuse-static)))))
1655
1656 (define-public sshfs-fuse
1657 (package
1658 (name "sshfs-fuse")
1659 (version "2.9")
1660 (source (origin
1661 (method url-fetch)
1662 (uri (string-append "https://github.com/libfuse/sshfs/releases/"
1663 "download/sshfs-" version "/sshfs-" version
1664 ".tar.gz"))
1665 (sha256
1666 (base32
1667 "1pp5wsl1jx11apkv2fpp559miifqhi8ka400npy5awp9ghlf3la6"))))
1668 (build-system gnu-build-system)
1669 (inputs
1670 `(("fuse" ,fuse)
1671 ("glib" ,glib)))
1672 (native-inputs
1673 `(("pkg-config" ,pkg-config)))
1674 (home-page "https://github.com/libfuse/sshfs")
1675 (synopsis "Mount remote file systems over SSH")
1676 (description
1677 "This is a file system client based on the SSH File Transfer Protocol.
1678 Since most SSH servers already support this protocol it is very easy to set
1679 up: on the server side there's nothing to do; on the client side mounting the
1680 file system is as easy as logging into the server with an SSH client.")
1681 (license license:gpl2+)))
1682
1683 (define-public archivemount
1684 (package
1685 (name "archivemount")
1686 (version "0.8.7")
1687 (source
1688 (origin
1689 (method url-fetch)
1690 (uri (string-append "http://www.cybernoia.de/software/archivemount/"
1691 "archivemount-" version ".tar.gz"))
1692 (sha256
1693 (base32
1694 "1diiw6pnlnrnikn6l5ld92dx59lhrxjlqms8885vwbynsjl5q127"))))
1695 (build-system gnu-build-system)
1696 (inputs `(("fuse", fuse)
1697 ("libarchive", libarchive)))
1698 (native-inputs `(("pkg-config", pkg-config)))
1699 (home-page "http://www.cybernoia.de/software/archivemount")
1700 (synopsis "Tool for mounting archive files with FUSE")
1701 (description "archivemount is a FUSE-based file system for Unix variants,
1702 including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a
1703 mount point where it can be read from or written to as with any other file
1704 system. This makes accessing the contents of the archive, which may be
1705 compressed, transparent to other programs, without decompressing them.")
1706 (license license:lgpl2.0+)))
1707
1708 (define-public numactl
1709 (package
1710 (name "numactl")
1711 (version "2.0.11")
1712 (source (origin
1713 (method url-fetch)
1714 (uri (string-append
1715 "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-"
1716 version
1717 ".tar.gz"))
1718 (sha256
1719 (base32
1720 "0qbqa9gac2vlahrngi553hws2mqgqdwv2lc69a3yx4gq6l90j325"))))
1721 (build-system gnu-build-system)
1722 (arguments
1723 '(;; There's a 'test' target, but it requires NUMA support in the kernel
1724 ;; to run, which we can't assume to have.
1725 #:tests? #f))
1726
1727 ;; NUMA is apparently not supported on armhf, see
1728 ;; http://www.spinics.net/lists/linux-numa/msg01157.html
1729 (supported-systems (delete "armhf-linux" %supported-systems))
1730 (home-page "http://oss.sgi.com/projects/libnuma/")
1731 (synopsis "Tools for non-uniform memory access (NUMA) machines")
1732 (description
1733 "NUMA stands for Non-Uniform Memory Access, in other words a system whose
1734 memory is not all in one place. The numactl program allows you to run your
1735 application program on specific CPU's and memory nodes. It does this by
1736 supplying a NUMA memory policy to the operating system before running your
1737 program.
1738
1739 The package contains other commands, such as numademo, numastat and memhog.
1740 The numademo command provides a quick overview of NUMA performance on your
1741 system.")
1742 (license (list license:gpl2 ;programs
1743 license:lgpl2.1)))) ;library
1744
1745 (define-public kbd-neo
1746 (package
1747 (name "kbd-neo")
1748 (version "2486")
1749 (source
1750 (origin
1751 (method url-fetch)
1752 (uri (string-append "https://svn.neo-layout.org/!svn/bc/"
1753 version "/linux/console/neo.map"))
1754 (file-name (string-append name "-" version ".map"))
1755 (sha256
1756 (base32
1757 "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g"))))
1758 (build-system trivial-build-system)
1759 (arguments
1760 `(#:modules ((guix build utils))
1761 #:builder (begin
1762 (use-modules (guix build utils))
1763 (let ((out (string-append %output "/share/keymaps"))
1764 (source (assoc-ref %build-inputs "source")))
1765 (mkdir-p out)
1766 (copy-file source (string-append out "/neo.map"))
1767 #t))))
1768 (home-page "https://neo-layout.org")
1769 (synopsis "Neo2 console layout")
1770 (description
1771 "Kbd-neo provides the Neo2 keyboard layout for use with
1772 @command{loadkeys(1)} from @code{kbd(4)}.")
1773 ;; The file is located in an svn directory, the entire content of
1774 ;; the directory is licensed as GPL3.
1775 (license license:gpl3+)))
1776
1777 (define-public kbd
1778 (package
1779 (name "kbd")
1780 (version "2.0.4")
1781 (source (origin
1782 (method url-fetch)
1783 (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-"
1784 version ".tar.xz"))
1785 (sha256
1786 (base32
1787 "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz"))
1788 (modules '((guix build utils)))
1789 (snippet
1790 '(begin
1791 (substitute* "tests/Makefile.in"
1792 ;; The '%: %.in' rule incorrectly uses @VERSION@.
1793 (("@VERSION@")
1794 "[@]VERSION[@]"))
1795 (substitute* '("src/unicode_start" "src/unicode_stop")
1796 ;; Assume the Coreutils are in $PATH.
1797 (("/usr/bin/tty")
1798 "tty"))))))
1799 (build-system gnu-build-system)
1800 (arguments
1801 '(#:phases
1802 (modify-phases %standard-phases
1803 (add-before 'build 'pre-build
1804 (lambda* (#:key inputs #:allow-other-keys)
1805 (let ((gzip (assoc-ref %build-inputs "gzip"))
1806 (bzip2 (assoc-ref %build-inputs "bzip2")))
1807 (substitute* "src/libkeymap/findfile.c"
1808 (("gzip")
1809 (string-append gzip "/bin/gzip"))
1810 (("bzip2")
1811 (string-append bzip2 "/bin/bzip2"))))))
1812 (add-after 'install 'post-install
1813 (lambda* (#:key outputs #:allow-other-keys)
1814 ;; Make sure these programs find their comrades.
1815 (let* ((out (assoc-ref outputs "out"))
1816 (bin (string-append out "/bin")))
1817 (for-each (lambda (prog)
1818 (wrap-program (string-append bin "/" prog)
1819 `("PATH" ":" prefix (,bin))))
1820 '("unicode_start" "unicode_stop"))))))))
1821 (inputs `(("check" ,check)
1822 ("gzip" ,gzip)
1823 ("bzip2" ,bzip2)
1824 ("pam" ,linux-pam)))
1825 (native-search-paths
1826 (list (search-path-specification
1827 (variable "LOADKEYS_KEYMAP_PATH")
1828 (files (list "share/keymaps")))))
1829 (native-inputs `(("pkg-config" ,pkg-config)))
1830 (home-page "http://kbd-project.org/")
1831 (synopsis "Linux keyboard utilities and keyboard maps")
1832 (description
1833 "This package contains keytable files and keyboard utilities compatible
1834 for systems using the Linux kernel. This includes commands such as
1835 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.")
1836 (license license:gpl2+)))
1837
1838 (define-public inotify-tools
1839 (package
1840 (name "inotify-tools")
1841 (version "3.13")
1842 (source (origin
1843 (method url-fetch)
1844 (uri (string-append
1845 "mirror://sourceforge/inotify-tools/inotify-tools/"
1846 version "/inotify-tools-" version ".tar.gz"))
1847 (sha256
1848 (base32
1849 "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6"))))
1850 (build-system gnu-build-system)
1851 (home-page "http://inotify-tools.sourceforge.net/")
1852 (synopsis "Monitor file accesses")
1853 (description
1854 "The inotify-tools packages provides a C library and command-line tools
1855 to use Linux' inotify mechanism, which allows file accesses to be monitored.")
1856 (license license:gpl2+)))
1857
1858 (define-public kmod
1859 (package
1860 (name "kmod")
1861 (version "24")
1862 (source (origin
1863 (method url-fetch)
1864 (uri
1865 (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
1866 "kmod-" version ".tar.xz"))
1867 (sha256
1868 (base32
1869 "15xkkkzvca9flvkm48gkh8y8f13vlm3sl7nz9ydc7b3jy4fqs2v1"))
1870 (patches (search-patches "kmod-module-directory.patch"))))
1871 (build-system gnu-build-system)
1872 (native-inputs
1873 `(("pkg-config" ,pkg-config)))
1874 (inputs
1875 `(("xz" ,xz)
1876 ("zlib" ,zlib)))
1877 (arguments
1878 `(#:tests? #f ; FIXME: Investigate test failures
1879 #:configure-flags '("--with-xz" "--with-zlib")
1880 #:phases (alist-cons-after
1881 'install 'install-modprobe&co
1882 (lambda* (#:key outputs #:allow-other-keys)
1883 (let* ((out (assoc-ref outputs "out"))
1884 (bin (string-append out "/bin")))
1885 (for-each (lambda (tool)
1886 (symlink "kmod"
1887 (string-append bin "/" tool)))
1888 '("insmod" "rmmod" "lsmod" "modprobe"
1889 "modinfo" "depmod"))))
1890 %standard-phases)))
1891 (home-page "https://www.kernel.org/")
1892 (synopsis "Kernel module tools")
1893 (description "Kmod is a set of tools to handle common tasks with Linux
1894 kernel modules like insert, remove, list, check properties, resolve
1895 dependencies and aliases.
1896
1897 These tools are designed on top of libkmod, a library that is shipped with
1898 kmod. The aim is to be compatible with tools, configurations and indices
1899 from the module-init-tools project.")
1900 (license license:gpl2+))) ; library under lgpl2.1+
1901
1902 (define-public eudev
1903 ;; The post-systemd fork, maintained by Gentoo.
1904 (package
1905 (name "eudev")
1906 (version "3.2.2")
1907 (source (origin
1908 (method url-fetch)
1909 (uri (string-append
1910 "http://dev.gentoo.org/~blueness/eudev/eudev-"
1911 version ".tar.gz"))
1912 (sha256
1913 (base32
1914 "0qqgbgpm5wdllk0s04pf80nwc8pr93xazwri1bylm1f15zn5ck1y"))
1915 (patches (search-patches "eudev-rules-directory.patch"))))
1916 (build-system gnu-build-system)
1917 (arguments
1918 '(#:phases (modify-phases %standard-phases
1919 (add-after 'install 'build-hwdb
1920 (lambda* (#:key outputs #:allow-other-keys)
1921 ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and
1922 ;; similar tools to display product names.
1923 (let ((out (assoc-ref outputs "out")))
1924 (zero? (system* (string-append out "/bin/udevadm")
1925 "hwdb" "--update"))))))))
1926 (native-inputs
1927 `(("pkg-config" ,pkg-config)
1928 ("perl" ,perl)
1929 ("gperf" ,gperf)))
1930 (inputs
1931 ;; When linked against libblkid, eudev can populate /dev/disk/by-label
1932 ;; and similar; it also installs the '60-persistent-storage.rules' file,
1933 ;; which contains the rules to do that.
1934 `(("util-linux" ,util-linux) ;for blkid
1935 ("kmod" ,kmod)))
1936 (home-page "https://wiki.gentoo.org/wiki/Project:Eudev")
1937 (synopsis "Userspace device management")
1938 (description "Udev is a daemon which dynamically creates and removes
1939 device nodes from /dev/, handles hotplug events and loads drivers at boot
1940 time.")
1941 (license license:gpl2+)))
1942
1943 (define-public eudev-with-hwdb
1944 (deprecated-package "eudev-with-hwdb" eudev))
1945
1946 (define-public lvm2
1947 (package
1948 (name "lvm2")
1949 (version "2.02.171")
1950 (source (origin
1951 (method url-fetch)
1952 (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2."
1953 version ".tgz"))
1954 (sha256
1955 (base32
1956 "0r4r9fsvpj9hjmf0zz7h4prz12r6y16jhjhsvk1sbfpsl88sf5dq"))
1957 (modules '((guix build utils)))
1958 (snippet
1959 '(begin
1960 (use-modules (guix build utils))
1961
1962 ;; Honor sysconfdir.
1963 (substitute* "make.tmpl.in"
1964 (("confdir = .*$")
1965 "confdir = @sysconfdir@\n")
1966 (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@")
1967 "DEFAULT_SYS_DIR = @sysconfdir@"))))
1968 (patches (search-patches "lvm2-static-link.patch"))))
1969 (build-system gnu-build-system)
1970 (native-inputs
1971 `(("pkg-config" ,pkg-config)
1972 ("procps" ,procps))) ;tests use 'pgrep'
1973 (inputs
1974 `(("udev" ,eudev)))
1975 (arguments
1976 '(#:phases
1977 (modify-phases %standard-phases
1978 (add-after 'configure 'set-makefile-shell
1979 (lambda _
1980 ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as
1981 ;; expected.
1982 (setenv "SHELL" (which "sh"))
1983
1984 ;; Replace /bin/sh with the right file name.
1985 (patch-makefile-SHELL "make.tmpl")
1986 #t))
1987 (add-before 'strip 'make-objects-writable
1988 (lambda* (#:key outputs #:allow-other-keys)
1989 ;; Make compiled objects writable so they can be stripped.
1990 (let ((out (assoc-ref outputs "out")))
1991 (for-each (lambda (file)
1992 (chmod file #o755))
1993 (append
1994 (find-files (string-append out "/lib"))
1995 (find-files (string-append out "/sbin"))))
1996 #t))))
1997
1998 #:configure-flags (list (string-append "--sysconfdir="
1999 (assoc-ref %outputs "out")
2000 "/etc/lvm")
2001 "--enable-udev_sync"
2002 "--enable-udev_rules"
2003
2004 ;; Make sure programs such as 'dmsetup' can
2005 ;; find libdevmapper.so.
2006 (string-append "LDFLAGS=-Wl,-rpath="
2007 (assoc-ref %outputs "out")
2008 "/lib"))
2009
2010 ;; The tests use 'mknod', which requires root access.
2011 #:tests? #f))
2012 (home-page "https://sourceware.org/lvm2/")
2013 (synopsis "Logical volume management for Linux")
2014 (description
2015 "LVM2 is the logical volume management tool set for Linux-based systems.
2016 This package includes the user-space libraries and tools, including the device
2017 mapper. Kernel components are part of Linux-libre.")
2018
2019 ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1.
2020 ;; Command-line tools are GPLv2.
2021 (license (list license:gpl2 license:lgpl2.1))))
2022
2023 (define-public lvm2-static
2024 (package
2025 (inherit lvm2)
2026 (name "lvm2-static")
2027
2028 ;; Propagate udev because libdevmapper.a depends on libudev.
2029 (inputs (alist-delete "udev" (package-inputs lvm2)))
2030 (propagated-inputs `(("udev" ,eudev)))
2031
2032 (arguments
2033 (substitute-keyword-arguments (package-arguments lvm2)
2034 ((#:configure-flags flags '())
2035 ;; LVM2 doesn't use Libtool, hence the custom option.
2036 `(cons "--enable-static_link" ,flags))))
2037 (synopsis "Logical volume management for Linux (statically linked)")))
2038
2039 (define-public wireless-tools
2040 (package
2041 (name "wireless-tools")
2042 (version "30.pre9")
2043 (source (origin
2044 (method url-fetch)
2045 (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools."
2046 version ".tar.gz"))
2047 (sha256
2048 (base32
2049 "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb"))
2050 (snippet
2051 '(begin
2052 ;; Remove the older header files that are not free software.
2053 (for-each (lambda (n)
2054 (delete-file (format #f "wireless.~a.h" n)))
2055 '(10 11 12 13 14 15 16 17 18 19 20))
2056 #t))))
2057 (build-system gnu-build-system)
2058 (arguments
2059 `(#:make-flags
2060 (list (string-append "PREFIX=" %output)
2061 (string-append "INSTALL_MAN=" %output "/share/man")
2062 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")
2063 "BUILD_STATIC=")
2064 #:phases (modify-phases %standard-phases
2065 (delete 'configure))
2066 #:tests? #f))
2067 (synopsis "Tools for manipulating Linux Wireless Extensions")
2068 (description "Wireless Tools are used to manipulate the now-deprecated
2069 Linux Wireless Extensions; consider using 'iw' instead. The Wireless
2070 Extension was an interface allowing you to set Wireless LAN specific
2071 parameters and get the specific stats. It is deprecated in favor the nl80211
2072 interface.")
2073 (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html")
2074 ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the
2075 ;; other files are distributed under gpl2.
2076 (license (list license:gpl2 license:lgpl2.1+))))
2077
2078 (define-public crda
2079 (package
2080 (name "crda")
2081 (version "3.18")
2082 (source (origin
2083 (method url-fetch)
2084 (uri (string-append "mirror://kernel.org/software/network/crda/"
2085 "crda-" version ".tar.xz"))
2086 (sha256
2087 (base32
2088 "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23"))
2089 (patches (search-patches "crda-optional-gcrypt.patch"))))
2090 (build-system gnu-build-system)
2091 (arguments
2092 '(#:phases (modify-phases %standard-phases
2093 (delete 'configure)
2094 (add-before
2095 'build 'no-werror-no-ldconfig
2096 (lambda _
2097 (substitute* "Makefile"
2098 (("-Werror") "")
2099 (("ldconfig") "true"))
2100 #t))
2101 (add-before
2102 'build 'set-regulator-db-file-name
2103 (lambda* (#:key inputs #:allow-other-keys)
2104 ;; Tell CRDA where to find our database.
2105 (let ((regdb (assoc-ref inputs "wireless-regdb")))
2106 (substitute* "crda.c"
2107 (("\"/lib/crda/regulatory.bin\"")
2108 (string-append "\"" regdb
2109 "/lib/crda/regulatory.bin\"")))
2110 #t))))
2111 #:test-target "verify"
2112 #:make-flags (let ((out (assoc-ref %outputs "out"))
2113 (regdb (assoc-ref %build-inputs "wireless-regdb")))
2114 (list "CC=gcc" "V=1"
2115
2116 ;; Disable signature-checking on 'regulatory.bin'.
2117 ;; The reason is that this simplifies maintenance
2118 ;; on our side (no need to manage a distro key
2119 ;; pair), and we can guarantee integrity of
2120 ;; 'regulatory.bin' by other means anyway, such as
2121 ;; 'guix gc --verify'. See
2122 ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb>
2123 ;; for a discssion.
2124 "USE_OPENSSL=0"
2125
2126 (string-append "PREFIX=" out)
2127 (string-append "SBINDIR=" out "/sbin/")
2128 (string-append "UDEV_RULE_DIR="
2129 out "/lib/udev/rules.d")
2130 (string-append "LDFLAGS=-Wl,-rpath="
2131 out "/lib -L.")
2132 (string-append "REG_BIN=" regdb
2133 "/lib/crda/regulatory.bin")))))
2134 (native-inputs `(("pkg-config" ,pkg-config)
2135 ("python" ,python-2)
2136 ("wireless-regdb" ,wireless-regdb)))
2137 (inputs `(("libnl" ,libnl)))
2138 (home-page
2139 "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA")
2140 (synopsis "Central regulatory domain agent (CRDA) for WiFi")
2141 (description
2142 "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for
2143 communication between the kernel Linux and user space for regulatory
2144 compliance.")
2145 (license license:copyleft-next)))
2146
2147 (define-public wireless-regdb
2148 (package
2149 (name "wireless-regdb")
2150 (version "2017.03.07")
2151 (source (origin
2152 (method url-fetch)
2153 (uri (string-append
2154 "mirror://kernel.org/software/network/wireless-regdb/"
2155 "wireless-regdb-" version ".tar.xz"))
2156 (sha256
2157 (base32
2158 "1f9mcp78sdd4sci6v32vxfcl1rfjpv205jisz1p93kkfnaisy7ip"))
2159
2160 ;; We're building 'regulatory.bin' by ourselves.
2161 (snippet '(delete-file "regulatory.bin"))))
2162 (build-system gnu-build-system)
2163 (arguments
2164 '(#:phases (modify-phases %standard-phases
2165 (delete 'configure))
2166
2167 ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which
2168 ;; is computed and can be equal to 'maintainer-clean'; when that
2169 ;; happens, we can end up deleting the 'regulatory.bin' file that we
2170 ;; just built. Thus, build things sequentially.
2171 #:parallel-build? #f
2172
2173 #:tests? #f ;no tests
2174 #:make-flags (let ((out (assoc-ref %outputs "out")))
2175 (list (string-append "PREFIX=" out)
2176 (string-append "LSB_ID=GuixSD")
2177 (string-append "DISTRO_PUBKEY=/dev/null")
2178 (string-append "DISTRO_PRIVKEY=/dev/null")
2179 (string-append "REGDB_PUBKEY=/dev/null")
2180
2181 ;; Leave that empty so that db2bin.py doesn't try
2182 ;; to sign 'regulatory.bin'. This allows us to
2183 ;; avoid managing a key pair for the whole distro.
2184 (string-append "REGDB_PRIVKEY=")))))
2185 (native-inputs `(("python" ,python-2)))
2186 (home-page
2187 "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb")
2188 (synopsis "Wireless regulatory database")
2189 (description
2190 "This package contains the wireless regulatory database Central
2191 Regulatory Database Agent (CRDA) daemon. The database contains information on
2192 country-specific regulations for the wireless spectrum.")
2193 (license license:isc)))
2194
2195 (define-public lm-sensors
2196 (package
2197 (name "lm-sensors")
2198 (version "3.4.0")
2199 (source (origin
2200 (method url-fetch)
2201 (uri (list (string-append
2202 "https://github.com/groeck/lm-sensors/archive/V"
2203 (string-join (string-split version #\.) "-")
2204 ".tar.gz")))
2205 (file-name (string-append name "-" version ".tar.gz"))
2206 (sha256
2207 (base32
2208 "0knb09s9lvx0wzfsaizx3xq58q6kllqf7nkbwvir0wkgn31c2d73"))
2209 (patches (search-patches "lm-sensors-hwmon-attrs.patch"))))
2210 (build-system gnu-build-system)
2211 (inputs `(("rrdtool" ,rrdtool)
2212 ("perl" ,perl)
2213 ("kmod" ,kmod)
2214 ("gnuplot" ,gnuplot)))
2215 (native-inputs `(("pkg-config" ,pkg-config)
2216 ("flex" ,flex)
2217 ("bison" ,bison)
2218 ("which" ,which)))
2219 (arguments
2220 `(#:tests? #f ; no 'check' target
2221 #:make-flags (list (string-append "PREFIX=" %output)
2222 (string-append "ETCDIR=" %output "/etc")
2223 (string-append "MANDIR=" %output "/share/man"))
2224 #:phases
2225 (alist-delete
2226 'configure
2227 (alist-cons-before
2228 'build 'patch-exec-paths
2229 (lambda* (#:key inputs outputs #:allow-other-keys)
2230 (substitute* "prog/detect/sensors-detect"
2231 (("`uname")
2232 (string-append "`" (assoc-ref inputs "coreutils")
2233 "/bin/uname"))
2234 (("(`|\")modprobe" all open-quote)
2235 (string-append open-quote
2236 (assoc-ref inputs "kmod")
2237 "/bin/modprobe")))
2238 (substitute* '("prog/pwm/pwmconfig"
2239 "prog/pwm/fancontrol")
2240 (("gnuplot")
2241 (string-append (assoc-ref inputs "gnuplot")
2242 "/bin/gnuplot"))
2243 (("cat ")
2244 (string-append (assoc-ref inputs "coreutils")
2245 "/bin/cat "))
2246 (("egrep ")
2247 (string-append (assoc-ref inputs "grep")
2248 "/bin/egrep "))
2249 (("sed -e")
2250 (string-append (assoc-ref inputs "sed")
2251 "/bin/sed -e"))
2252 (("cut -d")
2253 (string-append (assoc-ref inputs "coreutils")
2254 "/bin/cut -d"))
2255 (("sleep ")
2256 (string-append (assoc-ref inputs "coreutils")
2257 "/bin/sleep "))
2258 (("readlink -f")
2259 (string-append (assoc-ref inputs "coreutils")
2260 "/bin/readlink -f"))))
2261 %standard-phases))))
2262 (home-page "http://jdelvare.nerim.net/devel.html#lmsensors")
2263 (synopsis "Utilities to read temperature/voltage/fan sensors")
2264 (description
2265 "Lm-sensors is a hardware health monitoring package for Linux. It allows
2266 you to access information from temperature, voltage, and fan speed sensors.
2267 It works with most newer systems.")
2268 (license license:gpl2+)))
2269
2270 (define-public i2c-tools
2271 (package
2272 (name "i2c-tools")
2273 (version "3.1.1")
2274 (source (origin
2275 (method url-fetch)
2276 (uri (string-append
2277 "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-"
2278 version ".tar.bz2"))
2279 (sha256
2280 (base32
2281 "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l"))))
2282 (build-system gnu-build-system)
2283 (arguments
2284 `(#:tests? #f ; no 'check' target
2285 #:make-flags (list (string-append "prefix=" %output)
2286 "CC=gcc")
2287 ;; no configure script
2288 #:phases (alist-delete 'configure %standard-phases)))
2289 (inputs
2290 `(("perl" ,perl)))
2291 (home-page "http://jdelvare.nerim.net/devel.html#i2ctools")
2292 (synopsis "I2C tools for Linux")
2293 (description
2294 "The i2c-tools package contains a heterogeneous set of I2C tools for
2295 Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers,
2296 EEPROM decoding scripts, EEPROM programming tools, and a python module for
2297 SMBus access.")
2298 (license license:gpl2+)))
2299
2300 (define-public xsensors
2301 (package
2302 (name "xsensors")
2303 (version "0.70")
2304 (source (origin
2305 (method url-fetch)
2306 (uri (string-append
2307 "http://www.linuxhardware.org/xsensors/xsensors-"
2308 version ".tar.gz"))
2309 (sha256
2310 (base32
2311 "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"))))
2312 (build-system gnu-build-system)
2313 (inputs `(("lm-sensors" ,lm-sensors)
2314 ("gtk" ,gtk+-2)))
2315 (native-inputs `(("pkg-config" ,pkg-config)))
2316 (arguments
2317 `(#:phases (alist-cons-before
2318 'configure 'enable-deprecated
2319 (lambda _
2320 (substitute* "src/Makefile.in"
2321 (("-DGDK_DISABLE_DEPRECATED") "")
2322 (("-DGTK_DISABLE_DEPRECATED") "")))
2323 (alist-cons-before
2324 'configure 'remove-Werror
2325 (lambda _
2326 (substitute* '("configure" "src/Makefile.in")
2327 (("-Werror") "")))
2328 %standard-phases))))
2329 (home-page "http://www.linuxhardware.org/xsensors/")
2330 (synopsis "Hardware health information viewer")
2331 (description
2332 "Xsensors reads data from the libsensors library regarding hardware
2333 health such as temperature, voltage and fan speed and displays the information
2334 in a digital read-out.")
2335 (license license:gpl2+)))
2336
2337 (define-public perf
2338 (package
2339 (name "perf")
2340 (version (package-version linux-libre))
2341 (source (package-source linux-libre))
2342 (build-system gnu-build-system)
2343 (arguments
2344 '(#:phases (alist-replace
2345 'configure
2346 (lambda* (#:key inputs #:allow-other-keys)
2347 (setenv "SHELL_PATH" (which "bash"))
2348 (chdir "tools/perf"))
2349 %standard-phases)
2350 #:make-flags (list (string-append "DESTDIR="
2351 (assoc-ref %outputs "out"))
2352 "WERROR=0"
2353
2354 ;; By default, 'config/Makefile' uses lib64 on
2355 ;; x86_64. Work around that.
2356 "lib=lib")
2357 #:tests? #f)) ;no tests
2358 (native-inputs
2359 `(("pkg-config" ,pkg-config)
2360 ("bison" ,bison)
2361 ("flex" ,flex)
2362
2363 ;; There are build scripts written in these languages.
2364 ("perl" ,perl)
2365 ("python" ,python-2)))
2366 (inputs
2367 `(("slang" ,slang) ;for the interactive TUI
2368 ;; ("newt" ,newt)
2369 ("python" ,python-2) ;'perf' links against libpython
2370 ("elfutils" ,elfutils)
2371 ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling
2372
2373 ;; Documentation.
2374 ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES
2375 ("docbook-xsl" ,docbook-xsl)
2376 ("xmlto" ,xmlto)
2377 ("asciidoc" ,asciidoc)))
2378 (home-page "https://perf.wiki.kernel.org/")
2379 (synopsis "Linux profiling with performance counters")
2380 (description
2381 "perf is a tool suite for profiling using hardware performance counters,
2382 with support in the Linux kernel. perf can instrument CPU performance
2383 counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable
2384 of lightweight profiling. This package contains the user-land tools and in
2385 particular the 'perf' command.")
2386 (license (package-license linux-libre))))
2387
2388 (define-public pflask
2389 (package
2390 (name "pflask")
2391 (version "0.2")
2392 (source (origin
2393 (method url-fetch)
2394 (uri (string-append "https://github.com/ghedo/pflask/archive/v"
2395 version ".tar.gz"))
2396 (file-name (string-append name "-" version ".tar.gz"))
2397 (sha256
2398 (base32
2399 "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys"))))
2400 (build-system cmake-build-system)
2401 (arguments
2402 '(#:tests? #f)) ; no tests
2403 (home-page "http://ghedo.github.io/pflask/")
2404 (synopsis "Simple tool for creating Linux namespace containers")
2405 (description "pflask is a simple tool for creating Linux namespace
2406 containers. It can be used for running a command or even booting an OS inside
2407 an isolated container, created with the help of Linux namespaces. It is
2408 similar in functionality to chroot, although pflask provides better isolation
2409 thanks to the use of namespaces.")
2410 (license license:bsd-2)))
2411
2412 (define-public hdparm
2413 (package
2414 (name "hdparm")
2415 (version "9.52")
2416 (source (origin
2417 (method url-fetch)
2418 (uri (string-append "mirror://sourceforge/" name "/" name "/"
2419 name "-" version ".tar.gz"))
2420 (sha256
2421 (base32
2422 "1djgxhfadd865dcrl6dp7dvjxpaisy7mk17mbdbglwg24ga9qhn3"))))
2423 (build-system gnu-build-system)
2424 (arguments
2425 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2426 (list (string-append "binprefix=" out)
2427 (string-append "manprefix=" out)
2428 "CC=gcc"))
2429 #:phases
2430 (modify-phases %standard-phases
2431 (delete 'configure)) ; no configure script
2432 #:tests? #f)) ; no test suite
2433 (home-page "https://sourceforge.net/projects/hdparm/")
2434 (synopsis "View and tune ATA disk drive parameters")
2435 (description
2436 "@command{hdparm} is a command-line utility to control ATA controllers and
2437 disk drives. It can increase performance and/or reliability by careful tuning
2438 of hardware settings like power and acoustic management, DMA modes, and caching.
2439 It can also display detailed device information, or be used as a simple
2440 performance benchmarking tool.
2441
2442 @command{hdparm} provides a command line interface to various Linux kernel
2443 interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older
2444 IDE driver subsystem. Many external USB drive enclosures with @dfn{SCSI-ATA
2445 Command Translation} (SAT) are also supported.")
2446 (license (license:non-copyleft "file://LICENSE.TXT"))))
2447
2448 (define-public rfkill
2449 (package
2450 (name "rfkill")
2451 (version "0.5")
2452 (source (origin
2453 (method url-fetch)
2454 (uri (string-append "mirror://kernel.org/software/network/"
2455 name "/" name "-" version ".tar.xz"))
2456 (sha256
2457 (base32
2458 "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0"))))
2459 (build-system gnu-build-system)
2460 (arguments
2461 `(#:make-flags (list "CC=gcc"
2462 (string-append "PREFIX=" %output))
2463 #:phases (modify-phases %standard-phases
2464 (delete 'configure))
2465 #:tests? #f))
2466 (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill")
2467 (synopsis "Tool for enabling and disabling wireless devices")
2468 (description
2469 "rfkill is a simple tool for accessing the rfkill device interface,
2470 which is used to enable and disable wireless networking devices, typically
2471 WLAN, Bluetooth and mobile broadband.")
2472 (license (license:non-copyleft "file://COPYING"
2473 "See COPYING in the distribution."))))
2474
2475 (define-public acpi
2476 (package
2477 (name "acpi")
2478 (version "1.7")
2479 (source (origin
2480 (method url-fetch)
2481 (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/"
2482 version "/" name "-" version ".tar.gz"))
2483 (sha256
2484 (base32
2485 "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp"))))
2486 (build-system gnu-build-system)
2487 (home-page "http://acpiclient.sourceforge.net")
2488 (synopsis "Display information on ACPI devices")
2489 (description "@code{acpi} attempts to replicate the functionality of the
2490 \"old\" @code{apm} command on ACPI systems, including battery and thermal
2491 information. It does not support ACPI suspending, only displays information
2492 about ACPI devices.")
2493 (license license:gpl2+)))
2494
2495 (define-public acpid
2496 (package
2497 (name "acpid")
2498 (version "2.0.28")
2499 (source (origin
2500 (method url-fetch)
2501 (uri (string-append "mirror://sourceforge/acpid2/acpid-"
2502 version ".tar.xz"))
2503 (sha256
2504 (base32
2505 "043igasvp1l6nv5rzh4sksmymay2qn20anl4zm4zvwnkn1a3l34q"))))
2506 (build-system gnu-build-system)
2507 (home-page "https://sourceforge.net/projects/acpid2/")
2508 (synopsis "Daemon for delivering ACPI events to user-space programs")
2509 (description
2510 "acpid is designed to notify user-space programs of Advanced
2511 Configuration and Power Interface (ACPI) events. acpid should be started
2512 during the system boot, and will run as a background process. When an ACPI
2513 event is received from the kernel, acpid will examine the list of rules
2514 specified in /etc/acpi/events and execute the rules that match the event.")
2515 (license license:gpl2+)))
2516
2517 (define-public sysfsutils
2518 (package
2519 (name "sysfsutils")
2520 (version "2.1.0")
2521 (source
2522 (origin
2523 (method url-fetch)
2524 (uri
2525 (string-append
2526 "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-"
2527 version ".tar.gz"))
2528 (sha256
2529 (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8"))))
2530 (build-system gnu-build-system)
2531 (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html")
2532 (synopsis "System utilities based on Linux sysfs")
2533 (description
2534 "These are a set of utilities built upon sysfs, a virtual file system in
2535 Linux kernel versions 2.5+ that exposes a system's device tree. The package
2536 also contains the libsysfs library.")
2537 ;; The library is under lgpl2.1+ (all files say "or any later version").
2538 ;; The rest is mostly gpl2, with a few files indicating gpl2+.
2539 (license (list license:gpl2 license:gpl2+ license:lgpl2.1+))))
2540
2541 (define-public sysfsutils-1
2542 (package
2543 (inherit sysfsutils)
2544 (version "1.3.0")
2545 (source
2546 (origin
2547 (method url-fetch)
2548 (uri
2549 (string-append
2550 "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version
2551 "/sysfsutils-" version ".tar.gz"))
2552 (sha256
2553 (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3"))
2554 (modules '((guix build utils)))
2555 (snippet
2556 '(begin
2557 (substitute* "Makefile.in"
2558 (("includedir = /usr/include/sysfs")
2559 "includedir = @includedir@"))
2560 (substitute* "configure"
2561 (("includedir='(\\$\\{prefix\\}/include)'" all orig)
2562 (string-append "includedir='" orig "/sysfs'")))))))
2563 (synopsis "System utilities based on Linux sysfs (version 1.x)")))
2564
2565 (define-public cpufrequtils
2566 (package
2567 (name "cpufrequtils")
2568 (version "0.3")
2569 (source
2570 (origin
2571 (method url-fetch)
2572 (uri
2573 (string-append
2574 "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-"
2575 version ".tar.gz"))
2576 (sha256
2577 (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm"))
2578 (patches (search-patches "cpufrequtils-fix-aclocal.patch"))))
2579 (build-system gnu-build-system)
2580 (native-inputs
2581 `(("sysfsutils" ,sysfsutils-1)))
2582 (arguments
2583 '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2584 (assoc-ref %outputs "out") "/lib"))))
2585 (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/")
2586 (synopsis "Utilities to get and set CPU frequency on Linux")
2587 (description
2588 "The cpufrequtils suite contains utilities to retrieve CPU frequency
2589 information, and set the CPU frequency if supported, using the cpufreq
2590 capabilities of the Linux kernel.")
2591 (license license:gpl2)))
2592
2593 (define-public libraw1394
2594 (package
2595 (name "libraw1394")
2596 (version "2.1.2")
2597 (source (origin
2598 (method url-fetch)
2599 (uri (string-append
2600 "mirror://kernel.org/linux/libs/ieee1394/"
2601 name "-" version ".tar.xz"))
2602 (sha256
2603 (base32
2604 "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03"))))
2605 (build-system gnu-build-system)
2606 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2607 (synopsis "Interface library for the Linux IEEE1394 drivers")
2608 (description
2609 "Libraw1394 is the only supported interface to the kernel side raw1394 of
2610 the Linux IEEE-1394 subsystem, which provides direct access to the connected
2611 1394 buses to user space. Through libraw1394/raw1394, applications can directly
2612 send to and receive from other nodes without requiring a kernel driver for the
2613 protocol in question.")
2614 (license license:lgpl2.1+)))
2615
2616 (define-public libavc1394
2617 (package
2618 (name "libavc1394")
2619 (version "0.5.4")
2620 (source (origin
2621 (method url-fetch)
2622 (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/"
2623 name "-" version ".tar.gz"))
2624 (sha256
2625 (base32
2626 "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw"))))
2627 (build-system gnu-build-system)
2628 (native-inputs
2629 `(("pkg-config" ,pkg-config)))
2630 (propagated-inputs
2631 `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc
2632 (home-page "https://sourceforge.net/projects/libavc1394/")
2633 (synopsis "AV/C protocol library for IEEE 1394")
2634 (description
2635 "Libavc1394 is a programming interface to the AV/C specification from
2636 the 1394 Trade Association. AV/C stands for Audio/Video Control.")
2637 (license license:lgpl2.1+)))
2638
2639 (define-public libiec61883
2640 (package
2641 (name "libiec61883")
2642 (version "1.2.0")
2643 (source (origin
2644 (method url-fetch)
2645 (uri (string-append
2646 "mirror://kernel.org/linux/libs/ieee1394/"
2647 name "-" version ".tar.xz"))
2648 (sha256
2649 (base32
2650 "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i"))))
2651 (build-system gnu-build-system)
2652 (native-inputs
2653 `(("pkg-config" ,pkg-config)))
2654 (propagated-inputs
2655 `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc
2656 (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page")
2657 (synopsis "Isochronous streaming media library for IEEE 1394")
2658 (description
2659 "The libiec61883 library provides a higher level API for streaming DV,
2660 MPEG-2 and audio over Linux IEEE 1394.")
2661 (license license:lgpl2.1+)))
2662
2663 (define-public mdadm
2664 (package
2665 (name "mdadm")
2666 (version "4.0")
2667 (source (origin
2668 (method url-fetch)
2669 (uri (string-append
2670 "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-"
2671 version ".tar.xz"))
2672 (sha256
2673 (base32
2674 "1ad3mma641946wn5lsllwf0lifw9lps34fv1nnkhyfpd9krffshx"))))
2675 (build-system gnu-build-system)
2676 (inputs
2677 `(("udev" ,eudev)))
2678 (arguments
2679 `(#:make-flags (let ((out (assoc-ref %outputs "out")))
2680 (list "CC=gcc"
2681 "INSTALL=install"
2682 "CHECK_RUN_DIR=0"
2683 ;; TODO: tell it where to find 'sendmail'
2684 ;; (string-append "MAILCMD=" <???> "/sbin/sendmail")
2685 (string-append "BINDIR=" out "/sbin")
2686 (string-append "MANDIR=" out "/share/man")
2687 (string-append "UDEVDIR=" out "/lib/udev")))
2688 #:phases (alist-cons-before
2689 'build 'patch-program-paths
2690 (lambda* (#:key inputs #:allow-other-keys)
2691 (let ((coreutils (assoc-ref inputs "coreutils")))
2692 (substitute* "udev-md-raid-arrays.rules"
2693 (("/usr/bin/(readlink|basename)" all program)
2694 (string-append coreutils "/bin/" program)))))
2695 (alist-cons-before
2696 'build 'remove-W-error
2697 (lambda _
2698 ;; We cannot build with -Werror on i686 due to a
2699 ;; 'sign-compare' warning in util.c.
2700 (substitute* "Makefile"
2701 (("-Werror") ""))
2702 #t)
2703 (alist-delete 'configure %standard-phases)))
2704 ;;tests must be done as root
2705 #:tests? #f))
2706 (home-page "http://neil.brown.name/blog/mdadm")
2707 (synopsis "Tool for managing Linux Software RAID arrays")
2708 (description
2709 "mdadm is a tool for managing Linux Software RAID arrays. It can create,
2710 assemble, report on, and monitor arrays. It can also move spares between raid
2711 arrays when needed.")
2712 (license license:gpl2+)))
2713
2714 (define-public mdadm-static
2715 (package
2716 (inherit mdadm)
2717 (name "mdadm-static")
2718 (arguments
2719 (substitute-keyword-arguments (package-arguments mdadm)
2720 ((#:make-flags flags)
2721 `(cons "LDFLAGS = -static" ,flags))
2722 ((#:phases phases)
2723 `(modify-phases ,phases
2724 (add-after 'install 'remove-cruft
2725 (lambda* (#:key outputs #:allow-other-keys)
2726 (let* ((out (assoc-ref outputs "out"))
2727 (precious? (lambda (file)
2728 (member file '("." ".." "sbin"))))
2729 (directories (scandir out (negate precious?))))
2730 (with-directory-excursion out
2731 (for-each delete-file-recursively directories)
2732 (remove-store-references "sbin/mdadm")
2733 (delete-file "sbin/mdmon")
2734 #t))))))
2735 ((#:modules modules %gnu-build-system-modules)
2736 `((ice-9 ftw) ,@modules))
2737 ((#:strip-flags _ '())
2738 ''("--strip-all")) ;strip a few extra KiB
2739 ((#:allowed-references _ '("out"))
2740 '("out")))) ;refer only self
2741 (synopsis "Statically-linked 'mdadm' command for use in an initrd")))
2742
2743 (define-public multipath-tools
2744 (package
2745 (name "multipath-tools")
2746 (version "0.7.1")
2747 (source (origin
2748 (method url-fetch)
2749 (uri (string-append "http://git.opensvc.com/?p=multipath-tools/"
2750 ".git;a=snapshot;h=" version ";sf=tgz"))
2751 (file-name (string-append name "-" version ".tar.gz"))
2752 (sha256
2753 (base32
2754 "0w0rgi3lqksaki30yvd4l5rgjqb0d7js1sh7masl8aw6xbrsm26p"))
2755 (modules '((guix build utils)))
2756 (snippet
2757 '(begin
2758 ;; Drop bundled valgrind headers.
2759 (delete-file-recursively "third-party")
2760 (substitute* '("multipathd/main.c"
2761 "libmultipath/debug.c")
2762 (("#include \"../third-party/")
2763 "#include \""))
2764 #t))))
2765 (build-system gnu-build-system)
2766 (arguments
2767 '(#:tests? #f ; No tests.
2768 #:make-flags (list (string-append "DESTDIR="
2769 (assoc-ref %outputs "out"))
2770 "SYSTEMDPATH=lib"
2771 (string-append "LDFLAGS=-Wl,-rpath="
2772 (assoc-ref %outputs "out")
2773 "/lib"))
2774 #:phases
2775 (modify-phases %standard-phases
2776 (add-after 'unpack 'patch-source
2777 (lambda* (#:key inputs #:allow-other-keys)
2778 (let ((lvm2 (assoc-ref inputs "lvm2"))
2779 (udev (assoc-ref inputs "udev")))
2780 (substitute* "Makefile.inc"
2781 (("\\$\\(prefix\\)/usr") "$(prefix)"))
2782 (substitute* '("kpartx/Makefile" "libmultipath/Makefile")
2783 (("/usr/include/libdevmapper.h")
2784 (string-append lvm2 "/include/libdevmapper.h"))
2785 (("/usr/include/libudev.h")
2786 (string-append udev "/include/libudev.h")))
2787 #t)))
2788 (delete 'configure)
2789 (add-before 'build 'set-CC
2790 (lambda _
2791 (setenv "CC" "gcc")
2792 #t)))))
2793 (native-inputs
2794 `(("perl" ,perl)
2795 ("pkg-config" ,pkg-config)
2796 ("valgrind" ,valgrind)))
2797 (inputs
2798 `(("ceph:lib" ,ceph "lib")
2799 ("json-c" ,json-c)
2800 ("libaio" ,libaio)
2801 ("liburcu" ,liburcu)
2802 ("lvm2" ,lvm2)
2803 ("readline" ,readline)
2804 ("udev" ,eudev)))
2805 (home-page "http://christophe.varoqui.free.fr/")
2806 (synopsis "Access block devices through multiple paths")
2807 (description
2808 "This package provides the following binaries to drive the
2809 Linux Device Mapper multipathing driver:
2810 @enumerate
2811 @item @command{multipath} - Device mapper target autoconfig.
2812 @item @command{multipathd} - Multipath daemon.
2813 @item @command{mpathpersist} - Manages SCSI persistent reservations on
2814 @code{dm} multipath devices.
2815 @item @command{kpartx} - Create device maps from partition tables.
2816 @end enumerate")
2817 (license (list license:gpl2+ ; Main distribution.
2818 license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h
2819
2820 (define-public libaio
2821 (package
2822 (name "libaio")
2823 (version "0.3.110")
2824 (source (origin
2825 (method url-fetch)
2826 (uri (list
2827 (string-append "mirror://debian/pool/main/liba/libaio/"
2828 name "_" version ".orig.tar.gz")))
2829 (sha256
2830 (base32
2831 "0zjzfkwd1kdvq6zpawhzisv7qbq1ffs343i5fs9p498pcf7046g0"))))
2832 (build-system gnu-build-system)
2833 (arguments
2834 '(#:make-flags
2835 (list "CC=gcc" (string-append "prefix=" %output))
2836 #:test-target "partcheck" ; need root for a full 'check'
2837 #:phases
2838 (alist-delete 'configure %standard-phases))) ; no configure script
2839 (home-page "http://lse.sourceforge.net/io/aio.html")
2840 (synopsis "Linux-native asynchronous I/O access library")
2841 (description
2842 "This library enables userspace to use Linux kernel asynchronous I/O
2843 system calls, important for the performance of databases and other advanced
2844 applications.")
2845 (license license:lgpl2.1+)))
2846
2847 (define-public sbc
2848 (package
2849 (name "sbc")
2850 (version "1.3")
2851 (source (origin
2852 (method url-fetch)
2853 (uri (string-append "https://www.kernel.org/pub/linux/bluetooth/"
2854 name "-" version ".tar.xz"))
2855 (sha256
2856 (base32
2857 "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476"))))
2858 (build-system gnu-build-system)
2859 (inputs
2860 `(("libsndfile" ,libsndfile)))
2861 (native-inputs
2862 `(("pkg-config" ,pkg-config)))
2863 (home-page "https://www.kernel.org/pub/linux/bluetooth/")
2864 (synopsis "Bluetooth subband audio codec")
2865 (description
2866 "The SBC is a digital audio encoder and decoder used to transfer data to
2867 Bluetooth audio output devices like headphones or loudspeakers.")
2868 (license license:gpl2+)))
2869
2870 (define-public bluez
2871 (package
2872 (name "bluez")
2873 (version "5.45")
2874 (source (origin
2875 (method url-fetch)
2876 (uri (string-append
2877 "mirror://kernel.org/linux/bluetooth/bluez-"
2878 version ".tar.xz"))
2879 (sha256
2880 (base32
2881 "1sb4aflgyrl7apricjipa8wx95qm69yja0lmn2f19g560c3v1b2c"))))
2882 (build-system gnu-build-system)
2883 (arguments
2884 '(#:configure-flags
2885 (let ((out (assoc-ref %outputs "out")))
2886 (list "--sysconfdir=/etc"
2887 "--localstatedir=/var"
2888 "--enable-library"
2889 "--disable-systemd"
2890 ;; Install dbus/udev files to the correct location.
2891 (string-append "--with-dbusconfdir=" out "/etc")
2892 (string-append "--with-udevdir=" out "/lib/udev")))
2893 #:phases
2894 (modify-phases %standard-phases
2895 (add-after 'install 'post-install
2896 (lambda* (#:key inputs outputs #:allow-other-keys)
2897 (let* ((out (assoc-ref outputs "out"))
2898 (servicedir (string-append out "/share/dbus-1/services"))
2899 (service "obexd/src/org.bluez.obex.service")
2900 (rule (string-append
2901 out "/lib/udev/rules.d/97-hid2hci.rules")))
2902 ;; Install the obex dbus service file.
2903 (substitute* service
2904 (("/bin/false")
2905 (string-append out "/libexec/bluetooth/obexd")))
2906 (install-file service servicedir)
2907 ;; Fix paths in the udev rule.
2908 (substitute* rule
2909 (("hid2hci --method")
2910 (string-append out "/lib/udev/hid2hci --method"))
2911 (("/sbin/udevadm")
2912 (string-append (assoc-ref inputs "eudev") "/bin/udevadm")))
2913 #t))))))
2914 (native-inputs
2915 `(("pkg-config" ,pkg-config)
2916 ("gettext" ,gettext-minimal)))
2917 (inputs
2918 `(("glib" ,glib)
2919 ("dbus" ,dbus)
2920 ("eudev" ,eudev)
2921 ("libical" ,libical)
2922 ("readline" ,readline)))
2923 (home-page "http://www.bluez.org/")
2924 (synopsis "Linux Bluetooth protocol stack")
2925 (description
2926 "BlueZ provides support for the core Bluetooth layers and protocols. It
2927 is flexible, efficient and uses a modular implementation.")
2928 (license license:gpl2+)))
2929
2930 (define-public fuse-exfat
2931 (package
2932 (name "fuse-exfat")
2933 (version "1.2.7")
2934 (source (origin
2935 (method url-fetch)
2936 (uri (string-append
2937 "https://github.com/relan/exfat/releases/download/v"
2938 version "/" name "-" version ".tar.gz"))
2939 (sha256
2940 (base32
2941 "0df0ccnd0dgwc6rvk9qmrz0nfb8whc5s3wg9qnw1mzbrh4rcvhw2"))))
2942 (build-system gnu-build-system)
2943 (native-inputs
2944 `(("pkg-config" ,pkg-config)))
2945 (inputs
2946 `(("fuse" ,fuse)))
2947 (home-page "https://github.com/relan/exfat")
2948 (synopsis "Mount exFAT file systems")
2949 (description
2950 "This package provides a FUSE-based file system that provides read and
2951 write access to exFAT devices.")
2952 (license license:gpl2+)))
2953
2954 (define-public gpm
2955 (package
2956 (name "gpm")
2957 (version "1.20.7")
2958 (source (origin
2959 (method url-fetch)
2960 (uri (string-append
2961 "http://www.nico.schottelius.org/software/gpm/archives/gpm-"
2962 version ".tar.bz2"))
2963 (sha256
2964 (base32
2965 "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh"))))
2966 (build-system gnu-build-system)
2967 (arguments
2968 '(#:phases (modify-phases %standard-phases
2969 (add-before 'configure 'bootstrap
2970 (lambda _
2971 ;; The tarball was not generated with 'make dist' so we
2972 ;; need to bootstrap things ourselves.
2973 (and (zero? (system* "./autogen.sh"))
2974 (begin
2975 (patch-makefile-SHELL "Makefile.include.in")
2976 #t)))))
2977
2978 ;; Make sure programs find libgpm.so.
2979 #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
2980 (assoc-ref %outputs "out")
2981 "/lib"))))
2982 (native-inputs
2983 `(("texinfo" ,texinfo)
2984 ("bison" ,bison)
2985 ("flex" ,flex)
2986 ("autoconf" ,autoconf)
2987 ("automake" ,automake)
2988 ("libtool" ,libtool)))
2989 (home-page "http://www.nico.schottelius.org/software/gpm/")
2990 (synopsis "Mouse support for the Linux console")
2991 (description
2992 "The GPM (general-purpose mouse) daemon is a mouse server for
2993 applications running on the Linux console. It allows users to select items
2994 and copy/paste text in the console and in xterm.")
2995 (license license:gpl2+)))
2996
2997 (define-public btrfs-progs
2998 (package
2999 (name "btrfs-progs")
3000 (version "4.11")
3001 (source (origin
3002 (method url-fetch)
3003 (uri (string-append "mirror://kernel.org/linux/kernel/"
3004 "people/kdave/btrfs-progs/"
3005 "btrfs-progs-v" version ".tar.xz"))
3006 (sha256
3007 (base32
3008 "03mzv89f08gdsqv4ima793g44kdavcfyjialf5dr0zd2ab66hyp1"))))
3009 (build-system gnu-build-system)
3010 (outputs '("out"
3011 "static")) ; static versions of binaries in "out" (~16MiB!)
3012 (arguments
3013 '(#:phases (modify-phases %standard-phases
3014 (add-after 'build 'build-static
3015 (lambda _ (zero? (system* "make" "static"))))
3016 (add-after 'install 'install-static
3017 (let ((staticbin (string-append (assoc-ref %outputs "static")
3018 "/bin")))
3019 (lambda _
3020 (zero? (system* "make"
3021 (string-append "bindir=" staticbin)
3022 "install-static"))))))
3023 #:test-target "test"
3024 #:parallel-tests? #f)) ; tests fail when run in parallel
3025 (inputs `(("e2fsprogs" ,e2fsprogs)
3026 ("libblkid" ,util-linux)
3027 ("libblkid:static" ,util-linux "static")
3028 ("libuuid" ,util-linux)
3029 ("libuuid:static" ,util-linux "static")
3030 ("zlib" ,zlib)
3031 ("lzo" ,lzo)))
3032 (native-inputs `(("pkg-config" ,pkg-config)
3033 ("asciidoc" ,asciidoc)
3034 ("xmlto" ,xmlto)
3035 ;; For building documentation.
3036 ("libxml2" ,libxml2)
3037 ("docbook-xsl" ,docbook-xsl)
3038 ;; For tests.
3039 ("which" ,which)))
3040 (home-page "https://btrfs.wiki.kernel.org/")
3041 (synopsis "Create and manage btrfs copy-on-write file systems")
3042 (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux
3043 aimed at implementing advanced features while focusing on fault tolerance,
3044 repair and easy administration.")
3045 ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c.
3046 ;; GPL2: Everything else.
3047 (license (list license:gpl2 license:gpl2+))))
3048
3049 (define-public btrfs-progs/static
3050 (package
3051 (name "btrfs-progs-static")
3052 (version (package-version btrfs-progs))
3053 (source #f)
3054 (build-system trivial-build-system)
3055 (inputs
3056 `(("btrfs-progs:static" ,btrfs-progs "static")))
3057 (arguments
3058 `(#:modules ((guix build utils))
3059 #:builder
3060 (begin
3061 (use-modules (guix build utils)
3062 (ice-9 ftw)
3063 (srfi srfi-26))
3064
3065 (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static"))
3066 (out (assoc-ref %outputs "out"))
3067 (source (string-append btrfs "/bin/btrfs.static"))
3068 (target (string-append out "/bin/btrfs")))
3069 (mkdir-p (dirname target))
3070 (copy-file source target)
3071 (remove-store-references target)
3072 (chmod target #o555)))))
3073 (home-page (package-home-page btrfs-progs))
3074 (synopsis "Statically-linked btrfs command from btrfs-progs")
3075 (description "This package provides the statically-linked @command{btrfs}
3076 from the btrfs-progs package. It is meant to be used in initrds.")
3077 (license (package-license btrfs-progs))))
3078
3079 (define-public freefall
3080 (package
3081 (name "freefall")
3082 (version (package-version linux-libre))
3083 (source (package-source linux-libre))
3084 (build-system gnu-build-system)
3085 (arguments
3086 '(#:phases (modify-phases %standard-phases
3087 (add-after 'unpack 'enter-subdirectory
3088 (lambda _
3089 (chdir "tools/laptop/freefall")))
3090 (delete 'configure)
3091 (add-before 'build 'increase-timeout
3092 (lambda _
3093 ;; The default of 2 seconds is too low: it assumes an
3094 ;; open lid and AC power without actually checking.
3095 (substitute* "freefall.c"
3096 (("alarm\\(2\\)") "alarm(5)")))))
3097 #:make-flags (list (string-append "PREFIX="
3098 (assoc-ref %outputs "out")))
3099 #:tests? #f)) ;no tests
3100 (home-page (package-home-page linux-libre))
3101 (synopsis "Free-fall protection for spinning laptop hard drives")
3102 (description
3103 "Prevents shock damage to the internal spinning hard drive(s) of some
3104 HP and Dell laptops. When sudden movement is detected, all input/output
3105 operations on the drive are suspended and its heads are parked on the ramp,
3106 where they are less likely to cause damage to the spinning disc. Requires a
3107 drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
3108 feature, and a laptop with an accelerometer. It has no effect on SSDs.")
3109 (license license:gpl2)))
3110
3111 (define-public thinkfan
3112 (package
3113 (name "thinkfan")
3114 (version "0.9.3")
3115 (source (origin
3116 (method url-fetch)
3117 (uri (string-append "mirror://sourceforge/thinkfan/"
3118 "/thinkfan-" version ".tar.gz"))
3119 (sha256
3120 (base32
3121 "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
3122 (modules '((guix build utils)))
3123 ;; Fix erroneous man page location in Makefile leading to
3124 ;; a compilation failure.
3125 (snippet
3126 '(substitute* "CMakeLists.txt"
3127 (("thinkfan\\.1") "src/thinkfan.1")))))
3128 (build-system cmake-build-system)
3129 (arguments
3130 `(#:modules ((guix build cmake-build-system)
3131 (guix build utils)
3132 (srfi srfi-26))
3133 #:tests? #f ;no test target
3134 #:configure-flags
3135 ;; Enable reading temperatures from hard disks via S.M.A.R.T.
3136 `("-DUSE_ATASMART:BOOL=ON")
3137 #:phases
3138 (modify-phases %standard-phases
3139 ;; Install scripts for various foreign init systems. Also fix
3140 ;; hard-coded path for daemon.
3141 (add-after 'install 'install-rc-scripts
3142 (lambda* (#:key outputs #:allow-other-keys)
3143 (let ((out (assoc-ref outputs "out"))
3144 (files (find-files
3145 (string-append "../thinkfan-" ,version "/rcscripts")
3146 ".*")))
3147 (substitute* files
3148 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
3149 (string-append out "/sbin/" name)))
3150 (for-each (cute install-file <>
3151 (string-append out "/share/thinkfan"))
3152 files))
3153 #t)))))
3154 (inputs
3155 `(("libatasmart" ,libatasmart)))
3156 (home-page "http://thinkfan.sourceforge.net/")
3157 (synopsis "Simple fan control program")
3158 (description
3159 "Thinkfan is a simple fan control program. It reads temperatures,
3160 checks them against configured limits and switches to appropriate (also
3161 pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
3162 other @code{hwmon} driver that enables temperature reading and fan control
3163 from userspace.")
3164 (license license:gpl3+)))
3165
3166 (define-public ntfs-3g
3167 (package
3168 (name "ntfs-3g")
3169 (version "2016.2.22")
3170 (source (origin
3171 (method url-fetch)
3172 (uri (string-append "https://tuxera.com/opensource/"
3173 "ntfs-3g_ntfsprogs-" version ".tgz"))
3174 (sha256
3175 (base32
3176 "180y5y09h30ryf2vim8j30a2npwz1iv9ly5yjmh3wjdkwh2jrdyp"))
3177 (modules '((guix build utils)))
3178 (patches (search-patches "ntfs-3g-CVE-2017-0358.patch"))
3179 (snippet
3180 ;; Install under $prefix.
3181 '(substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in")
3182 (("/sbin")
3183 "@sbindir@")))))
3184 (build-system gnu-build-system)
3185 (inputs `(("util-linux" ,util-linux)
3186 ("fuse" ,fuse))) ;libuuid
3187 (native-inputs `(("pkg-config" ,pkg-config)))
3188 (arguments
3189 '(#:configure-flags (list "--exec-prefix=${prefix}"
3190 "--with-fuse=external" ;use our own FUSE
3191 "--enable-mount-helper"
3192 "--enable-posix-acls"
3193 "--enable-xattr-mappings")))
3194 (home-page "http://www.tuxera.com/community/open-source-ntfs-3g/")
3195 (synopsis "Read-write access to NTFS file systems")
3196 (description
3197 "NTFS-3G provides read-write access to NTFS file systems, which are
3198 commonly found on Microsoft Windows. It is implemented as a FUSE file system.
3199 The package provides additional NTFS tools.")
3200 (license license:gpl2+)))
3201
3202 (define-public rdma-core
3203 (package
3204 (name "rdma-core")
3205 (version "13")
3206 (source (origin
3207 (method url-fetch)
3208 (uri (string-append "https://github.com/linux-rdma/rdma-core"
3209 "/releases/download/v" version "/rdma-core-"
3210 version ".tar.gz"))
3211 (sha256
3212 (base32
3213 "15qdfqkia22vab1dh41s88vgi70yifi40ar5s4x7a456rpbhy8z5"))))
3214 (build-system cmake-build-system)
3215 (arguments
3216 '(#:tests? #f ; no tests
3217 ;; Upstream uses the "ninja" build system and encourage distros
3218 ;; to do the same for consistency. They also recommend using the
3219 ;; "Release" build type.
3220 #:configure-flags (list "-GNinja"
3221 ;; Defaults to "lib64" on 64-bit archs.
3222 (string-append "-DCMAKE_INSTALL_LIBDIR="
3223 (assoc-ref %outputs "out") "/lib")
3224 "-DCMAKE_BUILD_TYPE=Release")
3225 #:phases
3226 (modify-phases %standard-phases
3227 (replace 'build
3228 (lambda _
3229 (zero? (system* "ninja"
3230 "-j" (number->string (parallel-job-count))))))
3231 (replace 'install
3232 (lambda _
3233 (zero? (system* "ninja" "install")))))))
3234 (native-inputs
3235 `(("ninja" ,ninja)
3236 ("pkg-config" ,pkg-config)
3237 ("python" ,python-wrapper)))
3238 (inputs
3239 `(("libnl" ,libnl)
3240 ("udev" ,eudev)))
3241 (home-page "https://github.com/linux-rdma/rdma-core")
3242 (synopsis "Utilities and libraries for working with RDMA devices")
3243 (description
3244 "This package provides userspace components for the InfiniBand
3245 subsystem of the Linux kernel. Specifically it contains userspace
3246 libraries for the following device nodes:
3247
3248 @enumerate
3249 @item @file{/dev/infiniband/uverbsX} (@code{libibverbs})
3250 @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm})
3251 @item @file{/dev/infiniband/umadX} (@code{libibumad})
3252 @end enumerate
3253
3254 The following service daemons are also provided:
3255 @enumerate
3256 @item @code{srp_daemon} (for the @code{ib_srp} kernel module)
3257 @item @code{iwpmd} (for iWARP kernel providers)
3258 @item @code{ibacm} (for InfiniBand communication management assistant)
3259 @end enumerate")
3260 ;; All library code is dual licensed under GPL2 and a custom MIT
3261 ;; variant. The package also includes some components covered by
3262 ;; other licenses. Consult COPYING.md for full details.
3263 (license
3264 (list license:gpl2
3265 (license:x11-style "See COPYING.BSD_MIT in the distribution")
3266 license:bsd-2 ; Files referring to COPYING.BSD_FB
3267 license:cc0 ; most files in ccan/
3268 license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3
3269
3270 (define-public rng-tools
3271 (package
3272 (name "rng-tools")
3273 (version "5")
3274 (source (origin
3275 (method url-fetch)
3276 (uri (string-append
3277 "http://downloads.sourceforge.net/sourceforge/gkernel/"
3278 "rng-tools-" version ".tar.gz"))
3279 (sha256
3280 (base32
3281 "13h7lc8wl9khhvkr0i3bl5j9bapf8anhqis1lcnwxg1vc2v058b0"))))
3282 (build-system gnu-build-system)
3283 (synopsis "Random number generator daemon")
3284 (description
3285 "Monitor a hardware random number generator, and supply entropy
3286 from that to the system kernel's @file{/dev/random} machinery.")
3287 (home-page "https://sourceforge.net/projects/gkernel")
3288 ;; The source package is offered under the GPL2+, but the files
3289 ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
3290 (license (list license:gpl2 license:gpl2+))))
3291
3292 (define-public cpupower
3293 (package
3294 (name "cpupower")
3295 (version (package-version linux-libre))
3296 (source (package-source linux-libre))
3297 (build-system gnu-build-system)
3298 (arguments
3299 '(#:phases (modify-phases %standard-phases
3300 (add-after 'unpack 'enter-subdirectory
3301 (lambda _
3302 (chdir "tools/power/cpupower")))
3303 (delete 'configure)
3304 (add-before 'build 'fix-makefiles
3305 (lambda _
3306 (substitute* "Makefile"
3307 (("/usr/") "/")
3308 (("/bin/(install|pwd)" _ command) command))
3309 (substitute* "bench/Makefile"
3310 (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
3311 #:make-flags (let ((out (assoc-ref %outputs "out")))
3312 (list (string-append "DESTDIR=" out)
3313 (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
3314 "docdir=/share/doc/cpupower"
3315 "confdir=$(docdir)/examples"
3316 ;; The Makefile recommends the following changes
3317 "DEBUG=false"
3318 "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
3319 #:tests? #f)) ;no tests
3320 (native-inputs `(("gettext" ,gettext-minimal)))
3321 (inputs `(("pciutils" ,pciutils)))
3322 (home-page (package-home-page linux-libre))
3323 (synopsis "CPU frequency and voltage scaling tools for Linux")
3324 (description
3325 "cpupower is a set of user-space tools that use the cpufreq feature of the
3326 Linux kernel to retrieve and control processor features related to power saving,
3327 such as frequency and voltage scaling.")
3328 (license license:gpl2)))
3329
3330 (define-public haveged
3331 (package
3332 (name "haveged")
3333 (version "1.9.1")
3334 (source
3335 (origin
3336 (method url-fetch)
3337 (uri (string-append "http://www.issihosts.com/haveged/haveged-"
3338 version ".tar.gz"))
3339 (sha256
3340 (base32
3341 "059pxlfd4l5dqhd6r3lynzfz4wby2f17294fy17pi9j2jpnn68ww"))))
3342 (build-system gnu-build-system)
3343 (home-page "http://www.issihosts.com/haveged")
3344 (synopsis "Entropy source for the Linux random number generator")
3345 (description
3346 "haveged generates an unpredictable stream of random numbers for use by
3347 Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's
3348 standard mechanisms for filling the entropy pool may not be sufficient for
3349 systems with high needs or limited user interaction, such as headless servers.
3350 @command{haveged} runs as a privileged daemon, harvesting randomness from the
3351 indirect effects of hardware events on hidden processor state using the HArdware
3352 Volatile Entropy Gathering and Expansion (HAVEGE) algorithm. It tunes itself to
3353 its environment and provides the same built-in test suite for the output stream
3354 as used on certified hardware security devices.")
3355 (license (list (license:non-copyleft "file://nist/mconf.h")
3356 (license:non-copyleft "file://nist/packtest.c")
3357 license:public-domain ; nist/dfft.c
3358 license:gpl3+)))) ; everything else
3359
3360 (define-public ecryptfs-utils
3361 (package
3362 (name "ecryptfs-utils")
3363 (version "111")
3364 (source
3365 (origin
3366 (method url-fetch)
3367 (uri (string-append "https://launchpad.net/ecryptfs/trunk/"
3368 version "/+download/ecryptfs-utils_"
3369 version ".orig.tar.gz"))
3370 (sha256
3371 (base32
3372 "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i"))))
3373 (build-system gnu-build-system)
3374 (arguments
3375 `(#:configure-flags (list "--disable-pywrap")))
3376 (native-inputs
3377 `(("intltool" ,intltool)
3378 ("perl" ,perl) ; for pod2man
3379 ("pkg-config" ,pkg-config)))
3380 (inputs
3381 `(("keyutils" ,keyutils)
3382 ("linux-pam" ,linux-pam)
3383 ("nss" ,nss)))
3384 (home-page "http://ecryptfs.org/")
3385 (synopsis "eCryptfs cryptographic file system utilities")
3386 (description
3387 "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux.
3388 Each file's cryptographic meta-data is stored inside the file itself, along
3389 with the encrypted contents. This allows individual encrypted files to be
3390 copied between hosts and still be decrypted with the proper key. eCryptfs is a
3391 native Linux file system, and has been part of the Linux kernel since version
3392 2.6.19. This package contains the userland utilities to manage it.")
3393 ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c
3394 ;; grant additional permission to link with OpenSSL.
3395 (license license:gpl2+)))
3396
3397 (define-public libnfsidmap
3398 (package
3399 (name "libnfsidmap")
3400 (version "0.25")
3401 (source (origin
3402 (method url-fetch)
3403 (uri (string-append
3404 "http://www.citi.umich.edu/projects/nfsv4/linux/"
3405 name "/" name "-" version ".tar.gz"))
3406 (sha256
3407 (base32
3408 "1kzgwxzh83qi97rblcm9qj80cdvnv8kml2plz0q103j0hifj8vb5"))))
3409 (build-system gnu-build-system)
3410 (arguments
3411 `(#:configure-flags (list
3412 (string-append "--with-pluginpath="
3413 (assoc-ref %outputs "out")
3414 "/lib/libnfsidmap"))))
3415 (home-page
3416 "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html")
3417 (synopsis
3418 "NFSv4 support library for name/ID mapping")
3419 (description "Libnfsidmap is a library holding mulitiple methods of
3420 mapping names to ids and visa versa, mainly for NFSv4. It provides an
3421 extensible array of mapping functions, currently consisting of two choices:
3422 the default @code{nsswitch} and the experimental @code{umich_ldap}.")
3423 (license (license:non-copyleft "file://COPYING"
3424 "See COPYING in the distribution."))))
3425
3426 (define-public module-init-tools
3427 (package
3428 (name "module-init-tools")
3429 (version "3.16")
3430 (source (origin
3431 (method url-fetch)
3432 (uri (string-append
3433 "mirror://kernel.org/linux/utils/kernel/module-init-tools/"
3434 "module-init-tools-" version ".tar.bz2"))
3435 (sha256
3436 (base32
3437 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))
3438 (patches (search-patches "module-init-tools-moduledir.patch"))))
3439 (build-system gnu-build-system)
3440 (arguments
3441 ;; FIXME: The upstream tarball lacks man pages, and building them would
3442 ;; require DocBook & co. We used to use Gentoo's pre-built man pages,
3443 ;; but they vanished. In the meantime, fake it.
3444 '(#:phases (alist-cons-before
3445 'configure 'fake-docbook
3446 (lambda _
3447 (substitute* "Makefile.in"
3448 (("^DOCBOOKTOMAN.*$")
3449 "DOCBOOKTOMAN = true\n")))
3450 %standard-phases)))
3451 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
3452 (synopsis "Tools for loading and managing Linux kernel modules")
3453 (description
3454 "Tools for loading and managing Linux kernel modules, such as `modprobe',
3455 `insmod', `lsmod', and more.")
3456 (license license:gpl2+)))
3457
3458 (define-public mcelog
3459 (package
3460 (name "mcelog")
3461 (version "153")
3462 (source (origin
3463 (method url-fetch)
3464 (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/"
3465 "mcelog.git/snapshot/v" version ".tar.gz"))
3466 (sha256
3467 (base32
3468 "0q40d60p1klzg0aznvxhxgjlddwcxfj2q59s4q86sf9ild6rcdhl"))
3469 (file-name (string-append name "-" version ".tar.gz"))
3470 (modules '((guix build utils)))
3471 (snippet
3472 ;; The snapshots lack a .git directory, breaking ‘git describe’.
3473 `(substitute* "Makefile"
3474 (("\"unknown\"") (string-append "\"v" ,version "\""))))))
3475 (build-system gnu-build-system)
3476 (arguments
3477 `(#:phases (modify-phases %standard-phases
3478 (delete 'configure)) ; no configure script
3479 #:make-flags (let ((out (assoc-ref %outputs "out")))
3480 (list "CC=gcc"
3481 (string-append "prefix=" out)
3482 (string-append "DOCDIR=" out "/share/doc/mcelog")
3483 "etcprefix=$(DOCDIR)/examples"))
3484 ;; The tests will only run as root on certain supported CPU models.
3485 #:tests? #f))
3486 (supported-systems (list "i686-linux" "x86_64-linux"))
3487 (home-page "http://mcelog.org/")
3488 (synopsis "Machine check monitor for x86 Linux systems")
3489 (description
3490 "The mcelog daemon is required by the Linux kernel to log memory, I/O, CPU,
3491 and other hardware errors on x86 systems. It can also perform user-defined
3492 tasks, such as bringing bad pages off-line, when configurable error thresholds
3493 are exceeded.")
3494 (license license:gpl2)))
3495
3496 (define-public mtd-utils
3497 (package
3498 (name "mtd-utils")
3499 (version "1.5.2")
3500 (source (origin
3501 (method url-fetch)
3502 (uri (string-append
3503 "ftp://ftp.infradead.org/pub/mtd-utils/"
3504 "mtd-utils-" version ".tar.bz2"))
3505 (sha256
3506 (base32
3507 "007lhsd8yb34l899r4m37whhzdw815cz4fnjbpnblfha524p7dax"))))
3508 (inputs
3509 `(("acl" ,acl)
3510 ("libuuid" ,util-linux)
3511 ("lzo", lzo)
3512 ("zlib" ,zlib)))
3513 (build-system gnu-build-system)
3514 (arguments
3515 `(#:test-target "tests"
3516 #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
3517 #:phases (modify-phases %standard-phases
3518 (delete 'configure))))
3519 (synopsis "MTD Flash Storage Utilities")
3520 (description "This package provides utilities for testing, partitioning, etc
3521 of flash storage.")
3522 (home-page "http://www.linux-mtd.infradead.org/")
3523 (license
3524 (list license:gpl2 ; Almost everything is gpl2 or gpl2+
3525 license:mpl1.1 ; All ftl* files
3526 license:expat)))) ; libiniparser
3527
3528 (define-public libseccomp
3529 (package
3530 (name "libseccomp")
3531 (version "2.3.2")
3532 (source (origin
3533 (method url-fetch)
3534 (uri (string-append "https://github.com/seccomp/libseccomp/"
3535 "releases/download/v" version
3536 "/libseccomp-" version ".tar.gz"))
3537 (sha256
3538 (base32
3539 "18dwfxzsw3agiy2dxbflrkhmjgvlji0wwkk636nabh2ng41qrp1x"))))
3540 (build-system gnu-build-system)
3541 (native-inputs
3542 `(("which" ,which)))
3543 (synopsis "Interface to Linux's seccomp syscall filtering mechanism")
3544 (description "The libseccomp library provides an easy to use, platform
3545 independent, interface to the Linux Kernel's syscall filtering mechanism. The
3546 libseccomp API is designed to abstract away the underlying BPF based syscall
3547 filter language and present a more conventional function-call based filtering
3548 interface that should be familiar to, and easily adopted by, application
3549 developers.")
3550 (home-page "https://github.com/seccomp/libseccomp")
3551 (license license:lgpl2.1)))
3552
3553 (define-public radeontop
3554 (package
3555 (name "radeontop")
3556 (version "1.0")
3557 (home-page "https://github.com/clbr/radeontop/")
3558 (source (origin
3559 (method url-fetch)
3560 (uri (string-append home-page "archive/v" version ".tar.gz"))
3561 (file-name (string-append name "-" version ".tar.gz"))
3562 (sha256
3563 (base32
3564 "1z38nibirqxrbsfyhfcrnzlcw16cqjp4ds6qnjfxalwayf9fm5x9"))))
3565 (build-system gnu-build-system)
3566 (arguments
3567 `(#:phases (modify-phases %standard-phases
3568 ;; getver.sh uses ‘git --describe’, isn't worth an extra git
3569 ;; dependency, and doesn't even work on release(!) tarballs.
3570 (add-after 'unpack 'report-correct-version
3571 (lambda _ (substitute* "getver.sh"
3572 (("ver=unknown")
3573 (string-append "ver=" ,version)))))
3574 (delete 'configure)) ; no configure script
3575 #:make-flags (list "CC=gcc"
3576 (string-append "PREFIX=" %output))
3577 #:tests? #f)) ; no tests
3578 (native-inputs
3579 `(("gettext" ,gettext-minimal)
3580 ("pkg-config" ,pkg-config)))
3581 (inputs
3582 `(("libdrm" ,libdrm)
3583 ("libpciaccess" ,libpciaccess)
3584 ("libxcb" ,libxcb)
3585 ("ncurses" ,ncurses)))
3586 (synopsis "Usage monitor for AMD Radeon graphics")
3587 (description "RadeonTop monitors resource consumption on supported AMD
3588 Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on
3589 a terminal or saved to a file for further processing. It measures both the
3590 activity of the GPU as a whole, which is also accurate during OpenCL
3591 computations, as well as separate component statistics that are only meaningful
3592 under OpenGL graphics workloads.")
3593 (license license:gpl3)))
3594
3595 (define-public efivar
3596 (package
3597 (name "efivar")
3598 (version "30")
3599 (source (origin
3600 (method url-fetch)
3601 (uri (string-append "https://github.com/rhinstaller/" name
3602 "/releases/download/" version "/" name
3603 "-" version ".tar.bz2"))
3604 (sha256
3605 (base32
3606 "12qjnm44yi55ffqxjpgrxy82s89yjziy84w2rfjjknsd8flj0mqz"))))
3607 (build-system gnu-build-system)
3608 (arguments
3609 `(;; Tests require a UEFI system and is not detected in the chroot.
3610 #:tests? #f
3611 #:make-flags (list (string-append "prefix=" %output)
3612 (string-append "libdir=" %output "/lib")
3613 (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib"))
3614 #:phases
3615 (modify-phases %standard-phases
3616 (delete 'configure))))
3617 (native-inputs
3618 `(("pkg-config" ,pkg-config)))
3619 (inputs
3620 `(("popt" ,popt)))
3621 (home-page "https://github.com/rhinstaller/efivar")
3622 (synopsis "Tool and library to manipulate EFI variables")
3623 (description "This package provides a library and a command line
3624 interface to the variable facility of UEFI boot firmware.")
3625 (license license:lgpl2.1+)))
3626
3627 (define-public efibootmgr
3628 (package
3629 (name "efibootmgr")
3630 (version "14")
3631 (source (origin
3632 (method url-fetch)
3633 (uri (string-append "https://github.com/rhinstaller/" name
3634 "/releases/download/" version "/" name
3635 "-" version ".tar.bz2"))
3636 (sha256
3637 (base32
3638 "1n3sydvpr6yl040hhf460k7mrxby7laqd9dqs6pq0js1hijc2zip"))))
3639 (build-system gnu-build-system)
3640 (arguments
3641 `(#:tests? #f ; No tests.
3642 #:make-flags (list (string-append "prefix=" %output)
3643 (string-append "libdir=" %output "/lib")
3644 ;; Override CFLAGS to add efivar include directory.
3645 (string-append "CFLAGS=-O2 -g -flto -I"
3646 (assoc-ref %build-inputs "efivar")
3647 "/include/efivar"))
3648 #:phases
3649 (modify-phases %standard-phases
3650 (add-after 'unpack 'branding
3651 ;; Replace default loader path with something more familiar.
3652 (lambda _
3653 (substitute* "src/efibootmgr.c"
3654 (("EFI\\\\\\\\redhat") ; Matches 'EFI\\redhat'.
3655 "EFI\\\\gnu"))
3656 #t))
3657 (delete 'configure))))
3658 (native-inputs
3659 `(("pkg-config" ,pkg-config)))
3660 (inputs
3661 `(("efivar" ,efivar)
3662 ("popt" ,popt)))
3663 (home-page "https://github.com/rhinstaller/efibootmgr")
3664 (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager")
3665 (description
3666 "@code{efibootmgr} is a user-space application to modify the Intel
3667 Extensible Firmware Interface (EFI) Boot Manager. This application can
3668 create and destroy boot entries, change the boot order, change the next
3669 running boot option, and more.")
3670 (license license:gpl2+)))
3671
3672 (define-public sysstat
3673 (package
3674 (name "sysstat")
3675 (version "11.4.3")
3676 (source (origin
3677 (method url-fetch)
3678 (uri (string-append "http://perso.orange.fr/sebastien.godard/"
3679 "sysstat-" version ".tar.xz"))
3680 (sha256
3681 (base32
3682 "1ryf9myjzpa2279i3rvsh6fr5psm6qvr5r9kbm1sxyspapxcms82"))))
3683 (build-system gnu-build-system)
3684 (arguments
3685 `(#:tests? #f ; No test suite.
3686 ;; Without this flag, it tries to install the man pages with group 'root'
3687 ;; and fails because /etc/passwd lacks an entry for the root user.
3688 #:configure-flags
3689 (list "--disable-file-attr"
3690 (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc"))
3691 #:phases
3692 (modify-phases %standard-phases
3693 ;; The build process tries to create '/var/lib/sa', so we skip that
3694 ;; instruction.
3695 (add-after 'build 'skip-touching-var
3696 (lambda _
3697 (substitute* "Makefile"
3698 (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)")
3699 ""))
3700 #t)))))
3701 (home-page "http://sebastien.godard.pagesperso-orange.fr/")
3702 (synopsis "Performance monitoring tools for Linux")
3703 (description "The sysstat utilities are a collection of performance
3704 monitoring tools for Linux. These include @code{mpstat}, @code{iostat},
3705 @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc},
3706 @code{sadf} and @code{sa}.")
3707 (license license:gpl2+)))
3708
3709 (define-public light
3710 (package
3711 (name "light")
3712 (version "1.0")
3713 (source (origin
3714 (method url-fetch)
3715 (uri (string-append "https://github.com/haikarainen/" name
3716 "/archive/v" version ".tar.gz"))
3717 (sha256
3718 (base32
3719 "0r5gn6c0jcxknzybl6059dplxv46dpahchqq4gymrs7z8bp0hilp"))
3720 (file-name (string-append name "-" version ".tar.gz"))))
3721 (build-system gnu-build-system)
3722 (arguments
3723 '(#:tests? #f ; no tests
3724 #:make-flags (list "CC=gcc"
3725 (string-append "PREFIX=" %output))
3726 #:phases
3727 (modify-phases %standard-phases
3728 (delete 'configure)
3729 (add-after 'unpack 'patch-makefile
3730 (lambda _
3731 (substitute* "Makefile" (("chown") "#")))))))
3732 (native-inputs
3733 `(("help2man" ,help2man)))
3734 (home-page "https://haikarainen.github.io/light")
3735 (synopsis "GNU/Linux application to control backlights")
3736 (description
3737 "Light is a program to send commands to screen backlight controllers
3738 under GNU/Linux. Features include:
3739
3740 @itemize
3741 @item It does not rely on X.
3742 @item Light can automatically figure out the best controller to use, making
3743 full use of underlying hardware.
3744 @item It is possible to set a minimum brightness value, as some controllers
3745 set the screen to be pitch black at a vaĺue of 0 (or higher).
3746 @end itemize
3747
3748 Light is the successor of lightscript.")
3749 (license license:gpl3+)))
3750
3751 (define-public tlp
3752 (package
3753 (name "tlp")
3754 (version "0.9")
3755 (source (origin
3756 (method url-fetch)
3757 (uri (string-append
3758 "https://github.com/linrunner/"
3759 (string-upcase name)
3760 "/archive/" version ".tar.gz"))
3761 (file-name (string-append name "-" version ".tar.gz"))
3762 (sha256
3763 (base32
3764 "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
3765 (inputs `(("bash" ,bash)
3766 ("dbus" ,dbus)
3767 ("ethtool" ,ethtool)
3768 ("eudev" ,eudev)
3769 ("grep" ,grep)
3770 ("hdparm" ,hdparm)
3771 ("inetutils" ,inetutils)
3772 ("iw" ,iw)
3773 ("kmod" ,kmod)
3774 ("pciutils" ,pciutils)
3775 ("perl" ,perl)
3776 ("rfkill" ,rfkill)
3777 ("sed" ,sed)
3778 ("usbutils" ,usbutils)
3779 ("util-linux" ,util-linux)
3780 ("wireless-tools" ,wireless-tools)))
3781 (build-system gnu-build-system)
3782 (arguments
3783 `(#:phases
3784 (modify-phases %standard-phases
3785 (delete 'configure) ; no configure script
3786 (add-before 'build 'setenv
3787 (lambda* (#:key outputs #:allow-other-keys)
3788 (let ((out (assoc-ref outputs "out")))
3789 (setenv "TLP_WITH_SYSTEMD" "0")
3790 (setenv "TLP_NO_INIT" "1")
3791 (setenv "TLP_NO_PMUTILS" "1")
3792 (setenv "TLP_SBIN" (string-append out "/bin"))
3793 (setenv "TLP_BIN" (string-append out "/bin"))
3794 (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
3795 (setenv "TLP_ULIB" (string-append out "/lib/udev"))
3796 (setenv "TLP_CONF" "/etc/tlp")
3797 (setenv "TLP_SHCPL"
3798 (string-append out "/share/bash-completion/completions"))
3799 (setenv "TLP_MAN" (string-append out "/share/man")))))
3800 (delete 'check) ; no tests
3801 (add-before 'install 'fix-installation
3802 (lambda _
3803 ;; Stop the Makefile from trying to create system directories.
3804 (substitute* "Makefile" (("\\[ -f \\$\\(_CONF\\) \\]") "#"))))
3805 (replace 'install
3806 (lambda _
3807 (zero? (system* "make" "install-tlp" "install-man"))))
3808 (add-after 'install 'wrap
3809 (lambda* (#:key inputs outputs #:allow-other-keys)
3810 (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
3811 (bin-files (find-files bin ".*")))
3812 (define (bin-directory input-name)
3813 (string-append (assoc-ref inputs input-name) "/bin"))
3814 (define (sbin-directory input-name)
3815 (string-append (assoc-ref inputs input-name) "/sbin"))
3816 (for-each (lambda (program)
3817 (wrap-program program
3818 `("PATH" ":" prefix
3819 ,(append
3820 (map bin-directory '("bash"
3821 "coreutils"
3822 "dbus"
3823 "eudev"
3824 "grep"
3825 "inetutils"
3826 "kmod"
3827 "perl"
3828 "sed"
3829 "usbutils"
3830 "util-linux"))
3831 (map sbin-directory '("ethtool"
3832 "hdparm"
3833 "iw"
3834 "pciutils"
3835 "rfkill"
3836 "wireless-tools"))))))
3837 bin-files)))))))
3838 (home-page "http://linrunner.de/en/tlp/tlp.html")
3839 (synopsis "Power management tool for Linux")
3840 (description "TLP is a power management tool for Linux. It comes with
3841 a default configuration already optimized for battery life. Nevertheless,
3842 TLP is customizable to fulfil system requirements. TLP settings are applied
3843 every time the power supply source is changed.")
3844
3845 ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the
3846 ;; rest is GPLv2+.
3847 (license (list license:gpl2+ license:gpl3+))))
3848
3849 (define-public lshw
3850 (package
3851 (name "lshw")
3852 (version "B.02.18")
3853 (source (origin
3854 (method url-fetch)
3855 (uri (string-append "https://www.ezix.org/software/"
3856 "files/lshw-" version
3857 ".tar.gz"))
3858 (sha256
3859 (base32
3860 "0brwra4jld0d53d7jsgca415ljglmmx1l2iazpj4ndilr48yy8mf"))))
3861 (build-system gnu-build-system)
3862 (arguments
3863 `(#:phases (modify-phases %standard-phases (delete 'configure))
3864 #:tests? #f ; no tests
3865 #:make-flags
3866 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))))
3867 (synopsis "List hardware information")
3868 (description
3869 "@command{lshw} (Hardware Lister) is a small tool to provide
3870 detailed information on the hardware configuration of the machine.
3871 It can report exact memory configuration, firmware version, mainboard
3872 configuration, CPU version and speed, cache configuration, bus speed,
3873 and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC
3874 machines (PowerMac G4 is known to work).")
3875 (home-page "https://www.ezix.org/project/wiki/HardwareLiSter")
3876 (license license:gpl2+)))
3877
3878 (define-public libmnl
3879 (package
3880 (name "libmnl")
3881 (version "1.0.4")
3882 (source
3883 (origin
3884 (method url-fetch)
3885 (uri (string-append "mirror://netfilter.org/libmnl/"
3886 "libmnl-" version ".tar.bz2"))
3887 (sha256
3888 (base32
3889 "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp"))))
3890 (build-system gnu-build-system)
3891 (home-page "https://www.netfilter.org/projects/libmnl/")
3892 (synopsis "Netlink utility library")
3893 (description "Libmnl is a minimalistic user-space library oriented to
3894 Netlink developers. There are a lot of common tasks in parsing, validating,
3895 constructing of both the Netlink header and TLVs that are repetitive and easy to
3896 get wrong. This library aims to provide simple helpers that allows you to
3897 re-use code and to avoid re-inventing the wheel.")
3898 (license license:lgpl2.1+)))
3899
3900 (define-public libnftnl
3901 (package
3902 (name "libnftnl")
3903 (version "1.0.7")
3904 (source
3905 (origin
3906 (method url-fetch)
3907 (uri (string-append "mirror://netfilter.org/libnftnl/"
3908 "libnftnl-" version ".tar.bz2"))
3909 (sha256
3910 (base32
3911 "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv"))))
3912 (build-system gnu-build-system)
3913 (native-inputs
3914 `(("pkg-config" ,pkg-config)))
3915 (inputs
3916 `(("libmnl" ,libmnl)))
3917 (home-page "https://www.netfilter.org/projects/libnftnl/index.html")
3918 (synopsis "Netlink programming interface to the Linux nf_tables subsystem")
3919 (description "Libnftnl is a userspace library providing a low-level netlink
3920 programming interface to the in-kernel nf_tables subsystem. The library
3921 libnftnl has been previously known as libnftables. This library is currently
3922 used by nftables.")
3923 (license license:gpl2+)))
3924
3925 (define-public nftables
3926 (package
3927 (name "nftables")
3928 (version "0.7")
3929 (source
3930 (origin
3931 (method url-fetch)
3932 (uri (string-append "http://www.nftables.org/projects/nftables"
3933 "/files/nftables-" version ".tar.bz2"))
3934 (sha256
3935 (base32
3936 "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy"))))
3937 (build-system gnu-build-system)
3938 (inputs `(("bison", bison)
3939 ("flex", flex)
3940 ("gmp", gmp)
3941 ("libmnl", libmnl)
3942 ("libnftnl", libnftnl)
3943 ("readline", readline)))
3944 (native-inputs `(("pkg-config", pkg-config)))
3945 (home-page "http://www.nftables.org")
3946 (synopsis "Userspace utility for Linux packet filtering")
3947 (description "nftables is the project that aims to replace the existing
3948 {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet
3949 filtering framework, a new userspace utility and also a compatibility layer for
3950 {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter
3951 infrastructure such as the existing hooks, the connection tracking system, the
3952 userspace queueing component and the logging subsystem.")
3953 (license license:gpl2)))
3954
3955 (define-public proot
3956 (package
3957 (name "proot")
3958 (version "5.1.0")
3959 (home-page "https://github.com/proot-me/PRoot")
3960 (source (origin
3961 (method url-fetch)
3962 (uri (string-append home-page "/archive/v" version ".tar.gz"))
3963 (file-name (string-append name "-" version ".tar.gz"))
3964 (sha256
3965 (base32
3966 "11h30i83vdhc3khlj6hrh3a21sbmmz8nhfv09vkf6b9bcs1biz2h"))
3967 (patches (search-patches "proot-test-fhs.patch"))))
3968 (build-system gnu-build-system)
3969 (arguments
3970 '(#:make-flags '("-C" "src")
3971
3972 #:phases (modify-phases %standard-phases
3973 (delete 'configure)
3974 (add-before 'build 'set-shell-file-name
3975 (lambda* (#:key inputs #:allow-other-keys)
3976 (substitute* (find-files "src" "\\.[ch]$")
3977 (("\"/bin/sh\"")
3978 (string-append "\""
3979 (assoc-ref inputs "bash")
3980 "/bin/sh\"")))
3981 #t))
3982 (add-before 'check 'fix-fhs-assumptions-in-tests
3983 (lambda _
3984 (substitute* "tests/test-c6b77b77.mk"
3985 (("/bin/bash") (which "bash"))
3986 (("/usr/bin/test") (which "test")))
3987 (substitute* '("tests/test-16573e73.c")
3988 (("/bin/([a-z-]+)" _ program)
3989 (which program)))
3990
3991 (substitute* (find-files "tests" "\\.sh$")
3992 ;; Some of the tests try to "bind-mount" /bin/true.
3993 (("-b /bin/true:")
3994 (string-append "-b " (which "true") ":"))
3995 ;; Likewise for /bin.
3996 (("-b /bin:") "-b /gnu:")
3997 ;; Others try to run /bin/sh.
3998 (("/bin/sh") (which "sh"))
3999 ;; Others assume /etc/fstab exists.
4000 (("/etc/fstab") "/etc/passwd"))
4001
4002 (substitute* "tests/GNUmakefile"
4003 (("-b /bin:") "-b /gnu:"))
4004
4005 ;; XXX: This test fails in an obscure corner case, just
4006 ;; skip it.
4007 (delete-file "tests/test-kkkkkkkk.c")
4008
4009 #t))
4010 (replace 'check
4011 (lambda _
4012 (let ((n (parallel-job-count)))
4013 ;; For some reason we get lots of segfaults with
4014 ;; seccomp support (x86_64, Linux-libre 4.11.0).
4015 (setenv "PROOT_NO_SECCOMP" "1")
4016
4017 ;; Most of the tests expect "/bin" to be in $PATH so
4018 ;; they can run things that live in $ROOTFS/bin.
4019 (setenv "PATH"
4020 (string-append (getenv "PATH") ":/bin"))
4021
4022 (zero? (system* "make" "check" "-C" "tests"
4023 ;;"V=1"
4024 "-j" (number->string n))))))
4025 (replace 'install
4026 (lambda* (#:key outputs #:allow-other-keys)
4027 ;; The 'install' rule does nearly nothing.
4028 (let ((out (assoc-ref outputs "out")))
4029 (and (zero?
4030 ;; TODO: 'make install-care' (does not even
4031 ;; build currently.)
4032 (system* "make" "-C" "src" "install"
4033 (string-append "PREFIX=" out)))
4034 (let ((man1 (string-append out
4035 "/share/man/man1")))
4036 (mkdir-p man1)
4037 (copy-file "doc/proot/man.1"
4038 (string-append man1 "/proot.1"))
4039 #t))))))))
4040 (native-inputs `(("which" ,which)
4041
4042 ;; For 'mcookie', used by some of the tests.
4043 ("util-linux" ,util-linux)))
4044 (inputs `(("talloc" ,talloc)))
4045 (synopsis "Unprivileged chroot, bind mount, and binfmt_misc")
4046 (description
4047 "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind},
4048 and @code{binfmt_misc}. This means that users don't need any privileges or
4049 setup to do things like using an arbitrary directory as the new root
4050 filesystem, making files accessible somewhere else in the file system
4051 hierarchy, or executing programs built for another CPU architecture
4052 transparently through QEMU user-mode. Also, developers can use PRoot as a
4053 generic process instrumentation engine thanks to its extension mechanism.
4054 Technically PRoot relies on @code{ptrace}, an unprivileged system-call
4055 available in the kernel Linux.")
4056 (license license:gpl2+)))
4057
4058 (define-public proot-static
4059 (package
4060 (inherit proot)
4061 (name "proot-static")
4062 (synopsis
4063 "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)")
4064 (inputs `(("talloc" ,talloc/static)))
4065 (arguments
4066 (substitute-keyword-arguments (package-arguments proot)
4067 ((#:make-flags flags)
4068 `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags))
4069 ((#:phases phases)
4070 `(modify-phases ,phases
4071 (add-after 'strip 'remove-store-references
4072 (lambda* (#:key outputs #:allow-other-keys)
4073 (let* ((out (assoc-ref outputs "out")))
4074 (with-directory-excursion out
4075 (remove-store-references "bin/proot")
4076 #t))))))
4077 ((#:allowed-references _ '("out"))
4078 '("out"))))))
4079
4080 (define-public cpuid
4081 (package
4082 (name "cpuid")
4083 (version "20170122")
4084 (source (origin
4085 (method url-fetch)
4086 (uri (string-append "http://www.etallen.com/cpuid/cpuid-"
4087 version ".src.tar.gz"))
4088 (sha256
4089 (base32
4090 "0ra8ph9m1dckqaikfnbsh408fp2w9k49fkl423fl2hvhwsm14xk6"))))
4091 (build-system gnu-build-system)
4092 (arguments
4093 '(#:make-flags '("CC=gcc")
4094 #:tests? #f ; no tests
4095 #:phases (modify-phases %standard-phases
4096 (delete 'configure)
4097 (add-before 'install 'fix-makefile
4098 (lambda* (#:key outputs #:allow-other-keys)
4099 (substitute* "Makefile"
4100 (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out")))
4101 ;; Make the compressed manpages writable so that the
4102 ;; reset-gzip-timestamps phase does not error out.
4103 (substitute* "Makefile"
4104 (("-m 444") "-m 644"))
4105 #t)))))
4106 (inputs `(("perl" ,perl)))
4107 (supported-systems '("i686-linux" "x86_64-linux"))
4108 (home-page "http://www.etallen.com/cpuid.html")
4109 (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)")
4110 (description "cpuid dumps detailed information about the CPU(s) gathered
4111 from the CPUID instruction, and also determines the exact model of CPU(s). It
4112 supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC,
4113 NexGen, Rise, and SiS CPUs.")
4114 (license license:gpl2+)))
4115
4116 (define-public jmtpfs
4117 (package
4118 (name "jmtpfs")
4119 (version "0.5")
4120 (source
4121 (origin
4122 (method url-fetch)
4123 (uri (string-append "https://github.com/JasonFerrara/jmtpfs/archive/v"
4124 version ".tar.gz"))
4125 (file-name (string-append name "-" version ".tar.gz"))
4126 (sha256
4127 (base32
4128 "10v8d7mmx8b8123x5f9y9zaaa428ms6wkngwn2ra71n5a53wrjn0"))))
4129 (build-system gnu-build-system)
4130 (inputs
4131 `(("file" ,file)
4132 ("fuse" ,fuse)
4133 ("libmtp" ,libmtp)))
4134 (native-inputs
4135 `(("pkg-config" ,pkg-config)))
4136 (home-page "https://github.com/JasonFerrara/jmtpfs")
4137 (synopsis "Use a FUSE filesystem to access data over MTP")
4138 (description "jmtpfs uses FUSE (filesystem in userspace) to provide access
4139 to data over the Media Transfer Protocol (MTP). Unprivileged users can mount
4140 the MTP device as a filesystem.")
4141 (license license:gpl3)))
4142
4143 (define-public procenv
4144 (package
4145 (name "procenv")
4146 (version "0.49")
4147 (source
4148 (origin
4149 (method url-fetch)
4150 (uri (string-append "https://github.com/jamesodhunt/procenv/archive/"
4151 version ".tar.gz"))
4152 (file-name (string-append name "-" version ".tar.gz"))
4153 (sha256
4154 (base32 "0brzf6185hb76imw107cl21c8lzwiywkxi3jknihrk86bvvicd0d"))))
4155 (build-system gnu-build-system)
4156 (arguments `(#:configure-flags '("--disable-silent-rules")))
4157 (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
4158 ("groff" ,groff) ; for tests
4159 ("libselinux" ,libselinux)))
4160 (synopsis "Utility to show process environment")
4161 (description "Procenv is a command-line tool that displays as much detail about
4162 itself and its environment as possible. It can be used as a test
4163 tool, to understand the type of environment a process runs in, and for
4164 comparing system environments.")
4165 (home-page "http://github.com/jamesodhunt/procenv/")
4166 (license license:gpl3+)))