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