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