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