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