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