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