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