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