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