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