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