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