Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
24a4a635 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 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> |
ec80220c | 5 | ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 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> |
a428fdd4 | 8 | ;;; Copyright © 2015, 2016, 2017, 2018, 2020 Efraim Flashner <efraim@flashner.co.il> |
1348185a | 9 | ;;; Copyright © 2016 Christopher Allan Webber <cwebber@dustycloud.org> |
e0dde179 | 10 | ;;; Copyright © 2016, 2017, 2018, 2019, 2020 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> |
8a890f3c | 14 | ;;; Copyright © 2016, 2018, 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
4ca80a2b | 15 | ;;; Copyright © 2016, 2018, 2019, 2020 Ricardo Wurmus <rekado@elephly.net> |
9b0942c1 | 16 | ;;; Copyright © 2016 David Craven <david@craven.ch> |
594d740d | 17 | ;;; Copyright © 2016 John Darrington <jmd@gnu.org> |
71e0f1e9 | 18 | ;;; Copyright © 2016, 2017, 2018, 2019, 2020 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> |
3c986a7d | 21 | ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is> |
84334427 | 22 | ;;; Copyright © 2017, 2018, 2020 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> |
9b70f2c3 | 25 | ;;; Copyright © 2017, 2019 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> |
e74b2c8e | 31 | ;;; Copyright © 2018, 2020 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> |
76f5428b | 36 | ;;; Copyright © 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
71bd55cb | 37 | ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com> |
2f3c0fb3 | 38 | ;;; Copyright © 2019 Pierre Langlois <pierre.langlois@gmx.com> |
9844848b | 39 | ;;; Copyright © 2019, 2020 Brice Waegeneire <brice@waegenei.re> |
8c6c97de | 40 | ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net> |
baa195dd | 41 | ;;; Copyright © 2020 Oleg Pykhalov <go.wigust@gmail.com> |
a69bc738 | 42 | ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz> |
dedbdacf | 43 | ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com> |
c06c7a3a | 44 | ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com> |
11a5ffba | 45 | ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> |
ddcfc467 | 46 | ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re> |
1acf4c59 | 47 | ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com> |
b523b034 | 48 | ;;; Copyright © 2020 John Soo <jsoo1@asu.edu> |
a6843071 | 49 | ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> |
d888a9c9 | 50 | ;;; Copyright © 2020 Anders Thuné <asse.97@gmail.com> |
957f4e4c | 51 | ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
fd76c904 | 52 | ;;; |
233e7676 | 53 | ;;; This file is part of GNU Guix. |
fd76c904 | 54 | ;;; |
233e7676 | 55 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
fd76c904 LC |
56 | ;;; under the terms of the GNU General Public License as published by |
57 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
58 | ;;; your option) any later version. | |
59 | ;;; | |
233e7676 | 60 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
fd76c904 LC |
61 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
62 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
63 | ;;; GNU General Public License for more details. | |
64 | ;;; | |
65 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 66 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
fd76c904 | 67 | |
1ffa7090 | 68 | (define-module (gnu packages linux) |
59a43334 | 69 | #:use-module (gnu packages) |
0c60cc53 | 70 | #:use-module (gnu packages acl) |
75750abb DC |
71 | #:use-module (gnu packages admin) |
72 | #:use-module (gnu packages algebra) | |
624ee211 | 73 | #:use-module (gnu packages audio) |
75750abb | 74 | #:use-module (gnu packages autotools) |
1eacffb9 | 75 | #:use-module (gnu packages backup) |
75750abb | 76 | #:use-module (gnu packages base) |
c7adafa7 | 77 | #:use-module (gnu packages bash) |
75750abb | 78 | #:use-module (gnu packages bison) |
a6843071 | 79 | #:use-module (gnu packages boost) |
75750abb DC |
80 | #:use-module (gnu packages calendar) |
81 | #:use-module (gnu packages check) | |
78410b09 | 82 | #:use-module (gnu packages cpio) |
e385e957 | 83 | #:use-module (gnu packages crypto) |
17a21bcf | 84 | #:use-module (gnu packages cryptsetup) |
f61e0e79 | 85 | #:use-module (gnu packages compression) |
255d1bbe | 86 | #:use-module (gnu packages dbm) |
b3ed50e6 | 87 | #:use-module (gnu packages datastructures) |
75750abb DC |
88 | #:use-module (gnu packages docbook) |
89 | #:use-module (gnu packages documentation) | |
90 | #:use-module (gnu packages elf) | |
1ffa7090 | 91 | #:use-module (gnu packages flex) |
afc9d8ec | 92 | #:use-module (gnu packages file) |
75750abb | 93 | #:use-module (gnu packages freedesktop) |
957f4e4c | 94 | #:use-module (gnu packages gawk) |
75750abb DC |
95 | #:use-module (gnu packages gcc) |
96 | #:use-module (gnu packages gettext) | |
97 | #:use-module (gnu packages glib) | |
626de0d1 | 98 | #:use-module (gnu packages golang) |
d7d42d6b | 99 | #:use-module (gnu packages gperf) |
8c6c97de | 100 | #:use-module (gnu packages gstreamer) |
75750abb | 101 | #:use-module (gnu packages gtk) |
8a890f3c | 102 | #:use-module (gnu packages haskell-apps) |
76f5428b | 103 | #:use-module (gnu packages haskell-xyz) |
1d484507 | 104 | #:use-module (gnu packages libunwind) |
1ffa7090 | 105 | #:use-module (gnu packages libusb) |
cfd8daaf JS |
106 | #:use-module (gnu packages llvm) |
107 | #:use-module (gnu packages lua) | |
01be4f93 | 108 | #:use-module (gnu packages man) |
75750abb | 109 | #:use-module (gnu packages maths) |
dfe93c9a | 110 | #:use-module (gnu packages multiprecision) |
1ffa7090 | 111 | #:use-module (gnu packages ncurses) |
8d8d227b | 112 | #:use-module (gnu packages netpbm) |
c7adafa7 | 113 | #:use-module (gnu packages networking) |
f8f44dd7 | 114 | #:use-module (gnu packages ninja) |
aff0cce9 | 115 | #:use-module (gnu packages nss) |
1ffa7090 | 116 | #:use-module (gnu packages perl) |
75750abb | 117 | #:use-module (gnu packages pciutils) |
1ffa7090 | 118 | #:use-module (gnu packages pkg-config) |
0d74462a | 119 | #:use-module (gnu packages popt) |
75750abb | 120 | #:use-module (gnu packages pulseaudio) |
7c0dbe78 | 121 | #:use-module (gnu packages python) |
e68f954e | 122 | #:use-module (gnu packages python-xyz) |
75750abb DC |
123 | #:use-module (gnu packages readline) |
124 | #:use-module (gnu packages rrdtool) | |
62b28c0e | 125 | #:use-module (gnu packages samba) |
8c6c97de | 126 | #:use-module (gnu packages sdl) |
9a3d176e | 127 | #:use-module (gnu packages serialization) |
b1fb4b23 | 128 | #:use-module (gnu packages slang) |
f57d2639 | 129 | #:use-module (gnu packages texinfo) |
75343704 | 130 | #:use-module (gnu packages tls) |
b3ed50e6 | 131 | #:use-module (gnu packages valgrind) |
7d2511bc | 132 | #:use-module (gnu packages video) |
d888a9c9 | 133 | #:use-module (gnu packages vulkan) |
7f412f33 | 134 | #:use-module (gnu packages web) |
7d2511bc | 135 | #:use-module (gnu packages xiph) |
75750abb | 136 | #:use-module (gnu packages xml) |
58c4f11e TGR |
137 | #:use-module (gnu packages xdisorg) |
138 | #:use-module (gnu packages xorg) | |
a73e7dd3 | 139 | #:use-module (gnu packages groff) |
e8ded3ee | 140 | #:use-module (gnu packages rsync) |
a73e7dd3 | 141 | #:use-module (gnu packages selinux) |
3eb7c000 | 142 | #:use-module (gnu packages swig) |
220193ad | 143 | #:use-module (guix build-system cmake) |
75750abb | 144 | #:use-module (guix build-system gnu) |
626de0d1 | 145 | #:use-module (guix build-system go) |
8c6c97de | 146 | #:use-module (guix build-system meson) |
e102f940 | 147 | #:use-module (guix build-system python) |
a94546ec | 148 | #:use-module (guix build-system trivial) |
6a8c4b9e | 149 | #:use-module (guix build-system linux-module) |
75750abb | 150 | #:use-module (guix download) |
6d31c175 | 151 | #:use-module (guix git-download) |
75750abb DC |
152 | #:use-module ((guix licenses) #:prefix license:) |
153 | #:use-module (guix packages) | |
1ad9c105 MW |
154 | #:use-module (guix gexp) |
155 | #:use-module (guix store) | |
156 | #:use-module (guix monads) | |
75750abb | 157 | #:use-module (guix utils) |
adddd5ba | 158 | #:use-module (srfi srfi-1) |
17db0706 | 159 | #:use-module (srfi srfi-2) |
a94546ec LC |
160 | #:use-module (srfi srfi-26) |
161 | #:use-module (ice-9 match)) | |
fd76c904 | 162 | |
aaf4cb20 LC |
163 | (define-public (system->linux-architecture arch) |
164 | "Return the Linux architecture name for ARCH, a Guix system name such as | |
6d7ef2aa | 165 | \"x86_64-linux\" or a target triplet such as \"arm-linux-gnueabihf\"." |
618cea69 NK |
166 | (let ((arch (car (string-split arch #\-)))) |
167 | (cond ((string=? arch "i686") "i386") | |
168 | ((string-prefix? "mips" arch) "mips") | |
aaf4cb20 | 169 | ((string-prefix? "arm" arch) "arm") |
503275e9 | 170 | ((string-prefix? "aarch64" arch) "arm64") |
605fec78 | 171 | ((string-prefix? "alpha" arch) "alpha") |
c89e2107 | 172 | ((string-prefix? "powerpc" arch) "powerpc") ;including "powerpc64le" |
b91004c2 | 173 | ((string-prefix? "s390" arch) "s390") |
7180dd67 | 174 | ((string-prefix? "riscv" arch) "riscv") |
618cea69 NK |
175 | (else arch)))) |
176 | ||
440a3143 CSLL |
177 | (define-public (system->defconfig system) |
178 | "Some systems (notably powerpc-linux) require a special target for kernel | |
70c68ed5 | 179 | defconfig. Return the appropriate make target if applicable, otherwise return |
440a3143 CSLL |
180 | \"defconfig\"." |
181 | (cond ((string-prefix? "powerpc-" system) "pmac32_defconfig") | |
c89e2107 | 182 | ((string-prefix? "powerpc64le-" system) "ppc64_defconfig") |
440a3143 CSLL |
183 | (else "defconfig"))) |
184 | ||
1ad9c105 MW |
185 | \f |
186 | ;;; | |
187 | ;;; Kernel source code deblobbing. | |
188 | ;;; | |
189 | ||
190 | (define (linux-libre-deblob-scripts version | |
191 | deblob-hash | |
192 | deblob-check-hash) | |
193 | (list (version-major+minor version) | |
194 | (origin | |
195 | (method url-fetch) | |
196 | (uri (string-append "https://linux-libre.fsfla.org" | |
197 | "/pub/linux-libre/releases/" version "-gnu/" | |
cca5720f | 198 | "deblob-" (version-major+minor version))) |
1bc27503 | 199 | (file-name (string-append "linux-libre-deblob-" |
cca5720f | 200 | version)) |
1ad9c105 MW |
201 | (sha256 deblob-hash)) |
202 | (origin | |
203 | (method url-fetch) | |
204 | (uri (string-append "https://linux-libre.fsfla.org" | |
205 | "/pub/linux-libre/releases/" version "-gnu/" | |
206 | "deblob-check")) | |
105a0370 | 207 | (file-name (string-append "linux-libre-deblob-check-" version)) |
1ad9c105 MW |
208 | (sha256 deblob-check-hash)))) |
209 | ||
1ad9c105 MW |
210 | (define* (computed-origin-method gexp-promise hash-algo hash |
211 | #:optional (name "source") | |
212 | #:key (system (%current-system)) | |
213 | (guile (default-guile))) | |
214 | "Return a derivation that executes the G-expression that results | |
215 | from forcing GEXP-PROMISE." | |
216 | (mlet %store-monad ((guile (package->derivation guile system))) | |
217 | (gexp->derivation (or name "computed-origin") | |
218 | (force gexp-promise) | |
219 | #:graft? #f ;nothing to graft | |
220 | #:system system | |
221 | #:guile-for-build guile))) | |
222 | ||
223 | (define (make-linux-libre-source version | |
224 | upstream-source | |
225 | deblob-scripts) | |
226 | "Return a 'computed' origin that generates a Linux-libre tarball from the | |
227 | corresponding UPSTREAM-SOURCE (an origin), using the given DEBLOB-SCRIPTS." | |
228 | (match deblob-scripts | |
229 | ((deblob-version (? origin? deblob) (? origin? deblob-check)) | |
230 | (unless (string=? deblob-version (version-major+minor version)) | |
231 | ;; The deblob script cannot be expected to work properly on a | |
232 | ;; different version (major+minor) of Linux, even if no errors | |
233 | ;; are signaled during execution. | |
234 | (error "deblob major+minor version mismatch")) | |
235 | (origin | |
236 | (method computed-origin-method) | |
237 | (file-name (string-append "linux-libre-" version "-guix.tar.xz")) | |
238 | (sha256 #f) | |
239 | (uri | |
240 | (delay | |
241 | (with-imported-modules '((guix build utils)) | |
242 | #~(begin | |
243 | (use-modules (guix build utils) | |
244 | (srfi srfi-1) | |
245 | (ice-9 match) | |
246 | (ice-9 ftw)) | |
8b41fdaf MC |
247 | |
248 | (setvbuf (current-output-port) 'line) | |
249 | ||
1ad9c105 MW |
250 | (let ((dir (string-append "linux-" #$version))) |
251 | ||
252 | (mkdir "/tmp/bin") | |
253 | (set-path-environment-variable | |
254 | "PATH" '("bin") | |
255 | (list "/tmp" | |
256 | #+(canonical-package bash) | |
257 | #+(canonical-package coreutils) | |
258 | #+(canonical-package diffutils) | |
259 | #+(canonical-package findutils) | |
260 | #+(canonical-package patch) | |
261 | #+(canonical-package xz) | |
262 | #+(canonical-package sed) | |
263 | #+(canonical-package grep) | |
264 | #+(canonical-package bzip2) | |
265 | #+(canonical-package gzip) | |
266 | #+(canonical-package tar) | |
957f4e4c | 267 | #+(canonical-package gawk) |
b9a7fa81 | 268 | #+python-wrapper)) |
1ad9c105 MW |
269 | |
270 | (with-directory-excursion "/tmp/bin" | |
271 | ||
272 | (copy-file #+deblob "deblob") | |
273 | (chmod "deblob" #o755) | |
274 | (substitute* "deblob" | |
275 | (("/bin/sh") (which "sh"))) | |
276 | ||
277 | (copy-file #+deblob-check "deblob-check") | |
278 | (chmod "deblob-check" #o755) | |
279 | (substitute* "deblob-check" | |
280 | (("/bin/sh") (which "sh")) | |
281 | (("/bin/sed") (which "sed")) | |
282 | (("/usr/bin/python") (which "python")))) | |
283 | ||
284 | (if (file-is-directory? #+upstream-source) | |
285 | (begin | |
286 | (format #t "Copying upstream linux source...~%") | |
1ad9c105 MW |
287 | (invoke "cp" "--archive" #+upstream-source dir) |
288 | (invoke "chmod" "--recursive" "u+w" dir)) | |
289 | (begin | |
290 | (format #t "Unpacking upstream linux tarball...~%") | |
1ad9c105 MW |
291 | (invoke "tar" "xf" #$upstream-source) |
292 | (match (scandir "." | |
293 | (lambda (name) | |
294 | (and (not (member name '("." ".."))) | |
295 | (file-is-directory? name)))) | |
296 | ((unpacked-dir) | |
297 | (unless (string=? dir unpacked-dir) | |
298 | (rename-file unpacked-dir dir))) | |
299 | (dirs | |
300 | (error "multiple directories found" dirs))))) | |
301 | ||
302 | (with-directory-excursion dir | |
1ad9c105 | 303 | (format #t "Running deblob script...~%") |
1ad9c105 MW |
304 | (invoke "/tmp/bin/deblob")) |
305 | ||
306 | (format #t "~%Packing new Linux-libre tarball...~%") | |
d0aff873 | 307 | (invoke "tar" "cvfa" #$output |
1ad9c105 MW |
308 | ;; Avoid non-determinism in the archive. |
309 | "--mtime=@0" | |
310 | "--owner=root:0" | |
311 | "--group=root:0" | |
312 | "--sort=name" | |
313 | "--hard-dereference" | |
957f4e4c MC |
314 | dir) |
315 | ||
316 | (format #t "~%Scanning the generated tarball for blobs...~%") | |
317 | (invoke "/tmp/bin/deblob-check" "--use-awk" "--list-blobs" | |
318 | #$output)))))))))) | |
1ad9c105 MW |
319 | |
320 | \f | |
321 | ;;; | |
322 | ;;; Kernel sources. | |
323 | ;;; | |
324 | ||
6023cc74 LC |
325 | (define (linux-libre-urls version) |
326 | "Return a list of URLs for Linux-Libre VERSION." | |
327 | (list (string-append | |
8420c7a3 | 328 | "https://linux-libre.fsfla.org/pub/linux-libre/releases/" |
6023cc74 LC |
329 | version "-gnu/linux-libre-" version "-gnu.tar.xz") |
330 | ||
331 | ;; XXX: Work around <http://bugs.gnu.org/14851>. | |
332 | (string-append | |
333 | "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-" | |
334 | version "-gnu.tar.xz") | |
335 | ||
336 | ;; Maybe this URL will become valid eventually. | |
337 | (string-append | |
338 | "mirror://gnu/linux-libre/" version "-gnu/linux-libre-" | |
339 | version "-gnu.tar.xz"))) | |
340 | ||
1ad9c105 MW |
341 | (define (%upstream-linux-source version hash) |
342 | (origin | |
343 | (method url-fetch) | |
344 | (uri (string-append "mirror://kernel.org" | |
345 | "/linux/kernel/v" (version-major version) ".x/" | |
346 | "linux-" version ".tar.xz")) | |
347 | (sha256 hash))) | |
348 | ||
1b131e1f | 349 | |
fe752d8c LF |
350 | ;; The current "stable" kernel. That is, the most recently released major |
351 | ;; version. | |
3b5b14d3 | 352 | (define-public linux-libre-5.8-version "5.8.10") |
fe752d8c LF |
353 | (define deblob-scripts-5.8 |
354 | (linux-libre-deblob-scripts | |
5f5ff266 | 355 | linux-libre-5.8-version |
fe752d8c LF |
356 | (base32 "07z7sglyrfh0706icqqf3shadf638pvyid9386r661ds5lbsa2mw") |
357 | (base32 "0j6jba5fcddqlb42f95gjl78jisfla4nswqila074gglcrbnl9q7"))) | |
cb97d076 MW |
358 | (define-public linux-libre-5.8-pristine-source |
359 | (let ((version linux-libre-5.8-version) | |
3b5b14d3 | 360 | (hash (base32 "1wjsdc93xilag0pk205m2q0ixmpp93ql5qj0fm3qlqddgxm14vlx"))) |
cb97d076 MW |
361 | (make-linux-libre-source version |
362 | (%upstream-linux-source version hash) | |
363 | deblob-scripts-5.8))) | |
364 | ||
fe752d8c LF |
365 | ;; The "longterm" kernels — the older releases with long-term upstream support. |
366 | ;; Here are the support timelines: | |
367 | ;; <https://www.kernel.org/category/releases.html> | |
e2fad8d4 | 368 | (define-public linux-libre-5.4-version "5.4.66") |
fe752d8c LF |
369 | (define deblob-scripts-5.4 |
370 | (linux-libre-deblob-scripts | |
e2fad8d4 | 371 | linux-libre-5.4-version |
fe752d8c LF |
372 | (base32 "0ckxn7k5zgcqk30dq943bnamr6a6zjbw2aqjl3x30f4kvh5f6k25") |
373 | (base32 "1b3q88i2qfdxyvpi9f7jds0qlb8hfpw87mgia096ax6822c2cmyb"))) | |
952820c5 MW |
374 | (define-public linux-libre-5.4-pristine-source |
375 | (let ((version linux-libre-5.4-version) | |
e2fad8d4 | 376 | (hash (base32 "1cnsrz21kcf0h7krpv9p1a7n59mybr5ii0jdi3yc3x3lcwvk06gz"))) |
9e34a5f3 TGR |
377 | (make-linux-libre-source version |
378 | (%upstream-linux-source version hash) | |
952820c5 | 379 | deblob-scripts-5.4))) |
9e34a5f3 | 380 | |
a91d5b6c | 381 | (define-public linux-libre-4.19-version "4.19.146") |
fe752d8c LF |
382 | (define deblob-scripts-4.19 |
383 | (linux-libre-deblob-scripts | |
a91d5b6c | 384 | linux-libre-4.19-version |
fe752d8c LF |
385 | (base32 "02zs405awaxydbapka4nz8h6lmnc0dahgczqsrs5s2bmzjyyqkcy") |
386 | (base32 "1jiaw0as1ippkrjdpd52657w5mz9qczg3y2hlra7m9k0xawwiqlf"))) | |
1ad9c105 MW |
387 | (define-public linux-libre-4.19-pristine-source |
388 | (let ((version linux-libre-4.19-version) | |
a91d5b6c | 389 | (hash (base32 "0jl17yk3fpz0sx203l9l1fj5bly3jgsyr8hy5qa6py99fbk0qnim"))) |
1ad9c105 MW |
390 | (make-linux-libre-source version |
391 | (%upstream-linux-source version hash) | |
392 | deblob-scripts-4.19))) | |
393 | ||
76ab528d | 394 | (define-public linux-libre-4.14-version "4.14.198") |
fe752d8c LF |
395 | (define deblob-scripts-4.14 |
396 | (linux-libre-deblob-scripts | |
76ab528d | 397 | linux-libre-4.14-version |
fe752d8c LF |
398 | (base32 "091jk9jkn9jf39bxpc7395bhcb7p96nkg3a8047380ki06lnfxh6") |
399 | (base32 "1qij18inijj6c3ma8hv98yjagnzxdxyn134da9fd23ky8q6hbvky"))) | |
1ad9c105 MW |
400 | (define-public linux-libre-4.14-pristine-source |
401 | (let ((version linux-libre-4.14-version) | |
76ab528d | 402 | (hash (base32 "00xmij2l4qmx1s07hplxkn9ddlwiyalh2l5fqdk6d8v031cbmyhy"))) |
1ad9c105 MW |
403 | (make-linux-libre-source version |
404 | (%upstream-linux-source version hash) | |
405 | deblob-scripts-4.14))) | |
406 | ||
a0aa0b6b | 407 | (define-public linux-libre-4.9-version "4.9.235") |
fe752d8c LF |
408 | (define deblob-scripts-4.9 |
409 | (linux-libre-deblob-scripts | |
410 | linux-libre-4.9-version | |
411 | (base32 "1wvldzlv7q2xdbadas87dh593nxr4a8p5n0f8zpm72lja6w18hmg") | |
412 | (base32 "0fxajshb75siq39lj5h8xvhdj8lcmddkslwlyj65rhlwk6g2r4b2"))) | |
1ad9c105 MW |
413 | (define-public linux-libre-4.9-pristine-source |
414 | (let ((version linux-libre-4.9-version) | |
a0aa0b6b | 415 | (hash (base32 "1hqcb3zw4546h6x5xy2mywdznha8813lx15mxbgfbvwm4qhsc9g6"))) |
1ad9c105 MW |
416 | (make-linux-libre-source version |
417 | (%upstream-linux-source version hash) | |
418 | deblob-scripts-4.9))) | |
419 | ||
ab5a3155 | 420 | (define-public linux-libre-4.4-version "4.4.235") |
fe752d8c LF |
421 | (define deblob-scripts-4.4 |
422 | (linux-libre-deblob-scripts | |
423 | linux-libre-4.4-version | |
424 | (base32 "0x2j1i88am54ih2mk7gyl79g25l9zz4r08xhl482l3fvjj2irwbw") | |
425 | (base32 "0hhin1jpfkd6nwrb6xqxjzl3hdxy4pn8a15hy2d3d83yw6pflbsf"))) | |
1ad9c105 MW |
426 | (define-public linux-libre-4.4-pristine-source |
427 | (let ((version linux-libre-4.4-version) | |
ab5a3155 | 428 | (hash (base32 "0w5pkv936zb0shjgnpv17gcp5n8f91djznzq54p6j1bl5q2qdyqd"))) |
1ad9c105 MW |
429 | (make-linux-libre-source version |
430 | (%upstream-linux-source version hash) | |
431 | deblob-scripts-4.4))) | |
432 | ||
433 | (define %boot-logo-patch | |
434 | ;; Linux-Libre boot logo featuring Freedo and a gnu. | |
435 | (origin | |
436 | (method url-fetch) | |
437 | (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/" | |
438 | "lemote/gnewsense/branches/3.16/100gnu+freedo.patch")) | |
439 | (sha256 | |
440 | (base32 | |
441 | "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06")))) | |
442 | ||
443 | (define %linux-libre-arm-export-__sync_icache_dcache-patch | |
444 | (origin | |
445 | (method url-fetch) | |
446 | (uri (string-append | |
447 | "https://salsa.debian.org/kernel-team/linux" | |
448 | "/raw/34a7d9011fcfcfa38b68282fd2b1a8797e6834f0" | |
449 | "/debian/patches/bugfix/arm/" | |
450 | "arm-mm-export-__sync_icache_dcache-for-xen-privcmd.patch")) | |
451 | (file-name "linux-libre-arm-export-__sync_icache_dcache.patch") | |
452 | (sha256 | |
453 | (base32 "1ifnfhpakzffn4b8n7x7w5cps9mzjxlkcfz9zqak2vaw8nzvl39f")))) | |
454 | ||
455 | (define (source-with-patches source patches) | |
456 | (origin | |
457 | (inherit source) | |
458 | (patches (append (origin-patches source) | |
459 | patches)))) | |
460 | ||
cb97d076 MW |
461 | (define-public linux-libre-5.8-source |
462 | (source-with-patches linux-libre-5.8-pristine-source | |
463 | (list %boot-logo-patch | |
464 | %linux-libre-arm-export-__sync_icache_dcache-patch))) | |
465 | ||
952820c5 MW |
466 | (define-public linux-libre-5.4-source |
467 | (source-with-patches linux-libre-5.4-pristine-source | |
468 | (list %boot-logo-patch | |
730a4b10 VC |
469 | %linux-libre-arm-export-__sync_icache_dcache-patch |
470 | ;; Pinebook Pro patch from linux-next, | |
471 | ;; can be dropped for linux-libre 5.7 | |
472 | (search-patch | |
473 | "linux-libre-support-for-Pinebook-Pro.patch")))) | |
9e34a5f3 | 474 | |
1ad9c105 MW |
475 | (define-public linux-libre-4.19-source |
476 | (source-with-patches linux-libre-4.19-pristine-source | |
477 | (list %boot-logo-patch | |
7089a45a | 478 | %linux-libre-arm-export-__sync_icache_dcache-patch))) |
1ad9c105 MW |
479 | |
480 | (define-public linux-libre-4.14-source | |
481 | (source-with-patches linux-libre-4.14-pristine-source | |
ceaeae8f | 482 | (list %boot-logo-patch))) |
1ad9c105 MW |
483 | |
484 | (define-public linux-libre-4.9-source | |
485 | (source-with-patches linux-libre-4.9-pristine-source | |
19783b74 | 486 | (list %boot-logo-patch))) |
1ad9c105 MW |
487 | |
488 | (define-public linux-libre-4.4-source | |
489 | (source-with-patches linux-libre-4.4-pristine-source | |
90ff53af | 490 | (list %boot-logo-patch))) |
1ad9c105 MW |
491 | |
492 | \f | |
493 | ;;; | |
494 | ;;; Kernel headers. | |
495 | ;;; | |
496 | ||
497 | (define (make-linux-libre-headers version hash-string) | |
498 | (make-linux-libre-headers* version | |
499 | (origin | |
500 | (method url-fetch) | |
501 | (uri (linux-libre-urls version)) | |
502 | (sha256 (base32 hash-string))))) | |
503 | ||
504 | (define (make-linux-libre-headers* version source) | |
b450d2b4 DC |
505 | (package |
506 | (name "linux-libre-headers") | |
a15cee50 | 507 | (version version) |
1ad9c105 | 508 | (source source) |
b450d2b4 | 509 | (build-system gnu-build-system) |
a15cee50 CD |
510 | (native-inputs `(("perl" ,perl) |
511 | ,@(if (version>=? version "4.16") | |
512 | `(("flex" ,flex) | |
513 | ("bison" ,bison)) | |
e8ded3ee TGR |
514 | '()) |
515 | ,@(if (version>=? version "5.3") | |
516 | `(("rsync" ,rsync)) | |
a15cee50 | 517 | '()))) |
b450d2b4 DC |
518 | (arguments |
519 | `(#:modules ((guix build gnu-build-system) | |
520 | (guix build utils) | |
521 | (srfi srfi-1)) | |
522 | #:phases | |
523 | (modify-phases %standard-phases | |
524 | (delete 'configure) | |
525 | (replace 'build | |
526 | (lambda _ | |
527 | (let ((arch ,(system->linux-architecture | |
528 | (or (%current-target-system) | |
440a3143 CSLL |
529 | (%current-system)))) |
530 | (defconfig ,(system->defconfig | |
531 | (or (%current-target-system) | |
532 | (%current-system))))) | |
b450d2b4 | 533 | (setenv "ARCH" arch) |
618cea69 | 534 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) |
5dc9ded1 MW |
535 | (invoke "make" defconfig) |
536 | (invoke "make" "mrproper" "headers_check")))) | |
b450d2b4 DC |
537 | (replace 'install |
538 | (lambda* (#:key outputs #:allow-other-keys) | |
80fe5c60 | 539 | (let ((out (assoc-ref outputs "out"))) |
5dc9ded1 MW |
540 | (invoke "make" |
541 | (string-append "INSTALL_HDR_PATH=" out) | |
542 | "headers_install") | |
b15389e1 | 543 | |
5dc9ded1 MW |
544 | (mkdir (string-append out "/include/config")) |
545 | (call-with-output-file | |
546 | (string-append out | |
547 | "/include/config/kernel.release") | |
548 | (lambda (p) | |
549 | (format p "~a-default~%" ,version))) | |
b15389e1 | 550 | |
5dc9ded1 MW |
551 | ;; Remove the '.install' and '..install.cmd' files; the |
552 | ;; latter contains store paths, which pulls in bootstrap | |
553 | ;; binaries in the build environment, and prevents bit | |
554 | ;; reproducibility for the bootstrap binaries. | |
555 | (for-each delete-file (find-files out "\\.install")) | |
556 | ||
557 | #t)))) | |
b15389e1 | 558 | #:allowed-references () |
80fe5c60 | 559 | #:tests? #f)) |
6fd52309 | 560 | (home-page "https://www.gnu.org/software/linux-libre/") |
80fe5c60 LC |
561 | (synopsis "GNU Linux-Libre kernel headers") |
562 | (description "Headers of the Linux-Libre kernel.") | |
b450d2b4 | 563 | (license license:gpl2))) |
80fe5c60 | 564 | |
cb97d076 MW |
565 | (define-public linux-libre-headers-5.8 |
566 | (make-linux-libre-headers* linux-libre-5.8-version | |
567 | linux-libre-5.8-source)) | |
568 | ||
952820c5 MW |
569 | (define-public linux-libre-headers-5.4 |
570 | (make-linux-libre-headers* linux-libre-5.4-version | |
571 | linux-libre-5.4-source)) | |
9e34a5f3 | 572 | |
1ad9c105 MW |
573 | (define-public linux-libre-headers-4.19 |
574 | (make-linux-libre-headers* linux-libre-4.19-version | |
575 | linux-libre-4.19-source)) | |
576 | ||
577 | (define-public linux-libre-headers-4.14 | |
578 | (make-linux-libre-headers* linux-libre-4.14-version | |
579 | linux-libre-4.14-source)) | |
580 | ||
581 | (define-public linux-libre-headers-4.9 | |
582 | (make-linux-libre-headers* linux-libre-4.9-version | |
583 | linux-libre-4.9-source)) | |
584 | ||
585 | (define-public linux-libre-headers-4.4 | |
586 | (make-linux-libre-headers* linux-libre-4.4-version | |
587 | linux-libre-4.4-source)) | |
588 | ||
589 | ;; The following package is used in the early bootstrap, and thus must be kept | |
590 | ;; stable and with minimal build requirements. | |
429243a4 MB |
591 | (define-public linux-libre-headers-5.4.20 |
592 | (make-linux-libre-headers "5.4.20" | |
593 | "1qxhf6dmcwjblzx8fgn6vr10p38xw10iwh6d1y1v1mxb25y30b47")) | |
1ad9c105 | 594 | |
429243a4 | 595 | (define-public linux-libre-headers linux-libre-headers-5.4.20) |
1ad9c105 MW |
596 | |
597 | \f | |
598 | ;;; | |
599 | ;;; Kernel configurations. | |
600 | ;;; | |
3fb7b612 | 601 | |
c258807a | 602 | (define* (kernel-config arch #:key variant) |
a94546ec | 603 | "Return the absolute file name of the Linux-Libre build configuration file |
c258807a | 604 | for ARCH and optionally VARIANT, or #f if there is no such configuration." |
7994250f | 605 | (let* ((name (string-append (if variant (string-append variant "-") "") |
25847b32 | 606 | (if (string=? "i386" arch) "i686" arch) ".conf")) |
7994250f AK |
607 | (file (string-append "linux-libre/" name))) |
608 | (search-auxiliary-file file))) | |
a94546ec | 609 | |
90c18c32 | 610 | (define %default-extra-linux-options |
24446ce2 TGR |
611 | `(;; Some very mild hardening. |
612 | ("CONFIG_SECURITY_DMESG_RESTRICT" . #t) | |
18b3ba6f VC |
613 | ;; All kernels should have NAMESPACES options enabled |
614 | ("CONFIG_NAMESPACES" . #t) | |
615 | ("CONFIG_UTS_NS" . #t) | |
616 | ("CONFIG_IPC_NS" . #t) | |
617 | ("CONFIG_USER_NS" . #t) | |
618 | ("CONFIG_PID_NS" . #t) | |
619 | ("CONFIG_NET_NS" . #t) | |
450dcd1a VC |
620 | ;; Various options needed for elogind service: |
621 | ;; https://issues.guix.gnu.org/43078 | |
622 | ("CONFIG_CGROUP_FREEZER" . #t) | |
623 | ("CONFIG_BLK_CGROUP" . #t) | |
624 | ("CONFIG_CGROUP_WRITEBACK" . #t) | |
625 | ("CONFIG_CGROUP_SCHED" . #t) | |
626 | ("CONFIG_CGROUP_PIDS" . #t) | |
627 | ("CONFIG_CGROUP_FREEZER" . #t) | |
628 | ("CONFIG_CGROUP_DEVICE" . #t) | |
629 | ("CONFIG_CGROUP_CPUACCT" . #t) | |
630 | ("CONFIG_CGROUP_PERF" . #t) | |
631 | ("CONFIG_SOCK_CGROUP_DATA" . #t) | |
632 | ("CONFIG_BLK_CGROUP_IOCOST" . #t) | |
633 | ("CONFIG_CGROUP_NET_PRIO" . #t) | |
634 | ("CONFIG_CGROUP_NET_CLASSID" . #t) | |
635 | ("CONFIG_MEMCG" . #t) | |
636 | ("CONFIG_MEMCG_SWAP" . #t) | |
637 | ("CONFIG_MEMCG_KMEM" . #t) | |
638 | ("CONFIG_CPUSETS" . #t) | |
639 | ("CONFIG_PROC_PID_CPUSET" . #t) | |
24446ce2 | 640 | ;; Modules required for initrd: |
b9f7895d DC |
641 | ("CONFIG_NET_9P" . m) |
642 | ("CONFIG_NET_9P_VIRTIO" . m) | |
643 | ("CONFIG_VIRTIO_BLK" . m) | |
644 | ("CONFIG_VIRTIO_NET" . m) | |
645 | ("CONFIG_VIRTIO_PCI" . m) | |
646 | ("CONFIG_VIRTIO_BALLOON" . m) | |
647 | ("CONFIG_VIRTIO_MMIO" . m) | |
648 | ("CONFIG_FUSE_FS" . m) | |
649 | ("CONFIG_CIFS" . m) | |
650 | ("CONFIG_9P_FS" . m))) | |
90c18c32 | 651 | |
78410b09 JS |
652 | ;; See https://github.com/iovisor/bcc/blob/master/INSTALL.md#kernel-configuration |
653 | (define %bpf-extra-linux-options | |
654 | `(;; Needed for probes | |
655 | ("CONFIG_UPROBE_EVENTS" . #t) | |
656 | ("CONFIG_KPROBE_EVENTS" . #t) | |
657 | ;; kheaders module also helpful for tracing | |
658 | ("CONFIG_IKHEADERS" . #t) | |
659 | ("CONFIG_BPF" . #t) | |
660 | ("CONFIG_BPF_SYSCALL" . #t) | |
661 | ("CONFIG_BPF_JIT_ALWAYS_ON" . #t) | |
662 | ;; optional, for tc filters | |
663 | ("CONFIG_NET_CLS_BPF" . m) | |
664 | ;; optional, for tc actions | |
665 | ("CONFIG_NET_ACT_BPF" . m) | |
666 | ("CONFIG_BPF_JIT" . #t) | |
667 | ;; for Linux kernel versions 4.1 through 4.6 | |
668 | ;; ("CONFIG_HAVE_BPF_JIT" . y) | |
669 | ;; for Linux kernel versions 4.7 and later | |
670 | ("CONFIG_HAVE_EBPF_JIT" . #t) | |
671 | ;; optional, for kprobes | |
672 | ("CONFIG_BPF_EVENTS" . #t) | |
673 | ;; kheaders module | |
674 | ("CONFIG_IKHEADERS" . #t))) | |
675 | ||
90c18c32 DC |
676 | (define (config->string options) |
677 | (string-join (map (match-lambda | |
678 | ((option . 'm) | |
679 | (string-append option "=m")) | |
680 | ((option . #t) | |
681 | (string-append option "=y")) | |
682 | ((option . #f) | |
683 | (string-append option "=n"))) | |
684 | options) | |
685 | "\n")) | |
686 | ||
1ad9c105 MW |
687 | \f |
688 | ;;; | |
689 | ;;; Kernel package utilities. | |
690 | ;;; | |
691 | ||
692 | (define* (make-linux-libre version hash-string supported-systems | |
c258807a DC |
693 | #:key |
694 | ;; A function that takes an arch and a variant. | |
695 | ;; See kernel-config for an example. | |
a6d01325 | 696 | (extra-version #f) |
c258807a | 697 | (configuration-file #f) |
90c18c32 | 698 | (defconfig "defconfig") |
64de7d1c MW |
699 | (extra-options %default-extra-linux-options) |
700 | (patches (list %boot-logo-patch))) | |
1ad9c105 MW |
701 | (make-linux-libre* version |
702 | (origin | |
703 | (method url-fetch) | |
704 | (uri (linux-libre-urls version)) | |
705 | (sha256 (base32 hash-string)) | |
706 | (patches patches)) | |
707 | supported-systems | |
708 | #:extra-version extra-version | |
709 | #:configuration-file configuration-file | |
710 | #:defconfig defconfig | |
711 | #:extra-options extra-options)) | |
712 | ||
713 | (define* (make-linux-libre* version source supported-systems | |
714 | #:key | |
715 | ;; A function that takes an arch and a variant. | |
716 | ;; See kernel-config for an example. | |
717 | (extra-version #f) | |
718 | (configuration-file #f) | |
719 | (defconfig "defconfig") | |
720 | (extra-options %default-extra-linux-options)) | |
614d1738 | 721 | (package |
a6d01325 DC |
722 | (name (if extra-version |
723 | (string-append "linux-libre-" extra-version) | |
724 | "linux-libre")) | |
c258807a | 725 | (version version) |
1ad9c105 | 726 | (source source) |
3129b9c2 | 727 | (supported-systems supported-systems) |
614d1738 | 728 | (build-system gnu-build-system) |
614d1738 DC |
729 | (native-inputs |
730 | `(("perl" ,perl) | |
731 | ("bc" ,bc) | |
732 | ("openssl" ,openssl) | |
78602fad | 733 | ("elfutils" ,elfutils) ; Needed to enable CONFIG_STACK_VALIDATION |
81d98d7e MW |
734 | ("flex" ,flex) |
735 | ("bison" ,bison) | |
ce899af1 | 736 | |
ce899af1 MW |
737 | ;; These are needed to compile the GCC plugins. |
738 | ("gmp" ,gmp) | |
739 | ("mpfr" ,mpfr) | |
740 | ("mpc" ,mpc) | |
741 | ||
64b5e413 LC |
742 | ,@(match (and configuration-file |
743 | (configuration-file | |
744 | (system->linux-architecture | |
745 | (or (%current-target-system) (%current-system))) | |
746 | #:variant (version-major+minor version))) | |
747 | (#f ;no config for this platform | |
748 | '()) | |
749 | ((? string? config) | |
750 | `(("kconfig" ,config)))))) | |
614d1738 DC |
751 | (arguments |
752 | `(#:modules ((guix build gnu-build-system) | |
753 | (guix build utils) | |
754 | (srfi srfi-1) | |
c5ceec41 | 755 | (srfi srfi-26) |
5c79f238 | 756 | (ice-9 ftw) |
614d1738 DC |
757 | (ice-9 match)) |
758 | #:phases | |
759 | (modify-phases %standard-phases | |
c5bd8753 MW |
760 | (add-after 'unpack 'patch-/bin/pwd |
761 | (lambda _ | |
762 | (substitute* (find-files "." "^Makefile(\\.include)?$") | |
763 | (("/bin/pwd") "pwd")) | |
764 | #t)) | |
9416459b | 765 | (replace 'configure |
4b42703e | 766 | (lambda* (#:key inputs native-inputs target #:allow-other-keys) |
96e9f097 RN |
767 | ;; Avoid introducing timestamps |
768 | (setenv "KCONFIG_NOTIMESTAMP" "1") | |
769 | (setenv "KBUILD_BUILD_TIMESTAMP" (getenv "SOURCE_DATE_EPOCH")) | |
770 | ||
4b42703e | 771 | ;; Set ARCH and CROSS_COMPILE |
6d7ef2aa DC |
772 | (let ((arch ,(system->linux-architecture |
773 | (or (%current-target-system) | |
774 | (%current-system))))) | |
4b42703e DC |
775 | (setenv "ARCH" arch) |
776 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) | |
6d7ef2aa | 777 | |
4b42703e DC |
778 | (when target |
779 | (setenv "CROSS_COMPILE" (string-append target "-")) | |
780 | (format #t "`CROSS_COMPILE' set to `~a'~%" | |
781 | (getenv "CROSS_COMPILE")))) | |
beacfcab | 782 | |
a6d01325 DC |
783 | (setenv "EXTRA_VERSION" ,extra-version) |
784 | ||
a94546ec | 785 | (let ((build (assoc-ref %standard-phases 'build)) |
65416733 | 786 | (config (assoc-ref (or native-inputs inputs) "kconfig"))) |
1650dd8a | 787 | |
e4e9c0a0 DC |
788 | ;; Use a custom kernel configuration file or a default |
789 | ;; configuration file. | |
1650dd8a LC |
790 | (if config |
791 | (begin | |
792 | (copy-file config ".config") | |
793 | (chmod ".config" #o666)) | |
fdd400d8 | 794 | (invoke "make" ,defconfig)) |
a94546ec LC |
795 | |
796 | ;; Appending works even when the option wasn't in the | |
797 | ;; file. The last one prevails if duplicated. | |
90c18c32 DC |
798 | (let ((port (open-file ".config" "a")) |
799 | (extra-configuration ,(config->string extra-options))) | |
800 | (display extra-configuration port) | |
a94546ec LC |
801 | (close-port port)) |
802 | ||
fdd400d8 | 803 | (invoke "make" "oldconfig")))) |
614d1738 | 804 | (replace 'install |
4b42703e | 805 | (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) |
beacfcab LC |
806 | (let* ((out (assoc-ref outputs "out")) |
807 | (moddir (string-append out "/lib/modules")) | |
5c79f238 | 808 | (dtbdir (string-append out "/lib/dtbs"))) |
e4e9c0a0 DC |
809 | ;; Install kernel image, kernel configuration and link map. |
810 | (for-each (lambda (file) (install-file file out)) | |
d0a39b92 | 811 | (find-files "." "^(\\.config|bzImage|zImage|Image|vmlinuz|System\\.map|Module\\.symvers)$")) |
e4e9c0a0 | 812 | ;; Install device tree files |
a8e3fd5f VC |
813 | (unless (null? (find-files "." "\\.dtb$")) |
814 | (mkdir-p dtbdir) | |
815 | (invoke "make" (string-append "INSTALL_DTBS_PATH=" dtbdir) | |
816 | "dtbs_install")) | |
e4e9c0a0 | 817 | ;; Install kernel modules |
beacfcab | 818 | (mkdir-p moddir) |
fdd400d8 | 819 | (invoke "make" |
5c79f238 DM |
820 | ;; Disable depmod because the Guix system's module directory |
821 | ;; is an union of potentially multiple packages. It is not | |
822 | ;; possible to use depmod to usefully calculate a dependency | |
823 | ;; graph while building only one of those packages. | |
824 | "DEPMOD=true" | |
fdd400d8 DM |
825 | (string-append "MODULE_DIR=" moddir) |
826 | (string-append "INSTALL_PATH=" out) | |
827 | (string-append "INSTALL_MOD_PATH=" out) | |
828 | "INSTALL_MOD_STRIP=1" | |
5c79f238 DM |
829 | "modules_install") |
830 | (let* ((versions (filter (lambda (name) | |
831 | (not (string-prefix? "." name))) | |
832 | (scandir moddir))) | |
833 | (version (match versions | |
834 | ((x) x)))) | |
835 | ;; There are symlinks to the build and source directory, | |
836 | ;; both of which will point to target /tmp/guix-build* | |
837 | ;; and thus not be useful in a profile. Delete the symlinks. | |
838 | (false-if-file-not-found | |
839 | (delete-file (string-append moddir "/" version "/build"))) | |
840 | (false-if-file-not-found | |
841 | (delete-file (string-append moddir "/" version "/source")))) | |
842 | #t)))) | |
beacfcab | 843 | #:tests? #f)) |
f8aa265e | 844 | (home-page "https://www.gnu.org/software/linux-libre/") |
f50d2669 | 845 | (synopsis "100% free redistribution of a cleaned Linux kernel") |
a22dc0c4 | 846 | (description |
79c311b8 LC |
847 | "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel. |
848 | It has been modified to remove all non-free binary blobs.") | |
614d1738 | 849 | (license license:gpl2))) |
beacfcab | 850 | |
1ad9c105 MW |
851 | \f |
852 | ;;; | |
853 | ;;; Generic kernel packages. | |
854 | ;;; | |
adbe6dea | 855 | |
7bb0527c LF |
856 | (define-public linux-libre-5.8 |
857 | (make-linux-libre* linux-libre-5.8-version | |
858 | linux-libre-5.8-source | |
859 | '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux") | |
860 | #:configuration-file kernel-config)) | |
861 | ||
862 | (define-public linux-libre-version linux-libre-5.8-version) | |
863 | (define-public linux-libre-pristine-source linux-libre-5.8-pristine-source) | |
864 | (define-public linux-libre-source linux-libre-5.8-source) | |
865 | (define-public linux-libre linux-libre-5.8) | |
866 | ||
952820c5 MW |
867 | (define-public linux-libre-5.4 |
868 | (make-linux-libre* linux-libre-5.4-version | |
869 | linux-libre-5.4-source | |
b3d25e21 | 870 | '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux" "riscv64-linux") |
9e34a5f3 TGR |
871 | #:configuration-file kernel-config)) |
872 | ||
ff148ea5 | 873 | (define-public linux-libre-4.19 |
1ad9c105 MW |
874 | (make-linux-libre* linux-libre-4.19-version |
875 | linux-libre-4.19-source | |
876 | '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux") | |
877 | #:configuration-file kernel-config)) | |
adbe6dea MW |
878 | |
879 | (define-public linux-libre-4.14 | |
1ad9c105 MW |
880 | (make-linux-libre* linux-libre-4.14-version |
881 | linux-libre-4.14-source | |
882 | '("x86_64-linux" "i686-linux" "armhf-linux") | |
883 | #:configuration-file kernel-config)) | |
a15cee50 | 884 | |
52d901da | 885 | (define-public linux-libre-4.9 |
1ad9c105 MW |
886 | (make-linux-libre* linux-libre-4.9-version |
887 | linux-libre-4.9-source | |
888 | '("x86_64-linux" "i686-linux") | |
889 | #:configuration-file kernel-config)) | |
52d901da | 890 | |
75b314a6 | 891 | (define-public linux-libre-4.4 |
1ad9c105 MW |
892 | (make-linux-libre* linux-libre-4.4-version |
893 | linux-libre-4.4-source | |
894 | '("x86_64-linux" "i686-linux") | |
895 | #:configuration-file kernel-config | |
896 | #:extra-options | |
897 | (append | |
898 | `(;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html | |
899 | ;; This option was removed upstream in version 4.7. | |
900 | ("CONFIG_DEVPTS_MULTIPLE_INSTANCES" . #t)) | |
901 | %default-extra-linux-options))) | |
75b314a6 | 902 | |
1ad9c105 MW |
903 | \f |
904 | ;;; | |
905 | ;;; Specialized kernel variants. | |
906 | ;;; | |
a15cee50 | 907 | |
403b3a8c | 908 | (define-public linux-libre-arm-generic |
1ad9c105 MW |
909 | (make-linux-libre* linux-libre-version |
910 | linux-libre-source | |
911 | '("armhf-linux") | |
912 | #:defconfig "multi_v7_defconfig" | |
6978df6a VC |
913 | #:extra-version "arm-generic" |
914 | #:extra-options | |
915 | (append | |
916 | `(;; needed to fix the RTC on rockchip platforms | |
917 | ("CONFIG_RTC_DRV_RK808" . #t)) | |
918 | %default-extra-linux-options))) | |
1dbb9302 | 919 | |
1eb27d5c LF |
920 | (define-public linux-libre-arm-veyron |
921 | (deprecated-package "linux-libre-arm-veyron" linux-libre-arm-generic)) | |
922 | ||
8a54e42b VC |
923 | (define-public linux-libre-arm-generic-5.4 |
924 | (make-linux-libre* linux-libre-5.4-version | |
925 | linux-libre-5.4-source | |
926 | '("armhf-linux") | |
927 | #:defconfig "multi_v7_defconfig" | |
928 | #:extra-version "arm-generic" | |
929 | #:extra-options | |
930 | (append | |
931 | `(;; needed to fix the RTC on rockchip platforms | |
932 | ("CONFIG_RTC_DRV_RK808" . #t)) | |
933 | %default-extra-linux-options))) | |
934 | ||
ff148ea5 | 935 | (define-public linux-libre-arm-generic-4.19 |
1ad9c105 MW |
936 | (make-linux-libre* linux-libre-4.19-version |
937 | linux-libre-4.19-source | |
938 | '("armhf-linux") | |
939 | #:defconfig "multi_v7_defconfig" | |
940 | #:extra-version "arm-generic")) | |
cde7c23f | 941 | |
adbe6dea | 942 | (define-public linux-libre-arm-generic-4.14 |
1ad9c105 MW |
943 | (make-linux-libre* linux-libre-4.14-version |
944 | linux-libre-4.14-source | |
945 | '("armhf-linux") | |
946 | #:defconfig "multi_v7_defconfig" | |
947 | #:extra-version "arm-generic")) | |
adbe6dea | 948 | |
f6948189 | 949 | (define-public linux-libre-arm-omap2plus |
1ad9c105 MW |
950 | (make-linux-libre* linux-libre-version |
951 | linux-libre-source | |
952 | '("armhf-linux") | |
953 | #:defconfig "omap2plus_defconfig" | |
954 | #:extra-version "arm-omap2plus")) | |
ff148ea5 MW |
955 | |
956 | (define-public linux-libre-arm-omap2plus-4.19 | |
1ad9c105 MW |
957 | (make-linux-libre* linux-libre-4.19-version |
958 | linux-libre-4.19-source | |
959 | '("armhf-linux") | |
960 | #:defconfig "omap2plus_defconfig" | |
961 | #:extra-version "arm-omap2plus")) | |
f6948189 | 962 | |
adbe6dea | 963 | (define-public linux-libre-arm-omap2plus-4.14 |
1ad9c105 MW |
964 | (make-linux-libre* linux-libre-4.14-version |
965 | linux-libre-4.14-source | |
966 | '("armhf-linux") | |
967 | #:defconfig "omap2plus_defconfig" | |
968 | #:extra-version "arm-omap2plus")) | |
adbe6dea | 969 | |
058e96c5 VC |
970 | (define-public linux-libre-arm64-generic |
971 | (make-linux-libre* linux-libre-version | |
972 | linux-libre-source | |
973 | '("aarch64-linux") | |
974 | #:defconfig "defconfig" | |
6978df6a | 975 | #:extra-version "arm64-generic" |
2d4c25f0 VC |
976 | #:extra-options |
977 | (append | |
978 | `(;; needed to fix the RTC on rockchip platforms | |
979 | ("CONFIG_RTC_DRV_RK808" . #t)) | |
980 | %default-extra-linux-options))) | |
981 | ||
611d45f6 VC |
982 | (define-public linux-libre-arm64-generic-5.4 |
983 | (make-linux-libre* linux-libre-5.4-version | |
984 | linux-libre-5.4-source | |
985 | '("aarch64-linux") | |
986 | #:defconfig "defconfig" | |
987 | #:extra-version "arm64-generic" | |
988 | #:extra-options | |
989 | (append | |
990 | `(;; needed to fix the RTC on rockchip platforms | |
991 | ("CONFIG_RTC_DRV_RK808" . #t)) | |
992 | %default-extra-linux-options))) | |
993 | ||
b3d25e21 VC |
994 | (define-public linux-libre-riscv64-generic |
995 | (make-linux-libre* linux-libre-version | |
996 | linux-libre-source | |
997 | '("riscv64-linux") | |
998 | #:extra-version "riscv64-generic")) | |
999 | ||
78410b09 JS |
1000 | (define-public linux-libre-with-bpf |
1001 | (let ((base-linux-libre | |
1002 | (make-linux-libre* | |
1003 | linux-libre-5.4-version | |
1004 | linux-libre-5.4-source | |
1005 | '("x86_64-linux" "i686-linux" "armhf-linux" | |
1006 | "aarch64-linux" "riscv64-linux") | |
1007 | #:extra-version "bpf" | |
1008 | #:configuration-file kernel-config | |
1009 | #:extra-options | |
1010 | (append %bpf-extra-linux-options | |
1011 | %default-extra-linux-options)))) | |
1012 | (package | |
1013 | (inherit base-linux-libre) | |
1014 | (inputs `(("cpio" ,cpio) ,@(package-inputs base-linux-libre)))))) | |
1015 | ||
1016 | ||
e1f640db TGR |
1017 | \f |
1018 | ;;; | |
1019 | ;;; Linux kernel modules. | |
1020 | ;;; | |
1021 | ||
7bf28446 | 1022 | (define-public acpi-call-linux-module |
ae1cda76 TGR |
1023 | (let ((commit "70b9c80bd700e6a4d10797eaac9fd34b7e8cbd4a") |
1024 | (revision "0")) | |
1025 | (package | |
1026 | (name "acpi-call-linux-module") | |
1027 | (version (git-version "3.17" revision commit)) | |
1028 | (source | |
1029 | (origin | |
1030 | (method git-fetch) | |
1031 | (uri (git-reference | |
b0e7b699 | 1032 | (url "https://github.com/teleshoes/acpi_call") |
ae1cda76 TGR |
1033 | (commit commit))) |
1034 | (file-name (git-file-name name version)) | |
1035 | (sha256 | |
1036 | (base32 "09c1vw6vcrkqxbwhpgfgpj4d1grzn4qq6ka8pwwzm7cvm405xj7x")))) | |
1037 | (build-system linux-module-build-system) | |
1038 | (arguments | |
1039 | `(#:tests? #f ; no tests | |
1040 | #:phases | |
1041 | (modify-phases %standard-phases | |
1042 | (add-after 'install 'install-documentation | |
1043 | (lambda* (#:key outputs #:allow-other-keys) | |
1044 | (let* ((out (assoc-ref outputs "out")) | |
1045 | (doc (string-append out "/share/doc/" ,name "-" ,version))) | |
1046 | (for-each (lambda (file) | |
1047 | (let ((target (string-append doc "/" file))) | |
1048 | (mkdir-p (dirname target)) | |
1049 | (copy-recursively file target))) | |
1050 | (list "README.md" "examples")) | |
1051 | #t)))))) | |
1052 | (home-page "https://github.com/teleshoes/acpi_call") | |
1053 | (synopsis "Linux kernel module to perform ACPI method calls") | |
1054 | (description | |
1055 | "This simple Linux kernel module allows calls from user space to any | |
7bf28446 TGR |
1056 | @acronym{ACPI, Advanced Configuration and Power Interface} method provided by |
1057 | your computer's firmware, by writing to @file{/proc/acpi/call}. You can pass | |
44585a0e | 1058 | any number of parameters of types @code{ACPI_INTEGER}, @code{ACPI_STRING}, |
7bf28446 TGR |
1059 | and @code{ACPI_BUFFER}. |
1060 | ||
1061 | It grants direct and undocumented access to your hardware that may cause damage | |
1062 | and should be used with caution, especially on untested models.") | |
ae1cda76 | 1063 | (license license:gpl3+)))) ; see README.md (no licence headers) |
7bf28446 | 1064 | |
ce5af131 | 1065 | (define-public rtl8812au-aircrack-ng-linux-module |
44adf883 TGR |
1066 | (let ((commit "df2b8dfd8cb7d9f6cfeb55abaeab8a5372011fc9") |
1067 | (revision "1")) | |
ce5af131 TGR |
1068 | (package |
1069 | (name "rtl8812au-aircrack-ng-linux-module") | |
1070 | (version (git-version "5.6.4.2" revision commit)) | |
1071 | (source | |
1072 | (origin | |
1073 | (method git-fetch) | |
1074 | (uri (git-reference | |
b0e7b699 | 1075 | (url "https://github.com/aircrack-ng/rtl8812au") |
ce5af131 TGR |
1076 | (commit commit))) |
1077 | (file-name (git-file-name name version)) | |
1078 | (sha256 | |
44adf883 | 1079 | (base32 "1qcr0j8yhg8l9l0f5y55zcsk1mgf3qd46yh9xfqgg91szxa3yvca")) |
ce5af131 TGR |
1080 | (modules '((guix build utils))) |
1081 | (snippet | |
1082 | '(begin | |
1083 | ;; Remove bundled tarballs, APKs, word lists, speadsheets, | |
1084 | ;; and other unnecessary unlicenced things. | |
1085 | (for-each delete-file-recursively (list "android" | |
1086 | "docs" | |
1087 | "tools")) | |
1088 | #t)))) | |
1089 | (build-system linux-module-build-system) | |
1090 | (arguments | |
de728cb8 TGR |
1091 | `(#:make-flags |
1092 | (list (string-append "KSRC=" | |
1093 | (assoc-ref %build-inputs "linux-module-builder") | |
1094 | "/lib/modules/build")) | |
1095 | #:phases | |
ce5af131 TGR |
1096 | (modify-phases %standard-phases |
1097 | (replace 'build | |
de728cb8 TGR |
1098 | (lambda* (#:key (make-flags '()) #:allow-other-keys) |
1099 | (apply invoke "make" make-flags)))) | |
ce5af131 TGR |
1100 | #:tests? #f)) ; no test suite |
1101 | (supported-systems '("x86_64-linux" "i686-linux")) | |
1102 | (home-page "https://github.com/aircrack-ng/rtl8812au") | |
1103 | (synopsis "Linux driver for Realtek USB wireless network adapters") | |
1104 | (description | |
1105 | "This is Realtek's rtl8812au Linux driver for USB 802.11n wireless | |
1106 | network adapters, modified by the aircrack-ng project to support monitor mode | |
1107 | and frame injection. It provides a @code{88XXau} kernel module that supports | |
1108 | RTL8812AU, RTL8821AU, and RTL8814AU chips.") | |
1109 | (license license:gpl2+)))) | |
1110 | ||
f3b075a0 MR |
1111 | (define-public rtl8821ce-linux-module |
1112 | (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea") | |
1113 | (revision "0")) | |
1114 | (package | |
1115 | (name "rtl8821ce-linux-module") | |
1116 | (version (git-version "0.0.0" revision commit)) | |
1117 | (source | |
1118 | (origin | |
1119 | (method git-fetch) | |
1120 | (uri (git-reference | |
b0e7b699 | 1121 | (url "https://github.com/tomaspinho/rtl8821ce") |
f3b075a0 MR |
1122 | (commit commit))) |
1123 | (file-name (git-file-name name version)) | |
1124 | (sha256 | |
1125 | (base32 | |
1126 | "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s")))) | |
1127 | (build-system linux-module-build-system) | |
1128 | (arguments | |
d1fe14be TGR |
1129 | `(#:make-flags |
1130 | (list "CC=gcc" | |
1131 | (string-append "KSRC=" | |
1132 | (assoc-ref %build-inputs "linux-module-builder") | |
1133 | "/lib/modules/build")) | |
1134 | #:phases | |
f3b075a0 MR |
1135 | (modify-phases %standard-phases |
1136 | (replace 'build | |
d1fe14be TGR |
1137 | (lambda* (#:key (make-flags '()) #:allow-other-keys) |
1138 | (apply invoke "make" make-flags)))) | |
1139 | #:tests? #f)) ; no test suite | |
f3b075a0 MR |
1140 | (home-page "https://github.com/tomaspinho/rtl8821ce") |
1141 | (synopsis "Linux driver for Realtek RTL8821CE wireless network adapters") | |
1142 | (description "This is Realtek's RTL8821CE Linux driver for wireless | |
1143 | network adapters.") | |
1144 | (license license:gpl2)))) | |
1145 | ||
b40a36ba MW |
1146 | (define-public vhba-module |
1147 | (package | |
1148 | (name "vhba-module") | |
0847e479 | 1149 | (version "20200106") |
b40a36ba MW |
1150 | (source (origin |
1151 | (method url-fetch) | |
1152 | (uri (string-append | |
1153 | "http://downloads.sourceforge.net/cdemu/vhba-module/vhba-module-" | |
1154 | version ".tar.bz2")) | |
1155 | (sha256 | |
1156 | (base32 | |
0847e479 | 1157 | "10rlvsfj0fw6n0qmwcnvhimqnsnhi7n55lyl7fq1pkwggf5218sr")))) |
b40a36ba MW |
1158 | (build-system linux-module-build-system) |
1159 | (arguments | |
1160 | ;; TODO: No tests? | |
1161 | `(#:tests? #f)) | |
1162 | (home-page "https://cdemu.sourceforge.io/") | |
1163 | (synopsis "Kernel module that emulates SCSI devices") | |
1164 | (description "VHBA module provides a Virtual (SCSI) HBA, which is the link | |
1165 | between the CDemu userspace daemon and linux kernel.") | |
1166 | (license license:gpl2+))) | |
1167 | ||
cc62eab1 PN |
1168 | (define-public bbswitch-module |
1169 | (package | |
1170 | (name "bbswitch-module") | |
1171 | (version "0.8") | |
1172 | (source (origin | |
1173 | (method git-fetch) | |
1174 | (uri (git-reference | |
1175 | (url "https://github.com/Bumblebee-Project/bbswitch") | |
1176 | (commit (string-append "v" version)))) | |
1177 | (file-name (git-file-name name version)) | |
1178 | (sha256 | |
1179 | (base32 | |
1180 | "1glch4j0x1dzlp2yrb67v2r5jg9609jb6p8m251y78m74advqw0l")))) | |
1181 | (build-system linux-module-build-system) | |
1182 | (arguments | |
1183 | ;; No tests. | |
1184 | `(#:tests? #f)) | |
1185 | (home-page "https://github.com/Bumblebee-Project/bbswitch") | |
1186 | (synopsis "Kernel module that disables discrete Nvidia graphics cards") | |
1187 | (description "The bbswitch module provides a way to toggle the Nvidia | |
1188 | graphics card on Optimus laptops.") | |
1189 | (license license:gpl2))) | |
1190 | ||
7eea1de7 BW |
1191 | (define-public ddcci-driver-linux |
1192 | (package | |
1193 | (name "ddcci-driver-linux") | |
1194 | (version "0.3.3") | |
1195 | (source | |
1196 | (origin | |
1197 | (method git-fetch) | |
1198 | (uri | |
1199 | (git-reference | |
1200 | (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git") | |
1201 | (commit (string-append "v" version)))) | |
1202 | (file-name (git-file-name name version)) | |
1203 | (sha256 | |
1204 | (base32 | |
1205 | "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f")))) | |
1206 | (build-system linux-module-build-system) | |
1207 | (arguments | |
1208 | `(#:tests? #f ; no tests | |
1209 | #:phases | |
1210 | (modify-phases %standard-phases | |
1211 | (replace 'build | |
1212 | (lambda args | |
1213 | (for-each | |
1214 | (lambda (module) | |
1215 | (with-directory-excursion module | |
1216 | (apply (assoc-ref %standard-phases 'build) args))) | |
1217 | '("ddcci" "ddcci-backlight")) | |
1218 | #t)) | |
1219 | (replace 'install | |
1220 | (lambda args | |
1221 | (for-each | |
1222 | (lambda (module) | |
1223 | (with-directory-excursion module | |
1224 | (apply (assoc-ref %standard-phases 'install) args))) | |
1225 | '("ddcci" "ddcci-backlight")) | |
1226 | #t))))) | |
1227 | (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux") | |
1228 | (synopsis "Pair of Linux kernel drivers for DDC/CI monitors") | |
1229 | (description "This package provides two Linux kernel drivers, ddcci and | |
1230 | ddcci-backlight, that allows the control of DDC/CI monitors through the sysfs | |
1231 | interface. The ddcci module creates a character device for each DDC/CI | |
1232 | monitors in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight | |
1233 | module allows the control of the backlight level or luminance property when | |
1234 | supported under @file{/sys/class/backlight/}.") | |
1235 | (license license:gpl2+))) | |
1236 | ||
1acf4c59 MS |
1237 | (define-public v4l2loopback-linux-module |
1238 | (package | |
1239 | (name "v4l2loopback-linux-module") | |
1240 | (version "0.12.5") | |
1241 | (source (origin | |
1242 | (method git-fetch) | |
1243 | (uri (git-reference | |
b0e7b699 | 1244 | (url "https://github.com/umlaeute/v4l2loopback") |
1acf4c59 MS |
1245 | (commit (string-append "v" version)))) |
1246 | (file-name (git-file-name name version)) | |
1247 | (sha256 | |
1248 | (base32 | |
1249 | "1qi4l6yam8nrlmc3zwkrz9vph0xsj1cgmkqci4652mbpbzigg7vn")))) | |
1250 | (build-system linux-module-build-system) | |
c34a7dc2 TGR |
1251 | (arguments |
1252 | `(#:tests? #f)) ; no test suite | |
1acf4c59 | 1253 | (home-page "https://github.com/umlaeute/v4l2loopback") |
ecb65812 TGR |
1254 | (synopsis "Linux kernel module to create virtual V4L2 video devices") |
1255 | (description | |
1256 | "This Linux module creates virtual video devices. @acronym{V4L2, Video | |
1257 | for Linux 2} applications will treat these as ordinary video devices but read | |
1258 | video data generated by another application, instead of a hardware device such | |
1259 | as a capture card. | |
1260 | ||
1261 | This lets you apply nifty effects to your Jitsi video, for example, but also | |
1262 | allows some more serious things like adding streaming capabilities to an | |
1263 | application by hooking GStreamer into the loopback device.") | |
1acf4c59 MS |
1264 | (license license:gpl2+))) |
1265 | ||
97121c2a | 1266 | \f |
c84d0eca LC |
1267 | ;;; |
1268 | ;;; Pluggable authentication modules (PAM). | |
1269 | ;;; | |
1270 | ||
fd76c904 LC |
1271 | (define-public linux-pam |
1272 | (package | |
1273 | (name "linux-pam") | |
eca24b2f | 1274 | (version "1.3.1") |
fd76c904 LC |
1275 | (source |
1276 | (origin | |
eca24b2f TGR |
1277 | (method url-fetch) |
1278 | (uri (string-append | |
1279 | "https://github.com/linux-pam/linux-pam/releases/download/v" | |
1280 | version "/Linux-PAM-" version ".tar.xz")) | |
1281 | (sha256 | |
1282 | (base32 | |
1283 | "1nyh9kdi3knhxcbv5v4snya0g3gff0m671lnvqcbygw3rm77mx7g")) | |
1284 | (patches (search-patches "linux-pam-no-setfsuid.patch")))) | |
411264c2 | 1285 | |
fd76c904 | 1286 | (build-system gnu-build-system) |
c4c4cc05 | 1287 | (native-inputs |
fd76c904 LC |
1288 | `(("flex" ,flex) |
1289 | ||
1290 | ;; TODO: optional dependencies | |
1291 | ;; ("libxcrypt" ,libxcrypt) | |
1292 | ;; ("cracklib" ,cracklib) | |
1293 | )) | |
1294 | (arguments | |
ed8111ea | 1295 | `(;; Most users, such as `shadow', expect the headers to be under |
c134056a LC |
1296 | ;; `security'. |
1297 | #:configure-flags (list (string-append "--includedir=" | |
1298 | (assoc-ref %outputs "out") | |
ed8111ea LC |
1299 | "/include/security") |
1300 | ||
1301 | ;; XXX: <rpc/rpc.h> is missing from glibc when | |
1302 | ;; cross-compiling, so we have to disable NIS | |
1303 | ;; support altogether. | |
1304 | ,@(if (%current-target-system) | |
1305 | '("--disable-nis") | |
1306 | '())) | |
c134056a LC |
1307 | |
1308 | ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d | |
1309 | ;; isn't available. | |
1310 | #:tests? #f)) | |
fd76c904 LC |
1311 | (home-page "http://www.linux-pam.org/") |
1312 | (synopsis "Pluggable authentication modules for Linux") | |
1313 | (description | |
1314 | "A *Free* project to implement OSF's RFC 86.0. | |
1315 | Pluggable authentication modules are small shared object files that can | |
1316 | be used through the PAM API to perform tasks, like authenticating a user | |
e881752c | 1317 | at login. Local and dynamic reconfiguration are its key features.") |
3ac73271 | 1318 | (license license:bsd-3))) |
686f14e8 | 1319 | |
4c93ce42 EF |
1320 | (define-public linux-pam-1.2 |
1321 | (package | |
1322 | (inherit linux-pam) | |
4c93ce42 EF |
1323 | (version "1.2.1") |
1324 | (source | |
1325 | (origin | |
1326 | (method url-fetch) | |
1327 | (uri (string-append | |
1328 | "http://www.linux-pam.org/library/" | |
1329 | "Linux-PAM-" version ".tar.bz2")) | |
1330 | (sha256 | |
1331 | (base32 | |
411264c2 RS |
1332 | "1n9lnf9gjs72kbj1g354v1xhi2j27aqaah15vykh7cnkq08i4arl")) |
1333 | (patches (search-patches "linux-pam-no-setfsuid.patch")))))) | |
4c93ce42 | 1334 | |
e8f04331 EF |
1335 | (define-public python-pamela |
1336 | (package | |
1337 | (name "python-pamela") | |
1338 | (version "1.0.0") | |
1339 | (source | |
1340 | (origin | |
1341 | ;; Tests not distributed in pypi release. | |
1342 | (method git-fetch) | |
1343 | (uri (git-reference | |
1344 | (url "https://github.com/minrk/pamela.git") | |
1345 | (commit version))) | |
1346 | (file-name (git-file-name name version)) | |
1347 | (sha256 | |
1348 | (base32 | |
1349 | "0cg3w6np1fbjpvzhv54xg567hpf38szwp2d4gvzb9r736nxbv0vr")))) | |
1350 | (build-system python-build-system) | |
1351 | (arguments | |
1352 | '(#:tests? #f ; Test suite isn't designed to be run inside a container. | |
1353 | #:phases | |
1354 | (modify-phases %standard-phases | |
1355 | (add-after 'unpack 'hardcode-pam.so | |
1356 | (lambda* (#:key inputs #:allow-other-keys) | |
1357 | (let ((pam (assoc-ref inputs "linux-pam"))) | |
1358 | (substitute* "pamela.py" | |
1359 | (("find_library\\(\"pam\")") | |
1360 | (string-append "'" pam "/lib/libpam.so'"))) | |
1361 | #t))) | |
1362 | (replace 'check | |
1363 | (lambda* (#:key tests? #:allow-other-keys) | |
1364 | (if tests? | |
1365 | (if (file-exists? "test_pamela.py") | |
1366 | (invoke "py.test" "--assert=plain" "test_pamela.py") | |
1367 | (invoke "python" "-m" "pamela" "-a" "`whoami`")) | |
1368 | #t)))))) | |
1369 | (inputs | |
1370 | `(("linux-pam" ,linux-pam))) | |
1371 | (native-inputs | |
1372 | `(("python-pytest" ,python-pytest))) | |
1373 | (home-page "https://github.com/minrk/pamela") | |
1374 | (synopsis "PAM interface using ctypes") | |
1375 | (description "This package provides a PAM interface using @code{ctypes}.") | |
1376 | (license license:expat))) | |
1377 | ||
53142109 | 1378 | |
c84d0eca LC |
1379 | ;;; |
1380 | ;;; Miscellaneous. | |
1381 | ;;; | |
1382 | ||
510a8eb1 TGR |
1383 | (define-public powerstat |
1384 | (package | |
1385 | (name "powerstat") | |
1386 | (version "0.02.22") | |
1387 | (source | |
1388 | (origin | |
1389 | (method url-fetch) | |
1390 | (uri (string-append "https://kernel.ubuntu.com/~cking/tarballs/" | |
1391 | "powerstat/powerstat-" version ".tar.gz")) | |
1392 | (sha256 | |
1393 | (base32 "0r355b9syqa2nhfy8ksvxyy5d58v0isf983842js091s6liy0x7g")))) | |
1394 | (build-system gnu-build-system) | |
1395 | (arguments | |
1396 | `(#:make-flags | |
1ca44ae3 MB |
1397 | (list (string-append "CC=" ,(cc-for-target)) |
1398 | (string-append "prefix=" (assoc-ref %outputs "out"))) | |
510a8eb1 TGR |
1399 | #:tests? #f ; no test suite |
1400 | #:phases | |
1401 | (modify-phases %standard-phases | |
1402 | (add-after 'unpack 'respect-$prefix | |
1403 | ;; https://bugs.launchpad.net/ubuntu/+source/powerstat/+bug/1877744 | |
1404 | (lambda _ | |
1405 | (substitute* "Makefile" | |
1406 | (("DIR=/usr/") "DIR=$(prefix)/")) | |
1407 | #t)) | |
1408 | (delete 'configure)))) ; no configure script | |
1409 | (home-page "https://kernel.ubuntu.com/~cking/powerstat/") | |
1410 | (synopsis "Measure system power consumption") | |
1411 | (description | |
1412 | "Powerstat measures and reports your computer's power consumption in real | |
1413 | time. On mobile PCs, it uses ACPI battery information to measure the power | |
1414 | drain of the entire system. | |
1415 | ||
1416 | Powerstat can also report @acronym{RAPL, Running Average Power Limit} power | |
1417 | domain measurements. These are available only on some hardware such as Intel | |
1418 | Sandybridge and newer, and cover only part of the machine's components such as | |
1419 | CPU, DRAM, and graphics. However, they provide accurate and immediate readings | |
1420 | and don't require a battery at all. | |
1421 | ||
1422 | The output is like @command{vmstat} but also shows power consumption statistics: | |
1423 | at the end of a run, @command{powerstat} will calculate the average, standard | |
1424 | deviation, and minimum and maximum values. It can show a nice histogram too.") | |
1425 | (license license:gpl2))) | |
1426 | ||
686f14e8 LC |
1427 | (define-public psmisc |
1428 | (package | |
1429 | (name "psmisc") | |
bd88082d | 1430 | (version "23.3") |
686f14e8 LC |
1431 | (source |
1432 | (origin | |
1433 | (method url-fetch) | |
03113e31 | 1434 | (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-" |
f42846b2 | 1435 | version ".tar.xz")) |
686f14e8 | 1436 | (sha256 |
bd88082d | 1437 | (base32 "16i7qzjmm6g0lzha8yzpfrlcxnvkgh95hkq9gdjd4zmzb8d0wxa1")))) |
686f14e8 | 1438 | (build-system gnu-build-system) |
46429444 MO |
1439 | (arguments |
1440 | `(,@(if (%current-target-system) | |
1441 | '(#:configure-flags | |
1442 | (list | |
1443 | "ac_cv_func_malloc_0_nonnull=yes" | |
1444 | "ac_cv_func_realloc_0_nonnull=yes")) | |
1445 | '()))) | |
686f14e8 | 1446 | (inputs `(("ncurses" ,ncurses))) |
aa9c221f | 1447 | (home-page "https://gitlab.com/psmisc/psmisc") |
70a4fb6f | 1448 | (synopsis "Small utilities that use the proc file system") |
686f14e8 LC |
1449 | (description |
1450 | "This PSmisc package is a set of some small useful utilities that | |
8f65585b | 1451 | use the proc file system. We're not about changing the world, but |
686f14e8 | 1452 | providing the system administrator with some help in common tasks.") |
3ac73271 | 1453 | (license license:gpl2+))) |
02b80c3f NK |
1454 | |
1455 | (define-public util-linux | |
1456 | (package | |
1457 | (name "util-linux") | |
fef24361 | 1458 | (version "2.35.1") |
5a6a3ba4 LC |
1459 | (source (origin |
1460 | (method url-fetch) | |
1461 | (uri (string-append "mirror://kernel.org/linux/utils/" | |
80095bd3 TGR |
1462 | "util-linux/v" (version-major+minor version) "/" |
1463 | "util-linux-" version ".tar.xz")) | |
5a6a3ba4 LC |
1464 | (sha256 |
1465 | (base32 | |
fef24361 | 1466 | "1yfpy6bkab4jw61mpx48gfy24yrqp4a7arvpis8csrkk53fkxpnr")) |
ab0bdd54 | 1467 | (patches (search-patches "util-linux-tests.patch")) |
9d77da2a LC |
1468 | (modules '((guix build utils))) |
1469 | (snippet | |
0223db58 MB |
1470 | ;; We take 'nologin' from Shadow, the 'logger' program from |
1471 | ;; GNU Inetutils and 'kill' from GNU Coreutils. | |
8338c241 MW |
1472 | '(begin |
1473 | (substitute* "configure" | |
0223db58 | 1474 | (("build_nologin=yes") "build_nologin=no") |
8338c241 MW |
1475 | (("build_logger=yes") "build_logger=no") |
1476 | (("build_kill=yes") "build_kill=no")) | |
1477 | #t)))) | |
02b80c3f | 1478 | (build-system gnu-build-system) |
bb93042c MB |
1479 | (outputs '("out" ;6.4 MiB executables and documentation |
1480 | "lib" ;8.8 MiB shared libraries, headers and locales | |
1481 | "static")) ;2.9 MiB static .a libraries | |
02b80c3f | 1482 | (arguments |
29ec55ee | 1483 | `(#:configure-flags (list "--disable-use-tty-group" |
d9804e50 | 1484 | "--enable-fs-paths-default=/run/current-system/profile/sbin" |
db9107b9 EF |
1485 | ;; Don't try to chown root:root mount and umount |
1486 | "--disable-makeinstall-chown" | |
bb93042c MB |
1487 | "--localstatedir=/var" |
1488 | (string-append "--localedir=" | |
1489 | (assoc-ref %outputs "lib") | |
1490 | "/share/locale") | |
29ec55ee LC |
1491 | ;; Install completions where our |
1492 | ;; bash-completion package expects them. | |
1493 | (string-append "--with-bashcompletiondir=" | |
1494 | (assoc-ref %outputs "out") | |
1495 | "/etc/bash_completion.d")) | |
1b9cf4ad | 1496 | #:phases (modify-phases %standard-phases |
bb93042c MB |
1497 | (add-before 'configure 'patch-build-scripts |
1498 | (lambda* (#:key outputs #:allow-other-keys) | |
1499 | (substitute* "configure" | |
1500 | ;; The build system assumes that we want to install | |
1501 | ;; libraries below $exec_prefix when $libdir does not | |
1502 | ;; match any of the "usual" locations. Fix that. | |
1503 | (("usrlib_execdir='\\$\\{exec_prefix\\}'\\$libdir") | |
1504 | "usrlib_execdir=$libdir")) | |
1505 | #t)) | |
a4a70cc4 MB |
1506 | (add-before 'build 'set-umount-file-name |
1507 | (lambda* (#:key outputs #:allow-other-keys) | |
1508 | ;; Tell 'eject' the right file name of 'umount'. | |
1509 | (let ((out (assoc-ref outputs "out"))) | |
1510 | (substitute* "sys-utils/eject.c" | |
1511 | (("\"/bin/umount\"") | |
1512 | (string-append "\"" out "/bin/umount\""))) | |
1513 | #t))) | |
1514 | (add-before 'check 'pre-check | |
1515 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1516 | (let ((out (assoc-ref outputs "out")) | |
1517 | (net (assoc-ref inputs "net-base"))) | |
1518 | ;; Change the test to refer to the right file. | |
1519 | (substitute* "tests/ts/misc/mcookie" | |
1520 | (("/etc/services") | |
1521 | (string-append net "/etc/services"))) | |
f69a22ac MB |
1522 | |
1523 | ;; The C.UTF-8 locale does not exist in our libc. | |
1524 | (substitute* "tests/ts/column/invalid-multibyte" | |
1525 | (("C\\.UTF-8") "en_US.utf8")) | |
a4a70cc4 | 1526 | #t))) |
3e902bbb MB |
1527 | ;; TODO: Remove the conditional on the next rebuild cycle. |
1528 | ,@(if (string-prefix? "arm" (%current-system)) | |
1529 | '((add-before 'check 'disable-setarch-test | |
1530 | (lambda _ | |
1531 | ;; The setarch tests are unreliable in QEMU's | |
1532 | ;; user-mode emulation, which is our primary | |
1533 | ;; method of building ARMv7 packages. | |
1534 | ;; <https://github.com/karelzak/util-linux/issues/601> | |
1535 | (substitute* "tests/ts/misc/setarch" | |
1536 | (("ts_init_subtest.*" all) | |
1537 | (string-append | |
1538 | all "\n" | |
1539 | "ts_skip \"setarch tests are unreliable under QEMU\""))) | |
1540 | #t))) | |
1541 | '()) | |
a4a70cc4 MB |
1542 | (add-after 'install 'move-static-libraries |
1543 | (lambda* (#:key outputs #:allow-other-keys) | |
bb93042c | 1544 | (let ((lib (assoc-ref outputs "lib")) |
a4a70cc4 | 1545 | (static (assoc-ref outputs "static"))) |
bb93042c MB |
1546 | |
1547 | ;; Move static libraries to the "static" output. | |
a4a70cc4 | 1548 | (mkdir-p (string-append static "/lib")) |
bb93042c | 1549 | (with-directory-excursion lib |
a4a70cc4 MB |
1550 | (for-each (lambda (file) |
1551 | (rename-file file | |
1552 | (string-append static "/" | |
1553 | file))) | |
1554 | (find-files "lib" "\\.a$")) | |
1555 | ||
1556 | ;; Remove references to the static library from the '.la' | |
1557 | ;; files so that Libtool does the right thing when both | |
1558 | ;; the shared and static library is available. | |
1559 | (substitute* (find-files "lib" "\\.la$") | |
1560 | (("old_library=.*") "old_library=''\n"))) | |
1561 | ||
bb93042c MB |
1562 | #t))) |
1563 | (add-after 'install 'adjust-pkg-config-files | |
1564 | (lambda* (#:key outputs #:allow-other-keys) | |
1565 | (let ((lib (assoc-ref outputs "lib"))) | |
1566 | ;; Drop the unused "prefix=" and "exec_prefix=" variables from | |
1567 | ;; the pkg-config files to avoid a cyclic reference on "out". | |
1568 | (substitute* (find-files (string-append lib "/lib/pkgconfig") | |
1569 | "\\.pc$") | |
1570 | (("^(exec_)?prefix=.*") ""))) | |
1571 | #t))))) | |
f61e0e79 | 1572 | (inputs `(("zlib" ,zlib) |
ba4aca3a LC |
1573 | ("ncurses" ,ncurses) |
1574 | ||
1575 | ;; XXX: This is so that the 'pre-check' phase can find it. | |
1576 | ,@(if (%current-target-system) | |
1577 | `(("net-base" ,net-base)) | |
1578 | '()))) | |
c4c4cc05 | 1579 | (native-inputs |
9f533d60 | 1580 | `(("perl" ,perl) |
a4a70cc4 | 1581 | ("net-base" ,net-base))) ;for tests |
02b80c3f | 1582 | (home-page "https://www.kernel.org/pub/linux/utils/util-linux/") |
35ec07c7 | 1583 | (synopsis "Collection of utilities for the Linux kernel") |
437d7286 | 1584 | (description "Util-linux is a diverse collection of Linux kernel |
8f65585b | 1585 | utilities. It provides dmesg and includes tools for working with file systems, |
437d7286 | 1586 | block devices, UUIDs, TTYs, and many other tools.") |
fe8ccfcc | 1587 | |
02b80c3f | 1588 | ;; Note that util-linux doesn't use the same license for all the |
fe8ccfcc | 1589 | ;; code. GPLv2+ is the default license for a code without an |
02b80c3f | 1590 | ;; explicitly defined license. |
3ac73271 LC |
1591 | (license (list license:gpl3+ license:gpl2+ license:gpl2 license:lgpl2.0+ |
1592 | license:bsd-4 license:public-domain)))) | |
5d5c4278 | 1593 | |
71e0f1e9 MB |
1594 | ;; util-linux optionally supports udev, which allows lsblk to read file system |
1595 | ;; metadata without special privileges. Add it as a separate package to avoid | |
1596 | ;; a circular dependency, and to keep the size small. | |
1597 | (define-public util-linux+udev | |
1598 | (package/inherit | |
1599 | util-linux | |
60a366ec | 1600 | (name "util-linux-with-udev") |
71e0f1e9 MB |
1601 | (inputs |
1602 | `(("udev" ,eudev) | |
60a366ec | 1603 | ,@(package-inputs util-linux))))) |
71e0f1e9 | 1604 | |
3116c8b5 | 1605 | (define-public ddate |
1606 | (package | |
1607 | (name "ddate") | |
1608 | (version "0.2.2") | |
1609 | (source (origin | |
eb4cfec2 EF |
1610 | (method git-fetch) |
1611 | (uri (git-reference | |
1612 | (url "https://github.com/bo0ts/ddate") | |
1613 | (commit (string-append "v" version)))) | |
1614 | (file-name (git-file-name name version)) | |
3116c8b5 | 1615 | (sha256 |
eb4cfec2 | 1616 | (base32 "1qchxnxvghbma6gp1g78wnjxsri0b72ha9axyk31cplssl7yn73f")))) |
3116c8b5 | 1617 | (build-system cmake-build-system) |
1618 | (arguments '(#:tests? #f)) | |
1619 | (home-page "https://github.com/bo0ts/ddate") | |
1620 | (synopsis "PERPETUAL DATE CONVERTER FROM GREGORIAN TO POEE CALENDAR") | |
1621 | (description | |
1622 | "ddate displays the Discordian date and holidays of a given date. | |
1623 | The Discordian calendar was made popular by the \"Illuminatus!\" trilogy | |
1624 | by Robert Shea and Robert Anton Wilson.") | |
1625 | (license license:public-domain))) | |
1626 | ||
96636e49 TGR |
1627 | (define-public fbset |
1628 | (package | |
1629 | (name "fbset") | |
1630 | (version "2.1") | |
1631 | (source | |
1632 | (origin | |
1633 | (method url-fetch) | |
1634 | (uri (string-append "http://users.telenet.be/geertu/Linux/fbdev/fbset-" | |
1635 | version ".tar.gz")) | |
1636 | (sha256 | |
1637 | (base32 "080wnisi0jq7dp0jcwdp83rq8q8s3kw41vc712516xbv4jq4mzs0")))) | |
1638 | (build-system gnu-build-system) | |
1639 | (arguments | |
1640 | '(#:modules ((guix build gnu-build-system) | |
1641 | (guix build utils) | |
1642 | (srfi srfi-26)) | |
1643 | #:phases | |
1644 | (modify-phases %standard-phases | |
1645 | (delete 'configure) ; no configure script | |
1646 | (add-before 'install 'pre-install | |
1647 | (lambda* (#:key outputs #:allow-other-keys) | |
1648 | (let ((out (assoc-ref outputs "out"))) | |
1649 | (substitute* "Makefile" | |
1650 | (("mknod ") "true ") | |
1651 | ;; The Makefile doesn't honour PREFIX or similar. | |
1652 | (("/usr") out)) | |
1653 | (mkdir out) | |
1654 | (with-directory-excursion out | |
1655 | (for-each mkdir-p (list "sbin" | |
1656 | "man/man5" | |
1657 | "man/man8"))) | |
1658 | #t))) | |
1659 | (add-after 'install 'install-fb.modes | |
1660 | (lambda* (#:key outputs #:allow-other-keys) | |
1661 | (let* ((out (assoc-ref outputs "out")) | |
1662 | (etc (string-append out "/etc"))) | |
1663 | (for-each (cut install-file <> etc) | |
1664 | (find-files "etc" "^fb\\.modes")) | |
1665 | (symlink "fb.modes.ATI" | |
1666 | (string-append etc "/fb.modes")) | |
1667 | #t)))) | |
1668 | ;; Parallel building races to create modes.tab.c. | |
1669 | #:parallel-build? #f | |
1670 | #:tests? #f)) ; no test suite | |
1671 | (native-inputs | |
1672 | `(("bison" ,bison) | |
1673 | ("flex" ,flex))) | |
1674 | (home-page "http://users.telenet.be/geertu/Linux/fbdev/") | |
1675 | (synopsis "Show and modify Linux frame buffer settings") | |
1676 | (description | |
1677 | "The kernel Linux's @dfn{frame buffers} provide a simple interface to | |
1678 | different kinds of graphic displays. The @command{fbset} utility can query and | |
1679 | change various device settings such as depth, virtual resolution, and timing | |
1680 | parameters.") | |
1681 | (license license:gpl2))) | |
1682 | ||
e47e3eff LC |
1683 | (define-public procps |
1684 | (package | |
1685 | (name "procps") | |
89a6d2d1 | 1686 | (version "3.3.16") |
e47e3eff | 1687 | (source (origin |
0cc22848 SB |
1688 | (method url-fetch) |
1689 | (uri (string-append "mirror://sourceforge/procps-ng/Production/" | |
1690 | "procps-ng-" version ".tar.xz")) | |
1691 | (sha256 | |
1692 | (base32 | |
89a6d2d1 | 1693 | "1br0g93ysqhlv13i1k4lfbimsgxnpy5rgs4lxfc9rkzdbpbaqplj")))) |
e47e3eff | 1694 | (build-system gnu-build-system) |
e47e3eff | 1695 | (arguments |
f0d5ce5a | 1696 | `(#:modules ((guix build utils) |
80393eed LC |
1697 | (guix build gnu-build-system) |
1698 | (srfi srfi-1) | |
1699 | (srfi srfi-26)) | |
f0d5ce5a MO |
1700 | ,@(if (%current-target-system) |
1701 | '(#:configure-flags | |
1702 | (list | |
1703 | "ac_cv_func_malloc_0_nonnull=yes" | |
1704 | "ac_cv_func_realloc_0_nonnull=yes")) | |
1705 | '()) | |
0cc22848 SB |
1706 | #:phases |
1707 | (modify-phases %standard-phases | |
1708 | (add-after | |
1709 | 'install 'post-install | |
1710 | ;; Remove commands and man pages redudant with | |
1711 | ;; Coreutils. | |
1712 | (lambda* (#:key outputs #:allow-other-keys) | |
1713 | (let* ((out (assoc-ref outputs "out")) | |
1714 | (dup (append-map (cut find-files out <>) | |
1715 | '("^kill" "^uptime")))) | |
1716 | (for-each delete-file dup) | |
1717 | #t)))))) | |
1718 | (inputs `(("ncurses" ,ncurses))) | |
1719 | (home-page "https://gitlab.com/procps-ng/procps/") | |
35ec07c7 | 1720 | (synopsis "Utilities that give information about processes") |
e47e3eff | 1721 | (description |
35b9e423 | 1722 | "Procps is the package that has a bunch of small useful utilities |
e47e3eff LC |
1723 | that give information about processes using the Linux /proc file system. |
1724 | The package includes the programs ps, top, vmstat, w, kill, free, | |
1725 | slabtop, and skill.") | |
3ac73271 | 1726 | (license license:gpl2))) |
e47e3eff | 1727 | |
5d5c4278 NK |
1728 | (define-public usbutils |
1729 | (package | |
1730 | (name "usbutils") | |
5b266358 | 1731 | (version "012") |
5d5c4278 NK |
1732 | (source |
1733 | (origin | |
1734 | (method url-fetch) | |
1735 | (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/" | |
1736 | "usbutils-" version ".tar.xz")) | |
1737 | (sha256 | |
5b266358 | 1738 | (base32 "0iiy0q7fzikavmdsjsb0sl9kp3gfh701qwyjjccvqh0qz4jlcqw8")))) |
5d5c4278 | 1739 | (build-system gnu-build-system) |
429a38a0 | 1740 | (outputs (list "out" "python")) |
5b266358 TGR |
1741 | (arguments |
1742 | `(#:phases | |
1743 | (modify-phases %standard-phases | |
1744 | (add-before 'bootstrap 'patch-bootstrap-scripts | |
1745 | (lambda _ | |
1746 | (substitute* "usbhid-dump/bootstrap" | |
1747 | (("/bin/bash") (which "bash"))) | |
1748 | ||
1749 | ;; Don't let autogen.sh run configure with bogus options & CFLAGS. | |
1750 | (substitute* "autogen.sh" | |
1751 | (("^\\./configure.*") "")) | |
429a38a0 TGR |
1752 | #t)) |
1753 | (add-after 'install 'separate-python-output | |
1754 | ;; Separating one Python script shaves more than 106 MiB from :out. | |
1755 | (lambda* (#:key outputs #:allow-other-keys) | |
1756 | (let ((out (assoc-ref outputs "out")) | |
1757 | (out:python (assoc-ref outputs "python"))) | |
1758 | (for-each (lambda (file) | |
1759 | (let ((old (string-append out "/" file)) | |
1760 | (new (string-append out:python "/" file))) | |
1761 | (mkdir-p (dirname new)) | |
1762 | (rename-file old new))) | |
1763 | (list "bin/lsusb.py")) | |
1764 | #t)))))) | |
5d5c4278 | 1765 | (inputs |
a6592732 TGR |
1766 | `(("eudev" ,eudev) |
1767 | ("libusb" ,libusb) | |
1768 | ("python" ,python))) | |
c4c4cc05 | 1769 | (native-inputs |
5b266358 TGR |
1770 | `(("autoconf" ,autoconf) |
1771 | ("automake" ,automake) | |
1772 | ("libtool" ,libtool) | |
1773 | ("pkg-config" ,pkg-config))) | |
5d5c4278 NK |
1774 | (home-page "http://www.linux-usb.org/") |
1775 | (synopsis | |
1776 | "Tools for working with USB devices, such as lsusb") | |
1777 | (description | |
1778 | "Tools for working with USB devices, such as lsusb.") | |
3ac73271 | 1779 | (license license:gpl2+))) |
0750452a LC |
1780 | |
1781 | (define-public e2fsprogs | |
1782 | (package | |
1783 | (name "e2fsprogs") | |
5687fdb7 | 1784 | (version "1.45.6") |
0750452a LC |
1785 | (source (origin |
1786 | (method url-fetch) | |
7409c8d4 MW |
1787 | (uri (string-append |
1788 | "mirror://kernel.org/linux/kernel/people/tytso/" | |
5687fdb7 TGR |
1789 | "e2fsprogs/v" version "/" |
1790 | "e2fsprogs-" version ".tar.xz")) | |
0750452a LC |
1791 | (sha256 |
1792 | (base32 | |
5687fdb7 | 1793 | "0mj2yizwygs7xww8jfy5mxjn8ww4pvc0b1hg1p2vsnirailsx9zz")))) |
0750452a | 1794 | (build-system gnu-build-system) |
bb93042c | 1795 | (inputs `(("util-linux" ,util-linux "lib"))) |
f57d2639 | 1796 | (native-inputs `(("pkg-config" ,pkg-config) |
75f796bb MB |
1797 | ("texinfo" ,texinfo) ;for the libext2fs Info manual |
1798 | ||
1799 | ;; For tests. | |
1800 | ("perl" ,perl) | |
1801 | ("procps" ,procps))) | |
0750452a | 1802 | (arguments |
b047a86b | 1803 | '(;; util-linux is the preferred source for some of the libraries and |
c44ed26c | 1804 | ;; commands, so disable them (see, e.g., |
a124bbd2 | 1805 | ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b33633>.) |
b047a86b MB |
1806 | #:configure-flags (list "--disable-libblkid" |
1807 | "--disable-libuuid" "--disable-uuidd" | |
1808 | "--disable-fsck" | |
7c594a2c | 1809 | |
b047a86b MB |
1810 | ;; Use symlinks instead of hard links for |
1811 | ;; 'fsck.extN' etc. This makes the resulting nar | |
1812 | ;; smaller and is preserved across copies. | |
1813 | "--enable-symlink-install" | |
74d21291 | 1814 | |
b047a86b MB |
1815 | (string-append "LDFLAGS=-Wl,-rpath=" |
1816 | (assoc-ref %outputs "out") | |
1817 | "/lib") | |
7c594a2c | 1818 | |
b047a86b MB |
1819 | ;; Install libext2fs et al. |
1820 | "--enable-elf-shlibs") | |
ddfc2fd8 | 1821 | |
55acb372 MB |
1822 | #:phases |
1823 | (modify-phases %standard-phases | |
1824 | (add-before 'configure 'patch-shells | |
1825 | (lambda _ | |
1826 | (substitute* "configure" | |
1827 | (("/bin/sh (.*)parse-types.sh" _ dir) | |
1828 | (string-append (which "sh") " " dir | |
1829 | "parse-types.sh"))) | |
b047a86b MB |
1830 | (substitute* "MCONFIG.in" |
1831 | (("INSTALL_SYMLINK = /bin/sh") | |
1832 | "INSTALL_SYMLINK = sh")) | |
55acb372 MB |
1833 | (substitute* (find-files "." "^Makefile.in$") |
1834 | (("#!/bin/sh") | |
1835 | (string-append "#!" (which "sh")))) | |
1836 | #t)) | |
1837 | (add-after 'install 'install-libs | |
1838 | (lambda* (#:key outputs #:allow-other-keys) | |
1839 | (let* ((out (assoc-ref outputs "out")) | |
1840 | (lib (string-append out "/lib"))) | |
b132ad3a MW |
1841 | (invoke "make" "install-libs") |
1842 | ||
1843 | ;; Make the .a writable so that 'strip' works. | |
1844 | ;; Failing to do that, due to debug symbols, we | |
1845 | ;; retain a reference to the final | |
1846 | ;; linux-libre-headers, which refer to the | |
1847 | ;; bootstrap binaries. | |
1848 | (let ((archives (find-files lib "\\.a$"))) | |
1849 | (for-each (lambda (file) | |
1850 | (chmod file #o666)) | |
1851 | archives)) | |
1852 | #t)))))) | |
0750452a | 1853 | (home-page "http://e2fsprogs.sourceforge.net/") |
35ec07c7 | 1854 | (synopsis "Creating and checking ext2/ext3/ext4 file systems") |
0750452a LC |
1855 | (description |
1856 | "This package provides tools for manipulating ext2/ext3/ext4 file systems.") | |
3ac73271 LC |
1857 | (license (list license:gpl2 ;programs |
1858 | license:lgpl2.0 ;libext2fs | |
1859 | license:x11)))) ;libuuid | |
d8482ad0 | 1860 | |
e48977e7 LC |
1861 | (define e2fsprogs/static |
1862 | (static-package | |
1863 | (package (inherit e2fsprogs) | |
1864 | (arguments | |
1865 | ;; Do not build shared libraries. | |
1866 | (substitute-keyword-arguments (package-arguments e2fsprogs) | |
1867 | ((#:configure-flags _) | |
1868 | '(list "--disable-blkid")) | |
1869 | ((#:make-flags _) | |
1870 | '(list))))))) | |
1871 | ||
e102f940 LC |
1872 | (define-public e2fsck/static |
1873 | (package | |
1874 | (name "e2fsck-static") | |
0997771a | 1875 | (version (package-version e2fsprogs)) |
e102f940 LC |
1876 | (build-system trivial-build-system) |
1877 | (source #f) | |
313880c7 DC |
1878 | (inputs |
1879 | `(("e2fsprogs" ,e2fsprogs/static))) | |
e102f940 LC |
1880 | (arguments |
1881 | `(#:modules ((guix build utils)) | |
1882 | #:builder | |
1883 | (begin | |
1884 | (use-modules (guix build utils) | |
1885 | (ice-9 ftw) | |
1886 | (srfi srfi-26)) | |
1887 | ||
313880c7 DC |
1888 | (let ((e2fsck (string-append (assoc-ref %build-inputs "e2fsprogs") |
1889 | "/sbin/e2fsck")) | |
e102f940 LC |
1890 | (bin (string-append (assoc-ref %outputs "out") "/sbin"))) |
1891 | (mkdir-p bin) | |
1892 | (with-directory-excursion bin | |
313880c7 DC |
1893 | (copy-file e2fsck "e2fsck") |
1894 | (remove-store-references "e2fsck") | |
e3cfef22 MW |
1895 | (chmod "e2fsck" #o555)) |
1896 | #t)))) | |
0997771a | 1897 | (home-page (package-home-page e2fsprogs)) |
313880c7 DC |
1898 | (synopsis "Statically-linked e2fsck command from e2fsprogs") |
1899 | (description "This package provides statically-linked e2fsck command taken | |
1900 | from the e2fsprogs package. It is meant to be used in initrds.") | |
0997771a | 1901 | (license (package-license e2fsprogs)))) |
e102f940 | 1902 | |
7c0a9104 LC |
1903 | (define-public extundelete |
1904 | (package | |
1905 | (name "extundelete") | |
1906 | (version "0.2.4") | |
76c888cb TGR |
1907 | (source |
1908 | (origin | |
1909 | (method url-fetch) | |
1910 | (uri (string-append "mirror://sourceforge/extundelete/" | |
1911 | "extundelete/" version "/extundelete-" | |
1912 | version ".tar.bz2")) | |
1913 | (sha256 | |
1914 | (base32 | |
1915 | "1x0r7ylxlp9lbj3d7sqf6j2a222dwy2nfpff05jd6mkh4ihxvyd1")) | |
1916 | (patches (search-patches "extundelete-e2fsprogs-1.44.patch")))) | |
7c0a9104 LC |
1917 | (build-system gnu-build-system) |
1918 | (inputs `(("e2fsprogs" ,e2fsprogs))) | |
1919 | (home-page "http://extundelete.sourceforge.net/") | |
1920 | (synopsis "Recover deleted files from ext2/3/4 partitions") | |
1921 | (description | |
1922 | "Extundelete is a set of tools that can recover deleted files from an | |
1923 | ext3 or ext4 partition.") | |
3ac73271 | 1924 | (license license:gpl2))) |
7c0a9104 | 1925 | |
1c975f60 LC |
1926 | (define-public zerofree |
1927 | (package | |
1928 | (name "zerofree") | |
5658b4ce | 1929 | (version "1.1.1") |
30ac4cc7 | 1930 | (home-page "https://frippery.org/uml/") |
1c975f60 LC |
1931 | (source (origin |
1932 | (method url-fetch) | |
1933 | (uri (string-append home-page name "-" version | |
1934 | ".tgz")) | |
1935 | (sha256 | |
1936 | (base32 | |
5658b4ce | 1937 | "0rrqfa5z103ws89vi8kfvbks1cfs74ix6n1wb6vs582vnmhwhswm")))) |
1c975f60 LC |
1938 | (build-system gnu-build-system) |
1939 | (arguments | |
0f08917d TGR |
1940 | '(#:phases |
1941 | (modify-phases %standard-phases | |
1942 | (delete 'configure) ; no configure script | |
1943 | (replace 'install | |
1944 | ;; The Makefile lacks an ‘install’ target. | |
1945 | (lambda* (#:key outputs #:allow-other-keys) | |
1946 | (let* ((out (assoc-ref outputs "out")) | |
1947 | (bin (string-append out "/bin"))) | |
7a068459 TGR |
1948 | (chmod "zerofree" #o555) |
1949 | (install-file "zerofree" bin) | |
0f08917d TGR |
1950 | #t)))) |
1951 | #:tests? #f)) ; no tests | |
1c975f60 LC |
1952 | (inputs `(("libext2fs" ,e2fsprogs))) |
1953 | (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems") | |
1954 | (description | |
4de4a1cf TGR |
1955 | "Zerofree finds the unallocated blocks with non-zero value content in an |
1956 | ext2, ext3, or ext4 file system and fills them with zeroes (or another value). | |
1957 | This is a simple way to make disk images more compressible. | |
1958 | Zerofree requires the file system to be unmounted or mounted read-only.") | |
3ac73271 | 1959 | (license license:gpl2))) |
1c975f60 | 1960 | |
d8482ad0 LC |
1961 | (define-public strace |
1962 | (package | |
1963 | (name "strace") | |
1bf6cdc4 | 1964 | (version "5.8") |
426284d8 | 1965 | (home-page "https://strace.io") |
d8482ad0 LC |
1966 | (source (origin |
1967 | (method url-fetch) | |
426284d8 MB |
1968 | (uri (string-append home-page "/files/" version |
1969 | "/strace-" version ".tar.xz")) | |
d8482ad0 LC |
1970 | (sha256 |
1971 | (base32 | |
1bf6cdc4 | 1972 | "1abs3svkg9985f4jrxx34sj1dcpsf95vv1a0g01c777zgygncjnz")))) |
d8482ad0 | 1973 | (build-system gnu-build-system) |
6983b8a8 MB |
1974 | (arguments |
1975 | '(#:phases | |
1976 | (modify-phases %standard-phases | |
1977 | (add-after 'unpack 'patch-/bin/sh | |
1978 | (lambda _ | |
1979 | (substitute* "strace.c" | |
1980 | (("/bin/sh") (which "sh"))) | |
53428597 TGR |
1981 | #t)) |
1982 | (add-after 'unpack 'disable-failing-tests | |
1983 | (lambda _ | |
1984 | ;; XXX These hang forever even if the test time-out is extended. | |
1985 | (substitute* "tests/Makefile.in" | |
1986 | (("^\tstrace-DD?D?\\.test \\\\.*") "")) | |
d1eb4234 | 1987 | #t))) |
1d437561 EF |
1988 | ;; Don't fail if the architecture doesn't support different personalities. |
1989 | #:configure-flags '("--enable-mpers=check") | |
72e782b2 TGR |
1990 | ;; See <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=32459>. |
1991 | #:parallel-tests? #f)) ; undeterministic failures | |
c4c4cc05 | 1992 | (native-inputs `(("perl" ,perl))) |
d8482ad0 LC |
1993 | (synopsis "System call tracer for Linux") |
1994 | (description | |
1995 | "strace is a system call tracer, i.e. a debugging tool which prints out a | |
1996 | trace of all the system calls made by a another process/program.") | |
035f9161 | 1997 | (license license:lgpl2.1+))) |
ba04571a | 1998 | |
e1e27737 TUBK |
1999 | (define-public ltrace |
2000 | (package | |
2001 | (name "ltrace") | |
2002 | (version "0.7.3") | |
2003 | (source (origin | |
2004 | (method url-fetch) | |
2005 | (uri (string-append "http://www.ltrace.org/ltrace_" version | |
2006 | ".orig.tar.bz2")) | |
2007 | (sha256 | |
2008 | (base32 | |
2009 | "00wmbdghqbz6x95m1mcdd3wd46l6hgcr4wggdp049dbifh3qqvqf")))) | |
2010 | (build-system gnu-build-system) | |
2011 | (inputs `(("libelf" ,libelf))) | |
2012 | (arguments | |
2013 | ;; Compilation uses -Werror by default, but it fails. | |
2014 | '(#:configure-flags '("--disable-werror"))) | |
81e59e41 | 2015 | (home-page "https://www.ltrace.org/") |
e1e27737 TUBK |
2016 | (synopsis "Library call tracer for Linux") |
2017 | (description | |
2018 | "ltrace intercepts and records dynamic library calls which are called by | |
2019 | an executed process and the signals received by that process. It can also | |
2020 | intercept and print the system calls executed by the program.") | |
3ac73271 | 2021 | (license license:gpl2+))) |
e1e27737 | 2022 | |
ba04571a LC |
2023 | (define-public alsa-lib |
2024 | (package | |
2025 | (name "alsa-lib") | |
c494e899 | 2026 | (version "1.2.2") |
ba04571a LC |
2027 | (source (origin |
2028 | (method url-fetch) | |
2029 | (uri (string-append | |
2030 | "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-" | |
2031 | version ".tar.bz2")) | |
2032 | (sha256 | |
2033 | (base32 | |
c494e899 | 2034 | "1v5kb8jyvrpkvvq7dq8hfbmcj68lml97i4s0prxpfx2mh3c57s6q")))) |
ba04571a | 2035 | (build-system gnu-build-system) |
ddf31e9a MB |
2036 | (arguments |
2037 | '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
2038 | (assoc-ref %outputs "out") | |
2039 | "/lib")))) | |
5f3070a5 | 2040 | (home-page "https://www.alsa-project.org/") |
ba04571a LC |
2041 | (synopsis "The Advanced Linux Sound Architecture libraries") |
2042 | (description | |
2043 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
2044 | MIDI functionality to the Linux-based operating system.") | |
3ac73271 | 2045 | (license license:lgpl2.1+))) |
10afdf50 | 2046 | |
17b293a0 LC |
2047 | (define-public alsa-utils |
2048 | (package | |
2049 | (name "alsa-utils") | |
c494e899 | 2050 | (version "1.2.2") |
17b293a0 LC |
2051 | (source (origin |
2052 | (method url-fetch) | |
992b527d EF |
2053 | (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/" |
2054 | name "-" version ".tar.bz2")) | |
17b293a0 LC |
2055 | (sha256 |
2056 | (base32 | |
c494e899 | 2057 | "1wz460by17rmxrcydn583rd4lhj6wlvqs6x1j5pdzxn5g3app024")))) |
17b293a0 LC |
2058 | (build-system gnu-build-system) |
2059 | (arguments | |
2060 | ;; XXX: Disable man page creation until we have DocBook. | |
2061 | '(#:configure-flags (list "--disable-xmlto" | |
f2817d43 LC |
2062 | |
2063 | ;; The udev rule is responsible for restoring | |
2064 | ;; the volume. | |
17b293a0 LC |
2065 | (string-append "--with-udev-rules-dir=" |
2066 | (assoc-ref %outputs "out") | |
2067 | "/lib/udev/rules.d")) | |
49165145 EF |
2068 | #:phases |
2069 | (modify-phases %standard-phases | |
46bf8b2b MB |
2070 | (add-before 'check 'disable-broken-test |
2071 | (lambda _ | |
2072 | ;; XXX: The 1.1.8 release tarball is missing a header that's | |
2073 | ;; required for this test to work. Fixed in 1.1.9. | |
2074 | (substitute* "axfer/test/Makefile" | |
2075 | ((".*container-test.*") "")) | |
2076 | #t)) | |
49165145 EF |
2077 | (add-before |
2078 | 'install 'pre-install | |
2079 | (lambda _ | |
2080 | ;; Don't try to mkdir /var/lib/alsa. | |
2081 | (substitute* "Makefile" | |
2082 | (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*") | |
457d154f EF |
2083 | "true\n")) |
2084 | #t))))) | |
9b70f2c3 MO |
2085 | (native-inputs |
2086 | `(("gettext" ,gettext-minimal))) | |
17b293a0 LC |
2087 | (inputs |
2088 | `(("libsamplerate" ,libsamplerate) | |
2089 | ("ncurses" ,ncurses) | |
2090 | ("alsa-lib" ,alsa-lib) | |
9b70f2c3 | 2091 | ("xmlto" ,xmlto))) |
17b293a0 LC |
2092 | (home-page "http://www.alsa-project.org/") |
2093 | (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)") | |
2094 | (description | |
2095 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
2096 | MIDI functionality to the Linux-based operating system.") | |
2097 | ||
2098 | ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are | |
2099 | ;; GPLv2-only. | |
3ac73271 | 2100 | (license license:gpl2))) |
17b293a0 | 2101 | |
7d2511bc | 2102 | (define-public alsa-plugins |
2103 | (package | |
2104 | (name "alsa-plugins") | |
c494e899 | 2105 | (version "1.2.2") |
7d2511bc | 2106 | (source (origin |
2107 | (method url-fetch) | |
2108 | (uri (string-append "ftp://ftp.alsa-project.org/pub/plugins/" | |
2109 | name "-" version ".tar.bz2")) | |
2110 | (sha256 | |
2111 | (base32 | |
c494e899 | 2112 | "0z9k3ssbfk2ky2w13avgyf202j1drsz9sv3834bp33cj1i2hc3qw")))) |
7d2511bc | 2113 | (build-system gnu-build-system) |
2114 | ;; TODO: Split libavcodec and speex if possible. It looks like they can not | |
2115 | ;; be split, there are references to both in files. | |
2116 | ;; TODO: Remove OSS related plugins, they add support to run native | |
2117 | ;; ALSA applications on OSS however we do not offer OSS and OSS is | |
2118 | ;; obsolete. | |
624ee211 | 2119 | (outputs '("out" "pulseaudio" "jack")) |
7d2511bc | 2120 | (arguments |
10b96d29 | 2121 | `(#:configure-flags '(;; Do not install a "local" configuration targeted |
59e80445 | 2122 | ;; for /etc/alsa. On Guix System plugins are loaded from |
10b96d29 MB |
2123 | ;; the ALSA service, and other distributions likely |
2124 | ;; won't use these files. | |
2125 | "--with-alsalconfdir=/tmp/noop") | |
2126 | #:phases | |
7d2511bc | 2127 | (modify-phases %standard-phases |
2128 | (add-after 'install 'split | |
2129 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
2130 | ;; Distribute the binaries to the various outputs. | |
2131 | (let* ((out (assoc-ref outputs "out")) | |
624ee211 SB |
2132 | (jack (assoc-ref outputs "jack")) |
2133 | (jacklib (string-append jack "/lib/alsa-lib")) | |
7d2511bc | 2134 | (pua (assoc-ref outputs "pulseaudio")) |
10b96d29 | 2135 | (pualib (string-append pua "/lib/alsa-lib"))) |
624ee211 SB |
2136 | ;; For jack. |
2137 | (mkdir-p jacklib) | |
2138 | (for-each (lambda (file) | |
2139 | (rename-file file (string-append jacklib "/" (basename file)))) | |
2140 | (find-files out ".*jack\\.(la|so)")) | |
10b96d29 | 2141 | ;; For pulseaudio. |
7d2511bc | 2142 | (mkdir-p pualib) |
7d2511bc | 2143 | (for-each (lambda (file) |
2144 | (rename-file file (string-append pualib "/" (basename file)))) | |
2145 | (find-files out ".*pulse\\.(la|so)")) | |
7d2511bc | 2146 | #t)))))) |
2147 | (inputs | |
2148 | `(("alsa-lib" ,alsa-lib) | |
624ee211 | 2149 | ("jack" ,jack-1) |
7d2511bc | 2150 | ("speex" ,speex) ; libspeexdsp resampling plugin |
2151 | ("libsamplerate" ,libsamplerate) ; libsamplerate resampling plugin | |
2152 | ("ffmpeg" ,ffmpeg) ; libavcodec resampling plugin, a52 plugin | |
2153 | ("pulseaudio" ,pulseaudio))) ; PulseAudio plugin | |
2154 | (native-inputs | |
2155 | `(("pkg-config" ,pkg-config))) | |
2156 | (home-page "http://www.alsa-project.org/") | |
2157 | (synopsis "Plugins for the Advanced Linux Sound Architecture (ALSA)") | |
2158 | (description | |
2159 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
2160 | MIDI functionality to the Linux-based operating system. This package enhances ALSA | |
2161 | by providing additional plugins which include: upmixing, downmixing, jackd and | |
2162 | pulseaudio support for native alsa applications, format conversion (s16 to a52), and | |
2163 | external rate conversion.") | |
2164 | (license (list license:gpl2+ | |
2165 | ;; `rate/rate_samplerate.c': LGPL v2.1 or later. | |
2166 | license:lgpl2.1+)))) | |
2167 | ||
10afdf50 LC |
2168 | (define-public iptables |
2169 | (package | |
2170 | (name "iptables") | |
0cafb90d TGR |
2171 | ;; XXX When updating, remove the ‘install-missing-script’ phase. |
2172 | (version "1.8.5") | |
2173 | (source | |
2174 | (origin | |
2175 | (method url-fetch) | |
2176 | (uri (list (string-append "mirror://netfilter.org/iptables/iptables-" | |
2177 | version ".tar.bz2") | |
2178 | (string-append "https://www.netfilter.org/projects/iptables/" | |
2179 | "files/iptables-" version ".tar.bz2"))) | |
2180 | (sha256 | |
2181 | (base32 "02a3575ypdpg6a2x752mhk3f7h1381ymkq1n0gss6fp6292xfmyl")))) | |
10afdf50 | 2182 | (build-system gnu-build-system) |
13223c8e LF |
2183 | (native-inputs |
2184 | `(("pkg-config" ,pkg-config) | |
2185 | ("flex" ,flex) | |
2186 | ("bison" ,bison))) | |
2187 | (inputs | |
2188 | `(("libmnl" ,libmnl) | |
2189 | ("libnftnl" ,libnftnl))) | |
50c26d9e SB |
2190 | (arguments |
2191 | '(#:tests? #f ; no test suite | |
2192 | #:configure-flags ; add $libdir to the RUNPATH of executables | |
0cafb90d TGR |
2193 | (list (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) |
2194 | #:phases | |
2195 | (modify-phases %standard-phases | |
2196 | (add-after 'install 'install-missing-script | |
2197 | ;; A typo prevents installation of /sbin/iptables-apply. It's been | |
2198 | ;; fixed upstream (d4ed0c741fc789bb09d977d74d30875fdd50d08b), but | |
2199 | ;; a patch would require bootstrapping and more inputs. Simply copy | |
2200 | ;; the file ourselves. | |
2201 | (lambda* (#:key outputs #:allow-other-keys) | |
2202 | (let* ((out (assoc-ref outputs "out")) | |
2203 | (sbin (string-append out "/sbin"))) | |
2204 | (install-file "iptables/iptables-apply" sbin) | |
2205 | #t)))))) | |
13223c8e | 2206 | (home-page "https://www.netfilter.org/projects/iptables/index.html") |
be5dc5fb | 2207 | (synopsis "Programs to configure Linux IP packet filtering rules") |
10afdf50 | 2208 | (description |
be5dc5fb TGR |
2209 | "@command{iptables} is the user-space command line program used to |
2210 | configure the Linux 2.4.x and later IPv4 packet filtering ruleset | |
2211 | (@dfn{firewall}), including @dfn{NAT} (Network Address Translation). | |
2212 | ||
2213 | This package also includes @command{ip6tables}, which is used to configure the | |
2214 | IPv6 packet filter. | |
2215 | ||
fadc5533 | 2216 | Both commands are targeted at system administrators.") |
3ac73271 | 2217 | (license license:gpl2+))) |
90a0048f | 2218 | |
c06c7a3a VL |
2219 | (define-public lsscsi |
2220 | (package | |
2221 | (name "lsscsi") | |
2222 | (version "0.31") | |
2223 | (source (origin | |
2224 | (method url-fetch) | |
2225 | (uri (string-append | |
2226 | "http://sg.danny.cz/scsi/lsscsi-" version ".tar.xz")) | |
2227 | (sha256 | |
2228 | (base32 | |
2229 | "1ry2y34xmpgxdbfbyvs8cjmbx0fn222yjdab87wj21q60nab5p75")))) | |
2230 | (build-system gnu-build-system) | |
2231 | (synopsis "Lists information about SCSI or NVMe devices in Linux") | |
2232 | (home-page "http://sg.danny.cz/scsi/lsscsi.html") | |
2233 | (description | |
2234 | "@command{lsscsi} lists SCSI logical units or SCSI targets. It can | |
2235 | also list NVMe namespaces or controllers and show the relationship between a | |
2236 | device's primary node name, its SCSI generic (sg) node name and its kernel | |
2237 | name.") | |
2238 | (license license:gpl2))) | |
2239 | ||
6876a6fe SB |
2240 | (define-public ebtables |
2241 | (package | |
2242 | (name "ebtables") | |
b614a223 | 2243 | (version "2.0.11") |
6876a6fe SB |
2244 | (source (origin |
2245 | (method url-fetch) | |
2246 | (uri (string-append | |
b614a223 | 2247 | "mirror://netfilter.org/ebtables/ebtables-" |
6876a6fe SB |
2248 | version ".tar.gz")) |
2249 | (sha256 | |
2250 | (base32 | |
b614a223 | 2251 | "0apxgmkhsk3vxn9q3libxn3dgrdljrxyy4mli2gk49m7hi3na7xp")))) |
6876a6fe | 2252 | (build-system gnu-build-system) |
6876a6fe SB |
2253 | (inputs |
2254 | `(("perl" ,perl) | |
2255 | ("iptables" ,iptables))) | |
2256 | (synopsis "Ethernet bridge frame table administration") | |
82c89ead | 2257 | (home-page "https://ebtables.netfilter.org/") |
6876a6fe SB |
2258 | (description |
2259 | "ebtables is an application program used to set up and maintain the | |
2260 | tables of rules (inside the Linux kernel) that inspect Ethernet frames. It is | |
2261 | analogous to the iptables application, but less complicated, due to the fact | |
2262 | that the Ethernet protocol is much simpler than the IP protocol.") | |
2263 | (license license:gpl2+))) | |
2264 | ||
90a0048f LC |
2265 | (define-public iproute |
2266 | (package | |
2267 | (name "iproute2") | |
aea58912 | 2268 | (version "5.8.0") |
90a0048f | 2269 | (source (origin |
75cd4b05 AK |
2270 | (method url-fetch) |
2271 | (uri (string-append | |
2272 | "mirror://kernel.org/linux/utils/net/iproute2/iproute2-" | |
2273 | version ".tar.xz")) | |
2274 | (sha256 | |
2275 | (base32 | |
aea58912 | 2276 | "0vk4vickrpahdhl3zazr2qn2bf99v5549ncirjpwiy4h0a4izkfg")))) |
90a0048f LC |
2277 | (build-system gnu-build-system) |
2278 | (arguments | |
54933202 TGR |
2279 | `( ;; There is a test suite, but it wants network namespaces and sudo. |
2280 | #:tests? #f | |
90a0048f LC |
2281 | #:make-flags (let ((out (assoc-ref %outputs "out"))) |
2282 | (list "DESTDIR=" | |
e777d07d LF |
2283 | (string-append "BASH_COMPDIR=" out |
2284 | "/etc/bash_completion.d") | |
90a0048f | 2285 | (string-append "LIBDIR=" out "/lib") |
61f78e72 | 2286 | (string-append "HDRDIR=" out "/include") |
90a0048f LC |
2287 | (string-append "SBINDIR=" out "/sbin") |
2288 | (string-append "CONFDIR=" out "/etc") | |
2289 | (string-append "DOCDIR=" out "/share/doc/" | |
2290 | ,name "-" ,version) | |
2291 | (string-append "MANDIR=" out "/share/man"))) | |
b53e44fb AK |
2292 | #:phases (modify-phases %standard-phases |
2293 | (add-before 'install 'pre-install | |
2294 | (lambda _ | |
2295 | ;; Don't attempt to create /var/lib/arpd. | |
2296 | (substitute* "Makefile" | |
9922278b MW |
2297 | (("^.*ARPDDIR.*$") "")) |
2298 | #t))))) | |
90a0048f | 2299 | (inputs |
54933202 | 2300 | `(("db4" ,bdb) |
3b636296 TGR |
2301 | ("iptables" ,iptables) |
2302 | ("libmnl" ,libmnl))) | |
c4c4cc05 | 2303 | (native-inputs |
54933202 | 2304 | `(("bison" ,bison) |
90a0048f | 2305 | ("flex" ,flex) |
54933202 TGR |
2306 | ("pkg-config" ,pkg-config))) |
2307 | ;; For tests. | |
2308 | ;; ("libmnl" ,libmnl) | |
2309 | ;; ("util-linux" ,util-linux) | |
90a0048f | 2310 | (home-page |
d7f84eab | 2311 | "https://wiki.linuxfoundation.org/networking/iproute2") |
90a0048f | 2312 | (synopsis |
9e771e3b | 2313 | "Utilities for controlling TCP/IP networking and traffic in Linux") |
90a0048f | 2314 | (description |
35a4fefc TGR |
2315 | "Iproute2 is a collection of utilities for controlling TCP/IP networking |
2316 | and traffic with the Linux kernel. The most important of these are | |
2317 | @command{ip}, which configures IPv4 and IPv6, and @command{tc} for traffic | |
2318 | control. | |
90a0048f LC |
2319 | |
2320 | Most network configuration manuals still refer to ifconfig and route as the | |
2321 | primary network configuration tools, but ifconfig is known to behave | |
35a4fefc | 2322 | inadequately in modern network environments, and both should be deprecated.") |
3ac73271 | 2323 | (license license:gpl2+))) |
85e0dc6a LC |
2324 | |
2325 | (define-public net-tools | |
2326 | ;; XXX: This package is basically unmaintained, but it provides a few | |
2327 | ;; commands not yet provided by Inetutils, such as 'route', so we have to | |
2328 | ;; live with it. | |
6d31c175 LF |
2329 | (let ((commit "479bb4a7e11a4084e2935c0a576388f92469225b") |
2330 | (revision "0")) | |
2331 | (package | |
2332 | (name "net-tools") | |
2333 | (version (string-append "1.60-" revision "." (string-take commit 7))) | |
2334 | (source (origin | |
631c9f74 LF |
2335 | (method url-fetch) |
2336 | (uri (string-append "https://sourceforge.net/code-snapshots/git/" | |
2337 | "n/ne/net-tools/code.git/net-tools-code-" | |
2338 | commit ".zip")) | |
2339 | (file-name (string-append name "-" version ".zip")) | |
6d31c175 LF |
2340 | (sha256 |
2341 | (base32 | |
631c9f74 | 2342 | "0hz9fda9d78spp774b6rr5xaxav7cm4h0qcpxf70rvdbrf6qx7vy")))) |
6d31c175 LF |
2343 | (home-page "http://net-tools.sourceforge.net/") |
2344 | (build-system gnu-build-system) | |
2345 | (arguments | |
898e8b52 | 2346 | `(#:modules ((guix build gnu-build-system) |
6d31c175 LF |
2347 | (guix build utils) |
2348 | (srfi srfi-1) | |
2349 | (srfi srfi-26)) | |
2350 | #:phases | |
2351 | (modify-phases %standard-phases | |
2352 | (replace 'configure | |
2353 | (lambda* (#:key outputs #:allow-other-keys) | |
2354 | (let ((out (assoc-ref outputs "out"))) | |
2355 | (mkdir-p (string-append out "/bin")) | |
2356 | (mkdir-p (string-append out "/sbin")) | |
2357 | ||
2358 | ;; Pretend we have everything... | |
2359 | (system "yes | make config") | |
2360 | ||
2361 | ;; ... except for the things we don't have. | |
2362 | ;; HAVE_AFDECnet requires libdnet, which we don't have. | |
2363 | ;; HAVE_HWSTRIP and HAVE_HWTR require kernel headers | |
2364 | ;; that have been removed. | |
2365 | ;; XXX SELINUX and AFBLUETOOTH are removed for now, but we should | |
2366 | ;; think about adding them later. | |
2367 | (substitute* '("config.make" "config.h") | |
2368 | (("^.*HAVE_(AFDECnet|HWSTRIP|HWTR|SELINUX|AFBLUETOOTH)[ =]1.*$") | |
8ea5d868 MW |
2369 | "")) |
2370 | #t))) | |
6d31c175 LF |
2371 | (add-after 'install 'remove-redundant-commands |
2372 | (lambda* (#:key outputs #:allow-other-keys) | |
2373 | ;; Remove commands and man pages redundant with Inetutils. | |
2374 | (let* ((out (assoc-ref outputs "out")) | |
2375 | (dup (append-map (cut find-files out <>) | |
2376 | '("^hostname" | |
2377 | "^(yp|nis|dns)?domainname")))) | |
2378 | (for-each delete-file dup) | |
2379 | #t)))) | |
2380 | ;; Binaries that depend on libnet-tools.a don't declare that | |
2381 | ;; dependency, making it parallel-unsafe. | |
2382 | #:parallel-build? #f | |
2383 | ||
2384 | #:tests? #f ; no test suite | |
2385 | #:make-flags (let ((out (assoc-ref %outputs "out"))) | |
898e8b52 | 2386 | (list ,(string-append "CC=" (cc-for-target)) |
6d31c175 LF |
2387 | (string-append "BASEDIR=" out) |
2388 | (string-append "INSTALLNLSDIR=" out "/share/locale") | |
2389 | (string-append "mandir=/share/man"))))) | |
631c9f74 LF |
2390 | (native-inputs `(("gettext" ,gettext-minimal) |
2391 | ("unzip" ,unzip))) | |
3d3ca76f | 2392 | (supported-systems (delete "i586-gnu" %supported-systems)) |
6d31c175 LF |
2393 | (synopsis "Tools for controlling the network subsystem in Linux") |
2394 | (description | |
2395 | "This package includes the important tools for controlling the network | |
2396 | subsystem of the Linux kernel. This includes arp, ifconfig, netstat, rarp and | |
2397 | route. Additionally, this package contains utilities relating to particular | |
2398 | network hardware types (plipconfig, slattach) and advanced aspects of IP | |
2399 | configuration (iptunnel, ipmaddr).") | |
2400 | (license license:gpl2+)))) | |
2401 | ||
c762e82e LC |
2402 | (define-public libcap |
2403 | (package | |
2404 | (name "libcap") | |
e21b70ac | 2405 | (version "2.31") |
c762e82e LC |
2406 | (source (origin |
2407 | (method url-fetch) | |
c762e82e | 2408 | (uri (string-append |
f6c2d05c LC |
2409 | "mirror://kernel.org/linux/libs/security/linux-privs/" |
2410 | "libcap2/libcap-" version ".tar.xz")) | |
c762e82e LC |
2411 | (sha256 |
2412 | (base32 | |
e21b70ac | 2413 | "0ikwm0kngrqa4ci80lqnrkk17kg09q7dxrz28y0gm5qw3vj8s266")))) |
c762e82e | 2414 | (build-system gnu-build-system) |
6d889daf SB |
2415 | (arguments '(#:phases |
2416 | (modify-phases %standard-phases | |
2417 | (replace 'configure | |
2418 | ;; Add $libdir to the RUNPATH of executables. | |
2419 | (lambda _ | |
2420 | (substitute* "Make.Rules" | |
2421 | (("LDFLAGS := #-g") | |
2422 | (string-append "LDFLAGS := -Wl,-rpath=" | |
d70d59d6 MW |
2423 | %output "/lib"))) |
2424 | #t))) | |
2a65cd8c | 2425 | #:test-target "test" |
c762e82e LC |
2426 | #:make-flags (list "lib=lib" |
2427 | (string-append "prefix=" | |
2428 | (assoc-ref %outputs "out")) | |
2429 | "RAISE_SETFCAP=no"))) | |
2430 | (native-inputs `(("perl" ,perl))) | |
11a5ffba | 2431 | (supported-systems (delete "i586-gnu" %supported-systems)) |
c762e82e LC |
2432 | (home-page "https://sites.google.com/site/fullycapable/") |
2433 | (synopsis "Library for working with POSIX capabilities") | |
2434 | (description | |
35b9e423 | 2435 | "Libcap2 provides a programming interface to POSIX capabilities on |
c762e82e LC |
2436 | Linux-based operating systems.") |
2437 | ||
2438 | ;; License is BSD-3 or GPLv2, at the user's choice. | |
3ac73271 | 2439 | (license license:gpl2))) |
215b6431 | 2440 | |
7431553b MB |
2441 | ;; libcap 2.31 causes problems for 'fakeroot', so provide this newer variant. |
2442 | ;; To be merged with libcap on the next rebuild cycle. | |
2443 | (define-public libcap/next | |
2444 | (package | |
2445 | (inherit libcap) | |
2446 | (version "2.34") | |
2447 | (source (origin | |
2448 | (method url-fetch) | |
2449 | (uri (string-append | |
2450 | "mirror://kernel.org/linux/libs/security/linux-privs/" | |
2451 | "libcap2/libcap-" version ".tar.xz")) | |
2452 | (sha256 | |
2453 | (base32 | |
2454 | "048n1gy2p48vl9hkrr9wymfxxcpwj2aslz2bv79nhl4m2lhd9kdf")))))) | |
2455 | ||
215b6431 LC |
2456 | (define-public bridge-utils |
2457 | (package | |
2458 | (name "bridge-utils") | |
4863773e TGR |
2459 | (version "1.6") |
2460 | (source | |
2461 | (origin | |
2462 | (method url-fetch) | |
18160c34 MB |
2463 | (uri (string-append "mirror://kernel.org/linux/utils/net/bridge-utils/" |
2464 | "bridge-utils-" version ".tar.xz")) | |
4863773e TGR |
2465 | (sha256 |
2466 | (base32 "1j16kr44csyr4yqxly26l1yw2bh4nkiasgwvask2i2gvsnsyyryc")))) | |
215b6431 LC |
2467 | (build-system gnu-build-system) |
2468 | ||
2469 | ;; The tarball lacks all the generated files. | |
2470 | (native-inputs `(("autoconf" ,autoconf) | |
2471 | ("automake" ,automake))) | |
2472 | (arguments | |
dc1d3cde KK |
2473 | '(#:phases |
2474 | (modify-phases %standard-phases | |
189be331 | 2475 | (add-before 'bootstrap 'patch-stuff |
dc1d3cde KK |
2476 | (lambda _ |
2477 | ;; Fix "field ‘ip6’ has incomplete type" errors. | |
2478 | (substitute* "libbridge/libbridge.h" | |
2479 | (("#include <linux/if_bridge.h>") | |
2480 | "#include <linux/in6.h>\n#include <linux/if_bridge.h>")) | |
2481 | ||
2482 | ;; Ensure that the entire build fails if one of the | |
2483 | ;; sub-Makefiles fails. | |
2484 | (substitute* "Makefile.in" | |
2485 | (("\\$\\(MAKE\\) \\$\\(MFLAGS\\) -C \\$\\$x ;") | |
2486 | "$(MAKE) $(MFLAGS) -C $$x || exit 1;")) | |
2487 | ||
189be331 | 2488 | #t))) |
215b6431 LC |
2489 | #:tests? #f)) ; no 'check' target |
2490 | ||
e496ee67 | 2491 | (home-page "https://wiki.linuxfoundation.org/networking/bridge") |
215b6431 LC |
2492 | (synopsis "Manipulate Ethernet bridges") |
2493 | (description | |
2494 | "Utilities for Linux's Ethernet bridging facilities. A bridge is a way | |
2495 | to connect two Ethernet segments together in a protocol independent way. | |
2496 | Packets are forwarded based on Ethernet address, rather than IP address (like | |
2497 | a router). Since forwarding is done at Layer 2, all protocols can go | |
2498 | transparently through a bridge.") | |
3ac73271 | 2499 | (license license:gpl2+))) |
3cc20675 LC |
2500 | |
2501 | (define-public libnl | |
2502 | (package | |
2503 | (name "libnl") | |
276e7739 | 2504 | (version "3.5.0") |
3cc20675 LC |
2505 | (source (origin |
2506 | (method url-fetch) | |
2507 | (uri (string-append | |
a2265ea3 MB |
2508 | "https://github.com/thom311/libnl/releases/download/" |
2509 | "libnl" (string-join (string-split version #\.) "_") | |
2510 | "/libnl-" version ".tar.gz")) | |
3cc20675 LC |
2511 | (sha256 |
2512 | (base32 | |
276e7739 | 2513 | "1yh5bqmkivd78x378x34gzb28lvykn6b9k3hgvvpdnj5jpn3689m")))) |
3cc20675 | 2514 | (build-system gnu-build-system) |
d80a47f2 DL |
2515 | (native-inputs |
2516 | `(("bison" ,bison) | |
2517 | ("flex" ,flex) | |
3eb7c000 DL |
2518 | ("pkg-config" ,pkg-config) |
2519 | ("swig" ,swig) | |
d80a47f2 DL |
2520 | ("libnl3-doc" |
2521 | ,(origin | |
2522 | (method url-fetch) | |
2523 | (uri (string-append | |
2524 | "https://github.com/thom311/libnl/releases/download/libnl" | |
2525 | (string-join (string-split version #\.) "_") | |
2526 | "/libnl-doc-" version ".tar.gz")) | |
2527 | (sha256 | |
276e7739 | 2528 | (base32 "19p5y8q3cm5wqvamqc4s5syxnnkvzxy3gw8ivxk6fv9ybn8jm35h")))))) |
c41f8869 | 2529 | (outputs `("out" "doc")) |
d80a47f2 | 2530 | (arguments |
c41f8869 | 2531 | `(#:phases |
d80a47f2 DL |
2532 | (modify-phases %standard-phases |
2533 | (add-after 'install 'install-doc | |
c41f8869 | 2534 | (lambda* (#:key inputs native-inputs outputs #:allow-other-keys) |
d80a47f2 DL |
2535 | (let ((dest (string-append (assoc-ref outputs "doc") |
2536 | "/share/doc/libnl"))) | |
2537 | (mkdir-p dest) | |
c41f8869 MO |
2538 | (invoke "tar" "xf" (assoc-ref |
2539 | (or native-inputs inputs) | |
2540 | "libnl3-doc") | |
35faa006 | 2541 | "--strip-components=1" "-C" dest))))))) |
81e59e41 | 2542 | (home-page "https://www.infradead.org/~tgr/libnl/") |
3cc20675 LC |
2543 | (synopsis "NetLink protocol library suite") |
2544 | (description | |
2545 | "The libnl suite is a collection of libraries providing APIs to netlink | |
69b4ffcf | 2546 | protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarily |
3cc20675 LC |
2547 | between the kernel and user space processes. It was designed to be a more |
2548 | flexible successor to ioctl to provide mainly networking related kernel | |
2549 | configuration and monitoring interfaces.") | |
2550 | ||
2551 | ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like | |
2552 | ;; 'nl-addr-add.c'), so the result is GPLv2-only. | |
3ac73271 | 2553 | (license license:gpl2))) |
023fef7d | 2554 | |
c41f8869 MO |
2555 | ;; libnl python extensions used to be outputs of libnl. However, as |
2556 | ;; cross-compiling python extensions is currently broken, create separate | |
2557 | ;; packages for libnl python extensions. | |
2558 | (define (libnl-python-package python) | |
2559 | (let ((name (string-append "libnl-" python))) | |
2560 | (package | |
2561 | (inherit libnl) | |
2562 | (name name) | |
2563 | (inputs `(,@(cond | |
2564 | ((string=? python "python2") | |
2565 | `(("python-2" ,python-2))) | |
2566 | ((string=? python "python3") | |
2567 | `(("python-3" ,python-3)))))) | |
2568 | (propagated-inputs `(("libnl" ,libnl))) | |
2569 | (outputs '("out")) | |
2570 | (arguments | |
2571 | `(#:modules ((guix build gnu-build-system) | |
2572 | (guix build utils) | |
2573 | (srfi srfi-1)) | |
2574 | #:phases | |
2575 | (modify-phases %standard-phases | |
2576 | (replace 'install | |
2577 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
2578 | (define (python-inst python) | |
2579 | (invoke python "setup.py" "build") | |
2580 | (invoke python "setup.py" "install" | |
2581 | (string-append "--prefix=" | |
2582 | (assoc-ref %outputs "out"))) | |
2583 | (invoke python "setup.py" "clean")) | |
2584 | (setenv "LDFLAGS" (format #f "-Wl,-rpath=~a/lib" | |
2585 | (assoc-ref inputs "libnl"))) | |
2586 | (with-directory-excursion "./python" (python-inst ,python)) | |
2587 | #t)))))))) | |
2588 | ||
2589 | (define-public libnl-python2 (libnl-python-package "python2")) | |
2590 | (define-public libnl-python3 (libnl-python-package "python3")) | |
2591 | ||
65cd77db MW |
2592 | (define-public iw |
2593 | (package | |
2594 | (name "iw") | |
4b0111a4 | 2595 | (version "4.14") |
65cd77db MW |
2596 | (source (origin |
2597 | (method url-fetch) | |
2598 | (uri (string-append | |
2f9e312a | 2599 | "mirror://kernel.org/software/network/iw/iw-" |
65cd77db MW |
2600 | version ".tar.xz")) |
2601 | (sha256 | |
2602 | (base32 | |
4b0111a4 | 2603 | "12ddd6vh6vs97135bnlyr0szv7hvpbnmfh48584frzab0z0725ph")))) |
65cd77db MW |
2604 | (build-system gnu-build-system) |
2605 | (native-inputs `(("pkg-config" ,pkg-config))) | |
2606 | (inputs `(("libnl" ,libnl))) | |
2607 | (arguments | |
88ca4029 MO |
2608 | `(#:make-flags |
2609 | (let* ((target ,(%current-target-system)) | |
88ca4029 MO |
2610 | (pkg-config (if target |
2611 | (string-append target "-pkg-config") | |
2612 | "pkg-config"))) | |
2613 | (list | |
56a9ef22 | 2614 | ,(string-append "CC=" (cc-for-target)) |
88ca4029 MO |
2615 | (string-append "PKG_CONFIG=" |
2616 | (assoc-ref %build-inputs "pkg-config") | |
2617 | "/bin/" pkg-config) | |
2618 | (string-append "PREFIX=" (assoc-ref %outputs "out")))) | |
dc1d3cde | 2619 | #:phases (modify-phases %standard-phases (delete 'configure)))) |
2f9e312a | 2620 | (home-page "https://wireless.wiki.kernel.org/") |
65cd77db MW |
2621 | (synopsis "Tool for configuring wireless devices") |
2622 | (description | |
2623 | "iw is a new nl80211 based CLI configuration utility for wireless | |
2f9e312a | 2624 | devices. It replaces @code{iwconfig}, which is deprecated.") |
3ac73271 | 2625 | (license license:isc))) |
65cd77db | 2626 | |
023fef7d LC |
2627 | (define-public powertop |
2628 | (package | |
2629 | (name "powertop") | |
10075003 | 2630 | (version "2.13") |
023fef7d LC |
2631 | (source |
2632 | (origin | |
2633 | (method url-fetch) | |
8118a086 | 2634 | (uri (string-append "https://01.org/sites/default/files/downloads/" |
4d36a278 | 2635 | "powertop-" version ".tar.gz")) |
023fef7d | 2636 | (sha256 |
10075003 | 2637 | (base32 "0y1ixw8v17fdb1ima0zshrd0rh4zxdh10r93nrrvq6d4lhn9jpx6")))) |
023fef7d | 2638 | (build-system gnu-build-system) |
4c48bf55 ML |
2639 | (arguments |
2640 | '(#:phases | |
2641 | (modify-phases %standard-phases | |
2642 | ;; TODO: Patch some hardcoded "wlan0" in calibrate/calibrate.cpp to | |
59e80445 | 2643 | ;; allow calibrating the network interface in Guix System. |
4c48bf55 ML |
2644 | (add-after 'unpack 'patch-absolute-file-names |
2645 | (lambda* (#:key inputs #:allow-other-keys) | |
2646 | (let ((kmod (assoc-ref inputs "kmod"))) | |
2647 | (substitute* (find-files "src" "\\.cpp$") | |
2648 | ;; Give the right 'modprobe' file name so that essential | |
2649 | ;; modules such as msr.ko can be loaded. | |
2650 | (("/sbin/modprobe") (string-append kmod "/bin/modprobe")) | |
2651 | ;; These programs are only needed to calibrate, so using | |
2652 | ;; relative file names avoids adding extra inputs. When they | |
2653 | ;; are missing powertop gracefully handles it. | |
2654 | (("/usr/bin/hcitool") "hcitool") | |
2655 | (("/usr/bin/xset") "xset") | |
2656 | (("/usr/sbin/hciconfig") "hciconfig")) | |
2657 | #t)))))) | |
023fef7d | 2658 | (inputs |
4c48bf55 ML |
2659 | `(("kmod" ,kmod) |
2660 | ("libnl" ,libnl) | |
023fef7d | 2661 | ("ncurses" ,ncurses) |
4c48bf55 ML |
2662 | ("pciutils" ,pciutils) |
2663 | ("zlib" ,zlib))) | |
c4c4cc05 | 2664 | (native-inputs |
ebacb0de | 2665 | `(("pkg-config" ,pkg-config))) |
023fef7d LC |
2666 | (home-page "https://01.org/powertop/") |
2667 | (synopsis "Analyze power consumption on Intel-based laptops") | |
2668 | (description | |
2669 | "PowerTOP is a Linux tool to diagnose issues with power consumption and | |
2670 | power management. In addition to being a diagnostic tool, PowerTOP also has | |
2671 | an interactive mode where the user can experiment various power management | |
2672 | settings for cases where the operating system has not enabled these | |
2673 | settings.") | |
3ac73271 | 2674 | (license license:gpl2))) |
6869e5c9 LC |
2675 | |
2676 | (define-public aumix | |
2677 | (package | |
2678 | (name "aumix") | |
2679 | (version "2.9.1") | |
2680 | (source (origin | |
2681 | (method url-fetch) | |
2682 | (uri (string-append | |
2683 | "http://www.jpj.net/~trevor/aumix/releases/aumix-" | |
2684 | version ".tar.bz2")) | |
2685 | (sha256 | |
2686 | (base32 | |
2687 | "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj")))) | |
2688 | (build-system gnu-build-system) | |
2689 | (inputs `(("ncurses" ,ncurses))) | |
2690 | (home-page "http://www.jpj.net/~trevor/aumix.html") | |
2691 | (synopsis "Audio mixer for X and the console") | |
2692 | (description | |
2693 | "Aumix adjusts an audio mixer from X, the console, a terminal, | |
2694 | the command line or a script.") | |
3ac73271 | 2695 | (license license:gpl2+))) |
7c0dbe78 SHT |
2696 | |
2697 | (define-public iotop | |
2698 | (package | |
2699 | (name "iotop") | |
2700 | (version "0.6") | |
2701 | (source | |
2702 | (origin | |
2703 | (method url-fetch) | |
2704 | (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-" | |
2705 | version ".tar.gz")) | |
2706 | (sha256 (base32 | |
2707 | "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s")))) | |
2708 | (build-system python-build-system) | |
2709 | (arguments | |
d79db39d EF |
2710 | '(#:phases |
2711 | (modify-phases %standard-phases | |
2712 | (add-after 'unpack 'fix-build-with-python3 | |
2713 | (lambda _ | |
2714 | (substitute* "setup.py" | |
2715 | (("itervalues") "values")) | |
2716 | #t))) | |
35cebf01 | 2717 | ;; There are currently no checks in the package. |
7c0dbe78 | 2718 | #:tests? #f)) |
d79db39d | 2719 | (native-inputs `(("python" ,python))) |
7c0dbe78 SHT |
2720 | (home-page "http://guichaz.free.fr/iotop/") |
2721 | (synopsis | |
2722 | "Displays the IO activity of running processes") | |
2723 | (description | |
2724 | "Iotop is a Python program with a top like user interface to show the | |
2725 | processes currently causing I/O.") | |
3ac73271 | 2726 | (license license:gpl2+))) |
e30835e2 LC |
2727 | |
2728 | (define-public fuse | |
2729 | (package | |
2730 | (name "fuse") | |
e905c8d6 | 2731 | (version "2.9.9") |
e30835e2 LC |
2732 | (source (origin |
2733 | (method url-fetch) | |
0e9bc883 LF |
2734 | (uri (string-append "https://github.com/libfuse/libfuse/releases/" |
2735 | "download/fuse-" version | |
2736 | "/fuse-" version ".tar.gz")) | |
e30835e2 LC |
2737 | (sha256 |
2738 | (base32 | |
e905c8d6 | 2739 | "1ddlq6kzxilccgbvxjfx80jx6kamgw4sv49phks2zhlcc1frvrnh")) |
cd48a549 | 2740 | (patches (search-patches "fuse-overlapping-headers.patch")))) |
e30835e2 | 2741 | (build-system gnu-build-system) |
b148bd71 | 2742 | (inputs `(("util-linux" ,util-linux))) |
e30835e2 LC |
2743 | (arguments |
2744 | '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH=" | |
2745 | (assoc-ref %outputs "out") | |
2746 | "/sbin") | |
2747 | (string-append "INIT_D_PATH=" | |
2748 | (assoc-ref %outputs "out") | |
2749 | "/etc/init.d") | |
9a4efac9 LC |
2750 | |
2751 | ;; The rule makes /dev/fuse 666. | |
e30835e2 LC |
2752 | (string-append "UDEV_RULES_PATH=" |
2753 | (assoc-ref %outputs "out") | |
9a4efac9 | 2754 | "/lib/udev/rules.d")) |
dc1d3cde KK |
2755 | #:phases |
2756 | (modify-phases %standard-phases | |
2757 | (add-before 'build 'set-file-names | |
2758 | (lambda* (#:key inputs #:allow-other-keys) | |
2759 | ;; libfuse calls out to mount(8) and umount(8). Make sure | |
2760 | ;; it refers to the right ones. | |
2761 | (substitute* '("lib/mount_util.c" "util/mount_util.c") | |
2762 | (("/bin/(u?)mount" _ maybe-u) | |
2763 | (string-append (assoc-ref inputs "util-linux") | |
2764 | "/bin/" maybe-u "mount"))) | |
2765 | (substitute* '("util/mount.fuse.c") | |
2766 | (("/bin/sh") | |
2767 | (which "sh"))) | |
2768 | ||
2769 | ;; This hack leads libfuse to search for 'fusermount' in | |
2770 | ;; $PATH, where it may find a setuid-root binary, instead of | |
2771 | ;; trying solely $out/sbin/fusermount and failing because | |
2772 | ;; it's not setuid. | |
2773 | (substitute* "lib/Makefile" | |
2774 | (("-DFUSERMOUNT_DIR=[[:graph:]]+") | |
2775 | "-DFUSERMOUNT_DIR=\\\"/var/empty\\\"")) | |
2776 | #t))))) | |
654de94e | 2777 | (supported-systems (delete "i586-gnu" %supported-systems)) |
0e9bc883 | 2778 | (home-page "https://github.com/libfuse/libfuse") |
e30835e2 LC |
2779 | (synopsis "Support file systems implemented in user space") |
2780 | (description | |
2781 | "As a consequence of its monolithic design, file system code for Linux | |
2782 | normally goes into the kernel itself---which is not only a robustness issue, | |
2783 | but also an impediment to system extensibility. FUSE, for \"file systems in | |
2784 | user space\", is a kernel module and user-space library that tries to address | |
2785 | part of this problem by allowing users to run file system implementations as | |
2786 | user-space processes.") | |
3ac73271 LC |
2787 | (license (list license:lgpl2.1 ;library |
2788 | license:gpl2+)))) ;command-line utilities | |
220193ad LC |
2789 | |
2790 | (define-public unionfs-fuse | |
2791 | (package | |
2792 | (name "unionfs-fuse") | |
2f861edf | 2793 | (version "2.0") |
220193ad | 2794 | (source (origin |
a428fdd4 EF |
2795 | (method git-fetch) |
2796 | (uri (git-reference | |
2797 | (url "https://github.com/rpodgorny/unionfs-fuse") | |
2798 | (commit (string-append "v" version)))) | |
2799 | (file-name (git-file-name name version)) | |
220193ad LC |
2800 | (sha256 |
2801 | (base32 | |
a428fdd4 | 2802 | "0lb8zgdxnjy2fjr2284hvdfn7inc1in44ynzgcr66x54bxzvynj6")))) |
220193ad | 2803 | (build-system cmake-build-system) |
094f4b53 | 2804 | (native-inputs |
3ef27337 | 2805 | `(("python" ,python))) |
220193ad | 2806 | (inputs `(("fuse" ,fuse))) |
094f4b53 | 2807 | (arguments |
3ef27337 LF |
2808 | ;; The tests were never actually run ("collected 0 items"), but in recent |
2809 | ;; versions of pytest that causes an error. | |
2810 | '(#:tests? #f)) | |
2f861edf | 2811 | (home-page "https://github.com/rpodgorny/unionfs-fuse") |
220193ad LC |
2812 | (synopsis "User-space union file system") |
2813 | (description | |
2814 | "UnionFS-FUSE is a flexible union file system implementation in user | |
2815 | space, using the FUSE library. Mounting a union file system allows you to | |
2816 | \"aggregate\" the contents of several directories into a single mount point. | |
2817 | UnionFS-FUSE additionally supports copy-on-write.") | |
3ac73271 | 2818 | (license license:bsd-3))) |
ed748588 | 2819 | |
0b7a0c20 LC |
2820 | (define fuse-static |
2821 | (package (inherit fuse) | |
2822 | (name "fuse-static") | |
2823 | (source (origin (inherit (package-source fuse)) | |
2824 | (modules '((guix build utils))) | |
2825 | (snippet | |
6cbee49d MW |
2826 | '(begin |
2827 | ;; Normally libfuse invokes mount(8) so that /etc/mtab is | |
2828 | ;; updated. Change calls to 'mtab_needs_update' to 0 so | |
2829 | ;; that it doesn't do that, allowing us to remove the | |
2830 | ;; dependency on util-linux (something that is useful in | |
2831 | ;; initrds.) | |
2832 | (substitute* '("lib/mount_util.c" | |
2833 | "util/mount_util.c") | |
2834 | (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") | |
2835 | "0") | |
2836 | (("/bin/") | |
2837 | "")) | |
2838 | #t)))))) | |
0b7a0c20 | 2839 | |
ed748588 LC |
2840 | (define-public unionfs-fuse/static |
2841 | (package (inherit unionfs-fuse) | |
2842 | (synopsis "User-space union file system (statically linked)") | |
2843 | (name (string-append (package-name unionfs-fuse) "-static")) | |
2844 | (source (origin (inherit (package-source unionfs-fuse)) | |
2845 | (modules '((guix build utils))) | |
2846 | (snippet | |
6cbee49d MW |
2847 | '(begin |
2848 | ;; Add -ldl to the libraries, because libfuse.a needs that. | |
2849 | (substitute* "src/CMakeLists.txt" | |
2850 | (("target_link_libraries(.*)\\)" _ libs) | |
2851 | (string-append "target_link_libraries" | |
2852 | libs " dl)"))) | |
2853 | #t)))) | |
ed748588 LC |
2854 | (arguments |
2855 | '(#:tests? #f | |
1456cff1 | 2856 | #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static") |
dc1d3cde KK |
2857 | #:phases |
2858 | (modify-phases %standard-phases | |
2859 | (add-after 'install 'post-install | |
2860 | (lambda* (#:key outputs #:allow-other-keys) | |
2861 | (let* ((out (assoc-ref outputs "out")) | |
2862 | (exe (string-append out "/bin/unionfs"))) | |
2863 | ;; By default, 'unionfs' keeps references to | |
2864 | ;; $glibc/share/locale and similar stuff. Remove them. | |
2865 | (remove-store-references exe) | |
2866 | ||
2867 | ;; 'unionfsctl' has references to glibc as well. Since | |
2868 | ;; we don't need it, remove it. | |
2869 | (delete-file (string-append out "/bin/unionfsctl")) | |
2870 | #t)))))) | |
0b7a0c20 | 2871 | (inputs `(("fuse" ,fuse-static))))) |
67b66003 | 2872 | |
357b9f9d | 2873 | (define-public sshfs |
db288efa | 2874 | (package |
357b9f9d | 2875 | (name "sshfs") |
20f8d1dd | 2876 | (version "2.10") |
db288efa LC |
2877 | (source (origin |
2878 | (method url-fetch) | |
b58c1b2d | 2879 | (uri (string-append "https://github.com/libfuse/sshfs/releases/" |
f5c6edd6 TGR |
2880 | "download/sshfs-" version "/sshfs-" version |
2881 | ".tar.gz")) | |
db288efa LC |
2882 | (sha256 |
2883 | (base32 | |
20f8d1dd | 2884 | "00fir2iykdx11g8nv5gijg0zjrp2g3ldypnv0yi6lq3h5pg5v13h")))) |
db288efa LC |
2885 | (build-system gnu-build-system) |
2886 | (inputs | |
2887 | `(("fuse" ,fuse) | |
2888 | ("glib" ,glib))) | |
2889 | (native-inputs | |
2890 | `(("pkg-config" ,pkg-config))) | |
f5c6edd6 | 2891 | (home-page "https://github.com/libfuse/sshfs") |
db288efa LC |
2892 | (synopsis "Mount remote file systems over SSH") |
2893 | (description | |
2894 | "This is a file system client based on the SSH File Transfer Protocol. | |
2895 | Since most SSH servers already support this protocol it is very easy to set | |
2896 | up: on the server side there's nothing to do; on the client side mounting the | |
2897 | file system is as easy as logging into the server with an SSH client.") | |
3ac73271 | 2898 | (license license:gpl2+))) |
db288efa | 2899 | |
357b9f9d | 2900 | (define-public sshfs-fuse |
2901 | (package (inherit sshfs) | |
2902 | (name "sshfs-fuse") | |
2903 | (properties `((superseded . ,sshfs))))) | |
2904 | ||
1eacffb9 RH |
2905 | (define-public archivemount |
2906 | (package | |
2907 | (name "archivemount") | |
903deeea | 2908 | (version "0.8.12") |
1eacffb9 RH |
2909 | (source |
2910 | (origin | |
2911 | (method url-fetch) | |
c6d8817e | 2912 | (uri (string-append "https://www.cybernoia.de/software/archivemount/" |
1eacffb9 RH |
2913 | "archivemount-" version ".tar.gz")) |
2914 | (sha256 | |
903deeea | 2915 | (base32 "12fb8fcmd1zwvfgzx4pay47md5cr2kgxcgq82cm6skmq75alfzi4")))) |
1eacffb9 | 2916 | (build-system gnu-build-system) |
c695fb76 TGR |
2917 | (inputs `(("fuse" ,fuse) |
2918 | ("libarchive" ,libarchive))) | |
2919 | (native-inputs `(("pkg-config" ,pkg-config))) | |
c6d8817e | 2920 | (home-page "https://www.cybernoia.de/software/archivemount.html") |
1eacffb9 RH |
2921 | (synopsis "Tool for mounting archive files with FUSE") |
2922 | (description "archivemount is a FUSE-based file system for Unix variants, | |
2923 | including Linux. Its purpose is to mount archives (i.e. tar, tar.gz, etc.) to a | |
2924 | mount point where it can be read from or written to as with any other file | |
2925 | system. This makes accessing the contents of the archive, which may be | |
2926 | compressed, transparent to other programs, without decompressing them.") | |
2927 | (license license:lgpl2.0+))) | |
2928 | ||
67b66003 LC |
2929 | (define-public numactl |
2930 | (package | |
2931 | (name "numactl") | |
93a16e4d | 2932 | (version "2.0.13") |
67b66003 LC |
2933 | (source (origin |
2934 | (method url-fetch) | |
2935 | (uri (string-append | |
0b4f8767 | 2936 | "https://github.com/numactl/numactl/releases/download/v" |
1ec29dff | 2937 | version "/numactl-" version ".tar.gz")) |
67b66003 LC |
2938 | (sha256 |
2939 | (base32 | |
93a16e4d | 2940 | "16lcypvcmx1ydkpi2s82kqhg13kak7qhpbnj8hd9bdbyhr5ja7lr")))) |
67b66003 LC |
2941 | (build-system gnu-build-system) |
2942 | (arguments | |
e35dff97 | 2943 | '(;; There's a 'test' target, but it requires NUMA support in the kernel |
67b66003 LC |
2944 | ;; to run, which we can't assume to have. |
2945 | #:tests? #f)) | |
b0015064 | 2946 | |
35dfcdd7 AE |
2947 | ;; NUMA is apparently not supported on armhf, see |
2948 | ;; http://www.spinics.net/lists/linux-numa/msg01157.html | |
2949 | (supported-systems (delete "armhf-linux" %supported-systems)) | |
0b4f8767 | 2950 | (home-page "https://github.com/numactl/numactl") |
67b66003 LC |
2951 | (synopsis "Tools for non-uniform memory access (NUMA) machines") |
2952 | (description | |
2953 | "NUMA stands for Non-Uniform Memory Access, in other words a system whose | |
79d5ac59 TGR |
2954 | memory is not all in one place. The @command{numactl} program allows you to |
2955 | run your application program on specific CPUs and memory nodes. It does this | |
2956 | by supplying a NUMA memory policy to the operating system before running your | |
67b66003 LC |
2957 | program. |
2958 | ||
79d5ac59 TGR |
2959 | The package contains other commands, such as @command{numastat}, |
2960 | @command{memhog}, and @command{numademo} which provides a quick overview of | |
2961 | NUMA performance on your system.") | |
3ac73271 LC |
2962 | (license (list license:gpl2 ;programs |
2963 | license:lgpl2.1)))) ;library | |
b10e9ff6 | 2964 | |
103b7e79 | 2965 | (define-public kbd-neo |
2966 | (package | |
2967 | (name "kbd-neo") | |
2968 | (version "2486") | |
2969 | (source | |
2970 | (origin | |
2971 | (method url-fetch) | |
2972 | (uri (string-append "https://svn.neo-layout.org/!svn/bc/" | |
2973 | version "/linux/console/neo.map")) | |
2974 | (file-name (string-append name "-" version ".map")) | |
2975 | (sha256 | |
2976 | (base32 | |
2977 | "19mfrd31vzpsjiwc7pshxm0b0sz5dd17xrz6k079cy4im1vf0r4g")))) | |
2978 | (build-system trivial-build-system) | |
2979 | (arguments | |
2980 | `(#:modules ((guix build utils)) | |
2981 | #:builder (begin | |
2982 | (use-modules (guix build utils)) | |
2983 | (let ((out (string-append %output "/share/keymaps")) | |
2984 | (source (assoc-ref %build-inputs "source"))) | |
2985 | (mkdir-p out) | |
2986 | (copy-file source (string-append out "/neo.map")) | |
2987 | #t)))) | |
2988 | (home-page "https://neo-layout.org") | |
2989 | (synopsis "Neo2 console layout") | |
2990 | (description | |
2991 | "Kbd-neo provides the Neo2 keyboard layout for use with | |
2992 | @command{loadkeys(1)} from @code{kbd(4)}.") | |
2993 | ;; The file is located in an svn directory, the entire content of | |
2994 | ;; the directory is licensed as GPL3. | |
2995 | (license license:gpl3+))) | |
2996 | ||
b10e9ff6 LC |
2997 | (define-public kbd |
2998 | (package | |
2999 | (name "kbd") | |
8555a609 | 3000 | (version "2.0.4") |
b10e9ff6 LC |
3001 | (source (origin |
3002 | (method url-fetch) | |
3003 | (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-" | |
710b4928 | 3004 | version ".tar.xz")) |
b10e9ff6 LC |
3005 | (sha256 |
3006 | (base32 | |
8555a609 | 3007 | "124swm93dm4ca0pifgkrand3r9gvj3019d4zkfxsj9djpvv0mnaz")) |
c8f60748 LC |
3008 | (modules '((guix build utils))) |
3009 | (snippet | |
f2cdcafb LC |
3010 | '(begin |
3011 | (substitute* "tests/Makefile.in" | |
3012 | ;; The '%: %.in' rule incorrectly uses @VERSION@. | |
3013 | (("@VERSION@") | |
3014 | "[@]VERSION[@]")) | |
3015 | (substitute* '("src/unicode_start" "src/unicode_stop") | |
3016 | ;; Assume the Coreutils are in $PATH. | |
3017 | (("/usr/bin/tty") | |
6cbee49d MW |
3018 | "tty")) |
3019 | #t)))) | |
b10e9ff6 LC |
3020 | (build-system gnu-build-system) |
3021 | (arguments | |
5953d2b7 AK |
3022 | '(#:phases |
3023 | (modify-phases %standard-phases | |
3024 | (add-before 'build 'pre-build | |
3025 | (lambda* (#:key inputs #:allow-other-keys) | |
3026 | (let ((gzip (assoc-ref %build-inputs "gzip")) | |
3027 | (bzip2 (assoc-ref %build-inputs "bzip2"))) | |
3028 | (substitute* "src/libkeymap/findfile.c" | |
3029 | (("gzip") | |
3030 | (string-append gzip "/bin/gzip")) | |
3031 | (("bzip2") | |
0d47fdf8 MW |
3032 | (string-append bzip2 "/bin/bzip2"))) |
3033 | #t))) | |
5953d2b7 AK |
3034 | (add-after 'install 'post-install |
3035 | (lambda* (#:key outputs #:allow-other-keys) | |
3036 | ;; Make sure these programs find their comrades. | |
3037 | (let* ((out (assoc-ref outputs "out")) | |
3038 | (bin (string-append out "/bin"))) | |
3039 | (for-each (lambda (prog) | |
3040 | (wrap-program (string-append bin "/" prog) | |
3041 | `("PATH" ":" prefix (,bin)))) | |
0d47fdf8 MW |
3042 | '("unicode_start" "unicode_stop")) |
3043 | #t)))))) | |
b10e9ff6 | 3044 | (inputs `(("check" ,check) |
f61e0e79 LC |
3045 | ("gzip" ,gzip) |
3046 | ("bzip2" ,bzip2) | |
b10e9ff6 | 3047 | ("pam" ,linux-pam))) |
fd7000fe | 3048 | (native-search-paths |
3049 | (list (search-path-specification | |
3050 | (variable "LOADKEYS_KEYMAP_PATH") | |
674d4e13 TGR |
3051 | ;; Append ‘/**’ to recursively search all directories. One can then |
3052 | ;; run (for example) ‘loadkeys en-latin9’ instead of having to find | |
3053 | ;; and type ‘i386/colemak/en-latin9’ on a mislabelled keyboard. | |
3054 | (files (list "share/keymaps/**"))))) | |
b10e9ff6 | 3055 | (native-inputs `(("pkg-config" ,pkg-config))) |
0ed81d04 | 3056 | (home-page "http://kbd-project.org/") |
b10e9ff6 LC |
3057 | (synopsis "Linux keyboard utilities and keyboard maps") |
3058 | (description | |
3059 | "This package contains keytable files and keyboard utilities compatible | |
3060 | for systems using the Linux kernel. This includes commands such as | |
36a4366d | 3061 | @code{loadkeys}, @code{setfont}, @code{kbdinfo}, and @code{chvt}.") |
3ac73271 | 3062 | (license license:gpl2+))) |
de0b620e | 3063 | |
48e595b7 LC |
3064 | (define-public loadkeys-static |
3065 | (package | |
3066 | (inherit kbd) | |
3067 | (name "loadkeys-static") | |
3068 | (arguments | |
3069 | (substitute-keyword-arguments (package-arguments kbd) | |
3070 | ((#:configure-flags flags ''()) | |
3071 | `(append '("LDFLAGS=-static" "--disable-shared" "--disable-nls" | |
3072 | "--disable-vlock" ;so we don't need libpam | |
3073 | "--disable-libkeymap") | |
3074 | ,flags)) | |
3075 | ((#:make-flags flags ''()) | |
3076 | `(cons "LDFLAGS=-all-static" ,flags)) | |
3077 | ((#:phases phases '%standard-phases) | |
3078 | `(modify-phases ,phases | |
3079 | (replace 'install | |
3080 | (lambda* (#:key outputs #:allow-other-keys) | |
3081 | (let ((out (assoc-ref outputs "out"))) | |
3082 | ;; The binary keeps references to gzip, among other things, | |
3083 | ;; which we don't need in the initrd, so strip references. | |
3084 | (remove-store-references "src/loadkeys") | |
3085 | ||
3086 | (install-file "src/loadkeys" | |
3087 | (string-append out "/bin")) | |
3088 | #t))) | |
3089 | (delete 'post-install))) | |
3090 | ((#:strip-flags _ '()) | |
3091 | ''("--strip-all")) | |
3092 | ((#:allowed-references _ '()) | |
3093 | '()))) | |
3094 | ||
3095 | (synopsis "Statically-linked @command{loadkeys} program") | |
3096 | ||
3097 | ;; This package is meant to be used internally in the initrd so don't | |
3098 | ;; expose it. | |
3099 | (properties '((hidden? . #t))))) | |
3100 | ||
de0b620e LC |
3101 | (define-public inotify-tools |
3102 | (package | |
3103 | (name "inotify-tools") | |
6c4500c4 | 3104 | (version "3.20.2.2") |
de0b620e | 3105 | (source (origin |
88f9fea7 RW |
3106 | (method git-fetch) |
3107 | (uri (git-reference | |
b0e7b699 | 3108 | (url "https://github.com/rvoicilas/inotify-tools") |
88f9fea7 RW |
3109 | (commit version))) |
3110 | (file-name (git-file-name name version)) | |
de0b620e LC |
3111 | (sha256 |
3112 | (base32 | |
6c4500c4 | 3113 | "1r12bglkb0bkqff6kgxjm81hk6z20nrxq3m7iv15d4nrqf9pm7s0")))) |
de0b620e | 3114 | (build-system gnu-build-system) |
fb5b359d MB |
3115 | (native-inputs |
3116 | `(("autoconf" ,autoconf) | |
3117 | ("automake" ,automake) | |
3118 | ("libtool" ,libtool))) | |
3119 | (home-page "https://github.com/rvoicilas/inotify-tools/wiki") | |
de0b620e LC |
3120 | (synopsis "Monitor file accesses") |
3121 | (description | |
3122 | "The inotify-tools packages provides a C library and command-line tools | |
3123 | to use Linux' inotify mechanism, which allows file accesses to be monitored.") | |
3ac73271 | 3124 | (license license:gpl2+))) |
e062d542 AE |
3125 | |
3126 | (define-public kmod | |
3127 | (package | |
3128 | (name "kmod") | |
ddcfc467 | 3129 | (version "27") |
e062d542 AE |
3130 | (source (origin |
3131 | (method url-fetch) | |
3132 | (uri | |
3133 | (string-append "mirror://kernel.org/linux/utils/kernel/kmod/" | |
3134 | "kmod-" version ".tar.xz")) | |
3135 | (sha256 | |
3136 | (base32 | |
ddcfc467 | 3137 | "035wzfzjx4nwidk747p8n085mgkvy531ppn16krrajx2dkqzply1")) |
fc1adab1 | 3138 | (patches (search-patches "kmod-module-directory.patch")))) |
e062d542 AE |
3139 | (build-system gnu-build-system) |
3140 | (native-inputs | |
3141 | `(("pkg-config" ,pkg-config))) | |
3142 | (inputs | |
f61e0e79 LC |
3143 | `(("xz" ,xz) |
3144 | ("zlib" ,zlib))) | |
e062d542 | 3145 | (arguments |
ddcfc467 BW |
3146 | `(#:configure-flags '("--with-xz" "--with-zlib" |
3147 | "--disable-test-modules") | |
9f2eb4ff TGR |
3148 | #:phases |
3149 | (modify-phases %standard-phases | |
ddcfc467 BW |
3150 | (add-after 'unpack 'disable-tests |
3151 | (lambda _ | |
3152 | ;; XXX: These tests need '--sysconfdir=/etc' to pass. | |
312d9a33 | 3153 | (substitute* "Makefile.in" |
ddcfc467 BW |
3154 | (("testsuite/test-modprobe") "") |
3155 | (("testsuite/test-depmod") "") | |
3156 | (("testsuite/test-blacklist") "")) | |
3157 | #t)) | |
9f2eb4ff TGR |
3158 | (add-after 'install 'install-modprobe&co |
3159 | (lambda* (#:key outputs #:allow-other-keys) | |
3160 | (let* ((out (assoc-ref outputs "out")) | |
3161 | (bin (string-append out "/bin"))) | |
3162 | (for-each (lambda (tool) | |
3163 | (symlink "kmod" | |
3164 | (string-append bin "/" tool))) | |
3165 | '("insmod" "rmmod" "lsmod" "modprobe" | |
3166 | "modinfo" "depmod")) | |
3167 | #t)))))) | |
22ee7209 | 3168 | (supported-systems (delete "i586-gnu" %supported-systems)) |
e062d542 AE |
3169 | (home-page "https://www.kernel.org/") |
3170 | (synopsis "Kernel module tools") | |
35b9e423 | 3171 | (description "Kmod is a set of tools to handle common tasks with Linux |
e062d542 AE |
3172 | kernel modules like insert, remove, list, check properties, resolve |
3173 | dependencies and aliases. | |
3174 | ||
3175 | These tools are designed on top of libkmod, a library that is shipped with | |
3176 | kmod. The aim is to be compatible with tools, configurations and indices | |
3177 | from the module-init-tools project.") | |
3ac73271 | 3178 | (license license:gpl2+))) ; library under lgpl2.1+ |
d7d42d6b | 3179 | |
76f5428b MC |
3180 | (define-public earlyoom |
3181 | (package | |
3182 | (name "earlyoom") | |
9f7a441d | 3183 | (version "1.3.1") |
76f5428b MC |
3184 | (source (origin |
3185 | (method git-fetch) | |
3186 | (uri (git-reference | |
b0e7b699 | 3187 | (url "https://github.com/rfjakob/earlyoom") |
76f5428b MC |
3188 | (commit (string-append "v" version)))) |
3189 | (file-name (git-file-name name version)) | |
3190 | (sha256 | |
3191 | (base32 | |
9f7a441d | 3192 | "06sd3jpkdrwqbphsf8jrgs5rxfi7j3xjmygjjvj4xjk4gncz7r2i")))) |
76f5428b MC |
3193 | (build-system gnu-build-system) |
3194 | (arguments | |
3195 | `(#:phases (modify-phases %standard-phases | |
3196 | (delete 'configure) | |
3197 | (add-before 'check 'set-home | |
3198 | (lambda _ | |
3199 | (setenv "HOME" (getcwd)) | |
3200 | #t)) | |
3201 | (add-after 'build 'install-contribs | |
3202 | ;; Install what seems useful from the contrib directory. | |
3203 | (lambda* (#:key outputs #:allow-other-keys) | |
3204 | (let* ((out (assoc-ref outputs "out")) | |
3205 | (contrib (string-append | |
3206 | out "/share/earlyoom/contrib"))) | |
3207 | (install-file "contrib/notify_all_users.py" contrib) | |
3208 | #t)))) | |
3209 | #:make-flags (let* ((prefix (assoc-ref %outputs "out"))) | |
15c8b172 | 3210 | (list ,(string-append "CC=" (cc-for-target)) |
76f5428b MC |
3211 | (string-append "VERSION=v" ,version) |
3212 | (string-append "PREFIX=" prefix) | |
3213 | (string-append "SYSCONFDIR=" prefix "/etc"))) | |
3214 | #:test-target "test")) | |
97aa6a07 RW |
3215 | (native-inputs `(("go" ,go) ;for the test suite |
3216 | ("pandoc" ,pandoc))) ;to generate the manpage | |
76f5428b MC |
3217 | (home-page "https://github.com/rfjakob/earlyoom") |
3218 | (synopsis "Simple out of memory (OOM) daemon for the Linux kernel") | |
3219 | (description "Early OOM is a minimalist out of memory (OOM) daemon that | |
3220 | runs in user space and provides a more responsive and configurable alternative | |
3221 | to the in-kernel OOM killer.") | |
3222 | (license license:expat))) | |
3223 | ||
7fa715e7 LC |
3224 | (define-public eudev |
3225 | ;; The post-systemd fork, maintained by Gentoo. | |
fe32c7f7 | 3226 | (package |
7fa715e7 | 3227 | (name "eudev") |
ed05d6b2 | 3228 | (version "3.2.9") |
7fa715e7 | 3229 | (source (origin |
ee2d63db MB |
3230 | (method git-fetch) |
3231 | (uri (git-reference (url "https://github.com/gentoo/eudev") | |
3232 | (commit (string-append "v" version)))) | |
3233 | (file-name (git-file-name name version)) | |
7fa715e7 LC |
3234 | (sha256 |
3235 | (base32 | |
ed05d6b2 | 3236 | "1g9z3d33m0i3hmbhm0wxpvkzf6ac7xj1drwcfrhzlfhhi63sg9h7")) |
202342fd | 3237 | (patches (search-patches "eudev-rules-directory.patch")))) |
fe32c7f7 | 3238 | (build-system gnu-build-system) |
4e859e92 | 3239 | (arguments |
213e1764 | 3240 | `(#:phases |
172a9b44 | 3241 | (modify-phases %standard-phases |
ee2d63db MB |
3242 | (add-after 'unpack 'make-source-writable |
3243 | (lambda _ | |
3244 | ;; XXX: Git checkouts are read-only, but this package needs to | |
3245 | ;; modify some of its files. | |
3246 | (for-each make-file-writable (find-files ".")) | |
3247 | #t)) | |
189be331 | 3248 | (add-before 'bootstrap 'patch-file-names |
213e1764 | 3249 | (lambda* (#:key inputs native-inputs #:allow-other-keys) |
172a9b44 MC |
3250 | (substitute* "man/make.sh" |
3251 | (("/usr/bin/xsltproc") | |
213e1764 MO |
3252 | (string-append (assoc-ref |
3253 | (or native-inputs inputs) "xsltproc") | |
172a9b44 | 3254 | "/bin/xsltproc"))) |
189be331 | 3255 | #t)) |
d5949638 MB |
3256 | (add-before 'configure 'patch-bindir-in-btrfs-rules |
3257 | (lambda* (#:key outputs #:allow-other-keys) | |
3258 | ;; The "@bindir@" substitution incorrectly expands to a literal | |
3259 | ;; "${exec_prefix}" (see <https://bugs.gnu.org/39926>). Work | |
3260 | ;; around it. | |
3261 | (let ((out (assoc-ref outputs "out"))) | |
3262 | (substitute* "rules/64-btrfs.rules.in" | |
3263 | (("@bindir@") | |
3264 | (string-append out "/bin"))) | |
3265 | #t))) | |
d85f8e46 MB |
3266 | (add-after 'install 'move-static-library |
3267 | (lambda* (#:key outputs #:allow-other-keys) | |
3268 | (let* ((out (assoc-ref outputs "out")) | |
3269 | (static (assoc-ref outputs "static")) | |
3270 | (source (string-append out "/lib/libudev.a")) | |
3271 | (target (string-append static "/lib/libudev.a"))) | |
3272 | (mkdir-p (dirname target)) | |
3273 | (link source target) | |
3274 | (delete-file source) | |
3275 | ;; Remove reference to the static library from the .la file | |
3276 | ;; such that Libtool looks for it in the usual places. | |
3277 | (substitute* (string-append out "/lib/libudev.la") | |
3278 | (("old_library=.*") | |
3279 | "old_library=''\n")) | |
3280 | #t))) | |
172a9b44 MC |
3281 | (add-after 'install 'build-hwdb |
3282 | (lambda* (#:key outputs #:allow-other-keys) | |
3283 | ;; Build OUT/etc/udev/hwdb.bin. This allows 'lsusb' and | |
3284 | ;; similar tools to display product names. | |
213e1764 MO |
3285 | ;; |
3286 | ;; XXX: This can't be done when cross-compiling. Find another way | |
3287 | ;; to generate hwdb.bin for cross-built systems. | |
172a9b44 | 3288 | (let ((out (assoc-ref outputs "out"))) |
213e1764 MO |
3289 | ,@(if (%current-target-system) |
3290 | '(#t) | |
3291 | '((invoke (string-append out "/bin/udevadm") | |
3292 | "hwdb" "--update"))))))) | |
d85f8e46 | 3293 | #:configure-flags (list "--enable-manpages"))) |
fe32c7f7 | 3294 | (native-inputs |
172a9b44 MC |
3295 | `(("autoconf" ,autoconf) |
3296 | ("automake" ,automake) | |
3297 | ("gperf" ,gperf) | |
3298 | ("libtool" ,libtool) | |
3299 | ("pkg-config" ,pkg-config) | |
3300 | ;; For tests. | |
e75230c1 | 3301 | ("perl" ,perl) |
172a9b44 MC |
3302 | ("python" ,python-wrapper) |
3303 | ;; For documentation. | |
3304 | ("docbook-xml" ,docbook-xml-4.2) | |
3305 | ("docbook-xsl" ,docbook-xsl) | |
3306 | ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES | |
c695fb76 | 3307 | ("xsltproc" ,libxslt))) |
fe32c7f7 | 3308 | (inputs |
255f7308 LC |
3309 | ;; When linked against libblkid, eudev can populate /dev/disk/by-label |
3310 | ;; and similar; it also installs the '60-persistent-storage.rules' file, | |
3311 | ;; which contains the rules to do that. | |
bb93042c | 3312 | `(("util-linux" ,util-linux "lib") ;for blkid |
255f7308 | 3313 | ("kmod" ,kmod))) |
d85f8e46 | 3314 | (outputs '("out" "static")) |
e1921a38 | 3315 | (home-page "https://wiki.gentoo.org/wiki/Project:Eudev") |
fe32c7f7 MW |
3316 | (synopsis "Userspace device management") |
3317 | (description "Udev is a daemon which dynamically creates and removes | |
3318 | device nodes from /dev/, handles hotplug events and loads drivers at boot | |
3319 | time.") | |
3ac73271 | 3320 | (license license:gpl2+))) |
7fa715e7 | 3321 | |
e74b2c8e BT |
3322 | (define-public python-evdev |
3323 | (package | |
3324 | (name "python-evdev") | |
3325 | (version "1.3.0") | |
3326 | (source | |
3327 | (origin | |
3328 | (method url-fetch) | |
3329 | (uri (pypi-uri "evdev" version)) | |
3330 | (sha256 | |
3331 | (base32 "0kb3636yaw9l8xi8s184w0r0n9ic5dw3b8hx048jf9fpzss4kimi")))) | |
3332 | (build-system python-build-system) | |
3333 | (native-inputs | |
3334 | `(("kernel-headers" ,linux-libre-headers))) | |
3335 | (arguments | |
3336 | `(#:tests? #f ;no rule for tests | |
3337 | #:phases | |
3338 | (modify-phases %standard-phases | |
3339 | (add-before 'build 'fix-hard-coded-directory | |
3340 | (lambda* (#:key inputs #:allow-other-keys) | |
3341 | (substitute* "setup.py" | |
3342 | (("/usr/include/linux") | |
3343 | (string-append | |
3344 | (assoc-ref inputs "kernel-headers") "/include/linux"))) | |
3345 | #t))))) | |
3346 | (home-page "https://github.com/gvalkov/python-evdev") | |
3347 | (synopsis "Bindings to the Linux input handling subsystem") | |
3348 | (description | |
3349 | "Python-evdev provides bindings to the generic input event interface in | |
3350 | Linux. The @code{evdev} interface serves the purpose of passing events | |
3351 | generated in the kernel directly to userspace through character devices that | |
3352 | are typically located in @file{/dev/input/}. | |
3353 | ||
3354 | This package also comes with bindings to @code{uinput}, the userspace input | |
3355 | subsystem. @code{uinput} allows userspace programs to create and handle input | |
3356 | devices that can inject events directly into the input subsystem.") | |
3357 | (license license:bsd-3))) | |
3358 | ||
66269d47 LC |
3359 | (define-public lvm2 |
3360 | (package | |
3361 | (name "lvm2") | |
748b2c85 | 3362 | (version "2.03.10") |
66269d47 LC |
3363 | (source (origin |
3364 | (method url-fetch) | |
b06dc2bb | 3365 | (uri (list (string-append "https://sourceware.org/ftp/lvm2/LVM2." |
57bd483f MB |
3366 | version ".tgz") |
3367 | (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2." | |
3368 | version ".tgz"))) | |
66269d47 LC |
3369 | (sha256 |
3370 | (base32 | |
748b2c85 | 3371 | "1l0fkn9abrgk5mfn6jfh9qhdr86b59l1c5pk6lp8jh0491d69las")) |
66269d47 LC |
3372 | (modules '((guix build utils))) |
3373 | (snippet | |
3374 | '(begin | |
3375 | (use-modules (guix build utils)) | |
3376 | ||
3377 | ;; Honor sysconfdir. | |
3378 | (substitute* "make.tmpl.in" | |
57bd483f | 3379 | (("^confdir = .*$") |
66269d47 LC |
3380 | "confdir = @sysconfdir@\n") |
3381 | (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@") | |
6cbee49d MW |
3382 | "DEFAULT_SYS_DIR = @sysconfdir@")) |
3383 | #t)) | |
01f94cca | 3384 | (patches (search-patches "lvm2-static-link.patch")))) |
66269d47 LC |
3385 | (build-system gnu-build-system) |
3386 | (native-inputs | |
3387 | `(("pkg-config" ,pkg-config) | |
3388 | ("procps" ,procps))) ;tests use 'pgrep' | |
3389 | (inputs | |
57bd483f MB |
3390 | `(("libaio" ,libaio) |
3391 | ("udev" ,eudev))) | |
66269d47 | 3392 | (arguments |
eff63325 | 3393 | `(#:phases |
3afbc6b3 LF |
3394 | (modify-phases %standard-phases |
3395 | (add-after 'configure 'set-makefile-shell | |
3396 | (lambda _ | |
3397 | ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as | |
3398 | ;; expected. | |
3399 | (setenv "SHELL" (which "sh")) | |
66269d47 | 3400 | |
3afbc6b3 LF |
3401 | ;; Replace /bin/sh with the right file name. |
3402 | (patch-makefile-SHELL "make.tmpl") | |
1ac18721 | 3403 | #t))) |
66269d47 LC |
3404 | |
3405 | #:configure-flags (list (string-append "--sysconfdir=" | |
3406 | (assoc-ref %outputs "out") | |
3407 | "/etc/lvm") | |
3408 | "--enable-udev_sync" | |
f2817d43 | 3409 | "--enable-udev_rules" |
9324d92e | 3410 | "--enable-pkgconfig" |
a3ed69b6 PN |
3411 | "--enable-cmdlib" |
3412 | "--enable-dmeventd" ; Requires '--enable-cmdlib'. | |
f2817d43 LC |
3413 | |
3414 | ;; Make sure programs such as 'dmsetup' can | |
3415 | ;; find libdevmapper.so. | |
3416 | (string-append "LDFLAGS=-Wl,-rpath=" | |
a3ed69b6 PN |
3417 | (assoc-ref %outputs "out") |
3418 | "/lib,-rpath=" | |
3419 | (assoc-ref %outputs "out") | |
a3ed69b6 | 3420 | "/lib/device-mapper") |
eff63325 MO |
3421 | ;; This is needed when cross-compiling. |
3422 | ,@(if (%current-target-system) | |
3423 | '("ac_cv_func_malloc_0_nonnull=yes" | |
3424 | "ac_cv_func_realloc_0_nonnull=yes") | |
3425 | '())) | |
66269d47 LC |
3426 | |
3427 | ;; The tests use 'mknod', which requires root access. | |
3428 | #:tests? #f)) | |
654de94e | 3429 | (supported-systems (delete "i586-gnu" %supported-systems)) |
62ec02bf | 3430 | (home-page "https://sourceware.org/lvm2/") |
66269d47 LC |
3431 | (synopsis "Logical volume management for Linux") |
3432 | (description | |
3433 | "LVM2 is the logical volume management tool set for Linux-based systems. | |
3434 | This package includes the user-space libraries and tools, including the device | |
3435 | mapper. Kernel components are part of Linux-libre.") | |
3436 | ||
3437 | ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1. | |
3438 | ;; Command-line tools are GPLv2. | |
3ac73271 | 3439 | (license (list license:gpl2 license:lgpl2.1)))) |
66269d47 | 3440 | |
01f94cca LC |
3441 | (define-public lvm2-static |
3442 | (package | |
3443 | (inherit lvm2) | |
3444 | (name "lvm2-static") | |
3445 | ||
3446 | ;; Propagate udev because libdevmapper.a depends on libudev. | |
d85f8e46 | 3447 | (propagated-inputs `(("udev:static" ,eudev "static"))) |
01f94cca LC |
3448 | |
3449 | (arguments | |
3450 | (substitute-keyword-arguments (package-arguments lvm2) | |
3451 | ((#:configure-flags flags '()) | |
3452 | ;; LVM2 doesn't use Libtool, hence the custom option. | |
57bd483f MB |
3453 | `(append '("--enable-static_link") |
3454 | ;; Building dmeventd statically is complicated due to a | |
3455 | ;; requirement on libdevmapper.a, which is being phased out | |
3456 | ;; in favor of libdevice-mapper.a, which in turn is is not | |
3457 | ;; easily made available at dmeventd build time. Just ignore | |
3458 | ;; it until the situation improves. | |
3459 | (delete "--enable-dmeventd" ,flags))) | |
3460 | ((#:phases phases) | |
3461 | `(modify-phases ,phases | |
3462 | (add-before 'configure 'adjust-Makefile | |
3463 | (lambda _ | |
3464 | ;; These fixes are related to the upstream libdm->device_mapper | |
3465 | ;; migration and will hopefully be fixed upstream in due time. | |
3466 | (substitute* "tools/Makefile.in" | |
3467 | ;; This variable is empty in a static configuration and causes | |
3468 | ;; an erroneous GCC command line. | |
3469 | (("-L\\$\\(interfacebuilddir\\)") "") | |
3470 | ;; Remove obsolete reference to libdevmapper.a. | |
3471 | (("-ldevmapper") "")) | |
3472 | #t)))))) | |
01f94cca LC |
3473 | (synopsis "Logical volume management for Linux (statically linked)"))) |
3474 | ||
a6843071 MR |
3475 | (define-public thin-provisioning-tools |
3476 | (package | |
3477 | (name "thin-provisioning-tools") | |
3478 | (version "0.8.5") | |
3479 | (source | |
3480 | (origin | |
3481 | (method git-fetch) | |
3482 | (uri (git-reference | |
b0e7b699 | 3483 | (url "https://github.com/jthornber/thin-provisioning-tools") |
a6843071 MR |
3484 | (commit (string-append "v" version)))) |
3485 | (file-name (git-file-name name version)) | |
3486 | (sha256 | |
3487 | (base32 "01wl8c0cjbx1smbhj8dx6av5bnw5775m58gasc3vqwvsj0s9hq19")))) | |
3488 | (build-system gnu-build-system) | |
3489 | (arguments | |
3490 | ;; Doesn't build with --enable-testing due to a function name collision | |
3491 | ;; with glibc. Fixed upstream. TODO: Enable tests when 0.9.0 is released. | |
3492 | `(#:tests? #f)) | |
3493 | (native-inputs | |
3494 | `(("automake" ,automake) | |
3495 | ("autoreconf" ,autoconf))) | |
3496 | (inputs | |
3497 | `(("boost" ,boost) | |
3498 | ("expat" ,expat) | |
3499 | ("libaio" ,libaio))) | |
3500 | (synopsis "Tools for manipulating the metadata of device-mapper targets") | |
3501 | (description "A suite of tools for manipulating the metadata of the | |
3502 | dm-thin, dm-cache and dm-era device-mapper targets.") | |
3503 | (home-page "https://github.com/jthornber/thin-provisioning-tools") | |
3504 | (license license:gpl3+))) | |
3505 | ||
000f7559 DT |
3506 | (define-public wireless-tools |
3507 | (package | |
3508 | (name "wireless-tools") | |
3509 | (version "30.pre9") | |
3510 | (source (origin | |
3511 | (method url-fetch) | |
3512 | (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools." | |
3513 | version ".tar.gz")) | |
3514 | (sha256 | |
3515 | (base32 | |
ec01f22d | 3516 | "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb")) |
ec01f22d | 3517 | (snippet |
c2099a4c MW |
3518 | '(begin |
3519 | ;; Remove the older header files that are not free software. | |
3520 | (for-each (lambda (n) | |
3521 | (delete-file (format #f "wireless.~a.h" n))) | |
3522 | '(10 11 12 13 14 15 16 17 18 19 20)) | |
3523 | #t)))) | |
000f7559 DT |
3524 | (build-system gnu-build-system) |
3525 | (arguments | |
c2099a4c MW |
3526 | `(#:make-flags |
3527 | (list (string-append "PREFIX=" %output) | |
3528 | (string-append "INSTALL_MAN=" %output "/share/man") | |
3529 | (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib") | |
3530 | "BUILD_STATIC=") | |
a21b88f1 MO |
3531 | #:phases |
3532 | (modify-phases %standard-phases | |
3533 | (replace 'configure | |
3534 | (lambda* (#:key target #:allow-other-keys) | |
3535 | (when ,(%current-target-system) | |
3536 | ;; Cross-compilation: use the cross tools. | |
3537 | (substitute* (find-files "." "Makefile") | |
3538 | (("CC = .*$") | |
3539 | (string-append "CC = " target "-gcc\n")) | |
3540 | (("AR = .*$") | |
3541 | (string-append "AR = " target "-ar\n")) | |
3542 | (("RANLIB = .*$") | |
3543 | (string-append "RANLIB = " target "-ranlib\n")))) | |
3544 | #t))) | |
000f7559 DT |
3545 | #:tests? #f)) |
3546 | (synopsis "Tools for manipulating Linux Wireless Extensions") | |
fb9b7ce2 | 3547 | (description "Wireless Tools are used to manipulate the now-deprecated |
36a4366d | 3548 | Linux Wireless Extensions; consider using @code{iw} instead. The Wireless |
fb9b7ce2 LC |
3549 | Extension was an interface allowing you to set Wireless LAN specific |
3550 | parameters and get the specific stats. It is deprecated in favor the nl80211 | |
3551 | interface.") | |
fe5ed0bb | 3552 | (home-page "https://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html") |
c2099a4c MW |
3553 | ;; wireless.21.h and wireless.22.h are distributed under lgpl2.1+, the |
3554 | ;; other files are distributed under gpl2. | |
3ac73271 | 3555 | (license (list license:gpl2 license:lgpl2.1+)))) |
30016044 | 3556 | |
cc205dac LC |
3557 | (define-public crda |
3558 | (package | |
3559 | (name "crda") | |
3560 | (version "3.18") | |
3561 | (source (origin | |
3562 | (method url-fetch) | |
3563 | (uri (string-append "mirror://kernel.org/software/network/crda/" | |
3564 | "crda-" version ".tar.xz")) | |
3565 | (sha256 | |
3566 | (base32 | |
3567 | "1gydiqgb08d9gbx4l6gv98zg3pljc984m50hmn3ysxcbkxkvkz23")) | |
fc1adab1 | 3568 | (patches (search-patches "crda-optional-gcrypt.patch")))) |
cc205dac LC |
3569 | (build-system gnu-build-system) |
3570 | (arguments | |
3403a420 | 3571 | `(#:phases (modify-phases %standard-phases |
cc205dac | 3572 | (delete 'configure) |
0bc7c2e4 MW |
3573 | (add-after 'unpack 'gzip-determinism |
3574 | (lambda _ | |
3575 | (substitute* "Makefile" | |
3576 | (("gzip") "gzip --no-name")) | |
3577 | #t)) | |
3403a420 PML |
3578 | ,@(if (%current-target-system) |
3579 | '((add-after | |
3580 | 'unpack 'fix-pkg-config | |
3581 | (lambda* (#:key target #:allow-other-keys) | |
3582 | (substitute* | |
3583 | "Makefile" | |
3584 | (("pkg-config") | |
3585 | (string-append target "-pkg-config"))) | |
3586 | #t))) | |
3587 | '()) | |
cc205dac LC |
3588 | (add-before |
3589 | 'build 'no-werror-no-ldconfig | |
3590 | (lambda _ | |
3591 | (substitute* "Makefile" | |
3592 | (("-Werror") "") | |
3593 | (("ldconfig") "true")) | |
3594 | #t)) | |
3595 | (add-before | |
3596 | 'build 'set-regulator-db-file-name | |
3403a420 | 3597 | (lambda* (#:key native-inputs inputs #:allow-other-keys) |
cc205dac | 3598 | ;; Tell CRDA where to find our database. |
3403a420 PML |
3599 | (let ((regdb (assoc-ref (or native-inputs inputs) |
3600 | "wireless-regdb"))) | |
cc205dac LC |
3601 | (substitute* "crda.c" |
3602 | (("\"/lib/crda/regulatory.bin\"") | |
3603 | (string-append "\"" regdb | |
3604 | "/lib/crda/regulatory.bin\""))) | |
3605 | #t)))) | |
3606 | #:test-target "verify" | |
3403a420 | 3607 | #:make-flags (let ((out (assoc-ref %outputs "out")) |
1ca44ae3 | 3608 | (regdb (assoc-ref %build-inputs "wireless-regdb"))) |
3403a420 | 3609 | (list |
1ca44ae3 | 3610 | (string-append "CC=" ,(cc-for-target)) |
3403a420 PML |
3611 | "V=1" |
3612 | ||
3613 | ;; Disable signature-checking on 'regulatory.bin'. | |
3614 | ;; The reason is that this simplifies maintenance | |
3615 | ;; on our side (no need to manage a distro key | |
3616 | ;; pair), and we can guarantee integrity of | |
3617 | ;; 'regulatory.bin' by other means anyway, such as | |
3618 | ;; 'guix gc --verify'. See | |
3619 | ;; <https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb> | |
3620 | ;; for a discssion. | |
3621 | "USE_OPENSSL=0" | |
3622 | ||
3623 | (string-append "PREFIX=" out) | |
3624 | (string-append "SBINDIR=" out "/sbin/") | |
3625 | (string-append "UDEV_RULE_DIR=" | |
3626 | out "/lib/udev/rules.d") | |
3627 | (string-append "LDFLAGS=-Wl,-rpath=" | |
3628 | out "/lib -L.") | |
3629 | (string-append "REG_BIN=" regdb | |
3630 | "/lib/crda/regulatory.bin") | |
3631 | "all_noverify")))) | |
cc205dac | 3632 | (native-inputs `(("pkg-config" ,pkg-config) |
cc205dac LC |
3633 | ("wireless-regdb" ,wireless-regdb))) |
3634 | (inputs `(("libnl" ,libnl))) | |
3635 | (home-page | |
3636 | "https://wireless.wiki.kernel.org/en/developers/Regulatory/CRDA") | |
3637 | (synopsis "Central regulatory domain agent (CRDA) for WiFi") | |
3638 | (description | |
3639 | "The Central Regulatory Domain Agent (CRDA) acts as the udev helper for | |
3640 | communication between the kernel Linux and user space for regulatory | |
3641 | compliance.") | |
3ac73271 | 3642 | (license license:copyleft-next))) |
cc205dac | 3643 | |
c80b4a3e LC |
3644 | (define-public wireless-regdb |
3645 | (package | |
3646 | (name "wireless-regdb") | |
3d494ccd | 3647 | (version "2020.04.29") |
c80b4a3e LC |
3648 | (source (origin |
3649 | (method url-fetch) | |
3650 | (uri (string-append | |
3651 | "mirror://kernel.org/software/network/wireless-regdb/" | |
3652 | "wireless-regdb-" version ".tar.xz")) | |
3653 | (sha256 | |
3654 | (base32 | |
3d494ccd | 3655 | "0yicda474ygahv8da18h1p4yf42s6x2f208mlwcw4xsrxld07zc9")) |
5568151f LC |
3656 | |
3657 | ;; We're building 'regulatory.bin' by ourselves. | |
6cbee49d MW |
3658 | (snippet '(begin |
3659 | (delete-file "regulatory.bin") | |
3660 | #t)))) | |
c80b4a3e LC |
3661 | (build-system gnu-build-system) |
3662 | (arguments | |
321292e1 TGR |
3663 | '(#:phases |
3664 | (modify-phases %standard-phases | |
3665 | (add-after 'unpack 'gzip-determinism | |
3666 | (lambda _ | |
3667 | (substitute* "Makefile" | |
3668 | (("gzip") "gzip --no-name")) | |
3669 | #t)) | |
3670 | (add-after 'unpack 'omit-signature | |
3671 | (lambda _ | |
3672 | (substitute* "Makefile" | |
3673 | ;; Signing requires a REGDB_PUBCERT and REGDB_PRIVKEY which we | |
3674 | ;; don't provide (see below). Disable it. | |
3675 | ((" regulatory\\.db\\.p7s") "") | |
3676 | ;; regulatory.db is built as a dependency of regulatory.db.p7s, | |
3677 | ;; but ‘make install’ depends only on the latter while installing | |
3678 | ;; both (and failing). Depend on it explicitly. | |
3679 | (("^install: " all) (string-append all "regulatory.db "))) | |
3680 | #t)) | |
3681 | (delete 'configure)) ; no configure script | |
5568151f LC |
3682 | |
3683 | ;; The 'all' target of the makefile depends on $(REGDB_CHANGED), which | |
3684 | ;; is computed and can be equal to 'maintainer-clean'; when that | |
3685 | ;; happens, we can end up deleting the 'regulatory.bin' file that we | |
3686 | ;; just built. Thus, build things sequentially. | |
3687 | #:parallel-build? #f | |
3688 | ||
321292e1 TGR |
3689 | #:tests? #f ; no tests |
3690 | #:make-flags | |
3691 | (let ((out (assoc-ref %outputs "out"))) | |
3692 | (list (string-append "PREFIX=" out) | |
3693 | (string-append "FIRMWARE_PATH=$(PREFIX)/lib/firmware") | |
3694 | ||
3695 | ;; Leave this empty so that db2bin.py doesn't try to sign | |
3696 | ;; ‘regulatory.bin’. This allows us to avoid managing a key | |
3697 | ;; pair for the whole distribution. | |
3698 | (string-append "REGDB_PRIVKEY=") | |
3699 | ;; Don't generate a public key for the same reason. These are | |
3700 | ;; used as Makefile targets and can't be the empty string. | |
3701 | (string-append "REGDB_PUBCERT=/dev/null") | |
3702 | (string-append "REGDB_PUBKEY=/dev/null"))))) | |
3703 | (native-inputs | |
3704 | `(("python" ,python-wrapper))) | |
c80b4a3e LC |
3705 | (home-page |
3706 | "https://wireless.wiki.kernel.org/en/developers/regulatory/wireless-regdb") | |
3707 | (synopsis "Wireless regulatory database") | |
3708 | (description | |
3709 | "This package contains the wireless regulatory database Central | |
3710 | Regulatory Database Agent (CRDA) daemon. The database contains information on | |
3711 | country-specific regulations for the wireless spectrum.") | |
3ac73271 | 3712 | (license license:isc))) |
c80b4a3e | 3713 | |
30016044 MW |
3714 | (define-public lm-sensors |
3715 | (package | |
3716 | (name "lm-sensors") | |
3feae386 | 3717 | (version "3.6.0") |
b7448627 TGR |
3718 | (source |
3719 | (origin | |
3720 | (method git-fetch) | |
3721 | (uri (git-reference | |
b0e7b699 | 3722 | (url "https://github.com/groeck/lm-sensors") |
b7448627 TGR |
3723 | (commit (string-append "V" (string-join |
3724 | (string-split version #\.) "-"))))) | |
3725 | (file-name (git-file-name name version)) | |
3726 | (sha256 | |
3feae386 | 3727 | (base32 "1ipf6wjx037sqyhy0r5jh4983h216anq9l68ckn2x5c3qc4wfmzn")) |
b7448627 | 3728 | (patches (search-patches "lm-sensors-hwmon-attrs.patch")))) |
30016044 MW |
3729 | (build-system gnu-build-system) |
3730 | (inputs `(("rrdtool" ,rrdtool) | |
3731 | ("perl" ,perl) | |
3732 | ("kmod" ,kmod) | |
3733 | ("gnuplot" ,gnuplot))) | |
3734 | (native-inputs `(("pkg-config" ,pkg-config) | |
3735 | ("flex" ,flex) | |
3736 | ("bison" ,bison) | |
3737 | ("which" ,which))) | |
3feae386 | 3738 | (outputs '("lib" ; avoid perl in closure |
8ddf20b2 | 3739 | "out")) |
30016044 | 3740 | (arguments |
3feae386 | 3741 | `(#:tests? #f ; no 'check' target |
30016044 | 3742 | #:make-flags (list (string-append "PREFIX=" %output) |
8ddf20b2 DL |
3743 | (string-append "ETCDIR=" (assoc-ref %outputs "lib") "/etc") |
3744 | (string-append "INCLUDEDIR=" | |
3745 | (assoc-ref %outputs "lib") "/include") | |
3746 | (string-append "MANDIR=" %output "/share/man") | |
3747 | (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib")) | |
30016044 | 3748 | #:phases |
dc1d3cde KK |
3749 | (modify-phases %standard-phases |
3750 | (delete 'configure) | |
3751 | (add-before 'build 'patch-exec-paths | |
3752 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
3753 | (substitute* "prog/detect/sensors-detect" | |
3754 | (("`uname") | |
3755 | (string-append "`" (assoc-ref inputs "coreutils") | |
3756 | "/bin/uname")) | |
3757 | (("(`|\")modprobe" all open-quote) | |
3758 | (string-append open-quote | |
3759 | (assoc-ref inputs "kmod") | |
3760 | "/bin/modprobe"))) | |
3761 | (substitute* '("prog/pwm/pwmconfig" | |
3762 | "prog/pwm/fancontrol") | |
3763 | (("gnuplot") | |
3764 | (string-append (assoc-ref inputs "gnuplot") | |
3765 | "/bin/gnuplot")) | |
3766 | (("cat ") | |
3767 | (string-append (assoc-ref inputs "coreutils") | |
3768 | "/bin/cat ")) | |
074cd595 | 3769 | (("e?grep " match) |
dc1d3cde | 3770 | (string-append (assoc-ref inputs "grep") |
074cd595 | 3771 | "/bin/" match)) |
dc1d3cde KK |
3772 | (("sed -e") |
3773 | (string-append (assoc-ref inputs "sed") | |
3774 | "/bin/sed -e")) | |
3775 | (("cut -d") | |
3776 | (string-append (assoc-ref inputs "coreutils") | |
3777 | "/bin/cut -d")) | |
3778 | (("sleep ") | |
3779 | (string-append (assoc-ref inputs "coreutils") | |
3780 | "/bin/sleep ")) | |
3781 | (("readlink -f") | |
3782 | (string-append (assoc-ref inputs "coreutils") | |
3783 | "/bin/readlink -f"))) | |
3784 | #t))))) | |
afab450c | 3785 | (home-page "https://hwmon.wiki.kernel.org/lm_sensors") |
30016044 MW |
3786 | (synopsis "Utilities to read temperature/voltage/fan sensors") |
3787 | (description | |
35b9e423 | 3788 | "Lm-sensors is a hardware health monitoring package for Linux. It allows |
30016044 MW |
3789 | you to access information from temperature, voltage, and fan speed sensors. |
3790 | It works with most newer systems.") | |
3ac73271 | 3791 | (license license:gpl2+))) |
b087d413 | 3792 | |
55e1d39b MB |
3793 | (define-public iucode-tool |
3794 | (package | |
3795 | (name "iucode-tool") | |
9eb7cde0 | 3796 | (version "2.3.1") |
55e1d39b MB |
3797 | (source (origin |
3798 | (method url-fetch) | |
3799 | (uri (string-append "https://gitlab.com/iucode-tool/releases" | |
3800 | "/raw/latest/iucode-tool_" version ".tar.xz")) | |
3801 | (sha256 | |
3802 | (base32 | |
9eb7cde0 | 3803 | "159gvf6ljgg3g4vlhyy6pyr0wz11rcyhp985vc4az58d9px8xf0j")))) |
55e1d39b MB |
3804 | (build-system gnu-build-system) |
3805 | (home-page "https://gitlab.com/iucode-tool/iucode-tool/wikis/home") | |
3806 | (synopsis "Manipulate Intel microcode bundles") | |
3807 | (description | |
3808 | "@command{iucode_tool} is a utility to work with microcode packages for | |
3809 | Intel processors. It can convert between formats, extract specific versions, | |
3810 | create a firmware image suitable for the Linux kernel, and more.") | |
513dc568 EF |
3811 | ;; cpuid.h is available for i686, x86_64, and ia64. |
3812 | (supported-systems '("i686-linux" "x86_64-linux")) | |
55e1d39b MB |
3813 | (license license:gpl2+))) |
3814 | ||
f5b2a53d RW |
3815 | (define-public i2c-tools |
3816 | (package | |
3817 | (name "i2c-tools") | |
3818 | (version "3.1.1") | |
3819 | (source (origin | |
3820 | (method url-fetch) | |
3821 | (uri (string-append | |
f32274a7 | 3822 | "http://jdelvare.nerim.net/mirror/i2c-tools/i2c-tools-" |
f5b2a53d RW |
3823 | version ".tar.bz2")) |
3824 | (sha256 | |
3825 | (base32 | |
3826 | "000pvg995qy1b15ks59gd0klri55hb33kqpg5czy84hw1pbdgm0l")))) | |
3827 | (build-system gnu-build-system) | |
3828 | (arguments | |
1f0e1c49 | 3829 | `(#:tests? #f ; no 'check' target |
f5b2a53d | 3830 | #:make-flags (list (string-append "prefix=" %output) |
1f0e1c49 TGR |
3831 | ,(string-append "CC=" (cc-for-target))) |
3832 | ;; No configure script. | |
dc1d3cde | 3833 | #:phases (modify-phases %standard-phases (delete 'configure)))) |
bccf27cb RW |
3834 | (inputs |
3835 | `(("perl" ,perl))) | |
f32274a7 | 3836 | (home-page "http://jdelvare.nerim.net/devel.html#i2ctools") |
f5b2a53d RW |
3837 | (synopsis "I2C tools for Linux") |
3838 | (description | |
3839 | "The i2c-tools package contains a heterogeneous set of I2C tools for | |
3840 | Linux: a bus probing tool, a chip dumper, register-level SMBus access helpers, | |
3841 | EEPROM decoding scripts, EEPROM programming tools, and a python module for | |
3842 | SMBus access.") | |
3ac73271 | 3843 | (license license:gpl2+))) |
f5b2a53d | 3844 | |
b087d413 MW |
3845 | (define-public xsensors |
3846 | (package | |
3847 | (name "xsensors") | |
3848 | (version "0.70") | |
3849 | (source (origin | |
3850 | (method url-fetch) | |
3851 | (uri (string-append | |
3852 | "http://www.linuxhardware.org/xsensors/xsensors-" | |
3853 | version ".tar.gz")) | |
3854 | (sha256 | |
3855 | (base32 | |
3856 | "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh")))) | |
3857 | (build-system gnu-build-system) | |
8ddf20b2 | 3858 | (inputs `(("lm-sensors" ,lm-sensors "lib") |
b087d413 MW |
3859 | ("gtk" ,gtk+-2))) |
3860 | (native-inputs `(("pkg-config" ,pkg-config))) | |
3861 | (arguments | |
dc1d3cde KK |
3862 | `(#:phases |
3863 | (modify-phases %standard-phases | |
3864 | (add-before 'configure 'enable-deprecated | |
3865 | (lambda _ | |
3866 | (substitute* "src/Makefile.in" | |
3867 | (("-DGDK_DISABLE_DEPRECATED") "") | |
3868 | (("-DGTK_DISABLE_DEPRECATED") "")) | |
3869 | #t)) | |
3870 | (add-before 'configure 'remove-Werror | |
3871 | (lambda _ | |
3872 | (substitute* '("configure" "src/Makefile.in") | |
3873 | (("-Werror") "")) | |
3874 | #t))))) | |
b087d413 MW |
3875 | (home-page "http://www.linuxhardware.org/xsensors/") |
3876 | (synopsis "Hardware health information viewer") | |
3877 | (description | |
35b9e423 | 3878 | "Xsensors reads data from the libsensors library regarding hardware |
b087d413 MW |
3879 | health such as temperature, voltage and fan speed and displays the information |
3880 | in a digital read-out.") | |
3ac73271 | 3881 | (license license:gpl2+))) |
b62fe07f LC |
3882 | |
3883 | (define-public perf | |
3884 | (package | |
3885 | (name "perf") | |
3886 | (version (package-version linux-libre)) | |
fb76ef84 | 3887 | (source (package-source linux-libre)) |
b62fe07f LC |
3888 | (build-system gnu-build-system) |
3889 | (arguments | |
dc1d3cde KK |
3890 | '(#:phases |
3891 | (modify-phases %standard-phases | |
3892 | (replace 'configure | |
3893 | (lambda* (#:key inputs #:allow-other-keys) | |
3894 | (setenv "SHELL_PATH" (which "bash")) | |
3895 | (chdir "tools/perf") | |
3896 | #t))) | |
65dabe4e | 3897 | #:make-flags (list (string-append "prefix=" |
b62fe07f | 3898 | (assoc-ref %outputs "out")) |
ff30860b | 3899 | "CC=gcc" |
2af29d23 LC |
3900 | "WERROR=0" |
3901 | ||
3902 | ;; By default, 'config/Makefile' uses lib64 on | |
3903 | ;; x86_64. Work around that. | |
3904 | "lib=lib") | |
b62fe07f LC |
3905 | #:tests? #f)) ;no tests |
3906 | (native-inputs | |
3907 | `(("pkg-config" ,pkg-config) | |
3908 | ("bison" ,bison) | |
3909 | ("flex" ,flex) | |
3910 | ||
3911 | ;; There are build scripts written in these languages. | |
3912 | ("perl" ,perl) | |
d9a412bd JK |
3913 | ("python2" ,python-2) |
3914 | ("python3" ,python-3))) | |
b62fe07f | 3915 | (inputs |
b1fb4b23 | 3916 | `(("slang" ,slang) ;for the interactive TUI |
b62fe07f | 3917 | ;; ("newt" ,newt) |
6c030d10 | 3918 | ("python" ,python-2) ;'perf' links against libpython |
b62fe07f | 3919 | ("elfutils" ,elfutils) |
b25d3bd9 | 3920 | ("libiberty" ,libiberty) ;used alongside BDF for symbol demangling |
1d484507 LC |
3921 | ("libunwind" ,libunwind) ;better stack walking |
3922 | ("numactl" ,numactl) ;for 'perf bench numa mem' | |
b62fe07f | 3923 | |
d7ece67a LC |
3924 | ;; Documentation. |
3925 | ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES | |
d7ece67a LC |
3926 | ("docbook-xsl" ,docbook-xsl) |
3927 | ("xmlto" ,xmlto) | |
3928 | ("asciidoc" ,asciidoc))) | |
b62fe07f LC |
3929 | (home-page "https://perf.wiki.kernel.org/") |
3930 | (synopsis "Linux profiling with performance counters") | |
3931 | (description | |
3932 | "perf is a tool suite for profiling using hardware performance counters, | |
3933 | with support in the Linux kernel. perf can instrument CPU performance | |
3934 | counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable | |
3935 | of lightweight profiling. This package contains the user-land tools and in | |
36a4366d | 3936 | particular the @code{perf} command.") |
b62fe07f | 3937 | (license (package-license linux-libre)))) |
c09e60e4 DT |
3938 | |
3939 | (define-public pflask | |
3940 | (package | |
3941 | (name "pflask") | |
3942 | (version "0.2") | |
3943 | (source (origin | |
8de37756 EF |
3944 | (method git-fetch) |
3945 | (uri (git-reference | |
3946 | (url "https://github.com/ghedo/pflask") | |
3947 | (commit (string-append "v" version)))) | |
3948 | (file-name (git-file-name name version)) | |
c09e60e4 DT |
3949 | (sha256 |
3950 | (base32 | |
8de37756 | 3951 | "1jikjbhlxlqracnai3v9krzcgd2xwp0p4adw5n07yxc7b857damz")))) |
c09e60e4 DT |
3952 | (build-system cmake-build-system) |
3953 | (arguments | |
3954 | '(#:tests? #f)) ; no tests | |
81e59e41 | 3955 | (home-page "https://ghedo.github.io/pflask/") |
c09e60e4 DT |
3956 | (synopsis "Simple tool for creating Linux namespace containers") |
3957 | (description "pflask is a simple tool for creating Linux namespace | |
3958 | containers. It can be used for running a command or even booting an OS inside | |
3959 | an isolated container, created with the help of Linux namespaces. It is | |
3960 | similar in functionality to chroot, although pflask provides better isolation | |
3961 | thanks to the use of namespaces.") | |
3ac73271 | 3962 | (license license:bsd-2))) |
288084d5 | 3963 | |
3ec07ced RW |
3964 | (define-public singularity |
3965 | (package | |
3966 | (name "singularity") | |
edc6dd03 | 3967 | (version "2.6.1") |
3ec07ced RW |
3968 | (source (origin |
3969 | (method url-fetch) | |
3970 | (uri (string-append "https://github.com/singularityware/singularity/" | |
3971 | "releases/download/" version | |
3972 | "/singularity-" version ".tar.gz")) | |
3973 | (sha256 | |
3974 | (base32 | |
fbf26cbc LC |
3975 | "1whx0hqqi1326scgdxxxa1d94vn95mnq0drid6s8wdp84ni4d3gk")) |
3976 | (modules '((guix build utils))) | |
3977 | (snippet | |
3978 | '(begin | |
3979 | ;; Do not create directories in /var. | |
3980 | (substitute* "Makefile.in" | |
3981 | (("\\$\\(MAKE\\) .*install-data-hook") "")) | |
af857579 LC |
3982 | |
3983 | ;; The original source overrides PATH so that it points to | |
3984 | ;; /bin, /usr/local/bin, etc., which obviously doesn't work | |
3985 | ;; on Guix System. Leave PATH unchanged so we refer to the | |
3986 | ;; installed Coreutils, grep, etc. | |
3987 | (substitute* "bin/singularity.in" | |
3988 | (("^PATH=.*" all) | |
3989 | (string-append "#" all "\n"))) | |
08814aec LC |
3990 | |
3991 | (substitute* (find-files "libexec/cli" "\\.exec$") | |
3992 | (("\\$SINGULARITY_libexecdir/singularity/bin/([a-z]+)-suid" | |
3993 | _ program) | |
3994 | (string-append "/run/setuid-programs/singularity-" | |
3995 | program "-helper"))) | |
e0dbed64 LC |
3996 | |
3997 | ;; These squashfs mount options are apparently no longer | |
3998 | ;; supported since Linux-libre 5.4.5. | |
3999 | (substitute* "src/lib/image/squashfs/mount.c" | |
4000 | (("\"errors=remount-ro\"") | |
4001 | "NULL")) | |
fbf26cbc | 4002 | #t)))) |
3ec07ced RW |
4003 | (build-system gnu-build-system) |
4004 | (arguments | |
08814aec | 4005 | `(#:configure-flags '("--localstatedir=/var") |
3ec07ced RW |
4006 | #:phases |
4007 | (modify-phases %standard-phases | |
338f5428 | 4008 | (add-after 'unpack 'patch-references |
3ec07ced RW |
4009 | (lambda _ |
4010 | (substitute* "libexec/cli/build.exec" | |
4011 | (("if ! singularity_which mksquashfs") "if 0") | |
4012 | (("if ! mksquashfs") | |
4013 | (string-append "if ! " (which "mksquashfs")))) | |
338f5428 TGR |
4014 | (substitute* (list "libexec/cli/help.exec" |
4015 | "libexec/bootstrap-scripts/functions" | |
4016 | "libexec/bootstrap-scripts/post.sh" | |
4017 | "libexec/functions") | |
4ca80a2b RW |
4018 | (("\\| grep ") |
4019 | (string-append "| " (which "grep") " ")) | |
338f5428 TGR |
4020 | (("egrep ") |
4021 | (string-append (which "egrep") " "))) | |
22464cf3 LC |
4022 | #t)) |
4023 | (add-after 'install 'set-PATH | |
4024 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
4025 | ;; Have the 'singularity' and 'run-singularity' self-sufficient. | |
4026 | (let ((out (assoc-ref outputs "out")) | |
4027 | (coreutils (assoc-ref inputs "coreutils"))) | |
4028 | (wrap-program (string-append out "/bin/singularity") | |
4029 | `("PATH" ":" = (,(string-append coreutils "/bin")))) | |
4030 | (substitute* (string-append out "/bin/run-singularity") | |
4031 | (("/usr/bin/env singularity") | |
4032 | (string-append (which "env") " " | |
4033 | out "/bin/singularity"))) | |
4034 | #t)))))) | |
3ec07ced RW |
4035 | (inputs |
4036 | `(("libarchive" ,libarchive) | |
4037 | ("python" ,python-wrapper) | |
3ec07ced RW |
4038 | ("zlib" ,zlib) |
4039 | ("squashfs-tools" ,squashfs-tools))) | |
4040 | (home-page "https://singularity.lbl.gov/") | |
4041 | (synopsis "Container platform") | |
4042 | (description "Singularity is a container platform supporting a number of | |
4043 | container image formats. It can build SquashFS container images or import | |
4044 | existing Docker images. Singularity requires kernel support for container | |
4045 | isolation or root privileges.") | |
4046 | (license license:bsd-3))) | |
4047 | ||
288084d5 MW |
4048 | (define-public hdparm |
4049 | (package | |
4050 | (name "hdparm") | |
abb90ff9 | 4051 | (version "9.58") |
288084d5 MW |
4052 | (source (origin |
4053 | (method url-fetch) | |
1b1ef87e TGR |
4054 | (uri (string-append "mirror://sourceforge/hdparm/hdparm/" |
4055 | "hdparm-" version ".tar.gz")) | |
288084d5 MW |
4056 | (sha256 |
4057 | (base32 | |
abb90ff9 | 4058 | "03z1qm8zbgpxagk3994lvp24yqsshjibkwg05v9p3q1w7y48xrws")))) |
288084d5 MW |
4059 | (build-system gnu-build-system) |
4060 | (arguments | |
7dd57cc0 TGR |
4061 | `(#:make-flags |
4062 | (let ((out (assoc-ref %outputs "out"))) | |
4063 | (list (string-append "binprefix=" out) | |
4064 | (string-append "manprefix=" out) | |
4065 | ,(string-append "CC=" (cc-for-target)) | |
4066 | ;; Let Guix strip the binaries and not break cross-compilation. | |
4067 | "STRIP=true")) | |
ec238332 TGR |
4068 | #:phases |
4069 | (modify-phases %standard-phases | |
4070 | (delete 'configure)) ; no configure script | |
4071 | #:tests? #f)) ; no test suite | |
3b3b60d0 | 4072 | (home-page "https://sourceforge.net/projects/hdparm/") |
02052b2c | 4073 | (synopsis "View and tune ATA disk drive parameters") |
288084d5 | 4074 | (description |
02052b2c TGR |
4075 | "@command{hdparm} is a command-line utility to control ATA controllers and |
4076 | disk drives. It can increase performance and/or reliability by careful tuning | |
4077 | of hardware settings like power and acoustic management, DMA modes, and caching. | |
4078 | It can also display detailed device information, or be used as a simple | |
4079 | performance benchmarking tool. | |
4080 | ||
4081 | @command{hdparm} provides a command line interface to various Linux kernel | |
4082 | interfaces provided by the SATA/ATA/SAS @code{libata} subsystem, and the older | |
d08be77a TGR |
4083 | IDE driver subsystem. Many external USB drive enclosures with SCSI-ATA Command |
4084 | Translation (@dfn{SAT}) are also supported.") | |
3ac73271 | 4085 | (license (license:non-copyleft "file://LICENSE.TXT")))) |
288084d5 | 4086 | |
323841bd VL |
4087 | (define-public nvme-cli |
4088 | (package | |
4089 | (name "nvme-cli") | |
639bdf97 | 4090 | (version "1.12") |
323841bd VL |
4091 | (home-page "https://github.com/linux-nvme/nvme-cli") |
4092 | (source (origin | |
4093 | (method git-fetch) | |
4094 | (uri (git-reference | |
4095 | (url home-page) | |
4096 | (commit (string-append "v" version)))) | |
4097 | (sha256 | |
639bdf97 | 4098 | (base32 "0ldky34sn0m5c4hgiip0fkzm465nca69bhxicpd5dg8wxhzxqrp3")) |
323841bd VL |
4099 | (file-name (git-file-name name version)))) |
4100 | (build-system gnu-build-system) | |
4101 | (arguments | |
2b9ce100 TGR |
4102 | `(#:make-flags |
4103 | (list ,(string-append "CC=" (cc-for-target))) | |
323841bd | 4104 | #:phases (modify-phases %standard-phases |
2b9ce100 | 4105 | (delete 'configure) ; no ./configure script |
323841bd VL |
4106 | (replace 'install |
4107 | (lambda _ | |
4108 | (invoke "make" "install-spec" "PREFIX=" | |
4109 | (string-append "DESTDIR=" %output))))) | |
2b9ce100 TGR |
4110 | ;; The tests require sysfs, which is not accessible from from the build |
4111 | ;; environment | |
4112 | #:tests? #f)) | |
323841bd VL |
4113 | (synopsis "NVM-Express user space tooling for Linux") |
4114 | (description "Nvme-cli is a utility to provide standards compliant tooling | |
4115 | for NVM-Express drives. It was made specifically for Linux as it relies on the | |
4116 | IOCTLs defined by the mainline kernel driver.") | |
4117 | (license license:gpl2+))) | |
4118 | ||
c755c854 MW |
4119 | (define-public rfkill |
4120 | (package | |
4121 | (name "rfkill") | |
4122 | (version "0.5") | |
4123 | (source (origin | |
4124 | (method url-fetch) | |
4125 | (uri (string-append "mirror://kernel.org/software/network/" | |
4126 | name "/" name "-" version ".tar.xz")) | |
4127 | (sha256 | |
4128 | (base32 | |
4129 | "0snqj5h0y991lszbigbyyqb8swj0hxajc1vfqg2scfay44231bp0")))) | |
4130 | (build-system gnu-build-system) | |
4131 | (arguments | |
4132 | `(#:make-flags (list "CC=gcc" | |
4133 | (string-append "PREFIX=" %output)) | |
4134 | #:phases (modify-phases %standard-phases | |
4135 | (delete 'configure)) | |
4136 | #:tests? #f)) | |
4137 | (home-page "https://wireless.wiki.kernel.org/en/users/Documentation/rfkill") | |
4138 | (synopsis "Tool for enabling and disabling wireless devices") | |
4139 | (description | |
4140 | "rfkill is a simple tool for accessing the rfkill device interface, | |
4141 | which is used to enable and disable wireless networking devices, typically | |
4142 | WLAN, Bluetooth and mobile broadband.") | |
3ac73271 | 4143 | (license (license:non-copyleft "file://COPYING" |
5146f22b EF |
4144 | "See COPYING in the distribution.")) |
4145 | ;; rfkill is part of util-linux as of 2.31. | |
4146 | (properties `((superseded . ,util-linux))))) | |
c755c854 | 4147 | |
dc9bdb1e ML |
4148 | (define-public acpi |
4149 | (package | |
4150 | (name "acpi") | |
4151 | (version "1.7") | |
4152 | (source (origin | |
4153 | (method url-fetch) | |
81e59e41 | 4154 | (uri (string-append "mirror://sourceforge/acpiclient/acpiclient/" |
de67e922 | 4155 | version "/" name "-" version ".tar.gz")) |
dc9bdb1e ML |
4156 | (sha256 |
4157 | (base32 | |
4158 | "01ahldvf0gc29dmbd5zi4rrnrw2i1ajnf30sx2vyaski3jv099fp")))) | |
4159 | (build-system gnu-build-system) | |
4160 | (home-page "http://acpiclient.sourceforge.net") | |
4161 | (synopsis "Display information on ACPI devices") | |
4162 | (description "@code{acpi} attempts to replicate the functionality of the | |
4163 | \"old\" @code{apm} command on ACPI systems, including battery and thermal | |
4164 | information. It does not support ACPI suspending, only displays information | |
4165 | about ACPI devices.") | |
4166 | (license license:gpl2+))) | |
4167 | ||
57a516d3 LC |
4168 | (define-public acpid |
4169 | (package | |
4170 | (name "acpid") | |
b928c587 | 4171 | (version "2.0.32") |
57a516d3 LC |
4172 | (source (origin |
4173 | (method url-fetch) | |
4174 | (uri (string-append "mirror://sourceforge/acpid2/acpid-" | |
4175 | version ".tar.xz")) | |
4176 | (sha256 | |
4177 | (base32 | |
b928c587 | 4178 | "0zhmxnhnhg4v1viw82yjr22kram6k5k1ixznhayk8cnw7q5x7lpj")))) |
57a516d3 | 4179 | (build-system gnu-build-system) |
3b3b60d0 | 4180 | (home-page "https://sourceforge.net/projects/acpid2/") |
57a516d3 LC |
4181 | (synopsis "Daemon for delivering ACPI events to user-space programs") |
4182 | (description | |
4183 | "acpid is designed to notify user-space programs of Advanced | |
4184 | Configuration and Power Interface (ACPI) events. acpid should be started | |
4185 | during the system boot, and will run as a background process. When an ACPI | |
4186 | event is received from the kernel, acpid will examine the list of rules | |
4187 | specified in /etc/acpi/events and execute the rules that match the event.") | |
3ac73271 | 4188 | (license license:gpl2+))) |
37f5caec TUBK |
4189 | |
4190 | (define-public sysfsutils | |
4191 | (package | |
4192 | (name "sysfsutils") | |
4193 | (version "2.1.0") | |
4194 | (source | |
4195 | (origin | |
4196 | (method url-fetch) | |
4197 | (uri | |
4198 | (string-append | |
4199 | "mirror://sourceforge/linux-diag/sysfsutils/" version "/sysfsutils-" | |
4200 | version ".tar.gz")) | |
4201 | (sha256 | |
4202 | (base32 "12i0ip11xbfcjzxz4r10cvz7mbzgq1hfcdn97w6zz7sm3wndwrg8")))) | |
4203 | (build-system gnu-build-system) | |
4204 | (home-page "http://linux-diag.sourceforge.net/Sysfsutils.html") | |
4205 | (synopsis "System utilities based on Linux sysfs") | |
4206 | (description | |
8f65585b | 4207 | "These are a set of utilities built upon sysfs, a virtual file system in |
37f5caec TUBK |
4208 | Linux kernel versions 2.5+ that exposes a system's device tree. The package |
4209 | also contains the libsysfs library.") | |
4210 | ;; The library is under lgpl2.1+ (all files say "or any later version"). | |
4211 | ;; The rest is mostly gpl2, with a few files indicating gpl2+. | |
3ac73271 | 4212 | (license (list license:gpl2 license:gpl2+ license:lgpl2.1+)))) |
a9a1a40b TUBK |
4213 | |
4214 | (define-public sysfsutils-1 | |
4215 | (package | |
4216 | (inherit sysfsutils) | |
4217 | (version "1.3.0") | |
4218 | (source | |
4219 | (origin | |
4220 | (method url-fetch) | |
4221 | (uri | |
4222 | (string-append | |
4223 | "mirror://sourceforge/linux-diag/sysfsutils/sysfsutils-" version | |
4224 | "/sysfsutils-" version ".tar.gz")) | |
4225 | (sha256 | |
4226 | (base32 "0kdhs07fm8263pxwd5blwn2x211cg4fk63fyf9ijcdkvzmwxrqq3")) | |
4227 | (modules '((guix build utils))) | |
4228 | (snippet | |
4229 | '(begin | |
4230 | (substitute* "Makefile.in" | |
4231 | (("includedir = /usr/include/sysfs") | |
4232 | "includedir = @includedir@")) | |
4233 | (substitute* "configure" | |
4234 | (("includedir='(\\$\\{prefix\\}/include)'" all orig) | |
6cbee49d MW |
4235 | (string-append "includedir='" orig "/sysfs'"))) |
4236 | #t)))) | |
a9a1a40b | 4237 | (synopsis "System utilities based on Linux sysfs (version 1.x)"))) |
e6caa52d TUBK |
4238 | |
4239 | (define-public cpufrequtils | |
4240 | (package | |
4241 | (name "cpufrequtils") | |
4242 | (version "0.3") | |
4243 | (source | |
4244 | (origin | |
4245 | (method url-fetch) | |
18160c34 MB |
4246 | (uri (string-append "mirror://kernel.org/linux/utils/kernel/cpufreq/" |
4247 | "cpufrequtils-" version ".tar.gz")) | |
e6caa52d TUBK |
4248 | (sha256 |
4249 | (base32 "0qfqv7nqmjfr3p0bwrdlxkiqwqr7vmx053cadaa548ybqbghxmvm")) | |
fc1adab1 | 4250 | (patches (search-patches "cpufrequtils-fix-aclocal.patch")))) |
e6caa52d TUBK |
4251 | (build-system gnu-build-system) |
4252 | (native-inputs | |
4253 | `(("sysfsutils" ,sysfsutils-1))) | |
4254 | (arguments | |
4255 | '(#:make-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
4256 | (assoc-ref %outputs "out") "/lib")))) | |
4257 | (home-page "https://www.kernel.org/pub/linux/utils/kernel/cpufreq/") | |
4258 | (synopsis "Utilities to get and set CPU frequency on Linux") | |
4259 | (description | |
e881752c | 4260 | "The cpufrequtils suite contains utilities to retrieve CPU frequency |
e6caa52d TUBK |
4261 | information, and set the CPU frequency if supported, using the cpufreq |
4262 | capabilities of the Linux kernel.") | |
3ac73271 | 4263 | (license license:gpl2))) |
0a588bf9 SB |
4264 | |
4265 | (define-public libraw1394 | |
4266 | (package | |
4267 | (name "libraw1394") | |
7c58c852 | 4268 | (version "2.1.2") |
0a588bf9 SB |
4269 | (source (origin |
4270 | (method url-fetch) | |
4271 | (uri (string-append | |
4272 | "mirror://kernel.org/linux/libs/ieee1394/" | |
4273 | name "-" version ".tar.xz")) | |
4274 | (sha256 | |
4275 | (base32 | |
7c58c852 | 4276 | "0pm5b415j1qdzyw38wdv8h7ff4yx20831z1727mpsb6jc6bwdk03")))) |
0a588bf9 SB |
4277 | (build-system gnu-build-system) |
4278 | (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page") | |
4279 | (synopsis "Interface library for the Linux IEEE1394 drivers") | |
4280 | (description | |
4281 | "Libraw1394 is the only supported interface to the kernel side raw1394 of | |
4282 | the Linux IEEE-1394 subsystem, which provides direct access to the connected | |
4283 | 1394 buses to user space. Through libraw1394/raw1394, applications can directly | |
4284 | send to and receive from other nodes without requiring a kernel driver for the | |
4285 | protocol in question.") | |
3ac73271 | 4286 | (license license:lgpl2.1+))) |
68e3c29d SB |
4287 | |
4288 | (define-public libavc1394 | |
4289 | (package | |
4290 | (name "libavc1394") | |
4291 | (version "0.5.4") | |
4292 | (source (origin | |
4293 | (method url-fetch) | |
de67e922 | 4294 | (uri (string-append "mirror://sourceforge/libavc1394/libavc1394/" |
68e3c29d SB |
4295 | name "-" version ".tar.gz")) |
4296 | (sha256 | |
4297 | (base32 | |
4298 | "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw")))) | |
4299 | (build-system gnu-build-system) | |
4300 | (native-inputs | |
4301 | `(("pkg-config" ,pkg-config))) | |
4302 | (propagated-inputs | |
4303 | `(("libraw1394" ,libraw1394))) ; required by libavc1394.pc | |
3b3b60d0 | 4304 | (home-page "https://sourceforge.net/projects/libavc1394/") |
68e3c29d SB |
4305 | (synopsis "AV/C protocol library for IEEE 1394") |
4306 | (description | |
4307 | "Libavc1394 is a programming interface to the AV/C specification from | |
69b4ffcf | 4308 | the 1394 Trade Association. AV/C stands for Audio/Video Control.") |
3ac73271 | 4309 | (license license:lgpl2.1+))) |
3f7bf86a SB |
4310 | |
4311 | (define-public libiec61883 | |
4312 | (package | |
4313 | (name "libiec61883") | |
4314 | (version "1.2.0") | |
4315 | (source (origin | |
4316 | (method url-fetch) | |
4317 | (uri (string-append | |
4318 | "mirror://kernel.org/linux/libs/ieee1394/" | |
4319 | name "-" version ".tar.xz")) | |
4320 | (sha256 | |
4321 | (base32 | |
4322 | "17ph458zya2l8dr2xwqnzy195qd9swrir31g78qkgb3g4xz2rq6i")))) | |
4323 | (build-system gnu-build-system) | |
4324 | (native-inputs | |
4325 | `(("pkg-config" ,pkg-config))) | |
4326 | (propagated-inputs | |
4327 | `(("libraw1394" ,libraw1394))) ; required by libiec61883.pc | |
4328 | (home-page "https://ieee1394.wiki.kernel.org/index.php/Main_Page") | |
4329 | (synopsis "Isochronous streaming media library for IEEE 1394") | |
4330 | (description | |
4331 | "The libiec61883 library provides a higher level API for streaming DV, | |
4332 | MPEG-2 and audio over Linux IEEE 1394.") | |
3ac73271 | 4333 | (license license:lgpl2.1+))) |
69159125 MW |
4334 | |
4335 | (define-public mdadm | |
4336 | (package | |
4337 | (name "mdadm") | |
30288ae5 | 4338 | (version "4.1") |
69159125 MW |
4339 | (source (origin |
4340 | (method url-fetch) | |
4341 | (uri (string-append | |
4342 | "mirror://kernel.org/linux/utils/raid/mdadm/mdadm-" | |
4343 | version ".tar.xz")) | |
4344 | (sha256 | |
4345 | (base32 | |
30288ae5 | 4346 | "0jjgjgqijpdp7ijh8slzzjjw690kydb1jjadf0x5ilq85628hxmb")))) |
69159125 MW |
4347 | (build-system gnu-build-system) |
4348 | (inputs | |
4349 | `(("udev" ,eudev))) | |
4350 | (arguments | |
4351 | `(#:make-flags (let ((out (assoc-ref %outputs "out"))) | |
3dec317f | 4352 | (list ,(string-append "CC=" (cc-for-target)) |
fae88ae8 | 4353 | "INSTALL=install" |
69159125 MW |
4354 | "CHECK_RUN_DIR=0" |
4355 | ;; TODO: tell it where to find 'sendmail' | |
4356 | ;; (string-append "MAILCMD=" <???> "/sbin/sendmail") | |
4357 | (string-append "BINDIR=" out "/sbin") | |
4358 | (string-append "MANDIR=" out "/share/man") | |
4359 | (string-append "UDEVDIR=" out "/lib/udev"))) | |
dc1d3cde KK |
4360 | #:phases |
4361 | (modify-phases %standard-phases | |
4362 | (add-before 'build 'patch-program-paths | |
7dbd3a8e MO |
4363 | (lambda* (#:key native-inputs inputs #:allow-other-keys) |
4364 | (let ((coreutils (assoc-ref (or native-inputs inputs) | |
4365 | "coreutils"))) | |
dc1d3cde KK |
4366 | (substitute* "udev-md-raid-arrays.rules" |
4367 | (("/usr/bin/(readlink|basename)" all program) | |
4368 | (string-append coreutils "/bin/" program)))) | |
4369 | #t)) | |
4370 | (add-before 'build 'remove-W-error | |
4371 | (lambda _ | |
4372 | ;; We cannot build with -Werror on i686 due to a | |
4373 | ;; 'sign-compare' warning in util.c. | |
4374 | (substitute* "Makefile" | |
4375 | (("-Werror") "")) | |
4376 | #t)) | |
4377 | (delete 'configure)) | |
69159125 MW |
4378 | ;;tests must be done as root |
4379 | #:tests? #f)) | |
654de94e | 4380 | (supported-systems (delete "i586-gnu" %supported-systems)) |
69159125 MW |
4381 | (home-page "http://neil.brown.name/blog/mdadm") |
4382 | (synopsis "Tool for managing Linux Software RAID arrays") | |
4383 | (description | |
4384 | "mdadm is a tool for managing Linux Software RAID arrays. It can create, | |
4385 | assemble, report on, and monitor arrays. It can also move spares between raid | |
4386 | arrays when needed.") | |
3ac73271 | 4387 | (license license:gpl2+))) |
01ccdfb6 | 4388 | |
631fda7e LC |
4389 | (define-public mdadm-static |
4390 | (package | |
4391 | (inherit mdadm) | |
4392 | (name "mdadm-static") | |
4393 | (arguments | |
4394 | (substitute-keyword-arguments (package-arguments mdadm) | |
4395 | ((#:make-flags flags) | |
4396 | `(cons "LDFLAGS = -static" ,flags)) | |
4397 | ((#:phases phases) | |
4398 | `(modify-phases ,phases | |
4399 | (add-after 'install 'remove-cruft | |
4400 | (lambda* (#:key outputs #:allow-other-keys) | |
4401 | (let* ((out (assoc-ref outputs "out")) | |
4402 | (precious? (lambda (file) | |
4403 | (member file '("." ".." "sbin")))) | |
4404 | (directories (scandir out (negate precious?)))) | |
4405 | (with-directory-excursion out | |
4406 | (for-each delete-file-recursively directories) | |
4407 | (remove-store-references "sbin/mdadm") | |
4408 | (delete-file "sbin/mdmon") | |
4409 | #t)))))) | |
4410 | ((#:modules modules %gnu-build-system-modules) | |
4411 | `((ice-9 ftw) ,@modules)) | |
4412 | ((#:strip-flags _ '()) | |
4413 | ''("--strip-all")) ;strip a few extra KiB | |
4414 | ((#:allowed-references _ '("out")) | |
4415 | '("out")))) ;refer only self | |
4416 | (synopsis "Statically-linked 'mdadm' command for use in an initrd"))) | |
4417 | ||
b3ed50e6 MB |
4418 | (define-public multipath-tools |
4419 | (package | |
4420 | (name "multipath-tools") | |
cfdd023b | 4421 | (version "0.8.4") |
b3ed50e6 | 4422 | (source (origin |
d1ed1d75 MB |
4423 | (method git-fetch) |
4424 | (uri (git-reference | |
4425 | (url "https://git.opensvc.com/multipath-tools/.git") | |
4426 | (commit version))) | |
4427 | (file-name (git-file-name name version)) | |
b3ed50e6 MB |
4428 | (sha256 |
4429 | (base32 | |
cfdd023b MB |
4430 | "14n8pcgnliicqxzc40xvjxk4cafm4qx7a3rsx5qva74r3ydzx8rn")) |
4431 | (patches (search-patches "multipath-tools-sans-systemd.patch")) | |
b3ed50e6 MB |
4432 | (modules '((guix build utils))) |
4433 | (snippet | |
4434 | '(begin | |
4435 | ;; Drop bundled valgrind headers. | |
4436 | (delete-file-recursively "third-party") | |
4437 | (substitute* '("multipathd/main.c" | |
4438 | "libmultipath/debug.c") | |
4439 | (("#include \"../third-party/") | |
4440 | "#include \"")) | |
4441 | #t)))) | |
4442 | (build-system gnu-build-system) | |
4443 | (arguments | |
a43fe7ac | 4444 | '(#:test-target "test" |
cfdd023b | 4445 | #:parallel-build? #f ;XXX: broken in 0.8.4 |
bd835ff2 TGR |
4446 | #:make-flags (list "CC=gcc" |
4447 | (string-append "DESTDIR=" | |
b3ed50e6 | 4448 | (assoc-ref %outputs "out")) |
cfdd023b MB |
4449 | ;; Install Udev rules below this directory, relative |
4450 | ;; to the prefix. | |
b5fb9430 | 4451 | "SYSTEMDPATH=lib" |
b3ed50e6 MB |
4452 | (string-append "LDFLAGS=-Wl,-rpath=" |
4453 | (assoc-ref %outputs "out") | |
4454 | "/lib")) | |
4455 | #:phases | |
4456 | (modify-phases %standard-phases | |
b5fb9430 | 4457 | (add-after 'unpack 'patch-source |
7f412f33 MB |
4458 | (lambda* (#:key inputs #:allow-other-keys) |
4459 | (let ((lvm2 (assoc-ref inputs "lvm2")) | |
4460 | (udev (assoc-ref inputs "udev"))) | |
4461 | (substitute* "Makefile.inc" | |
a9e7d656 MO |
4462 | (("\\$\\(prefix\\)/usr") "$(prefix)") |
4463 | ;; Do not save timestamp to avoid gzip "timestamp | |
4464 | ;; out-of-range" warnings. | |
4465 | (("gzip -9") "gzip -9n")) | |
7f412f33 MB |
4466 | (substitute* '("kpartx/Makefile" "libmultipath/Makefile") |
4467 | (("/usr/include/libdevmapper.h") | |
4468 | (string-append lvm2 "/include/libdevmapper.h")) | |
4469 | (("/usr/include/libudev.h") | |
4470 | (string-append udev "/include/libudev.h"))) | |
4471 | #t))) | |
cfdd023b MB |
4472 | (add-after 'unpack 'fix-maybe-uninitialized-variable |
4473 | (lambda _ | |
4474 | ;; This variable gets initialized later if needed, but GCC 7 | |
4475 | ;; fails to notice. Should be fixed for > 0.8.4. | |
4476 | ;; https://www.redhat.com/archives/dm-devel/2020-March/msg00137.html | |
4477 | (substitute* "libmultipath/structs_vec.c" | |
4478 | (("bool is_queueing;") | |
4479 | "bool is_queueing = false;")) | |
4480 | #t)) | |
a43fe7ac MB |
4481 | (add-after 'unpack 'fix-linking-tests |
4482 | (lambda _ | |
4483 | ;; Add missing linker flag for -lmpathcmd. This should be fixed | |
4484 | ;; for versions > 0.8.4. | |
4485 | (substitute* "tests/Makefile" | |
4486 | (("-lmultipath -lcmocka") | |
4487 | "-lmultipath -L$(mpathcmddir) -lmpathcmd -lcmocka")) | |
4488 | #t)) | |
57e3f06b | 4489 | (delete 'configure)))) ; no configure script |
b3ed50e6 | 4490 | (native-inputs |
7f412f33 MB |
4491 | `(("perl" ,perl) |
4492 | ("pkg-config" ,pkg-config) | |
a43fe7ac MB |
4493 | ("valgrind" ,valgrind) |
4494 | ||
4495 | ;; For tests. | |
4496 | ("cmocka" ,cmocka))) | |
b3ed50e6 | 4497 | (inputs |
beec29da | 4498 | `(("json-c" ,json-c-0.13) |
b3ed50e6 MB |
4499 | ("libaio" ,libaio) |
4500 | ("liburcu" ,liburcu) | |
4501 | ("lvm2" ,lvm2) | |
4502 | ("readline" ,readline) | |
4503 | ("udev" ,eudev))) | |
4504 | (home-page "http://christophe.varoqui.free.fr/") | |
4505 | (synopsis "Access block devices through multiple paths") | |
4506 | (description | |
4507 | "This package provides the following binaries to drive the | |
4508 | Linux Device Mapper multipathing driver: | |
4509 | @enumerate | |
4510 | @item @command{multipath} - Device mapper target autoconfig. | |
4511 | @item @command{multipathd} - Multipath daemon. | |
4512 | @item @command{mpathpersist} - Manages SCSI persistent reservations on | |
4513 | @code{dm} multipath devices. | |
4514 | @item @command{kpartx} - Create device maps from partition tables. | |
4515 | @end enumerate") | |
57e3f06b | 4516 | (license (list license:gpl2+ ; main distribution |
b3ed50e6 MB |
4517 | license:lgpl2.0+)))) ; libmpathcmd/mpath_cmd.h |
4518 | ||
01ccdfb6 SB |
4519 | (define-public libaio |
4520 | (package | |
4521 | (name "libaio") | |
2fabf398 | 4522 | (version "0.3.112") |
01ccdfb6 SB |
4523 | (source (origin |
4524 | (method url-fetch) | |
87dc306b MB |
4525 | (uri (list |
4526 | (string-append "https://releases.pagure.org/libaio/" | |
4527 | name "-" version ".tar.gz"))) | |
4528 | (sha256 | |
4529 | (base32 | |
2fabf398 | 4530 | "14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b")))) |
01ccdfb6 SB |
4531 | (build-system gnu-build-system) |
4532 | (arguments | |
f847d9dc MB |
4533 | `(#:make-flags |
4534 | (let ((target ,(%current-target-system))) | |
4535 | (list (string-append "prefix=" %output) | |
4536 | (string-append | |
4537 | "CC=" (if target | |
4538 | (string-append (assoc-ref %build-inputs "cross-gcc") | |
4539 | "/bin/" target "-gcc") | |
4540 | "gcc")))) | |
01ccdfb6 SB |
4541 | #:test-target "partcheck" ; need root for a full 'check' |
4542 | #:phases | |
21bdf383 | 4543 | (modify-phases %standard-phases (delete 'configure)))) ; no configure script |
87dc306b | 4544 | (home-page "https://pagure.io/libaio") |
01ccdfb6 SB |
4545 | (synopsis "Linux-native asynchronous I/O access library") |
4546 | (description | |
4547 | "This library enables userspace to use Linux kernel asynchronous I/O | |
4548 | system calls, important for the performance of databases and other advanced | |
4549 | applications.") | |
3ac73271 | 4550 | (license license:lgpl2.1+))) |
eb7c43c3 | 4551 | |
12eb7bb8 VL |
4552 | (define-public blktrace |
4553 | ;; Take a newer commit to get the fix for CVE-2018-10689. | |
93a267b7 VL |
4554 | (let ((commit "db4f6340e04716285ea56fe26d76381c3adabe58") |
4555 | (revision "1")) | |
12eb7bb8 VL |
4556 | (package |
4557 | (name "blktrace") | |
4558 | (version (git-version "1.2.0" revision commit)) | |
4559 | (home-page | |
4560 | "https://git.kernel.org/pub/scm/linux/kernel/git/axboe/blktrace.git") | |
4561 | (source (origin | |
4562 | (method git-fetch) | |
4563 | (uri (git-reference | |
4564 | (url home-page) | |
4565 | (commit commit))) | |
4566 | (sha256 | |
93a267b7 VL |
4567 | (base32 "0ah7xn4qnx09k6bm39p69av7d0c8cl6863drv6a1nf914sq1kpgp")) |
4568 | (file-name (git-file-name name version)))) | |
12eb7bb8 VL |
4569 | (build-system gnu-build-system) |
4570 | (arguments | |
ac68ab33 TGR |
4571 | `(#:make-flags |
4572 | (list ,(string-append "CC=" (cc-for-target)) | |
4573 | (string-append "prefix=" %output)) | |
4574 | #:tests? #f ; no tests | |
12eb7bb8 VL |
4575 | #:phases |
4576 | (modify-phases %standard-phases | |
ac68ab33 | 4577 | (delete 'configure) ; no configure script |
12eb7bb8 VL |
4578 | (add-after 'unpack 'fix-gnuplot-path |
4579 | (lambda* (#:key inputs #:allow-other-keys) | |
4580 | (let ((gnuplot (assoc-ref inputs "gnuplot"))) | |
4581 | (substitute* "btt/bno_plot.py" | |
4582 | (("gnuplot %s") | |
4583 | (string-append gnuplot "/bin/gnuplot %s"))) | |
4584 | #t)))))) | |
4585 | (inputs | |
4586 | `(("libaio" ,libaio) | |
4587 | ("gnuplot" ,gnuplot) | |
4588 | ("python" ,python-wrapper))) ;for 'bno_plot.py' | |
4589 | (synopsis "Block layer IO tracing mechanism") | |
4590 | (description "Blktrace is a block layer IO tracing mechanism which provides | |
4591 | detailed information about request queue operations to user space. It extracts | |
4592 | event traces from the kernel (via the relaying through the debug file system).") | |
4593 | (license license:gpl2)))) | |
4594 | ||
81b98756 RW |
4595 | (define-public sbc |
4596 | (package | |
4597 | (name "sbc") | |
2a11a029 | 4598 | (version "1.4") |
81b98756 RW |
4599 | (source (origin |
4600 | (method url-fetch) | |
18160c34 MB |
4601 | (uri (string-append "mirror://kernel.org/linux/bluetooth/sbc-" |
4602 | version ".tar.xz")) | |
81b98756 RW |
4603 | (sha256 |
4604 | (base32 | |
2a11a029 | 4605 | "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si")))) |
81b98756 RW |
4606 | (build-system gnu-build-system) |
4607 | (inputs | |
4608 | `(("libsndfile" ,libsndfile))) | |
4609 | (native-inputs | |
4610 | `(("pkg-config" ,pkg-config))) | |
4611 | (home-page "https://www.kernel.org/pub/linux/bluetooth/") | |
4612 | (synopsis "Bluetooth subband audio codec") | |
4613 | (description | |
4614 | "The SBC is a digital audio encoder and decoder used to transfer data to | |
4615 | Bluetooth audio output devices like headphones or loudspeakers.") | |
4616 | (license license:gpl2+))) | |
4617 | ||
eb7c43c3 DT |
4618 | (define-public bluez |
4619 | (package | |
4620 | (name "bluez") | |
34ad1a55 | 4621 | (version "5.54") |
eb7c43c3 DT |
4622 | (source (origin |
4623 | (method url-fetch) | |
4624 | (uri (string-append | |
e9eb24b1 | 4625 | "mirror://kernel.org/linux/bluetooth/bluez-" |
eb7c43c3 DT |
4626 | version ".tar.xz")) |
4627 | (sha256 | |
4628 | (base32 | |
34ad1a55 | 4629 | "1p2ncvjz6alr9n3l5wvq2arqgc7xjs6dqyar1l9jp0z8cfgapkb8")))) |
eb7c43c3 DT |
4630 | (build-system gnu-build-system) |
4631 | (arguments | |
90ea83ee | 4632 | `(#:configure-flags |
eb7c43c3 | 4633 | (let ((out (assoc-ref %outputs "out"))) |
f3dbc626 SB |
4634 | (list "--sysconfdir=/etc" |
4635 | "--localstatedir=/var" | |
4636 | "--enable-library" | |
53142109 | 4637 | "--disable-systemd" |
eb7c43c3 DT |
4638 | ;; Install dbus/udev files to the correct location. |
4639 | (string-append "--with-dbusconfdir=" out "/etc") | |
87a16de7 SB |
4640 | (string-append "--with-udevdir=" out "/lib/udev"))) |
4641 | #:phases | |
4642 | (modify-phases %standard-phases | |
fbea821a TD |
4643 | ;; Test unit/test-gatt fails unpredictably. Seems to be a timing |
4644 | ;; issue (discussion on upstream mailing list: | |
4645 | ;; https://marc.info/?t=149578476300002&r=1&w=2) | |
4646 | (add-before 'check 'skip-wonky-test | |
4647 | (lambda _ | |
4648 | (substitute* "unit/test-gatt.c" | |
4649 | (("tester_init\\(&argc, &argv\\);") "return 77;")) | |
4650 | #t)) | |
87a16de7 SB |
4651 | (add-after 'install 'post-install |
4652 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
4653 | (let* ((out (assoc-ref outputs "out")) | |
4654 | (servicedir (string-append out "/share/dbus-1/services")) | |
4655 | (service "obexd/src/org.bluez.obex.service") | |
4656 | (rule (string-append | |
4657 | out "/lib/udev/rules.d/97-hid2hci.rules"))) | |
4658 | ;; Install the obex dbus service file. | |
4659 | (substitute* service | |
4660 | (("/bin/false") | |
4661 | (string-append out "/libexec/bluetooth/obexd"))) | |
4662 | (install-file service servicedir) | |
4663 | ;; Fix paths in the udev rule. | |
4664 | (substitute* rule | |
4665 | (("hid2hci --method") | |
4666 | (string-append out "/lib/udev/hid2hci --method")) | |
4667 | (("/sbin/udevadm") | |
4668 | (string-append (assoc-ref inputs "eudev") "/bin/udevadm"))) | |
de47cfed | 4669 | #t)))))) |
eb7c43c3 DT |
4670 | (native-inputs |
4671 | `(("pkg-config" ,pkg-config) | |
b94a6ca0 | 4672 | ("gettext" ,gettext-minimal))) |
eb7c43c3 DT |
4673 | (inputs |
4674 | `(("glib" ,glib) | |
4675 | ("dbus" ,dbus) | |
4676 | ("eudev" ,eudev) | |
4677 | ("libical" ,libical) | |
4678 | ("readline" ,readline))) | |
4679 | (home-page "http://www.bluez.org/") | |
4680 | (synopsis "Linux Bluetooth protocol stack") | |
4681 | (description | |
4682 | "BlueZ provides support for the core Bluetooth layers and protocols. It | |
4683 | is flexible, efficient and uses a modular implementation.") | |
3ac73271 | 4684 | (license license:gpl2+))) |
3d890318 LC |
4685 | |
4686 | (define-public fuse-exfat | |
4687 | (package | |
4688 | (name "fuse-exfat") | |
1372754d | 4689 | (version "1.3.0") |
3d890318 LC |
4690 | (source (origin |
4691 | (method url-fetch) | |
c0cc805e TGR |
4692 | (uri (string-append |
4693 | "https://github.com/relan/exfat/releases/download/v" | |
4694 | version "/" name "-" version ".tar.gz")) | |
3d890318 LC |
4695 | (sha256 |
4696 | (base32 | |
1372754d | 4697 | "1lz00q8g4590mrdqmf13ba1s9zrqq645ymgm5p9y99ad0qv22r87")))) |
3d890318 LC |
4698 | (build-system gnu-build-system) |
4699 | (native-inputs | |
c0cc805e | 4700 | `(("pkg-config" ,pkg-config))) |
3d890318 LC |
4701 | (inputs |
4702 | `(("fuse" ,fuse))) | |
c0cc805e | 4703 | (home-page "https://github.com/relan/exfat") |
3d890318 LC |
4704 | (synopsis "Mount exFAT file systems") |
4705 | (description | |
4706 | "This package provides a FUSE-based file system that provides read and | |
4707 | write access to exFAT devices.") | |
3ac73271 | 4708 | (license license:gpl2+))) |
53ec8d48 | 4709 | |
1564e0fe PN |
4710 | (define-public fuseiso |
4711 | (package | |
4712 | (name "fuseiso") | |
4713 | (version "20070708") | |
4714 | (source (origin | |
4715 | (method url-fetch) | |
4716 | (uri (string-append "mirror://sourceforge/fuseiso/fuseiso/" | |
4717 | version "/fuseiso-" version ".tar.bz2")) | |
4718 | (sha256 | |
4719 | (base32 | |
4720 | "127xql52dcdhmh7s5m9xc6q39jdlj3zhbjar1j821kb6gl3jw94b")))) | |
4721 | (build-system gnu-build-system) | |
4722 | (native-inputs | |
4723 | `(("pkg-config" ,pkg-config))) | |
4724 | (inputs | |
4725 | `(("fuse" ,fuse) | |
4726 | ("glib" ,glib) | |
4727 | ("zlib" ,zlib))) | |
4728 | (home-page "https://sourceforge.net/projects/fuseiso/") | |
dff79364 | 4729 | (synopsis "Mount ISO file system images") |
1564e0fe | 4730 | (description |
52beae7b | 4731 | "FuseISO is a FUSE module to mount ISO file system images (.iso, .nrg, |
b60e9fb8 PN |
4732 | .bin, .mdf and .img files). It supports plain ISO9660 Level 1 and 2, Rock |
4733 | Ridge, Joliet, and zisofs.") | |
1564e0fe PN |
4734 | (license license:gpl2))) |
4735 | ||
53ec8d48 LC |
4736 | (define-public gpm |
4737 | (package | |
4738 | (name "gpm") | |
4739 | (version "1.20.7") | |
4740 | (source (origin | |
4741 | (method url-fetch) | |
4742 | (uri (string-append | |
a5374cde NG |
4743 | "https://www.nico.schottelius.org/software/gpm/archives/" |
4744 | "gpm-" version ".tar.bz2")) | |
fddb22ac | 4745 | (patches (search-patches "gpm-glibc-2.26.patch")) |
53ec8d48 LC |
4746 | (sha256 |
4747 | (base32 | |
4748 | "13d426a8h403ckpc8zyf7s2p5rql0lqbg2bv0454x0pvgbfbf4gh")))) | |
4749 | (build-system gnu-build-system) | |
4750 | (arguments | |
4751 | '(#:phases (modify-phases %standard-phases | |
189be331 | 4752 | (replace 'bootstrap |
53ec8d48 LC |
4753 | (lambda _ |
4754 | ;; The tarball was not generated with 'make dist' so we | |
4755 | ;; need to bootstrap things ourselves. | |
77bb6c22 EF |
4756 | (substitute* "autogen.sh" |
4757 | (("/bin/sh") (which "sh"))) | |
90a54e36 MW |
4758 | (invoke "./autogen.sh") |
4759 | (patch-makefile-SHELL "Makefile.include.in") | |
4760 | #t))) | |
53ec8d48 LC |
4761 | |
4762 | ;; Make sure programs find libgpm.so. | |
4763 | #:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
4764 | (assoc-ref %outputs "out") | |
4765 | "/lib")))) | |
4766 | (native-inputs | |
4767 | `(("texinfo" ,texinfo) | |
4768 | ("bison" ,bison) | |
4769 | ("flex" ,flex) | |
4770 | ("autoconf" ,autoconf) | |
4771 | ("automake" ,automake) | |
4772 | ("libtool" ,libtool))) | |
a5374cde | 4773 | (home-page "https://www.nico.schottelius.org/software/gpm/") |
53ec8d48 LC |
4774 | (synopsis "Mouse support for the Linux console") |
4775 | (description | |
4776 | "The GPM (general-purpose mouse) daemon is a mouse server for | |
4777 | applications running on the Linux console. It allows users to select items | |
4778 | and copy/paste text in the console and in xterm.") | |
3ac73271 | 4779 | (license license:gpl2+))) |
fc686f9a TGR |
4780 | |
4781 | (define-public btrfs-progs | |
4782 | (package | |
4783 | (name "btrfs-progs") | |
94b68892 | 4784 | (version "5.7") |
fc686f9a TGR |
4785 | (source (origin |
4786 | (method url-fetch) | |
4787 | (uri (string-append "mirror://kernel.org/linux/kernel/" | |
4788 | "people/kdave/btrfs-progs/" | |
4789 | "btrfs-progs-v" version ".tar.xz")) | |
4790 | (sha256 | |
4791 | (base32 | |
94b68892 | 4792 | "0p6ycbr8sw5bq3mj84gh9rvh5sk8sjr2l9hb9dhm4j41ij5h8bsw")))) |
fc686f9a | 4793 | (build-system gnu-build-system) |
7cad981d | 4794 | (outputs '("out" |
c4b006ba | 4795 | "static")) ; static versions of the binaries in "out" |
fc686f9a | 4796 | (arguments |
7cad981d | 4797 | '(#:phases (modify-phases %standard-phases |
0c26e43e BW |
4798 | (add-after 'unpack 'patch-makefile |
4799 | (lambda* (#:key outputs #:allow-other-keys) | |
4800 | (substitute* "Makefile" | |
4801 | (("\\$\\(DESTDIR\\)\\$\\(udevruledir\\)") | |
4802 | (string-append (assoc-ref outputs "out") | |
4803 | "/lib/udev/rules.d"))) | |
4804 | #t)) | |
7cad981d | 4805 | (add-after 'build 'build-static |
caf4c7c8 | 4806 | (lambda _ (invoke "make" "static"))) |
9a1c4a98 MB |
4807 | (add-after 'install 'install-bash-completion |
4808 | (lambda* (#:key outputs #:allow-other-keys) | |
3ce4e265 MB |
4809 | (let* ((out (assoc-ref outputs "out")) |
4810 | (bashcomp (string-append out "/etc/bash_completion.d"))) | |
4811 | (mkdir-p bashcomp) | |
4812 | (copy-file "btrfs-completion" | |
4813 | (string-append bashcomp "/btrfs")) | |
4814 | #t))) | |
7cad981d TGR |
4815 | (add-after 'install 'install-static |
4816 | (let ((staticbin (string-append (assoc-ref %outputs "static") | |
4817 | "/bin"))) | |
4818 | (lambda _ | |
caf4c7c8 MW |
4819 | (invoke "make" |
4820 | (string-append "bindir=" staticbin) | |
4821 | "install-static"))))) | |
d6fb0985 | 4822 | #:tests? #f ; XXX: require the 'btrfs' kernel module. |
7cad981d | 4823 | #:test-target "test" |
fc686f9a | 4824 | #:parallel-tests? #f)) ; tests fail when run in parallel |
0c26e43e | 4825 | (inputs `(("e2fsprogs" ,e2fsprogs) ; for btrfs-convert |
e2937a55 | 4826 | ("lzo" ,lzo) |
bb93042c MB |
4827 | ("util-linux:lib" ,util-linux "lib") ;for libblkid and libuuid |
4828 | ("util-linux:static" ,util-linux "static") ;ditto | |
fc686f9a | 4829 | ("zlib" ,zlib) |
029c2ba0 | 4830 | ("zlib:static" ,zlib "static") |
ec0de9d8 MB |
4831 | ("zstd" ,zstd "lib") |
4832 | ("zstd:static" ,zstd "static"))) | |
fc686f9a TGR |
4833 | (native-inputs `(("pkg-config" ,pkg-config) |
4834 | ("asciidoc" ,asciidoc) | |
1dfb14d2 | 4835 | ("python" ,python) |
fc686f9a | 4836 | ("xmlto" ,xmlto) |
41d23dd1 | 4837 | ;; For building documentation. |
fc686f9a | 4838 | ("libxml2" ,libxml2) |
48b7e4a6 | 4839 | ("docbook-xsl" ,docbook-xsl) |
41d23dd1 | 4840 | ;; For tests. |
bc64676c | 4841 | ("acl" ,acl) |
caf4c7c8 | 4842 | ("which" ,which) |
0c26e43e BW |
4843 | ("dmsetup" ,lvm2) |
4844 | ("udevadm" ,eudev) | |
caf4c7c8 MW |
4845 | ;; The tests need 'grep' with perl regexp support. |
4846 | ("grep" ,grep))) | |
fc83ca2b | 4847 | (home-page "https://btrfs.wiki.kernel.org/index.php/Main_Page") |
fc686f9a | 4848 | (synopsis "Create and manage btrfs copy-on-write file systems") |
039601e0 TGR |
4849 | (description "Btrfs is a @dfn{copy-on-write} (CoW) file system for Linux |
4850 | aimed at implementing advanced features while focusing on fault tolerance, | |
4851 | repair and easy administration.") | |
68bcac6b LF |
4852 | ;; GPL2+: crc32.c, radix-tree.c, raid6.c, rbtree.c. |
4853 | ;; GPL2: Everything else. | |
4854 | (license (list license:gpl2 license:gpl2+)))) | |
08e9daf5 | 4855 | |
f3e44f5c DC |
4856 | (define-public btrfs-progs/static |
4857 | (package | |
4858 | (name "btrfs-progs-static") | |
4859 | (version (package-version btrfs-progs)) | |
4860 | (source #f) | |
4861 | (build-system trivial-build-system) | |
4862 | (inputs | |
4863 | `(("btrfs-progs:static" ,btrfs-progs "static"))) | |
4864 | (arguments | |
4865 | `(#:modules ((guix build utils)) | |
4866 | #:builder | |
4867 | (begin | |
4868 | (use-modules (guix build utils) | |
4869 | (ice-9 ftw) | |
4870 | (srfi srfi-26)) | |
4871 | ||
4872 | (let* ((btrfs (assoc-ref %build-inputs "btrfs-progs:static")) | |
4873 | (out (assoc-ref %outputs "out")) | |
4874 | (source (string-append btrfs "/bin/btrfs.static")) | |
4875 | (target (string-append out "/bin/btrfs"))) | |
4876 | (mkdir-p (dirname target)) | |
4877 | (copy-file source target) | |
4878 | (remove-store-references target) | |
e3cfef22 MW |
4879 | (chmod target #o555) |
4880 | #t)))) | |
f3e44f5c | 4881 | (home-page (package-home-page btrfs-progs)) |
ff797172 TGR |
4882 | (synopsis "Statically-linked btrfs command from btrfs-progs") |
4883 | (description "This package provides the statically-linked @command{btrfs} | |
4884 | from the btrfs-progs package. It is meant to be used in initrds.") | |
f3e44f5c DC |
4885 | (license (package-license btrfs-progs)))) |
4886 | ||
0f4be78f VL |
4887 | (define-public cramfs-tools |
4888 | (package | |
4889 | (name "cramfs-tools") | |
4890 | (home-page "https://github.com/npitre/cramfs-tools") | |
4891 | (version "2.1") | |
4892 | (source (origin | |
4893 | (method git-fetch) | |
4894 | (uri (git-reference | |
4895 | (url home-page) | |
4896 | (commit (string-append "v" version)))) | |
4897 | (sha256 | |
4898 | (base32 "183rfqqyzx52q0vxicdgf0p984idh3rqkvzfb93gjvyzfhc15c0p")) | |
4899 | (file-name (git-file-name name version)))) | |
4900 | (build-system gnu-build-system) | |
4901 | (arguments | |
4902 | '(#:tests? #f ; No tests. | |
4903 | #:phases | |
4904 | (modify-phases %standard-phases | |
4905 | (delete 'configure) | |
4906 | (replace 'install | |
4907 | (lambda* (#:key outputs #:allow-other-keys) | |
4908 | (let ((out (assoc-ref outputs "out"))) | |
4909 | (install-file "mkcramfs" (string-append out "/sbin")) | |
4910 | (install-file "cramfsck" (string-append out "/sbin"))) | |
4911 | #t))))) | |
4912 | (inputs | |
4913 | `(("zlib" ,zlib))) | |
4914 | (synopsis "Tools to manage Cramfs file systems") | |
4915 | (description "Cramfs is a Linux file system designed to be simple, small, | |
4916 | and to compress things well. It is used on a number of embedded systems and | |
4917 | small devices. This version has additional features such as uncompressed | |
4918 | blocks and random block placement.") | |
4919 | (license license:gpl2+))) | |
4920 | ||
49b28a74 PN |
4921 | (define-public compsize |
4922 | (package | |
4923 | (name "compsize") | |
4924 | (version "1.3") | |
4925 | (home-page "https://github.com/kilobyte/compsize") | |
4926 | (source (origin | |
4927 | (method git-fetch) | |
4928 | (uri (git-reference | |
4929 | (url home-page) | |
4930 | (commit (string-append "v" version)))) | |
4931 | (sha256 | |
4932 | (base32 "1c69whla844nwis30jxbj00zkpiw3ccndhkmzjii8av5358mjn43")) | |
4933 | (file-name (git-file-name name version)))) | |
4934 | (build-system gnu-build-system) | |
4935 | (inputs | |
4936 | `(("btrfs-progs" ,btrfs-progs))) | |
4937 | (arguments | |
4938 | `(#:tests? #f ; No tests. | |
4939 | #:make-flags (list "CC=gcc") | |
4940 | #:phases | |
4941 | (modify-phases %standard-phases | |
4942 | (delete 'configure) | |
4943 | (replace 'install | |
4944 | (lambda* (#:key outputs #:allow-other-keys) | |
4945 | (let ((out (assoc-ref outputs "out"))) | |
4946 | (install-file "compsize" (string-append out "/bin")) | |
4947 | (install-file "compsize.8" (string-append out "/share/man/man8")))))))) | |
4948 | (synopsis "Find compression type/ratio on Btrfs files") | |
4949 | (description "@command{compsize} takes a list of files (given as | |
4950 | arguments) on a Btrfs file system and measures used compression types and | |
4951 | effective compression ratio, producing a report. | |
4952 | ||
4953 | A directory has no extents but has a (recursive) list of files. A non-regular | |
4954 | file is silently ignored. | |
4955 | ||
4956 | As it makes no sense to talk about compression ratio of a partial extent, | |
4957 | every referenced extent is counted whole, exactly once -- no matter if you use | |
4958 | only a few bytes of a 1GB extent or reflink it a thousand times. Thus, the | |
4959 | uncompressed size will not match the number given by @command{tar} or | |
4960 | @command{du}. On the other hand, the space used should be accurate (although | |
4961 | obviously it can be shared with files outside our set).") | |
4962 | (license license:gpl2+))) | |
4963 | ||
72aa295e | 4964 | (define-public f2fs-tools-1.7 |
2e456982 MB |
4965 | (package |
4966 | (name "f2fs-tools") | |
72aa295e | 4967 | (version "1.7.0") |
2e456982 MB |
4968 | (source (origin |
4969 | (method url-fetch) | |
4970 | (uri (string-append | |
4971 | "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk" | |
2d588f3c | 4972 | "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz")) |
2e456982 MB |
4973 | (sha256 |
4974 | (base32 | |
72aa295e DM |
4975 | "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k")))) |
4976 | ||
2e456982 MB |
4977 | (build-system gnu-build-system) |
4978 | (arguments | |
4979 | `(#:phases | |
4980 | (modify-phases %standard-phases | |
72aa295e DM |
4981 | (add-after 'install 'install-headers |
4982 | (lambda* (#:key outputs #:allow-other-keys) | |
4983 | (let* ((out (assoc-ref outputs "out")) | |
4984 | (out-include (string-append out "/include"))) | |
4985 | (install-file "include/f2fs_fs.h" out-include) | |
4986 | (install-file "mkfs/f2fs_format_utils.h" out-include) | |
4987 | #t)))))) | |
2e456982 MB |
4988 | (native-inputs |
4989 | `(("autoconf" ,autoconf) | |
4990 | ("automake" ,automake) | |
4991 | ("libtool" ,libtool) | |
4992 | ("pkg-config" ,pkg-config))) | |
4993 | (inputs | |
bb93042c | 4994 | `(("libuuid" ,util-linux "lib") |
72aa295e | 4995 | ("libselinux" ,libselinux))) |
2e456982 MB |
4996 | (home-page "https://f2fs.wiki.kernel.org/") |
4997 | (synopsis "Userland tools for f2fs") | |
4998 | (description | |
4999 | "F2FS, the Flash-Friendly File System, is a modern file system | |
5000 | designed to be fast and durable on flash devices such as solid-state | |
5001 | disks and SD cards. This package provides the userland utilities.") | |
5002 | ;; The formatting utility, libf2fs and include/f2fs_fs.h is dual | |
5003 | ;; GPL2/LGPL2.1, everything else is GPL2 only. See 'COPYING'. | |
5004 | (license (list license:gpl2 license:lgpl2.1)))) | |
5005 | ||
72aa295e DM |
5006 | (define-public f2fs-tools |
5007 | (package | |
5008 | (inherit f2fs-tools-1.7) | |
5009 | (name "f2fs-tools") | |
d2119ddf | 5010 | (version "1.13.0") |
72aa295e DM |
5011 | (source (origin |
5012 | (method url-fetch) | |
5013 | (uri (string-append | |
5014 | "https://git.kernel.org/cgit/linux/kernel/git/jaegeuk" | |
2d588f3c | 5015 | "/f2fs-tools.git/snapshot/f2fs-tools-" version ".tar.gz")) |
72aa295e DM |
5016 | (sha256 |
5017 | (base32 | |
d2119ddf | 5018 | "0z9c0y3qq75iyqknl5k0v7v46l8c3pcifpqb0yqalrs24blkm7dk")))) |
72aa295e | 5019 | (inputs |
bb93042c | 5020 | `(("libuuid" ,util-linux "lib"))))) |
72aa295e | 5021 | |
807986a5 | 5022 | (define-public f2fs-tools/static |
5023 | (static-package | |
5024 | (package | |
5025 | (inherit f2fs-tools) | |
5026 | (name "f2fs-tools-static") | |
5027 | (arguments | |
5028 | `(#:configure-flags | |
5029 | (let ((libuuid-static (assoc-ref %build-inputs "libuuid:static")) | |
5030 | (libuuid (assoc-ref %build-inputs "libuuid"))) | |
5031 | (list | |
5032 | (string-append "libuuid_CFLAGS=-I" libuuid "/include") | |
5033 | (string-append "libuuid_LIBS=-L" libuuid-static "/lib -luuid") | |
5034 | (string-append "libblkid_CFLAGS=-I" libuuid "/include") | |
5035 | (string-append "libblkid_LIBS=-L" libuuid-static "/lib -lblkid"))) | |
5036 | #:disallowed-references (,util-linux) | |
5037 | #:phases | |
5038 | (modify-phases %standard-phases ; TODO: f2fs phases. | |
5039 | (add-after 'unpack 'make-static | |
5040 | (lambda _ | |
5041 | (define (append-to-file name body) | |
5042 | (let ((file (open-file name "a"))) | |
5043 | (display body file) | |
5044 | (close-port file))) | |
5045 | (append-to-file "mkfs/Makefile.am" "\nmkfs_f2fs_LDFLAGS = -all-static\n") | |
5046 | (append-to-file "fsck/Makefile.am" "\nfsck_f2fs_LDFLAGS = -all-static\n") | |
5047 | (append-to-file "tools/Makefile.am" "\nf2fscrypt_LDFLAGS = -all-static -luuid\n") | |
da09c63e DM |
5048 | #t)) |
5049 | (add-after 'install 'remove-store-references | |
5050 | (lambda* (#:key outputs #:allow-other-keys) | |
5051 | ;; Work around bug in our util-linux. | |
5052 | ;; <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=41019>. | |
5053 | (remove-store-references (string-append (assoc-ref outputs "out") | |
5054 | "/sbin/mkfs.f2fs")) | |
5055 | #t))))) | |
807986a5 | 5056 | (inputs |
5057 | `(("libuuid:static" ,util-linux "static") | |
50e6c1bf | 5058 | ("libuuid" ,util-linux "lib")))))) ; for include files |
807986a5 | 5059 | |
a5cf52d3 | 5060 | (define-public f2fs-fsck/static |
5061 | (package | |
5062 | (name "f2fs-fsck-static") | |
5063 | (version (package-version f2fs-tools/static)) | |
5064 | (source #f) | |
5065 | (build-system trivial-build-system) | |
5066 | (arguments | |
5067 | `(#:modules ((guix build utils)) | |
5068 | #:builder | |
5069 | (begin | |
5070 | (use-modules (guix build utils) | |
5071 | (ice-9 ftw) | |
5072 | (srfi srfi-26)) | |
5073 | (let* ((f2fs-tools (assoc-ref %build-inputs "f2fs-tools-static")) | |
5074 | (fsck "fsck.f2fs") | |
5075 | (out (assoc-ref %outputs "out")) | |
5076 | (sbin (string-append out "/sbin"))) | |
5077 | (mkdir-p sbin) | |
5078 | (with-directory-excursion sbin | |
5079 | (install-file (string-append f2fs-tools "/sbin/" fsck) | |
5080 | ".") | |
5081 | (remove-store-references fsck) | |
5082 | (chmod fsck #o555)) | |
5083 | #t)))) | |
5084 | (inputs | |
5085 | `(("f2fs-tools-static" ,f2fs-tools/static))) | |
5086 | (home-page (package-home-page f2fs-tools/static)) | |
5087 | (synopsis "Statically-linked fsck.f2fs command from f2fs-tools") | |
5088 | (description "This package provides statically-linked fsck.f2fs command taken | |
5089 | from the f2fs-tools package. It is meant to be used in initrds.") | |
5090 | (license (package-license f2fs-tools/static)))) | |
5091 | ||
08e9daf5 TGR |
5092 | (define-public freefall |
5093 | (package | |
5094 | (name "freefall") | |
5095 | (version (package-version linux-libre)) | |
5096 | (source (package-source linux-libre)) | |
5097 | (build-system gnu-build-system) | |
5098 | (arguments | |
5099 | '(#:phases (modify-phases %standard-phases | |
5100 | (add-after 'unpack 'enter-subdirectory | |
5101 | (lambda _ | |
2ee42f7e MW |
5102 | (chdir "tools/laptop/freefall") |
5103 | #t)) | |
08e9daf5 TGR |
5104 | (delete 'configure) |
5105 | (add-before 'build 'increase-timeout | |
5106 | (lambda _ | |
5107 | ;; The default of 2 seconds is too low: it assumes an | |
5108 | ;; open lid and AC power without actually checking. | |
5109 | (substitute* "freefall.c" | |
2ee42f7e MW |
5110 | (("alarm\\(2\\)") "alarm(5)")) |
5111 | #t))) | |
08e9daf5 | 5112 | #:make-flags (list (string-append "PREFIX=" |
c80629e7 EF |
5113 | (assoc-ref %outputs "out")) |
5114 | "CC=gcc") | |
08e9daf5 TGR |
5115 | #:tests? #f)) ;no tests |
5116 | (home-page (package-home-page linux-libre)) | |
5117 | (synopsis "Free-fall protection for spinning laptop hard drives") | |
5118 | (description | |
5119 | "Prevents shock damage to the internal spinning hard drive(s) of some | |
5120 | HP and Dell laptops. When sudden movement is detected, all input/output | |
5121 | operations on the drive are suspended and its heads are parked on the ramp, | |
5122 | where they are less likely to cause damage to the spinning disc. Requires a | |
5123 | drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload | |
5124 | feature, and a laptop with an accelerometer. It has no effect on SSDs.") | |
5125 | (license license:gpl2))) | |
d17ae8c0 NG |
5126 | |
5127 | (define-public thinkfan | |
5128 | (package | |
5129 | (name "thinkfan") | |
4367e7e8 | 5130 | (version "1.2.1") |
9a3d176e TGR |
5131 | (source |
5132 | (origin | |
5133 | (method git-fetch) | |
5134 | (uri (git-reference | |
b0e7b699 | 5135 | (url "https://github.com/vmatare/thinkfan") |
9a3d176e TGR |
5136 | (commit version))) |
5137 | (file-name (git-file-name name version)) | |
5138 | (sha256 | |
4367e7e8 | 5139 | (base32 "18vgm5w5pjnpipa34j4x87q10695w2jnqwvc2f027afy7mnzw7kz")))) |
d17ae8c0 NG |
5140 | (build-system cmake-build-system) |
5141 | (arguments | |
5142 | `(#:modules ((guix build cmake-build-system) | |
5143 | (guix build utils) | |
5144 | (srfi srfi-26)) | |
9a3d176e | 5145 | #:tests? #f ; no test target |
d17ae8c0 NG |
5146 | #:configure-flags |
5147 | ;; Enable reading temperatures from hard disks via S.M.A.R.T. | |
9a3d176e TGR |
5148 | ;; Upstream ‘defaults to OFF because libatasmart seems to be horribly |
5149 | ;; inefficient’. | |
d17ae8c0 NG |
5150 | `("-DUSE_ATASMART:BOOL=ON") |
5151 | #:phases | |
5152 | (modify-phases %standard-phases | |
908a3f36 TGR |
5153 | (add-after 'unpack 'create-init-scripts |
5154 | ;; CMakeLists.txt relies on build-time symptoms of OpenRC and | |
5155 | ;; systemd to patch and install their service files. Fake their | |
5156 | ;; presence rather than duplicating the build system below. Leave | |
5157 | ;; things like ‘/bin/kill’ because they're not worth a dependency. | |
5158 | ;; The sysvinit needs manual patching, but since upstream doesn't | |
5159 | ;; even provide the option to install it: don't. | |
d17ae8c0 | 5160 | (lambda* (#:key outputs #:allow-other-keys) |
908a3f36 TGR |
5161 | (let* ((out (assoc-ref outputs "out")) |
5162 | (share (string-append out "/share/" ,name))) | |
5163 | (substitute* "CMakeLists.txt" | |
5164 | (("pkg_check_modules\\((OPENRC|SYSTEMD) .*" _ package) | |
f989dffd | 5165 | (format #f "option(~a_FOUND \"Faked\" ON)\n" package)) |
908a3f36 TGR |
5166 | ;; That was easy! Now we just need to fix the destinations. |
5167 | (("/etc" directory) | |
5168 | (string-append out directory))) | |
5169 | #t)))))) | |
9a3d176e TGR |
5170 | (native-inputs |
5171 | `(("pkg-config" ,pkg-config))) | |
d17ae8c0 | 5172 | (inputs |
9a3d176e TGR |
5173 | `(("libatasmart" ,libatasmart) |
5174 | ("yaml-cpp" ,yaml-cpp))) | |
a8c8b890 | 5175 | (home-page "https://github.com/vmatare/thinkfan") |
d17ae8c0 NG |
5176 | (synopsis "Simple fan control program") |
5177 | (description | |
5178 | "Thinkfan is a simple fan control program. It reads temperatures, | |
5179 | checks them against configured limits and switches to appropriate (also | |
5180 | pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any | |
5181 | other @code{hwmon} driver that enables temperature reading and fan control | |
5182 | from userspace.") | |
5183 | (license license:gpl3+))) | |
91231156 | 5184 | |
b313665f TGR |
5185 | (define-public tpacpi-bat |
5186 | (package | |
5187 | (name "tpacpi-bat") | |
5188 | (version "3.1") | |
5189 | (source | |
5190 | (origin | |
5191 | (method git-fetch) | |
5192 | (uri (git-reference | |
b0e7b699 | 5193 | (url "https://github.com/teleshoes/tpacpi-bat") |
b313665f TGR |
5194 | (commit (string-append "v" version)))) |
5195 | (file-name (git-file-name name version)) | |
5196 | (sha256 | |
5197 | (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5")))) | |
5198 | (build-system gnu-build-system) | |
5199 | (arguments | |
5200 | `(#:tests? #f ; no test target | |
5201 | #:phases | |
5202 | (modify-phases %standard-phases | |
5203 | (add-after 'unpack 'refer-to-inputs | |
5204 | (lambda _ | |
5205 | (substitute* "tpacpi-bat" | |
5206 | (("cat ") | |
05e3ed30 | 5207 | (format #f "~a " (which "cat"))) |
b313665f TGR |
5208 | ;; tpacpi-bat modprobes the acpi_call kernel module if it's not |
5209 | ;; loaded. That's the administrator's prerogative; disable it. | |
5210 | (("system \"(modprobe .*)\"" _ match) | |
05e3ed30 | 5211 | (format #f "die \"Please run ‘~a’ first.\\n\"" match))) |
b313665f TGR |
5212 | #t)) |
5213 | (delete 'configure) ; nothing to configure | |
5214 | (delete 'build) ; nothing to build | |
5215 | (replace 'install | |
5216 | (lambda* (#:key outputs #:allow-other-keys) | |
5217 | (let* ((out (assoc-ref outputs "out")) | |
5218 | (bin (string-append out "/bin")) | |
5219 | (doc (string-append out "/share/doc/" ,name "-" ,version))) | |
5220 | (install-file "tpacpi-bat" bin) | |
5221 | ||
5222 | ;; There's no man page. Install other forms of documentation. | |
5223 | (for-each (lambda (file) | |
5224 | (let ((target (string-append doc "/" file))) | |
5225 | (mkdir-p (dirname target)) | |
5226 | (copy-recursively file target))) | |
5227 | (list "battery_asl" "examples" "README.md")) | |
5228 | #t)))))) | |
5229 | (inputs | |
5230 | `(("perl" ,perl))) | |
5231 | (home-page "https://github.com/teleshoes/tpacpi-bat") | |
5232 | (synopsis "ThinkPad battery charge controller") | |
5233 | (description | |
5234 | "Tpacpi-bat is a command-line interface to control battery charging on | |
5235 | @uref{https://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo | |
5236 | ThinkPad models released after 2011}, starting with the xx20 series. It can | |
5237 | query and set the thresholds at which one or both batteries will start and stop | |
5238 | charging, inhibit charging batteries for a set period of time, or force them to | |
5239 | discharge when they otherwise would not. | |
5240 | ||
5241 | This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux | |
5242 | kernel module provided by the @code{acpi-call-linux-module} package, which must | |
5243 | be installed and loaded separately. Only the original vendor firmware is | |
5244 | supported.") | |
5245 | (license license:gpl3+))) | |
5246 | ||
91231156 LC |
5247 | (define-public ntfs-3g |
5248 | (package | |
5249 | (name "ntfs-3g") | |
d8af4f6d | 5250 | (version "2017.3.23") |
91231156 LC |
5251 | (source (origin |
5252 | (method url-fetch) | |
5253 | (uri (string-append "https://tuxera.com/opensource/" | |
5254 | "ntfs-3g_ntfsprogs-" version ".tgz")) | |
6d01a7f4 | 5255 | (patches (search-patches "ntfs-3g-CVE-2019-9755.patch")) |
91231156 LC |
5256 | (sha256 |
5257 | (base32 | |
d8af4f6d | 5258 | "1mb228p80hv97pgk3myyvgp975r9mxq56c6bdn1n24kngcfh4niy")) |
91231156 | 5259 | (modules '((guix build utils))) |
6cbee49d MW |
5260 | (snippet '(begin |
5261 | ;; Install under $prefix. | |
5262 | (substitute* '("src/Makefile.in" "ntfsprogs/Makefile.in") | |
5263 | (("/sbin") | |
5264 | "@sbindir@")) | |
5265 | #t)))) | |
91231156 LC |
5266 | (build-system gnu-build-system) |
5267 | (inputs `(("util-linux" ,util-linux) | |
5268 | ("fuse" ,fuse))) ;libuuid | |
5269 | (native-inputs `(("pkg-config" ,pkg-config))) | |
5270 | (arguments | |
5271 | '(#:configure-flags (list "--exec-prefix=${prefix}" | |
5272 | "--with-fuse=external" ;use our own FUSE | |
5273 | "--enable-mount-helper" | |
5274 | "--enable-posix-acls" | |
91420521 PN |
5275 | "--enable-xattr-mappings") |
5276 | #:phases | |
5277 | (modify-phases %standard-phases | |
5278 | ;; If users install ntfs-3g, they probably want to make it the | |
5279 | ;; default driver as well, so we opt for sensible defaults and link | |
5280 | ;; mount.ntfs to mount.ntfs-3g. (libmount tries to run mount.ntfs to | |
52beae7b | 5281 | ;; mount NTFS file systems.) |
91420521 PN |
5282 | (add-after 'install 'install-link |
5283 | (lambda* (#:key outputs #:allow-other-keys) | |
5284 | (let* ((out (assoc-ref outputs "out")) | |
5285 | (sbin (string-append out "/sbin"))) | |
5286 | (symlink "mount.ntfs-3g" | |
9922278b MW |
5287 | (string-append sbin "/mount.ntfs"))) |
5288 | #t))))) | |
8bad0c0b | 5289 | (home-page "https://www.tuxera.com/community/open-source-ntfs-3g/") |
91231156 LC |
5290 | (synopsis "Read-write access to NTFS file systems") |
5291 | (description | |
5292 | "NTFS-3G provides read-write access to NTFS file systems, which are | |
5293 | commonly found on Microsoft Windows. It is implemented as a FUSE file system. | |
5294 | The package provides additional NTFS tools.") | |
5295 | (license license:gpl2+))) | |
9b0942c1 | 5296 | |
f8f44dd7 MB |
5297 | (define-public rdma-core |
5298 | (package | |
5299 | (name "rdma-core") | |
e68f954e | 5300 | (version "26.0") |
f8f44dd7 MB |
5301 | (source (origin |
5302 | (method url-fetch) | |
5303 | (uri (string-append "https://github.com/linux-rdma/rdma-core" | |
5304 | "/releases/download/v" version "/rdma-core-" | |
5305 | version ".tar.gz")) | |
5306 | (sha256 | |
5307 | (base32 | |
e68f954e | 5308 | "14raqwx4pkzghiwkx1v0dq338f7xqqx8rnsxlpdnngvjy1p5l79j")))) |
f8f44dd7 MB |
5309 | (build-system cmake-build-system) |
5310 | (arguments | |
e68f954e | 5311 | `(#:tests? #f ; no tests |
f8f44dd7 MB |
5312 | ;; Upstream uses the "ninja" build system and encourage distros |
5313 | ;; to do the same for consistency. They also recommend using the | |
5314 | ;; "Release" build type. | |
3def739d | 5315 | #:build-type "Release" |
2b14c60d LC |
5316 | #:configure-flags (list "-GNinja" |
5317 | ||
e68f954e LC |
5318 | (string-append "-DRST2MAN_EXECUTABLE=" |
5319 | (assoc-ref %build-inputs | |
5320 | "python-docutils") | |
5321 | "/bin/rst2man.py") | |
5322 | ||
2b14c60d LC |
5323 | ;; On some configurations, the |
5324 | ;; IB_USER_MAD_REGISTER_AGENT ioctl, which is | |
5325 | ;; used by default, would return ENODEV. To | |
5326 | ;; avoid that, use 'write' instead of ioctls, | |
5327 | ;; as suggested in 'CMakeList.txt'. | |
5328 | "-DIOCTL_MODE=write") | |
f8f44dd7 MB |
5329 | #:phases |
5330 | (modify-phases %standard-phases | |
5331 | (replace 'build | |
5332 | (lambda _ | |
8c3101b8 MW |
5333 | (invoke "ninja" |
5334 | "-j" (number->string (parallel-job-count))))) | |
f8f44dd7 MB |
5335 | (replace 'install |
5336 | (lambda _ | |
8c3101b8 | 5337 | (invoke "ninja" "install")))))) |
f8f44dd7 MB |
5338 | (native-inputs |
5339 | `(("ninja" ,ninja) | |
5340 | ("pkg-config" ,pkg-config) | |
e68f954e LC |
5341 | ("python" ,python-wrapper) |
5342 | ("python-docutils" ,python-docutils))) ;for 'rst2man' | |
f8f44dd7 MB |
5343 | (inputs |
5344 | `(("libnl" ,libnl) | |
5345 | ("udev" ,eudev))) | |
5346 | (home-page "https://github.com/linux-rdma/rdma-core") | |
5347 | (synopsis "Utilities and libraries for working with RDMA devices") | |
5348 | (description | |
5349 | "This package provides userspace components for the InfiniBand | |
5350 | subsystem of the Linux kernel. Specifically it contains userspace | |
5351 | libraries for the following device nodes: | |
5352 | ||
5353 | @enumerate | |
5354 | @item @file{/dev/infiniband/uverbsX} (@code{libibverbs}) | |
5355 | @item @file{/dev/infiniband/rdma_cm} (@code{librdmacm}) | |
5356 | @item @file{/dev/infiniband/umadX} (@code{libibumad}) | |
5357 | @end enumerate | |
5358 | ||
5359 | The following service daemons are also provided: | |
5360 | @enumerate | |
5361 | @item @code{srp_daemon} (for the @code{ib_srp} kernel module) | |
5362 | @item @code{iwpmd} (for iWARP kernel providers) | |
5363 | @item @code{ibacm} (for InfiniBand communication management assistant) | |
5364 | @end enumerate") | |
5365 | ;; All library code is dual licensed under GPL2 and a custom MIT | |
5366 | ;; variant. The package also includes some components covered by | |
5367 | ;; other licenses. Consult COPYING.md for full details. | |
5368 | (license | |
5369 | (list license:gpl2 | |
5370 | (license:x11-style "See COPYING.BSD_MIT in the distribution") | |
5371 | license:bsd-2 ; Files referring to COPYING.BSD_FB | |
5372 | license:cc0 ; most files in ccan/ | |
5373 | license:bsd-3)))) ; providers/hfi1verbs are dual GPL2/BSD-3 | |
5374 | ||
a0a273c1 MG |
5375 | (define-public perftest |
5376 | (package | |
5377 | (name "perftest") | |
50298d4a | 5378 | (version "4.4-0.4") |
a0a273c1 MG |
5379 | (source |
5380 | (origin | |
5381 | (method url-fetch) | |
50298d4a TGR |
5382 | (uri (string-append "https://github.com/linux-rdma/perftest/releases/download/v" |
5383 | version "/perftest-" version ".g0927198.tar.gz")) | |
a0a273c1 | 5384 | (sha256 |
50298d4a | 5385 | (base32 "11ix4h0rrmqqyi84y55a9xnkvwsmwq0sywr46hvxzm4rqz4ma8vq")))) |
a0a273c1 MG |
5386 | (build-system gnu-build-system) |
5387 | (arguments | |
5388 | `(#:phases | |
5389 | (modify-phases %standard-phases | |
5390 | (add-after 'unpack 'patch-header-paths | |
5391 | (lambda _ | |
5392 | (substitute* '("src/raw_ethernet_fs_rate.c" | |
5393 | "src/raw_ethernet_resources.c" | |
5394 | "src/raw_ethernet_resources.h" | |
5395 | "src/raw_ethernet_send_burst_lat.c" | |
5396 | "src/raw_ethernet_send_bw.c" | |
5397 | "src/raw_ethernet_send_lat.c") | |
5398 | (("/usr/include/netinet/ip.h") "netinet/ip.h")) | |
5399 | #t))))) | |
5400 | (inputs `(("rdma-core" ,rdma-core))) | |
5401 | (home-page "https://github.com/linux-rdma/perftest/") | |
5402 | (synopsis "Open Fabrics Enterprise Distribution (OFED) Performance Tests") | |
5403 | (description "This is a collection of tests written over uverbs intended for | |
5404 | use as a performance micro-benchmark. The tests may be used for hardware or | |
5405 | software tuning as well as for functional testing. | |
5406 | ||
5407 | The collection contains a set of bandwidth and latency benchmark such as: | |
5408 | @enumerate | |
5409 | @item Send - @code{ib_send_bw} and @code{ib_send_lat} | |
5410 | @item RDMA Read - @code{ib_read_bw} and @code{ib_read_lat} | |
5411 | @item RDMA Write - @code{ib_write_bw} and @code{ib_wriet_lat} | |
5412 | @item RDMA Atomic - @code{ib_atomic_bw} and @code{ib_atomic_lat} | |
5413 | @item Native Ethernet (when working with MOFED2) - @code{raw_ethernet_bw}, @code{raw_ethernet_lat} | |
5414 | @end enumerate") | |
5415 | (license license:gpl2))) | |
5416 | ||
9b0942c1 DC |
5417 | (define-public rng-tools |
5418 | (package | |
5419 | (name "rng-tools") | |
c6b772a0 | 5420 | (home-page "https://github.com/nhorman/rng-tools") |
fc66a560 | 5421 | (version "6.10") |
9b0942c1 | 5422 | (source (origin |
f289820c MB |
5423 | (method git-fetch) |
5424 | (uri (git-reference (url home-page) | |
5425 | (commit (string-append "v" version)))) | |
5426 | (file-name (git-file-name name version)) | |
9b0942c1 DC |
5427 | (sha256 |
5428 | (base32 | |
fc66a560 | 5429 | "0hbml37yxs0fs69g7f2x4ixq61z0029swy99rn7ykma9mi6b7ni9")))) |
9b0942c1 | 5430 | (build-system gnu-build-system) |
8bc6956b | 5431 | (arguments |
fc66a560 MB |
5432 | `(;; Disable support for various hardware entropy sources as they need |
5433 | ;; dependencies that are not yet in Guix, and would significantly | |
5434 | ;; increase closure size. | |
ae67d70d | 5435 | #:configure-flags '("--without-nistbeacon" |
fc66a560 MB |
5436 | "--without-pkcs11" |
5437 | "--without-rtlsdr"))) | |
8bc6956b LF |
5438 | (native-inputs |
5439 | `(("autoconf" ,autoconf) | |
5440 | ("automake" ,automake) | |
5441 | ("pkg-config" ,pkg-config))) | |
5442 | (inputs | |
fc66a560 MB |
5443 | `(("libsysfs" ,sysfsutils) |
5444 | ("openssl" ,openssl))) | |
9b0942c1 DC |
5445 | (synopsis "Random number generator daemon") |
5446 | (description | |
5447 | "Monitor a hardware random number generator, and supply entropy | |
5448 | from that to the system kernel's @file{/dev/random} machinery.") | |
9b0942c1 DC |
5449 | ;; The source package is offered under the GPL2+, but the files |
5450 | ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2. | |
5451 | (license (list license:gpl2 license:gpl2+)))) | |
58d6a1f2 TGR |
5452 | |
5453 | (define-public cpupower | |
5454 | (package | |
5455 | (name "cpupower") | |
5456 | (version (package-version linux-libre)) | |
5457 | (source (package-source linux-libre)) | |
5458 | (build-system gnu-build-system) | |
5459 | (arguments | |
5460 | '(#:phases (modify-phases %standard-phases | |
5461 | (add-after 'unpack 'enter-subdirectory | |
5462 | (lambda _ | |
9922278b MW |
5463 | (chdir "tools/power/cpupower") |
5464 | #t)) | |
58d6a1f2 TGR |
5465 | (delete 'configure) |
5466 | (add-before 'build 'fix-makefiles | |
5467 | (lambda _ | |
5468 | (substitute* "Makefile" | |
5469 | (("/usr/") "/") | |
5470 | (("/bin/(install|pwd)" _ command) command)) | |
5471 | (substitute* "bench/Makefile" | |
9922278b MW |
5472 | (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")) |
5473 | #t))) | |
58d6a1f2 TGR |
5474 | #:make-flags (let ((out (assoc-ref %outputs "out"))) |
5475 | (list (string-append "DESTDIR=" out) | |
5476 | (string-append "LDFLAGS=-Wl,-rpath=" out "/lib") | |
cd7e6885 | 5477 | "libdir=/lib" |
58d6a1f2 TGR |
5478 | "docdir=/share/doc/cpupower" |
5479 | "confdir=$(docdir)/examples" | |
5480 | ;; The Makefile recommends the following changes | |
5481 | "DEBUG=false" | |
5482 | "PACKAGE_BUGREPORT=bug-guix@gnu.org")) | |
5483 | #:tests? #f)) ;no tests | |
b94a6ca0 | 5484 | (native-inputs `(("gettext" ,gettext-minimal))) |
58d6a1f2 TGR |
5485 | (inputs `(("pciutils" ,pciutils))) |
5486 | (home-page (package-home-page linux-libre)) | |
5487 | (synopsis "CPU frequency and voltage scaling tools for Linux") | |
5488 | (description | |
5489 | "cpupower is a set of user-space tools that use the cpufreq feature of the | |
5490 | Linux kernel to retrieve and control processor features related to power saving, | |
5491 | such as frequency and voltage scaling.") | |
5492 | (license license:gpl2))) | |
2b76f135 | 5493 | |
71bd55cb SS |
5494 | (define-public x86-energy-perf-policy |
5495 | (package | |
5496 | (name "x86-energy-perf-policy") | |
5497 | (version (package-version linux-libre)) | |
5498 | (source (package-source linux-libre)) | |
5499 | (build-system gnu-build-system) | |
5500 | (arguments | |
5501 | '(#:tests? #f | |
5502 | #:phases | |
5503 | (modify-phases %standard-phases | |
5504 | (add-after 'unpack 'enter-subdirectory | |
5505 | (lambda _ | |
5506 | (chdir "tools/power/x86/x86_energy_perf_policy") | |
5507 | #t)) | |
5508 | (delete 'configure) | |
5509 | (add-before 'build 'fix-makefile | |
5510 | (lambda _ | |
5511 | (substitute* "Makefile" (("/usr") "")) | |
5512 | #t))) | |
5513 | #:make-flags | |
5514 | (let ((out (assoc-ref %outputs "out"))) | |
5515 | (list (string-append "DESTDIR=" out) | |
5516 | (string-append "LDFLAGS=-Wl,-rpath=" out "/lib"))))) | |
5517 | (supported-systems '("i686-linux" "x86_64-linux")) | |
5518 | (home-page (package-home-page linux-libre)) | |
5519 | (synopsis "Display and update Intel-CPU energy-performance policy") | |
5520 | (description | |
5521 | "@command{x86_energy_perf_policy} displays and updates energy-performance | |
5522 | policy settings specific to Intel Architecture Processors. Settings are | |
5523 | accessed via Model Specific Register (MSR) updates, no matter if the Linux | |
5524 | cpufreq sub-system is enabled or not.") | |
5525 | (license license:gpl2))) | |
5526 | ||
2b76f135 TGR |
5527 | (define-public haveged |
5528 | (package | |
5529 | (name "haveged") | |
27f56b2c | 5530 | (version "1.9.13") |
2b76f135 TGR |
5531 | (source |
5532 | (origin | |
893c340c TGR |
5533 | (method git-fetch) |
5534 | (uri (git-reference | |
b0e7b699 | 5535 | (url "https://github.com/jirka-h/haveged") |
389cae8b | 5536 | (commit (string-append "v" version)))) |
893c340c | 5537 | (file-name (git-file-name name version)) |
2b76f135 | 5538 | (sha256 |
27f56b2c | 5539 | (base32 "0g3hcvpky76cabgcfqh65fay7nnjkms32sgmlf33q969833hijqz")))) |
2b76f135 | 5540 | (build-system gnu-build-system) |
6664ec0c | 5541 | (home-page "https://www.issihosts.com/haveged") |
2b76f135 TGR |
5542 | (synopsis "Entropy source for the Linux random number generator") |
5543 | (description | |
5544 | "haveged generates an unpredictable stream of random numbers for use by | |
5545 | Linux's @file{/dev/random} and @file{/dev/urandom} devices. The kernel's | |
5546 | standard mechanisms for filling the entropy pool may not be sufficient for | |
5547 | systems with high needs or limited user interaction, such as headless servers. | |
b71a3488 | 5548 | |
2b76f135 | 5549 | @command{haveged} runs as a privileged daemon, harvesting randomness from the |
8e42b087 TGR |
5550 | indirect effects of hardware events on hidden processor state using the |
5551 | @acronym{HAVEGE, HArdware Volatile Entropy Gathering and Expansion} algorithm. | |
5552 | It tunes itself to its environment and provides the same built-in test suite | |
5553 | for the output stream as used on certified hardware security devices. | |
4a147986 TGR |
5554 | |
5555 | The quality of the randomness produced by this algorithm has not been proven. | |
5556 | It is recommended to run it together with another entropy source like rngd, and | |
5557 | not as a replacement for it.") | |
2b76f135 TGR |
5558 | (license (list (license:non-copyleft "file://nist/mconf.h") |
5559 | (license:non-copyleft "file://nist/packtest.c") | |
5560 | license:public-domain ; nist/dfft.c | |
5561 | license:gpl3+)))) ; everything else | |
e385e957 TGR |
5562 | |
5563 | (define-public ecryptfs-utils | |
5564 | (package | |
5565 | (name "ecryptfs-utils") | |
5566 | (version "111") | |
5567 | (source | |
5568 | (origin | |
5569 | (method url-fetch) | |
5570 | (uri (string-append "https://launchpad.net/ecryptfs/trunk/" | |
5571 | version "/+download/ecryptfs-utils_" | |
5572 | version ".orig.tar.gz")) | |
5573 | (sha256 | |
5574 | (base32 | |
5575 | "0zwq19siiwf09h7lwa7n7mgmrr8cxifp45lmwgcfr8c1gviv6b0i")))) | |
5576 | (build-system gnu-build-system) | |
5577 | (arguments | |
17a21bcf BT |
5578 | `(#:configure-flags (list "--disable-pywrap") |
5579 | #:phases | |
5580 | (modify-phases %standard-phases | |
5581 | (add-after 'patch-source-shebangs 'patch-hardcoded-paths | |
5582 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
5583 | (let ((out (assoc-ref outputs "out")) | |
5584 | (utils-linux (assoc-ref inputs "utils-linux")) | |
5585 | (cryptsetup (assoc-ref inputs "cryptsetup")) | |
5586 | (linux-pam (assoc-ref inputs "linux-pam")) | |
5587 | (lvm2 (assoc-ref inputs "lvm2"))) | |
5588 | (substitute* '("src/utils/ecryptfs-mount-private" | |
5589 | "src/utils/ecryptfs-umount-private" | |
5590 | "src/utils/ecryptfs-setup-private" | |
e8ec2dda | 5591 | "src/utils/ecryptfs-setup-swap" |
17a21bcf | 5592 | "src/utils/mount.ecryptfs.c" |
e8ec2dda | 5593 | "src/utils/umount.ecryptfs.c" |
17a21bcf BT |
5594 | "src/pam_ecryptfs/pam_ecryptfs.c" |
5595 | "src/desktop/ecryptfs-mount-private.desktop.in" | |
e8ec2dda | 5596 | "src/desktop/ecryptfs-setup-private.desktop.in") |
17a21bcf BT |
5597 | (("/bin/mount") |
5598 | (string-append utils-linux "/bin/mount")) | |
5599 | (("/bin/umount") | |
5600 | (string-append utils-linux "/bin/umount")) | |
5601 | (("/sbin/mount.ecryptfs_private") | |
5602 | (string-append out "/sbin/mount.ecryptfs_private")) | |
5603 | (("/sbin/umount.ecryptfs_private") | |
5604 | (string-append out "/sbin/umount.ecryptfs_private")) | |
5605 | (("/usr/bin/ecryptfs-mount-private") | |
5606 | (string-append out "/bin/ecryptfs-mount-private")) | |
5607 | (("/usr/bin/ecryptfs-rewrite-file") | |
5608 | (string-append out "/bin/ecryptfs-rewrite-file")) | |
5609 | (("/usr/bin/ecryptfs-setup-private") | |
5610 | (string-append out "/bin/ecryptfs-setup-private")) | |
5611 | (("/sbin/cryptsetup") | |
5612 | (string-append cryptsetup "/sbin/cryptsetup")) | |
5613 | (("/sbin/unix_chkpwd") | |
5614 | (string-append linux-pam "/sbin/unix_chkpwd")) | |
5615 | (("/sbin/dmsetup") | |
5616 | (string-append lvm2 "/sbin/dmsetup"))))))))) | |
e385e957 TGR |
5617 | (native-inputs |
5618 | `(("intltool" ,intltool) | |
5619 | ("perl" ,perl) ; for pod2man | |
5620 | ("pkg-config" ,pkg-config))) | |
5621 | (inputs | |
5622 | `(("keyutils" ,keyutils) | |
5623 | ("linux-pam" ,linux-pam) | |
17a21bcf BT |
5624 | ("utils-linux" ,util-linux) |
5625 | ("cryptsetup" ,cryptsetup) | |
5626 | ("lvm2" ,lvm2) | |
e385e957 | 5627 | ("nss" ,nss))) |
c04cbcf7 | 5628 | (home-page "https://ecryptfs.org/") |
e385e957 TGR |
5629 | (synopsis "eCryptfs cryptographic file system utilities") |
5630 | (description | |
5631 | "eCryptfs is a POSIX-compliant stacked cryptographic file system for Linux. | |
5632 | Each file's cryptographic meta-data is stored inside the file itself, along | |
5633 | with the encrypted contents. This allows individual encrypted files to be | |
5634 | copied between hosts and still be decrypted with the proper key. eCryptfs is a | |
5635 | native Linux file system, and has been part of the Linux kernel since version | |
5636 | 2.6.19. This package contains the userland utilities to manage it.") | |
5637 | ;; The files src/key_mod/ecryptfs_key_mod_{openssl,pkcs11_helper,tspi}.c | |
5638 | ;; grant additional permission to link with OpenSSL. | |
5639 | (license license:gpl2+))) | |
cff0adec DC |
5640 | |
5641 | (define-public libnfsidmap | |
5642 | (package | |
5643 | (name "libnfsidmap") | |
4505369c TGR |
5644 | (version "0.27") |
5645 | (source | |
5646 | (origin | |
5647 | (method url-fetch) | |
5648 | (uri (string-append "https://fedorapeople.org/~steved/" | |
5649 | name "/" version "/" name "-" version ".tar.bz2")) | |
5650 | (sha256 | |
5651 | (base32 "0bg2bcii424mf1bnp3fssr8jszbvhdxl7wvifm1yf6g596v8b8i5")))) | |
cff0adec DC |
5652 | (build-system gnu-build-system) |
5653 | (arguments | |
5654 | `(#:configure-flags (list | |
5655 | (string-append "--with-pluginpath=" | |
5656 | (assoc-ref %outputs "out") | |
5657 | "/lib/libnfsidmap")))) | |
4505369c TGR |
5658 | (native-inputs |
5659 | `(("autoconf" ,autoconf))) ; 0.27 still needs autoheader | |
cff0adec DC |
5660 | (home-page |
5661 | "http://www.citi.umich.edu/projects/nfsv4/crossrealm/libnfsidmap_config.html") | |
4505369c | 5662 | (synopsis "NFSv4 support library for name/ID mapping") |
cff0adec DC |
5663 | (description "Libnfsidmap is a library holding mulitiple methods of |
5664 | mapping names to ids and visa versa, mainly for NFSv4. It provides an | |
5665 | extensible array of mapping functions, currently consisting of two choices: | |
5666 | the default @code{nsswitch} and the experimental @code{umich_ldap}.") | |
5667 | (license (license:non-copyleft "file://COPYING" | |
5668 | "See COPYING in the distribution.")))) | |
035d3593 DC |
5669 | |
5670 | (define-public module-init-tools | |
5671 | (package | |
5672 | (name "module-init-tools") | |
5673 | (version "3.16") | |
5674 | (source (origin | |
5675 | (method url-fetch) | |
5676 | (uri (string-append | |
5677 | "mirror://kernel.org/linux/utils/kernel/module-init-tools/" | |
5678 | "module-init-tools-" version ".tar.bz2")) | |
5679 | (sha256 | |
5680 | (base32 | |
5681 | "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1")) | |
5682 | (patches (search-patches "module-init-tools-moduledir.patch")))) | |
5683 | (build-system gnu-build-system) | |
5684 | (arguments | |
5685 | ;; FIXME: The upstream tarball lacks man pages, and building them would | |
5686 | ;; require DocBook & co. We used to use Gentoo's pre-built man pages, | |
5687 | ;; but they vanished. In the meantime, fake it. | |
dc1d3cde KK |
5688 | '(#:phases |
5689 | (modify-phases %standard-phases | |
5690 | (add-before 'configure 'fake-docbook | |
5691 | (lambda _ | |
5692 | (substitute* "Makefile.in" | |
5693 | (("^DOCBOOKTOMAN.*$") | |
5694 | "DOCBOOKTOMAN = true\n")) | |
5695 | #t))))) | |
81e59e41 | 5696 | (home-page "https://www.kernel.org/pub/linux/utils/kernel/module-init-tools/") |
035d3593 DC |
5697 | (synopsis "Tools for loading and managing Linux kernel modules") |
5698 | (description | |
36a4366d EF |
5699 | "Tools for loading and managing Linux kernel modules, such as |
5700 | @code{modprobe}, @code{insmod}, @code{lsmod}, and more.") | |
035d3593 | 5701 | (license license:gpl2+))) |
dd65f3b7 TGR |
5702 | |
5703 | (define-public mcelog | |
5704 | (package | |
5705 | (name "mcelog") | |
ed139ee7 | 5706 | (version "170") |
dd65f3b7 TGR |
5707 | (source (origin |
5708 | (method url-fetch) | |
5709 | (uri (string-append "https://git.kernel.org/cgit/utils/cpu/mce/" | |
5710 | "mcelog.git/snapshot/v" version ".tar.gz")) | |
5711 | (sha256 | |
5712 | (base32 | |
ed139ee7 | 5713 | "1m11v1y7cvpm7hwsghj23z77ps1w5jzn8000iwiyxpb939h2km5l")) |
dd65f3b7 TGR |
5714 | (file-name (string-append name "-" version ".tar.gz")) |
5715 | (modules '((guix build utils))) | |
5716 | (snippet | |
6cbee49d MW |
5717 | `(begin |
5718 | ;; The snapshots lack a .git directory, | |
5719 | ;; breaking ‘git describe’. | |
5720 | (substitute* "Makefile" | |
5721 | (("\"unknown\"") (string-append "\"v" ,version "\""))) | |
5722 | #t)))) | |
dd65f3b7 TGR |
5723 | (build-system gnu-build-system) |
5724 | (arguments | |
5725 | `(#:phases (modify-phases %standard-phases | |
5726 | (delete 'configure)) ; no configure script | |
5727 | #:make-flags (let ((out (assoc-ref %outputs "out"))) | |
5728 | (list "CC=gcc" | |
5729 | (string-append "prefix=" out) | |
df305cea TGR |
5730 | (string-append "DOCDIR=" out "/share/doc/" |
5731 | ,name "-" ,version) | |
dd65f3b7 TGR |
5732 | "etcprefix=$(DOCDIR)/examples")) |
5733 | ;; The tests will only run as root on certain supported CPU models. | |
5734 | #:tests? #f)) | |
5735 | (supported-systems (list "i686-linux" "x86_64-linux")) | |
71d60b96 | 5736 | (home-page "https://mcelog.org/") |
dd65f3b7 TGR |
5737 | (synopsis "Machine check monitor for x86 Linux systems") |
5738 | (description | |
de382528 TGR |
5739 | "The mcelog daemon logs memory, I/O, CPU, and other hardware errors on x86 |
5740 | systems running the kernel Linux. It can also perform user-defined tasks, such | |
5741 | as bringing bad pages off-line, when configurable error thresholds are | |
5742 | exceeded.") | |
dd65f3b7 | 5743 | (license license:gpl2))) |
0c60cc53 DM |
5744 | |
5745 | (define-public mtd-utils | |
5746 | (package | |
5747 | (name "mtd-utils") | |
d0ff7e1c | 5748 | (version "2.1.2") |
0c60cc53 DM |
5749 | (source (origin |
5750 | (method url-fetch) | |
5751 | (uri (string-append | |
5752 | "ftp://ftp.infradead.org/pub/mtd-utils/" | |
5753 | "mtd-utils-" version ".tar.bz2")) | |
5754 | (sha256 | |
5755 | (base32 | |
d0ff7e1c | 5756 | "1mp9fqgnz5r69s8ly98ry6k2blqnaqpllwi8m930dm0n8zrwbm4a")))) |
e8b9aaf0 EF |
5757 | (arguments |
5758 | '(#:configure-flags '("--enable-unit-tests"))) | |
5759 | (native-inputs | |
5760 | `(("cmocka" ,cmocka) | |
5761 | ("pkg-config" ,pkg-config))) | |
0c60cc53 | 5762 | (inputs |
f8f2b048 | 5763 | `(("acl" ,acl) ; extended attributes (xattr) |
bb93042c | 5764 | ("libuuid" ,util-linux "lib") |
c695fb76 | 5765 | ("lzo" ,lzo) |
f8f2b048 | 5766 | ("openssl" ,openssl) ; optional crypto support |
9ea820a5 TGR |
5767 | ("zlib" ,zlib) |
5768 | ("zstd" ,zstd "lib"))) | |
0c60cc53 | 5769 | (build-system gnu-build-system) |
0c60cc53 DM |
5770 | (synopsis "MTD Flash Storage Utilities") |
5771 | (description "This package provides utilities for testing, partitioning, etc | |
5772 | of flash storage.") | |
5773 | (home-page "http://www.linux-mtd.infradead.org/") | |
5774 | (license | |
5775 | (list license:gpl2 ; Almost everything is gpl2 or gpl2+ | |
5776 | license:mpl1.1 ; All ftl* files | |
5777 | license:expat)))) ; libiniparser | |
def6213f LF |
5778 | |
5779 | (define-public libseccomp | |
5780 | (package | |
5781 | (name "libseccomp") | |
56a1ffeb | 5782 | (version "2.5.0") |
def6213f LF |
5783 | (source (origin |
5784 | (method url-fetch) | |
5785 | (uri (string-append "https://github.com/seccomp/libseccomp/" | |
5786 | "releases/download/v" version | |
5787 | "/libseccomp-" version ".tar.gz")) | |
5788 | (sha256 | |
5789 | (base32 | |
56a1ffeb | 5790 | "1wql62cg8f95cwpy057cl764nni9g4sdn5lqj68x22kjs8w71yhz")))) |
def6213f | 5791 | (build-system gnu-build-system) |
819b8b27 | 5792 | (arguments |
7a9a27a0 MB |
5793 | '(#:configure-flags '("--disable-static") |
5794 | #:phases (modify-phases %standard-phases | |
5795 | (add-before 'check 'skip-load-test | |
5796 | (lambda _ | |
5797 | ;; This test does a native system call and fails when | |
5798 | ;; run under QEMU user-mode emulation. Just skip it. | |
5799 | (delete-file "tests/52-basic-load.tests") | |
5800 | #t))))) | |
def6213f | 5801 | (native-inputs |
56a1ffeb MB |
5802 | `(("gperf" ,gperf) |
5803 | ("which" ,which))) | |
def6213f LF |
5804 | (synopsis "Interface to Linux's seccomp syscall filtering mechanism") |
5805 | (description "The libseccomp library provides an easy to use, platform | |
5806 | independent, interface to the Linux Kernel's syscall filtering mechanism. The | |
5807 | libseccomp API is designed to abstract away the underlying BPF based syscall | |
5808 | filter language and present a more conventional function-call based filtering | |
5809 | interface that should be familiar to, and easily adopted by, application | |
5810 | developers.") | |
5811 | (home-page "https://github.com/seccomp/libseccomp") | |
5812 | (license license:lgpl2.1))) | |
58c4f11e TGR |
5813 | |
5814 | (define-public radeontop | |
5815 | (package | |
5816 | (name "radeontop") | |
88e1bce5 | 5817 | (version "1.2") |
ee861a54 TGR |
5818 | (source |
5819 | (origin | |
5820 | (method git-fetch) | |
5821 | (uri (git-reference | |
b0e7b699 | 5822 | (url "https://github.com/clbr/radeontop") |
ee861a54 TGR |
5823 | (commit (string-append "v" version)))) |
5824 | (file-name (git-file-name name version)) | |
5825 | (sha256 | |
5826 | (base32 "1b1m30r2nfwqkajqw6m01xmfhlq83z1qylyijxg7962mp9x2k0gw")))) | |
58c4f11e TGR |
5827 | (build-system gnu-build-system) |
5828 | (arguments | |
5829 | `(#:phases (modify-phases %standard-phases | |
5830 | ;; getver.sh uses ‘git --describe’, isn't worth an extra git | |
5831 | ;; dependency, and doesn't even work on release(!) tarballs. | |
5832 | (add-after 'unpack 'report-correct-version | |
9922278b MW |
5833 | (lambda _ |
5834 | (substitute* "getver.sh" | |
5835 | (("ver=unknown") | |
5836 | (string-append "ver=" ,version))) | |
5837 | #t)) | |
58c4f11e TGR |
5838 | (delete 'configure)) ; no configure script |
5839 | #:make-flags (list "CC=gcc" | |
5840 | (string-append "PREFIX=" %output)) | |
5841 | #:tests? #f)) ; no tests | |
5842 | (native-inputs | |
7c90d0f4 | 5843 | `(("gettext" ,gettext-minimal) |
58c4f11e TGR |
5844 | ("pkg-config" ,pkg-config))) |
5845 | (inputs | |
5846 | `(("libdrm" ,libdrm) | |
5847 | ("libpciaccess" ,libpciaccess) | |
a7c61512 | 5848 | ("libxcb" ,libxcb) |
58c4f11e | 5849 | ("ncurses" ,ncurses))) |
ee861a54 | 5850 | (home-page "https://github.com/clbr/radeontop/") |
58c4f11e TGR |
5851 | (synopsis "Usage monitor for AMD Radeon graphics") |
5852 | (description "RadeonTop monitors resource consumption on supported AMD | |
5853 | Radeon Graphics Processing Units (GPUs), either in real time as bar graphs on | |
5854 | a terminal or saved to a file for further processing. It measures both the | |
5855 | activity of the GPU as a whole, which is also accurate during OpenCL | |
5856 | computations, as well as separate component statistics that are only meaningful | |
5857 | under OpenGL graphics workloads.") | |
5858 | (license license:gpl3))) | |
0d74462a MB |
5859 | |
5860 | (define-public efivar | |
5861 | (package | |
5862 | (name "efivar") | |
f19dfeeb | 5863 | (version "37") |
0d74462a MB |
5864 | (source (origin |
5865 | (method url-fetch) | |
c6dd2790 | 5866 | (uri (string-append "https://github.com/rhboot/" name |
0d74462a MB |
5867 | "/releases/download/" version "/" name |
5868 | "-" version ".tar.bz2")) | |
5869 | (sha256 | |
5870 | (base32 | |
f19dfeeb | 5871 | "17vvfivhsrszh7q39b6npjsrhrhsjf1cmmcpp3xrh6wh7ywzwrrw")))) |
0d74462a MB |
5872 | (build-system gnu-build-system) |
5873 | (arguments | |
5874 | `(;; Tests require a UEFI system and is not detected in the chroot. | |
5875 | #:tests? #f | |
5876 | #:make-flags (list (string-append "prefix=" %output) | |
5877 | (string-append "libdir=" %output "/lib") | |
b2b2ba40 | 5878 | "CC_FOR_BUILD=gcc" |
0d74462a MB |
5879 | (string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) |
5880 | #:phases | |
5881 | (modify-phases %standard-phases | |
6388bed7 | 5882 | (delete 'configure)))) |
0d74462a MB |
5883 | (native-inputs |
5884 | `(("pkg-config" ,pkg-config))) | |
5885 | (inputs | |
5886 | `(("popt" ,popt))) | |
c6dd2790 | 5887 | (home-page "https://github.com/rhboot/efivar") |
0d74462a MB |
5888 | (synopsis "Tool and library to manipulate EFI variables") |
5889 | (description "This package provides a library and a command line | |
5890 | interface to the variable facility of UEFI boot firmware.") | |
5891 | (license license:lgpl2.1+))) | |
1581406e MB |
5892 | |
5893 | (define-public efibootmgr | |
5894 | (package | |
5895 | (name "efibootmgr") | |
732825f3 | 5896 | (version "16") |
1581406e MB |
5897 | (source (origin |
5898 | (method url-fetch) | |
30559d8f MB |
5899 | (uri (string-append "https://github.com/rhinstaller/efibootmgr" |
5900 | "/releases/download/" version "/efibootmgr" | |
1581406e MB |
5901 | "-" version ".tar.bz2")) |
5902 | (sha256 | |
5903 | (base32 | |
732825f3 | 5904 | "0pzn67vxxaf7jna4cd0i4kqm60h04kb21hckksv9z82q9gxra1wm")))) |
1581406e MB |
5905 | (build-system gnu-build-system) |
5906 | (arguments | |
82e7a51c | 5907 | `(#:tests? #f ;no tests |
1581406e MB |
5908 | #:make-flags (list (string-append "prefix=" %output) |
5909 | (string-append "libdir=" %output "/lib") | |
732825f3 MB |
5910 | ;; EFIDIR denotes a subdirectory relative to the |
5911 | ;; EFI System Partition where the loader will be | |
5912 | ;; installed (known as OS_VENDOR in the code). | |
5913 | ;; GRUB overrides this, as such it's only used if | |
5914 | ;; nothing else is specified on the command line. | |
87d3e94d | 5915 | "EFIDIR=gnu") |
732825f3 | 5916 | #:phases (modify-phases %standard-phases (delete 'configure)))) |
1581406e MB |
5917 | (native-inputs |
5918 | `(("pkg-config" ,pkg-config))) | |
5919 | (inputs | |
5920 | `(("efivar" ,efivar) | |
5921 | ("popt" ,popt))) | |
5922 | (home-page "https://github.com/rhinstaller/efibootmgr") | |
5923 | (synopsis "Modify the Extensible Firmware Interface (EFI) boot manager") | |
5924 | (description | |
5925 | "@code{efibootmgr} is a user-space application to modify the Intel | |
5926 | Extensible Firmware Interface (EFI) Boot Manager. This application can | |
5927 | create and destroy boot entries, change the boot order, change the next | |
5928 | running boot option, and more.") | |
5929 | (license license:gpl2+))) | |
6d3e08d4 LF |
5930 | |
5931 | (define-public sysstat | |
5932 | (package | |
5933 | (name "sysstat") | |
eb86a442 | 5934 | (version "12.4.0") |
6d3e08d4 LF |
5935 | (source (origin |
5936 | (method url-fetch) | |
36ac9520 | 5937 | (uri (string-append "http://pagesperso-orange.fr/sebastien.godard/" |
6d3e08d4 LF |
5938 | "sysstat-" version ".tar.xz")) |
5939 | (sha256 | |
5940 | (base32 | |
eb86a442 | 5941 | "05idnvkhvzaynj9awx7q54x1v42jblzrxq0fn5zd1v4mjwrnqmbq")))) |
6d3e08d4 LF |
5942 | (build-system gnu-build-system) |
5943 | (arguments | |
eb86a442 | 5944 | `(#:tests? #f ; no test suite. |
6d3e08d4 LF |
5945 | ;; Without this flag, it tries to install the man pages with group 'root' |
5946 | ;; and fails because /etc/passwd lacks an entry for the root user. | |
5947 | #:configure-flags | |
5948 | (list "--disable-file-attr" | |
5949 | (string-append "conf_dir=" (assoc-ref %outputs "out") "/etc")) | |
5950 | #:phases | |
5951 | (modify-phases %standard-phases | |
5952 | ;; The build process tries to create '/var/lib/sa', so we skip that | |
5953 | ;; instruction. | |
5954 | (add-after 'build 'skip-touching-var | |
5955 | (lambda _ | |
5956 | (substitute* "Makefile" | |
5957 | (("mkdir -p \\$\\(DESTDIR\\)\\$\\(SA_DIR\\)") | |
5958 | "")) | |
5959 | #t))))) | |
5960 | (home-page "http://sebastien.godard.pagesperso-orange.fr/") | |
5961 | (synopsis "Performance monitoring tools for Linux") | |
5962 | (description "The sysstat utilities are a collection of performance | |
5963 | monitoring tools for Linux. These include @code{mpstat}, @code{iostat}, | |
5964 | @code{tapestat}, @code{cifsiostat}, @code{pidstat}, @code{sar}, @code{sadc}, | |
5965 | @code{sadf} and @code{sa}.") | |
5966 | (license license:gpl2+))) | |
01be4f93 JMSG |
5967 | |
5968 | (define-public light | |
5969 | (package | |
5970 | (name "light") | |
e3fdc019 | 5971 | (version "1.2.2") |
664cb939 TGR |
5972 | (source |
5973 | (origin | |
5974 | (method git-fetch) | |
5975 | (uri (git-reference | |
b0e7b699 | 5976 | (url "https://github.com/haikarainen/light") |
664cb939 TGR |
5977 | (commit (string-append "v" version)))) |
5978 | (sha256 | |
e3fdc019 | 5979 | (base32 "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s")) |
664cb939 | 5980 | (file-name (git-file-name name version)))) |
01be4f93 | 5981 | (build-system gnu-build-system) |
fcb510c5 AB |
5982 | (arguments |
5983 | `(#:phases | |
5984 | (modify-phases %standard-phases | |
5985 | (add-after 'unpack 'patch-udev-rules-absolute-path-bins | |
5986 | (lambda* (#:key inputs #:allow-other-keys) | |
5987 | (substitute* "90-backlight.rules" | |
5988 | (("/bin/chgrp") (which "chgrp")) | |
5989 | (("/bin/chmod") (which "chmod"))) | |
5990 | #t)) | |
5991 | (add-after 'install 'install-udev-rules | |
5992 | (lambda* (#:key outputs #:allow-other-keys) | |
5993 | (let ((out (assoc-ref outputs "out"))) | |
5994 | (install-file | |
5995 | "90-backlight.rules" (string-append out "/lib/udev/rules.d")) | |
5996 | #t)))))) | |
01be4f93 | 5997 | (native-inputs |
ff598353 PL |
5998 | `(("autoconf" ,autoconf) |
5999 | ("automake" ,automake))) | |
6000 | (home-page "https://haikarainen.github.io/light/") | |
01be4f93 JMSG |
6001 | (synopsis "GNU/Linux application to control backlights") |
6002 | (description | |
6003 | "Light is a program to send commands to screen backlight controllers | |
6004 | under GNU/Linux. Features include: | |
6005 | ||
6006 | @itemize | |
6007 | @item It does not rely on X. | |
6008 | @item Light can automatically figure out the best controller to use, making | |
6009 | full use of underlying hardware. | |
6010 | @item It is possible to set a minimum brightness value, as some controllers | |
6011 | set the screen to be pitch black at a vaĺue of 0 (or higher). | |
6012 | @end itemize | |
6013 | ||
6014 | Light is the successor of lightscript.") | |
6015 | (license license:gpl3+))) | |
189d8422 | 6016 | |
ab7f1eb9 VC |
6017 | (define-public brightnessctl |
6018 | (let ((commit "6a791e7694aeeb5d027f71c6098e5182cf03371c")) | |
6019 | (package | |
6020 | (name "brightnessctl") | |
6021 | (version (git-version "0.4" "0" commit)) | |
6022 | (source (origin | |
6023 | (method git-fetch) | |
6024 | (uri (git-reference | |
6025 | (url "https://github.com/Hummer12007/brightnessctl/") | |
6026 | (commit commit))) | |
6027 | (file-name (git-file-name name version)) | |
6028 | (sha256 | |
6029 | (base32 | |
6030 | "1n1gb8ldgqv3vs565yhk1w4jfvrviczp94r8wqlkv5q6ab43c8w9")))) | |
6031 | (build-system gnu-build-system) | |
6032 | (arguments | |
6033 | '(#:tests? #f ; no tests | |
6034 | #:make-flags (list "CC=gcc" | |
6035 | (string-append "PREFIX=" %output) | |
6036 | (string-append "UDEVDIR=" %output "/lib/udev/rules.d/")) | |
6037 | #:phases | |
6038 | (modify-phases %standard-phases | |
6039 | (delete 'configure) | |
6040 | (add-after 'unpack 'adjust-udev-rules | |
6041 | (lambda _ | |
6042 | (substitute* "90-brightnessctl.rules" | |
6043 | (("/bin/") "/run/current-system/profile/bin/")) | |
6044 | #t))))) | |
6045 | (home-page "https://github.com/Hummer12007/brightnessctl") | |
6046 | (synopsis "Backlight and LED brightness control") | |
6047 | (description | |
6048 | "This program allows you read and control device brightness. Devices | |
6049 | include backlight and LEDs. It can also preserve current brightness before | |
6050 | applying the operation, such as on lid close. | |
6051 | ||
6052 | The appropriate permissions must be set on the backlight or LED control | |
6053 | interface in sysfs, which can be accomplished with the included udev rules.") | |
6054 | (license license:expat)))) | |
6055 | ||
c7adafa7 MO |
6056 | (define-public tlp |
6057 | (package | |
6058 | (name "tlp") | |
0d4e780e | 6059 | (version "1.3.1") |
8a890f3c NG |
6060 | (source |
6061 | (origin | |
0d4e780e NG |
6062 | (method git-fetch) |
6063 | (uri (git-reference | |
b0e7b699 | 6064 | (url "https://github.com/linrunner/TLP") |
0d4e780e NG |
6065 | (commit version))) |
6066 | (file-name (git-file-name name version)) | |
8a890f3c | 6067 | (sha256 |
0d4e780e | 6068 | (base32 "14fcnaz9pw534v4d8dddqq4wcvpf1kghr8zlrk62r5lrl46sp1p5")))) |
8a890f3c NG |
6069 | (native-inputs |
6070 | `(("shellcheck" ,shellcheck))) | |
6071 | (inputs | |
6072 | `(("bash" ,bash) | |
6073 | ("dbus" ,dbus) | |
6074 | ("ethtool" ,ethtool) | |
6075 | ("eudev" ,eudev) | |
6076 | ("grep" ,grep) | |
6077 | ("hdparm" ,hdparm) | |
6078 | ("inetutils" ,inetutils) | |
6079 | ("iw" ,iw) | |
6080 | ("kmod" ,kmod) | |
6081 | ("pciutils" ,pciutils) | |
6082 | ("perl" ,perl) | |
6083 | ("rfkill" ,rfkill) | |
6084 | ("sed" ,sed) | |
6085 | ("usbutils" ,usbutils) | |
6086 | ("util-linux" ,util-linux) | |
6087 | ("wireless-tools" ,wireless-tools) | |
6088 | ,@(if (let ((system (or (%current-target-system) | |
6089 | (%current-system)))) | |
6090 | (or (string-prefix? "i686-" system) | |
6091 | (string-prefix? "x86_64-" system))) | |
6092 | `(("x86-energy-perf-policy" ,x86-energy-perf-policy)) | |
6093 | '()))) | |
c7adafa7 MO |
6094 | (build-system gnu-build-system) |
6095 | (arguments | |
8a890f3c NG |
6096 | ;; XXX: The full test suite is run with "checkall" but it requires |
6097 | ;; "checkbashisms" and "perlcritic", not yet packaged in Guix. | |
6098 | `(#:test-target "shellcheck" | |
6099 | #:modules ((guix build gnu-build-system) | |
cf342a85 SS |
6100 | (guix build utils) |
6101 | (srfi srfi-1)) | |
6102 | #:phases | |
c7adafa7 | 6103 | (modify-phases %standard-phases |
cef3f146 | 6104 | (delete 'configure) ; no configure script |
c7adafa7 MO |
6105 | (add-before 'build 'setenv |
6106 | (lambda* (#:key outputs #:allow-other-keys) | |
6107 | (let ((out (assoc-ref outputs "out"))) | |
6108 | (setenv "TLP_WITH_SYSTEMD" "0") | |
6109 | (setenv "TLP_NO_INIT" "1") | |
6110 | (setenv "TLP_NO_PMUTILS" "1") | |
6111 | (setenv "TLP_SBIN" (string-append out "/bin")) | |
6112 | (setenv "TLP_BIN" (string-append out "/bin")) | |
c6e775a8 NG |
6113 | (setenv "TLP_TLIB" (string-append out "/share/tlp")) |
6114 | (setenv "TLP_FLIB" (string-append out "/share/tlp/func.d")) | |
c7adafa7 | 6115 | (setenv "TLP_ULIB" (string-append out "/lib/udev")) |
8a890f3c NG |
6116 | (setenv "TLP_CONFDEF" |
6117 | (string-append out "/share/tlp/defaults.conf")) | |
6118 | (setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d")) | |
5d51a977 NG |
6119 | (setenv "TLP_ELOD" |
6120 | (string-append out "/lib/elogind/system-sleep")) | |
c7adafa7 MO |
6121 | (setenv "TLP_SHCPL" |
6122 | (string-append out "/share/bash-completion/completions")) | |
6db6c3a9 | 6123 | (setenv "TLP_MAN" (string-append out "/share/man")) |
272fc9dc TGR |
6124 | (setenv "TLP_META" (string-append out "/share/metainfo")) |
6125 | #t))) | |
cef3f146 TGR |
6126 | (add-before 'install 'fix-installation |
6127 | (lambda _ | |
6128 | ;; Stop the Makefile from trying to create system directories. | |
5d51a977 | 6129 | (substitute* "Makefile" |
8a890f3c | 6130 | (("\\[ -f \\$\\(_CONFUSR\\) \\]") "#") |
5d51a977 | 6131 | (("install -d -m 755 \\$\\(_VAR\\)") "#")) |
272fc9dc | 6132 | #t)) |
c7adafa7 | 6133 | (replace 'install |
8a890f3c | 6134 | (lambda _ (invoke "make" "install-tlp" "install-man-tlp"))) |
c7adafa7 MO |
6135 | (add-after 'install 'wrap |
6136 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
6137 | (let* ((bin (string-append (assoc-ref outputs "out") "/bin")) | |
6138 | (bin-files (find-files bin ".*"))) | |
6139 | (define (bin-directory input-name) | |
cf342a85 SS |
6140 | (let ((p (assoc-ref inputs input-name))) |
6141 | (and p (string-append p "/bin")))) | |
c7adafa7 MO |
6142 | (define (sbin-directory input-name) |
6143 | (string-append (assoc-ref inputs input-name) "/sbin")) | |
6144 | (for-each (lambda (program) | |
6145 | (wrap-program program | |
6146 | `("PATH" ":" prefix | |
6147 | ,(append | |
cf342a85 SS |
6148 | (filter-map bin-directory |
6149 | '("bash" | |
6150 | "coreutils" | |
6151 | "dbus" | |
6152 | "eudev" | |
6153 | "grep" | |
6154 | "inetutils" | |
6155 | "kmod" | |
6156 | "perl" | |
6157 | "sed" | |
6158 | "usbutils" | |
6159 | "util-linux" | |
6160 | "x86-energy-perf-policy")) | |
6161 | (filter-map sbin-directory | |
6162 | '("ethtool" | |
6163 | "hdparm" | |
6164 | "iw" | |
6165 | "pciutils" | |
6166 | "rfkill" | |
6167 | "wireless-tools")))))) | |
272fc9dc TGR |
6168 | bin-files) |
6169 | #t)))))) | |
e4c60dcf | 6170 | (home-page "https://linrunner.de/en/tlp/tlp.html") |
c7adafa7 MO |
6171 | (synopsis "Power management tool for Linux") |
6172 | (description "TLP is a power management tool for Linux. It comes with | |
6173 | a default configuration already optimized for battery life. Nevertheless, | |
6174 | TLP is customizable to fulfil system requirements. TLP settings are applied | |
6175 | every time the power supply source is changed.") | |
c7adafa7 MO |
6176 | ;; 'COPYING' is a custom version that says that one file is GPLv3+ and the |
6177 | ;; rest is GPLv2+. | |
6178 | (license (list license:gpl2+ license:gpl3+)))) | |
6179 | ||
189d8422 BG |
6180 | (define-public lshw |
6181 | (package | |
6182 | (name "lshw") | |
5cdb0f4a | 6183 | (version "B.02.19.2") |
189d8422 BG |
6184 | (source (origin |
6185 | (method url-fetch) | |
6186 | (uri (string-append "https://www.ezix.org/software/" | |
6187 | "files/lshw-" version | |
6188 | ".tar.gz")) | |
6189 | (sha256 | |
6190 | (base32 | |
5cdb0f4a | 6191 | "100gm1c6gb2hkfws22h0xhvv7nz38p49lxd1csikj8qlhyn4gcwv")))) |
189d8422 BG |
6192 | (build-system gnu-build-system) |
6193 | (arguments | |
6194 | `(#:phases (modify-phases %standard-phases (delete 'configure)) | |
6195 | #:tests? #f ; no tests | |
6196 | #:make-flags | |
6197 | (list (string-append "PREFIX=" (assoc-ref %outputs "out"))))) | |
6198 | (synopsis "List hardware information") | |
6199 | (description | |
6200 | "@command{lshw} (Hardware Lister) is a small tool to provide | |
6201 | detailed information on the hardware configuration of the machine. | |
6202 | It can report exact memory configuration, firmware version, mainboard | |
6203 | configuration, CPU version and speed, cache configuration, bus speed, | |
6204 | and more on DMI-capable x86 or EFI (IA-64) systems and on some PowerPC | |
6205 | machines (PowerMac G4 is known to work).") | |
6206 | (home-page "https://www.ezix.org/project/wiki/HardwareLiSter") | |
6207 | (license license:gpl2+))) | |
2f4a58b5 LF |
6208 | |
6209 | (define-public libmnl | |
6210 | (package | |
6211 | (name "libmnl") | |
6212 | (version "1.0.4") | |
6213 | (source | |
6214 | (origin | |
6215 | (method url-fetch) | |
f11ae44f | 6216 | (uri (string-append "mirror://netfilter.org/libmnl/" |
2f4a58b5 LF |
6217 | "libmnl-" version ".tar.bz2")) |
6218 | (sha256 | |
6219 | (base32 | |
6220 | "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp")))) | |
6221 | (build-system gnu-build-system) | |
6222 | (home-page "https://www.netfilter.org/projects/libmnl/") | |
6223 | (synopsis "Netlink utility library") | |
6224 | (description "Libmnl is a minimalistic user-space library oriented to | |
6225 | Netlink developers. There are a lot of common tasks in parsing, validating, | |
6226 | constructing of both the Netlink header and TLVs that are repetitive and easy to | |
6227 | get wrong. This library aims to provide simple helpers that allows you to | |
6228 | re-use code and to avoid re-inventing the wheel.") | |
6229 | (license license:lgpl2.1+))) | |
b754c612 LF |
6230 | |
6231 | (define-public libnftnl | |
6232 | (package | |
6233 | (name "libnftnl") | |
67e890ec | 6234 | (version "1.1.7") |
b754c612 | 6235 | (source |
e569c772 TGR |
6236 | (origin |
6237 | (method url-fetch) | |
6238 | (uri (string-append "mirror://netfilter.org/libnftnl/" | |
6239 | "libnftnl-" version ".tar.bz2")) | |
6240 | (sha256 | |
67e890ec | 6241 | (base32 "13zd90bfrr0q3j0l0cbc8kiizccw6n8gp727kqnfljh024zw3nr0")))) |
b754c612 LF |
6242 | (build-system gnu-build-system) |
6243 | (native-inputs | |
6244 | `(("pkg-config" ,pkg-config))) | |
6245 | (inputs | |
6246 | `(("libmnl" ,libmnl))) | |
6247 | (home-page "https://www.netfilter.org/projects/libnftnl/index.html") | |
6248 | (synopsis "Netlink programming interface to the Linux nf_tables subsystem") | |
6249 | (description "Libnftnl is a userspace library providing a low-level netlink | |
6250 | programming interface to the in-kernel nf_tables subsystem. The library | |
6251 | libnftnl has been previously known as libnftables. This library is currently | |
6252 | used by nftables.") | |
6253 | (license license:gpl2+))) | |
62b28c0e | 6254 | |
dfe93c9a RH |
6255 | (define-public nftables |
6256 | (package | |
6257 | (name "nftables") | |
2ddfcf4b | 6258 | (version "0.9.6") |
dfe93c9a RH |
6259 | (source |
6260 | (origin | |
6261 | (method url-fetch) | |
e221e9a7 TGR |
6262 | (uri (list (string-append "mirror://netfilter.org/nftables/nftables-" |
6263 | version ".tar.bz2") | |
6264 | (string-append "https://www.nftables.org/projects/nftables" | |
6265 | "/files/nftables-" version ".tar.bz2"))) | |
dfe93c9a | 6266 | (sha256 |
2ddfcf4b | 6267 | (base32 "0vmn6xwqa1nq6crfxshh049b199d0aj6hfgin7k068xhibzgvmk8")))) |
dfe93c9a | 6268 | (build-system gnu-build-system) |
9cb4bda2 RH |
6269 | (arguments `(#:configure-flags |
6270 | '("--disable-man-doc"))) ; FIXME: Needs docbook2x. | |
5450e301 | 6271 | (inputs `(("gmp" ,gmp) |
c695fb76 TGR |
6272 | ("libmnl" ,libmnl) |
6273 | ("libnftnl" ,libnftnl) | |
6274 | ("readline" ,readline))) | |
5450e301 VL |
6275 | (native-inputs `(("pkg-config" ,pkg-config) |
6276 | ("bison" ,bison) | |
6277 | ("flex" ,flex))) | |
4a27b0f1 | 6278 | (home-page "https://www.nftables.org") |
dfe93c9a RH |
6279 | (synopsis "Userspace utility for Linux packet filtering") |
6280 | (description "nftables is the project that aims to replace the existing | |
6281 | {ip,ip6,arp,eb}tables framework. Basically, this project provides a new packet | |
6282 | filtering framework, a new userspace utility and also a compatibility layer for | |
6283 | {ip,ip6}tables. nftables is built upon the building blocks of the Netfilter | |
6284 | infrastructure such as the existing hooks, the connection tracking system, the | |
6285 | userspace queueing component and the logging subsystem.") | |
6286 | (license license:gpl2))) | |
6287 | ||
62b28c0e LC |
6288 | (define-public proot |
6289 | (package | |
6290 | (name "proot") | |
6291 | (version "5.1.0") | |
674495b7 TGR |
6292 | (source |
6293 | (origin | |
6294 | (method git-fetch) | |
6295 | (uri (git-reference | |
b0e7b699 | 6296 | (url "https://github.com/proot-me/PRoot") |
674495b7 TGR |
6297 | (commit (string-append "v" version)))) |
6298 | (file-name (git-file-name name version)) | |
6299 | (sha256 | |
6300 | (base32 "0azsqis99gxldmbcg43girch85ysg4hwzf0h1b44bmapnsm89fbz")) | |
6301 | (patches (search-patches "proot-test-fhs.patch")))) | |
62b28c0e LC |
6302 | (build-system gnu-build-system) |
6303 | (arguments | |
6304 | '(#:make-flags '("-C" "src") | |
6305 | ||
6306 | #:phases (modify-phases %standard-phases | |
6307 | (delete 'configure) | |
6308 | (add-before 'build 'set-shell-file-name | |
6309 | (lambda* (#:key inputs #:allow-other-keys) | |
6310 | (substitute* (find-files "src" "\\.[ch]$") | |
6311 | (("\"/bin/sh\"") | |
6312 | (string-append "\"" | |
6313 | (assoc-ref inputs "bash") | |
6314 | "/bin/sh\""))) | |
6315 | #t)) | |
6316 | (add-before 'check 'fix-fhs-assumptions-in-tests | |
6317 | (lambda _ | |
6318 | (substitute* "tests/test-c6b77b77.mk" | |
6319 | (("/bin/bash") (which "bash")) | |
6320 | (("/usr/bin/test") (which "test"))) | |
6321 | (substitute* '("tests/test-16573e73.c") | |
6322 | (("/bin/([a-z-]+)" _ program) | |
6323 | (which program))) | |
6324 | ||
6325 | (substitute* (find-files "tests" "\\.sh$") | |
6326 | ;; Some of the tests try to "bind-mount" /bin/true. | |
6327 | (("-b /bin/true:") | |
6328 | (string-append "-b " (which "true") ":")) | |
6329 | ;; Likewise for /bin. | |
6330 | (("-b /bin:") "-b /gnu:") | |
6331 | ;; Others try to run /bin/sh. | |
6332 | (("/bin/sh") (which "sh")) | |
6333 | ;; Others assume /etc/fstab exists. | |
6334 | (("/etc/fstab") "/etc/passwd")) | |
6335 | ||
6336 | (substitute* "tests/GNUmakefile" | |
6337 | (("-b /bin:") "-b /gnu:")) | |
6338 | ||
6339 | ;; XXX: This test fails in an obscure corner case, just | |
6340 | ;; skip it. | |
6341 | (delete-file "tests/test-kkkkkkkk.c") | |
6342 | ||
6343 | #t)) | |
6344 | (replace 'check | |
6345 | (lambda _ | |
6346 | (let ((n (parallel-job-count))) | |
6347 | ;; For some reason we get lots of segfaults with | |
6348 | ;; seccomp support (x86_64, Linux-libre 4.11.0). | |
6349 | (setenv "PROOT_NO_SECCOMP" "1") | |
6350 | ||
6351 | ;; Most of the tests expect "/bin" to be in $PATH so | |
6352 | ;; they can run things that live in $ROOTFS/bin. | |
6353 | (setenv "PATH" | |
6354 | (string-append (getenv "PATH") ":/bin")) | |
6355 | ||
06153a30 MW |
6356 | (invoke "make" "check" "-C" "tests" |
6357 | ;;"V=1" | |
6358 | "-j" (number->string n))))) | |
62b28c0e LC |
6359 | (replace 'install |
6360 | (lambda* (#:key outputs #:allow-other-keys) | |
6361 | ;; The 'install' rule does nearly nothing. | |
06153a30 MW |
6362 | (let* ((out (assoc-ref outputs "out")) |
6363 | (man1 (string-append out "/share/man/man1"))) | |
6364 | ;; TODO: 'make install-care' (does not even | |
6365 | ;; build currently.) | |
6366 | (invoke "make" "-C" "src" "install" | |
6367 | (string-append "PREFIX=" out)) | |
6368 | ||
6369 | (mkdir-p man1) | |
6370 | (copy-file "doc/proot/man.1" | |
6371 | (string-append man1 "/proot.1")) | |
6372 | #t)))))) | |
62b28c0e LC |
6373 | (native-inputs `(("which" ,which) |
6374 | ||
6375 | ;; For 'mcookie', used by some of the tests. | |
cef0e08c LC |
6376 | ("util-linux" ,util-linux) |
6377 | ||
6378 | ;; XXX: Choose the old coreutils because its 'stat' | |
6379 | ;; program does not use statx(2) when running 'stat -c | |
6380 | ;; %a' or similar, which PRoot doesn't properly support. | |
6381 | ("coreutils-old" ,coreutils-8.30) | |
6382 | ||
6383 | ;; XXX: 'test-c6b77b77.sh' runs 'make' and that leads | |
6384 | ;; make 4.3 to segfault. | |
6385 | ("make-old" ,gnu-make-4.2))) | |
62b28c0e | 6386 | (inputs `(("talloc" ,talloc))) |
674495b7 | 6387 | (home-page "https://github.com/proot-me/PRoot") |
62b28c0e LC |
6388 | (synopsis "Unprivileged chroot, bind mount, and binfmt_misc") |
6389 | (description | |
6390 | "PRoot is a user-space implementation of @code{chroot}, @code{mount --bind}, | |
6391 | and @code{binfmt_misc}. This means that users don't need any privileges or | |
6392 | setup to do things like using an arbitrary directory as the new root | |
162a1374 | 6393 | file system, making files accessible somewhere else in the file system |
62b28c0e LC |
6394 | hierarchy, or executing programs built for another CPU architecture |
6395 | transparently through QEMU user-mode. Also, developers can use PRoot as a | |
6396 | generic process instrumentation engine thanks to its extension mechanism. | |
6397 | Technically PRoot relies on @code{ptrace}, an unprivileged system-call | |
6398 | available in the kernel Linux.") | |
6399 | (license license:gpl2+))) | |
b9048a14 LC |
6400 | |
6401 | (define-public proot-static | |
6402 | (package | |
6403 | (inherit proot) | |
6404 | (name "proot-static") | |
6405 | (synopsis | |
6406 | "Unprivileged chroot, bind mount, and binfmt_misc (statically linked)") | |
6407 | (inputs `(("talloc" ,talloc/static))) | |
6408 | (arguments | |
6409 | (substitute-keyword-arguments (package-arguments proot) | |
6410 | ((#:make-flags flags) | |
6411 | `(cons "LDFLAGS = -ltalloc -static -static-libgcc" ,flags)) | |
6412 | ((#:phases phases) | |
6413 | `(modify-phases ,phases | |
6414 | (add-after 'strip 'remove-store-references | |
6415 | (lambda* (#:key outputs #:allow-other-keys) | |
6416 | (let* ((out (assoc-ref outputs "out"))) | |
6417 | (with-directory-excursion out | |
6418 | (remove-store-references "bin/proot") | |
6419 | #t)))))) | |
6420 | ((#:allowed-references _ '("out")) | |
6421 | '("out")))))) | |
1113386b CL |
6422 | |
6423 | (define-public cpuid | |
6424 | (package | |
6425 | (name "cpuid") | |
7ae3b11a | 6426 | (version "20200427") |
1113386b CL |
6427 | (source (origin |
6428 | (method url-fetch) | |
6429 | (uri (string-append "http://www.etallen.com/cpuid/cpuid-" | |
6430 | version ".src.tar.gz")) | |
6431 | (sha256 | |
6432 | (base32 | |
7ae3b11a | 6433 | "1m31238z2ya8f8pzpyklwp0ksf5xicqrw1z941hhhx913wzldaf1")))) |
1113386b CL |
6434 | (build-system gnu-build-system) |
6435 | (arguments | |
6436 | '(#:make-flags '("CC=gcc") | |
fb9232d7 | 6437 | #:tests? #f ; no tests |
1113386b | 6438 | #:phases (modify-phases %standard-phases |
fb9232d7 | 6439 | (delete 'configure) ; no configure script |
1113386b CL |
6440 | (add-before 'install 'fix-makefile |
6441 | (lambda* (#:key outputs #:allow-other-keys) | |
6442 | (substitute* "Makefile" | |
6443 | (("\\$\\(BUILDROOT\\)/usr") (assoc-ref outputs "out"))) | |
6444 | ;; Make the compressed manpages writable so that the | |
6445 | ;; reset-gzip-timestamps phase does not error out. | |
6446 | (substitute* "Makefile" | |
6447 | (("-m 444") "-m 644")) | |
6448 | #t))))) | |
6449 | (inputs `(("perl" ,perl))) | |
6450 | (supported-systems '("i686-linux" "x86_64-linux")) | |
6451 | (home-page "http://www.etallen.com/cpuid.html") | |
6452 | (synopsis "Linux tool to dump x86 CPUID information about the CPU(s)") | |
6453 | (description "cpuid dumps detailed information about the CPU(s) gathered | |
6454 | from the CPUID instruction, and also determines the exact model of CPU(s). It | |
6455 | supports Intel, AMD, and VIA CPUs, as well as older Transmeta, Cyrix, UMC, | |
6456 | NexGen, Rise, and SiS CPUs.") | |
6457 | (license license:gpl2+))) | |
afc9d8ec LF |
6458 | |
6459 | (define-public jmtpfs | |
6460 | (package | |
6461 | (name "jmtpfs") | |
6462 | (version "0.5") | |
6463 | (source | |
6464 | (origin | |
d5c0b3fa EF |
6465 | (method git-fetch) |
6466 | (uri (git-reference | |
6467 | (url "https://github.com/JasonFerrara/jmtpfs") | |
6468 | (commit (string-append "v" version)))) | |
6469 | (file-name (git-file-name name version)) | |
afc9d8ec LF |
6470 | (sha256 |
6471 | (base32 | |
d5c0b3fa | 6472 | "1pm68agkhrwgrplrfrnbwdcvx5lrivdmqw8pb5gdmm3xppnryji1")))) |
afc9d8ec LF |
6473 | (build-system gnu-build-system) |
6474 | (inputs | |
6475 | `(("file" ,file) | |
6476 | ("fuse" ,fuse) | |
6477 | ("libmtp" ,libmtp))) | |
6478 | (native-inputs | |
6479 | `(("pkg-config" ,pkg-config))) | |
6480 | (home-page "https://github.com/JasonFerrara/jmtpfs") | |
162a1374 TGR |
6481 | (synopsis "Use a FUSE file system to access data over MTP") |
6482 | (description "jmtpfs uses FUSE (file system in userspace) to provide access | |
afc9d8ec | 6483 | to data over the Media Transfer Protocol (MTP). Unprivileged users can mount |
162a1374 | 6484 | the MTP device as a file system.") |
afc9d8ec | 6485 | (license license:gpl3))) |
a73e7dd3 DL |
6486 | |
6487 | (define-public procenv | |
6488 | (package | |
6489 | (name "procenv") | |
252f44ff | 6490 | (version "0.51") |
a73e7dd3 DL |
6491 | (source |
6492 | (origin | |
cfaf5bcc EF |
6493 | (method git-fetch) |
6494 | (uri (git-reference | |
6495 | (url "https://github.com/jamesodhunt/procenv") | |
6496 | (commit version))) | |
6497 | (file-name (git-file-name name version)) | |
a73e7dd3 | 6498 | (sha256 |
cfaf5bcc | 6499 | (base32 "1ilrsw1rc85w29mkbkmm5n5w427gapv43yrjzvkb4kc9xhscgdjn")))) |
a73e7dd3 DL |
6500 | (build-system gnu-build-system) |
6501 | (arguments `(#:configure-flags '("--disable-silent-rules"))) | |
edce3b95 MB |
6502 | (native-inputs |
6503 | `(("pkg-config" ,pkg-config) | |
6504 | ||
6505 | ;; For tests. | |
6506 | ("check" ,check) | |
6507 | ("groff" ,groff))) | |
6508 | (inputs | |
6509 | `(("expat" ,expat) | |
6510 | ("libcap" ,libcap) | |
6511 | ("libselinux" ,libselinux))) | |
a73e7dd3 DL |
6512 | (synopsis "Utility to show process environment") |
6513 | (description "Procenv is a command-line tool that displays as much detail about | |
6514 | itself and its environment as possible. It can be used as a test | |
6515 | tool, to understand the type of environment a process runs in, and for | |
6516 | comparing system environments.") | |
702a1012 | 6517 | (home-page "https://github.com/jamesodhunt/procenv/") |
a73e7dd3 | 6518 | (license license:gpl3+))) |
ae5947b0 DL |
6519 | |
6520 | (define-public libfabric | |
6521 | (package | |
6522 | (name "libfabric") | |
6523 | (version "1.4.1") | |
6524 | (source | |
6525 | (origin | |
6526 | (method url-fetch) | |
6527 | (uri | |
6528 | (string-append "https://github.com/ofiwg/libfabric/releases/download/v" | |
6529 | version "/libfabric-" version ".tar.bz2")) | |
6530 | (sha256 | |
6531 | (base32 "19l2m1frna1l765z4j7wl8hp4rb9wrh0hy5496685hd183hmy5pv")))) | |
6532 | (build-system gnu-build-system) | |
6533 | (inputs `(("rdma-core" ,rdma-core) | |
91298042 EF |
6534 | ,@(match (%current-system) |
6535 | ((member (package-supported-systems psm)) | |
6536 | `(("psm" ,psm))) | |
6537 | (_ `())) | |
ae5947b0 DL |
6538 | ("libnl" ,libnl))) |
6539 | (home-page "https://ofiwg.github.io/libfabric/") | |
6540 | (synopsis "Open Fabric Interfaces") | |
6541 | (description | |
6542 | "OpenFabrics Interfaces (OFI) is a framework focused on exporting fabric | |
6543 | communication services to applications. OFI is best described as a collection | |
6544 | of libraries and applications used to export fabric services. The key | |
6545 | components of OFI are: application interfaces, provider libraries, kernel | |
6546 | services, daemons, and test applications. | |
6547 | ||
6548 | Libfabric is a core component of OFI. It is the library that defines and | |
6549 | exports the user-space API of OFI, and is typically the only software that | |
6550 | applications deal with directly. It works in conjunction with provider | |
6551 | libraries, which are often integrated directly into libfabric.") | |
6552 | (license (list license:bsd-2 license:gpl2)))) ;dual | |
fd23d259 DL |
6553 | |
6554 | (define-public psm | |
6555 | (package | |
6556 | (name "psm") | |
6557 | (version "3.3.20170428") | |
b50a9cc0 | 6558 | (home-page "https://github.com/intel/psm") |
fd23d259 DL |
6559 | (source |
6560 | (origin | |
6561 | (method git-fetch) | |
b50a9cc0 | 6562 | (uri (git-reference (url home-page) |
fd23d259 DL |
6563 | (commit "604758e76dc31e68d1de736ccf5ddf16cb22355b"))) |
6564 | (file-name (string-append "psm-" version ".tar.gz")) | |
6565 | (sha256 | |
6566 | (base32 "0nsb325dmhn5ia3d2cnksqr0gdvrrx2hmvlylfgvmaqdpq76zm85")) | |
6567 | (patches (search-patches | |
6568 | "psm-arch.patch" ; uname -p returns "unknown" on Debian 9 | |
6569 | "psm-ldflags.patch" ; build shared lib with LDFLAGS | |
d8f8adfe LC |
6570 | "psm-repro.patch" ; reproducibility |
6571 | "psm-disable-memory-stats.patch")))) | |
fd23d259 | 6572 | (build-system gnu-build-system) |
348caf3d | 6573 | (outputs '("out" "debug")) |
bb93042c | 6574 | (inputs `(("libuuid" ,util-linux "lib"))) |
fd23d259 DL |
6575 | (arguments |
6576 | '(#:make-flags `("PSM_USE_SYS_UUID=1" "CC=gcc" "WERROR=" | |
6577 | ,(string-append "INSTALL_PREFIX=" %output) | |
6578 | ,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) | |
6579 | #:tests? #f | |
6580 | #:phases (modify-phases %standard-phases | |
6581 | (delete 'configure) | |
6582 | (add-after 'unpack 'patch-/usr/include | |
6583 | (lambda _ | |
6584 | (substitute* "Makefile" | |
6585 | (("\\$\\{DESTDIR}/usr/include") | |
6586 | (string-append %output "/include"))) | |
6587 | (substitute* "Makefile" | |
6588 | (("/lib64") "/lib")) | |
41313ace EB |
6589 | #t)) |
6590 | (add-after 'unpack 'patch-sysmacros | |
6591 | (lambda _ | |
6592 | (substitute* "ipath/ipath_proto.c" | |
6593 | (("#include <sys/poll.h>" m) | |
6594 | (string-append m "\n" | |
6595 | "#include <sys/sysmacros.h>"))) | |
fd23d259 | 6596 | #t))))) |
fd23d259 DL |
6597 | (synopsis "Intel Performance Scaled Messaging (PSM) Libraries") |
6598 | (description | |
6599 | "The PSM Messaging API, or PSM API, is Intel's low-level user-level | |
6600 | communications interface for the True Scale family of products. PSM users are | |
6601 | enabled with mechanisms necessary to implement higher level communications | |
6602 | interfaces in parallel environments.") | |
b516b780 EF |
6603 | ;; Only Intel-compatable processors are supported. |
6604 | (supported-systems '("i686-linux" "x86_64-linux")) | |
fd23d259 | 6605 | (license (list license:bsd-2 license:gpl2)))) ;dual |
c1c82584 TGR |
6606 | |
6607 | (define-public snapscreenshot | |
6608 | (package | |
6609 | (name "snapscreenshot") | |
6610 | (version "1.0.14.3") | |
6611 | (source | |
6612 | (origin | |
6613 | (method url-fetch) | |
6614 | (uri (string-append "http://bisqwit.iki.fi/src/arch/" | |
6615 | name "-" version ".tar.bz2")) | |
6616 | (sha256 | |
6617 | (base32 "0gzvqsbf6a2sbd1mqvj1lbm57i2bm5k0cr6ncr821d1f32gw03mk")))) | |
6618 | (build-system gnu-build-system) | |
6619 | (arguments | |
6620 | `(#:make-flags | |
6621 | (let ((out (assoc-ref %outputs "out"))) | |
6622 | (list (string-append "BINDIR=" out "/bin") | |
6623 | (string-append "MANDIR=" out "/share/man"))) | |
6624 | #:tests? #f ; no test suite | |
6625 | #:phases | |
6626 | (modify-phases %standard-phases | |
6627 | (delete 'configure) ; ./configure is a snarky no-op | |
6628 | (add-before 'install 'fix-ownership | |
6629 | ;; Install binaries owned by ‘root’ instead of the nonexistent ‘bin’. | |
6630 | (lambda _ | |
6631 | (substitute* "depfun.mak" | |
6632 | ((" -o bin -g bin ") " ")) | |
6633 | #t)) | |
6634 | (add-before 'install 'create-output-directories | |
6635 | (lambda* (#:key outputs #:allow-other-keys) | |
6636 | (let ((out (assoc-ref outputs "out"))) | |
6637 | (mkdir-p (string-append out "/share/man/man1")) | |
6638 | #t)))))) | |
81e59e41 | 6639 | (home-page "https://bisqwit.iki.fi/source/snapscreenshot.html") |
c1c82584 TGR |
6640 | (synopsis "Take screenshots of one or more Linux text consoles") |
6641 | (description | |
6642 | "snapscreenshot saves a screenshot of one or more Linux text consoles as a | |
6643 | Targa (@dfn{.tga}) image. It can be used by anyone with read access to the | |
6644 | relevant @file{/dev/vcs*} file(s).") | |
6645 | (license license:gpl2))) | |
8d8d227b TGR |
6646 | |
6647 | (define-public fbcat | |
6648 | (package | |
6649 | (name "fbcat") | |
7f86e5e7 | 6650 | (version "0.5.1") |
8d8d227b TGR |
6651 | (source |
6652 | (origin | |
6653 | (method url-fetch) | |
6654 | (uri (string-append "https://github.com/jwilk/fbcat/releases/download/" | |
6655 | version "/" name "-" version ".tar.gz")) | |
6656 | (sha256 | |
7f86e5e7 | 6657 | (base32 "0pj9hxmwhbz6kmd7847yx2jh1scl9l25zgndyi8s9vlzdkq2q8d7")))) |
8d8d227b | 6658 | (build-system gnu-build-system) |
8d8d227b TGR |
6659 | (inputs |
6660 | ;; The ‘fbgrab’ wrapper can use one of several PPM-to-PNG converters. We | |
6661 | ;; choose netpbm simply because it's the smallest. It still adds ~94 MiB | |
6662 | ;; to an otherwise tiny package, so we put ‘fbgrab’ in its own output. | |
6663 | `(("pnmtopng" ,netpbm))) | |
6664 | (outputs (list "out" "fbgrab")) | |
6665 | (arguments | |
7f86e5e7 TGR |
6666 | `(#:make-flags |
6667 | (list "CC=gcc" | |
6668 | (string-append "PREFIX=" (assoc-ref %outputs "out"))) | |
8d8d227b TGR |
6669 | #:tests? #f ; no tests |
6670 | #:phases | |
6671 | (modify-phases %standard-phases | |
8d8d227b | 6672 | (delete 'configure) ; no configure script |
8d8d227b TGR |
6673 | (add-after 'build 'qualify-references |
6674 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
6675 | (let* ((pnmtopng (assoc-ref inputs "pnmtopng")) | |
6676 | (out (assoc-ref outputs "out"))) | |
6677 | (substitute* "fbgrab" | |
6678 | (("fbcat" all) | |
6679 | (string-append out "/bin/" all)) | |
6680 | (("pnmtopng" all) | |
6681 | (string-append pnmtopng "/bin/" all))) | |
6682 | #t))) | |
7f86e5e7 | 6683 | (add-after 'install 'split-fbgrab-output |
8d8d227b TGR |
6684 | (lambda* (#:key outputs #:allow-other-keys) |
6685 | (let* ((out (assoc-ref outputs "out")) | |
6686 | (out:fbgrab (assoc-ref outputs "fbgrab"))) | |
7f86e5e7 TGR |
6687 | (for-each (lambda (file) |
6688 | (let ((old (string-append out "/" file)) | |
6689 | (new (string-append out:fbgrab "/" file))) | |
6690 | (mkdir-p (dirname new)) | |
6691 | (rename-file old new))) | |
6692 | (list "bin/fbgrab" | |
6693 | "share/man/man1/fbgrab.1")) | |
8d8d227b TGR |
6694 | #t)))))) |
6695 | (home-page "https://jwilk.net/software/fbcat") | |
6696 | (synopsis "Take a screenshot of the contents of the Linux framebuffer") | |
6697 | (description | |
6698 | "fbcat saves the contents of the Linux framebuffer (@file{/dev/fb*}), or | |
6699 | a dump therof. It supports a wide range of drivers and pixel formats. | |
6700 | @command{fbcat} can take screenshots of virtually any application that can be | |
6701 | made to write its output to the framebuffer, including (but not limited to) | |
6702 | text-mode or graphical applications that don't use a display server. | |
6703 | ||
6704 | Also included is @command{fbgrab}, a wrapper around @command{fbcat} that | |
6705 | emulates the behaviour of Gunnar Monell's older fbgrab utility.") | |
6706 | (license license:gpl2))) | |
a69e0cf3 TČ |
6707 | |
6708 | (define-public libcgroup | |
6709 | (package | |
6710 | (name "libcgroup") | |
6711 | (version "0.41") | |
6712 | (source | |
6713 | (origin | |
6714 | (method url-fetch) | |
6715 | (uri (string-append | |
6716 | "mirror://sourceforge/libcg/" name "/" | |
6717 | version "/" name "-" version ".tar.bz2")) | |
6718 | (sha256 | |
6719 | (base32 "0lgvyq37gq84sk30sg18admxaj0j0p5dq3bl6g74a1ppgvf8pqz4")))) | |
6720 | (build-system gnu-build-system) | |
6721 | (arguments | |
6722 | `(#:tests? #f)) | |
6723 | (native-inputs | |
6724 | `(("bison" ,bison) | |
6725 | ("flex" ,flex))) | |
6726 | (inputs | |
6727 | `(("linux-pam" ,linux-pam))) | |
6728 | (home-page "https://sourceforge.net/projects/libcg/") | |
6729 | (synopsis "Control groups management tools") | |
6730 | (description "Control groups is Linux kernel method for process resource | |
6731 | restriction, permission handling and more. This package provides userspace | |
6732 | interface to this kernel feature.") | |
6733 | (license license:lgpl2.1))) | |
5849c68a R |
6734 | |
6735 | (define-public mbpfan | |
6736 | (package | |
6737 | (name "mbpfan") | |
26fad5b7 | 6738 | (version "2.1.1") |
5849c68a R |
6739 | (source |
6740 | (origin | |
5478ab1e TGR |
6741 | (method git-fetch) |
6742 | (uri (git-reference | |
b0e7b699 | 6743 | (url "https://github.com/dgraziotin/mbpfan") |
5478ab1e TGR |
6744 | (commit (string-append "v" version)))) |
6745 | (file-name (git-file-name name version)) | |
5849c68a | 6746 | (sha256 |
26fad5b7 | 6747 | (base32 "0aijyxrqh01x0s80yr4cgxgd001iiqqph65pxvby7f0wz8lnxnqj")))) |
5849c68a R |
6748 | (build-system gnu-build-system) |
6749 | (arguments | |
e45f0c79 | 6750 | `(#:tests? #f ; tests ask to be run as root |
5849c68a R |
6751 | #:make-flags (let ((out (assoc-ref %outputs "out"))) |
6752 | (list (string-append "DESTDIR=" out) | |
e45f0c79 | 6753 | ,(string-append "CC=" (cc-for-target)))) |
5849c68a R |
6754 | #:phases |
6755 | (modify-phases %standard-phases | |
6756 | (add-after 'unpack 'patch-paths | |
6757 | (lambda _ | |
6758 | (substitute* "Makefile" | |
6759 | (("/usr") "")) | |
6760 | #t)) | |
697c5846 | 6761 | (delete 'configure)))) ; there's no configure phase |
5849c68a R |
6762 | (home-page "https://github.com/dgraziotin/mbpfan") |
6763 | (synopsis "Control fan speed on Macbooks") | |
6764 | (description | |
6765 | "mbpfan is a fan control daemon for Apple Macbooks. It uses input from | |
6766 | the @code{coretemp} module and sets the fan speed using the @code{applesmc} | |
6767 | module. It can be executed as a daemon or in the foreground with root | |
6768 | privileges.") | |
6769 | (license license:gpl3+))) | |
25637b77 PAR |
6770 | |
6771 | (define-public psm2 | |
6772 | (package | |
6773 | (name "psm2") | |
17a5cb45 | 6774 | (version "11.2.86") |
25637b77 PAR |
6775 | (source (origin |
6776 | (method git-fetch) | |
6777 | (uri (git-reference | |
b0e7b699 | 6778 | (url "https://github.com/intel/opa-psm2") |
25637b77 PAR |
6779 | (commit (string-append "PSM2_" version)))) |
6780 | (file-name (git-file-name name version)) | |
6781 | (sha256 | |
6782 | (base32 | |
17a5cb45 | 6783 | "1hiqzcmc97lzhaqjva82vf8irgg038cciypsv2brw90ak09n6vwf")))) |
25637b77 PAR |
6784 | (build-system gnu-build-system) |
6785 | (arguments | |
6786 | '(#:make-flags | |
6787 | `(,(string-append "LDFLAGS=-Wl,-rpath=" %output "/lib")) | |
6788 | #:tests? #f | |
6789 | #:phases (modify-phases %standard-phases | |
6790 | (delete 'configure) | |
6791 | (add-after 'unpack 'patch-Makefiles | |
6792 | (lambda _ | |
6793 | (substitute* "Makefile" | |
6794 | (("/lib64") "/lib") | |
6795 | (("/usr") "")) | |
6796 | (substitute* "compat/Makefile" | |
6797 | (("/lib64") "/lib") | |
6798 | (("/usr") "")) | |
6799 | #t)) | |
6800 | (replace 'install | |
6801 | (lambda _ | |
6802 | (setenv "DESTDIR" %output) | |
6803 | (invoke "make" "install") | |
6804 | #t))))) | |
6805 | (inputs | |
6806 | `(("rdma-core" ,rdma-core) | |
6807 | ("numactl" ,numactl))) | |
6808 | (synopsis "Intel Performance Scaled Messaging 2 (PSM2) library") | |
6809 | (description | |
6810 | "This package is low-level user-level Intel's communications interface. | |
6811 | The PSM2 API is a high-performance vendor-specific protocol that provides a | |
6812 | low-level communications interface for the Intel Omni-Path family of | |
6813 | high-speed networking devices.") | |
6814 | (home-page "https://github.com/intel/opa-psm2") | |
6815 | ;; Only the x86_64 architecure is supported. | |
6816 | (supported-systems '("x86_64-linux")) | |
6817 | (license (list license:bsd-3 license:gpl2)))) ; dual | |
2690b6ce PAR |
6818 | |
6819 | (define-public libpfm4 | |
6820 | (package | |
6821 | (name "libpfm4") | |
6822 | (version "4.9.0") | |
6823 | (source (origin | |
6824 | (method url-fetch) | |
6825 | (uri (string-append "mirror://sourceforge/perfmon2/" | |
6826 | name "/libpfm-" version ".tar.gz")) | |
6827 | (sha256 | |
6828 | (base32 | |
6829 | "1qp4g4n6dw42p2w5rkwzdb7ynk8h7g5vg01ybpmvxncgwa7bw3yv")))) | |
6830 | (build-system gnu-build-system) | |
6831 | (arguments | |
6832 | '(#:modules ((guix build utils) | |
6833 | (guix build gnu-build-system)) | |
6834 | #:phases (modify-phases %standard-phases | |
6835 | (delete 'configure) | |
6836 | (delete 'check) | |
6837 | (replace 'build | |
6838 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
6839 | (let* ((out (assoc-ref outputs "out"))) | |
6840 | (setenv "CC" "gcc") | |
6841 | (invoke "make") | |
6842 | #t))) | |
6843 | (replace 'install | |
6844 | (lambda* (#:key outputs #:allow-other-keys) | |
6845 | (let* ((out (assoc-ref outputs "out"))) | |
6846 | (invoke "make" | |
6847 | (string-append "PREFIX=" out) | |
6848 | "install") | |
6849 | #t)))))) | |
6850 | (synopsis "Performance event monitoring library") | |
6851 | (description | |
6852 | "This package provides a library called libpfm4, which is used to develop | |
6853 | monitoring tools exploiting the performance monitoring events such as those | |
6854 | provided by the Performance Monitoring Unit (PMU) of modern processors. | |
6855 | ||
6856 | Libpfm4 helps convert from an event name, expressed as a string, to the event | |
6857 | encoding that is either the raw event as documented by the hardware vendor or | |
6858 | the OS-specific encoding. In the latter case, the library is able to prepare | |
6859 | the OS-specific data structures needed by the kernel to setup the event. | |
6860 | ||
6861 | libpfm4 provides support for the @code{perf_events} interface, which was | |
6862 | introduced in Linux 2.6.31.") | |
6863 | (home-page "http://perfmon2.sourceforge.net/") | |
6864 | (license license:expat))) | |
4dd1fb79 SB |
6865 | |
6866 | (define-public libnfnetlink | |
6867 | (package | |
6868 | (name "libnfnetlink") | |
6869 | (version "1.0.1") | |
6870 | (source (origin | |
6871 | (method url-fetch) | |
6872 | (uri (string-append | |
6873 | "https://www.netfilter.org/projects/libnfnetlink/files/" | |
6874 | "libnfnetlink-" version ".tar.bz2")) | |
6875 | (sha256 | |
6876 | (base32 | |
6877 | "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j")))) | |
6878 | (build-system gnu-build-system) | |
6879 | (home-page "https://www.netfilter.org/projects/libnfnetlink/") | |
6880 | (synopsis "Low-level netfilter netlink communication library") | |
6881 | (description | |
6882 | "@code{libnfnetlink} is the low-level library for netfilter related | |
6883 | kernel/userspace communication. It provides a generic messaging | |
6884 | infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log, | |
6885 | nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or | |
6886 | management tools in userspace.") | |
6887 | (license license:gpl2))) | |
e4231cfe | 6888 | |
626de0d1 MC |
6889 | (define-public go-netlink |
6890 | (package | |
6891 | (name "go-netlink") | |
6892 | (version "1.0.0") | |
6893 | (source (origin | |
6894 | (method git-fetch) | |
6895 | (uri (git-reference | |
b0e7b699 | 6896 | (url "https://github.com/vishvananda/netlink") |
626de0d1 MC |
6897 | (commit (string-append "v" version)))) |
6898 | (file-name (git-file-name name version)) | |
6899 | (sha256 | |
6900 | (base32 | |
6901 | "0hpzghf1a4cwawzhkiwdzin80h6hd09fskl77d5ppgc084yvj8x0")))) | |
6902 | (build-system go-build-system) | |
6903 | (arguments | |
6904 | `(#:import-path "github.com/vishvananda/netlink")) | |
6905 | (native-inputs | |
561d391b | 6906 | `(("go-golang-org-x-sys" ,go-golang-org-x-sys) |
626de0d1 MC |
6907 | ("go-netns" ,go-netns))) |
6908 | (home-page "https://github.com/vishvananda/netlink") | |
6909 | (synopsis "Simple netlink library for Go") | |
6910 | (description "The netlink package provides a simple netlink library for | |
6911 | Go. Netlink is the interface a user-space program in Linux uses to | |
6912 | communicate with the kernel. It can be used to add and remove interfaces, set | |
6913 | IP addresses and routes, and configure IPsec.") | |
6914 | (license license:asl2.0))) | |
6915 | ||
e4231cfe DM |
6916 | (define-public xfsprogs |
6917 | (package | |
6918 | (name "xfsprogs") | |
efaeb84c | 6919 | (version "5.7.0") |
e4231cfe DM |
6920 | (source (origin |
6921 | (method url-fetch) | |
6922 | (uri (string-append | |
6923 | "mirror://kernel.org/linux/utils/fs/xfs/xfsprogs/" | |
6924 | "xfsprogs-" version ".tar.gz")) | |
6925 | (sha256 | |
6926 | (base32 | |
efaeb84c | 6927 | "0bssrfhnw5mhybgaa6d8wp87izi3c9cjpjy7vicm6y76mf7kl8p9")))) |
e4231cfe | 6928 | (build-system gnu-build-system) |
c78778e7 | 6929 | (outputs (list "out" "python")) |
e4231cfe | 6930 | (arguments |
c78778e7 TGR |
6931 | `(#:tests? #f ; kernel/user integration tests are in package "xfstests" |
6932 | #:phases | |
6933 | (modify-phases %standard-phases | |
6934 | (add-after 'install 'separate-python-output | |
6935 | (lambda* (#:key outputs #:allow-other-keys) | |
6936 | (let ((out (assoc-ref outputs "out")) | |
6937 | (python (assoc-ref outputs "python"))) | |
6938 | (for-each | |
6939 | (lambda (script) | |
6940 | (mkdir-p (string-append python (dirname script))) | |
6941 | (rename-file (string-append out script) | |
6942 | (string-append python script))) | |
6943 | (list "/sbin/xfs_scrub_all")) | |
6944 | #t))) | |
6945 | (add-after 'install 'install-headers | |
6946 | (lambda _ | |
6947 | (invoke "make" "install-dev")))))) | |
e4231cfe | 6948 | (native-inputs |
c148d2eb | 6949 | `(("gettext" ,gettext-minimal))) |
c78778e7 | 6950 | (inputs |
bb93042c | 6951 | `(("libuuid" ,util-linux "lib") |
c148d2eb | 6952 | ("python" ,python-wrapper))) |
e4231cfe DM |
6953 | (home-page "https://xfs.wiki.kernel.org/") |
6954 | (synopsis "XFS file system tools") | |
6955 | (description "This package provides commands to create and check XFS | |
6956 | file systems.") | |
6957 | ;; The library "libhandle" and the headers in "xfslibs-dev" are | |
6958 | ;; licensed under lgpl2.1. the other stuff is licensed under gpl2. | |
6959 | (license (list license:gpl2 license:lgpl2.1)))) | |
c63d7b79 DM |
6960 | |
6961 | (define-public genext2fs | |
6962 | (package | |
6963 | (name "genext2fs") | |
083639a5 | 6964 | (version "1.4.1-4") |
c63d7b79 DM |
6965 | (source (origin |
6966 | (method git-fetch) | |
6967 | (uri (git-reference | |
b0e7b699 | 6968 | (url "https://github.com/jeremie-koenig/genext2fs") |
083639a5 TGR |
6969 | ;; 1.4.1-3 had a VCS tag but 1.4.1-4 doesn't. |
6970 | (commit "9ee43894634998b0b2b309d636f25c64314c9421"))) | |
c63d7b79 DM |
6971 | (file-name (git-file-name name version)) |
6972 | (sha256 | |
083639a5 | 6973 | (base32 "0ib5icn78ciz00zhc1bgdlrwaxvsdz7wnplwblng0jirwi9ml7sq")))) |
c63d7b79 | 6974 | (build-system gnu-build-system) |
083639a5 TGR |
6975 | (arguments |
6976 | `(#:phases | |
6977 | (modify-phases %standard-phases | |
6978 | (add-after 'unpack 'apply-debian-patches | |
6979 | ;; Debian changes (the revision after ‘-’ in VERSION) are | |
6980 | ;; maintained as separate patches. Apply those relevant to us. | |
6981 | (lambda _ | |
6982 | (for-each | |
6983 | (lambda (file-name) | |
6984 | (invoke "patch" "-p1" "-i" | |
6985 | (string-append "debian/patches/" file-name))) | |
6986 | (list "blocksize+creator.diff" ; add -B/-o options | |
6987 | "byteswap_fix.diff")) | |
6988 | #t))))) | |
6989 | (native-inputs | |
6990 | `(("autoconf" ,autoconf) | |
6991 | ("automake" ,automake))) | |
c63d7b79 | 6992 | (home-page "https://github.com/jeremie-koenig/genext2fs") |
52beae7b TGR |
6993 | (synopsis "Generate ext2 file system as a normal user") |
6994 | (description "This package provides a program to generate an ext2 | |
6995 | file system as a normal (non-root) user. It does not require you to mount | |
c63d7b79 DM |
6996 | the image file to copy files on it, nor does it require that you become |
6997 | the superuser to make device nodes.") | |
6998 | (license license:gpl2))) | |
d1dfcc7c DM |
6999 | |
7000 | (define-public fakeroot | |
7001 | (package | |
7002 | (name "fakeroot") | |
ae1bab3e | 7003 | (version "1.24") |
d1dfcc7c DM |
7004 | (source (origin |
7005 | (method url-fetch) | |
ae1bab3e TGR |
7006 | (uri (string-append "https://deb.debian.org/debian/pool/main/f/" |
7007 | "fakeroot/fakeroot_" version ".orig.tar.gz")) | |
d1dfcc7c DM |
7008 | (file-name (string-append name "-" version ".tar.gz")) |
7009 | (sha256 | |
7010 | (base32 | |
ae1bab3e | 7011 | "1vb6f93hjyqnwx8dc8mm3dgma7axgqk8s7sdsjs8l2rpc0qmn11f")))) |
d1dfcc7c DM |
7012 | (build-system gnu-build-system) |
7013 | (arguments | |
7014 | `(#:phases | |
7015 | (modify-phases %standard-phases | |
7016 | (add-after 'configure 'patch-Makefile | |
7017 | (lambda _ | |
7018 | ;; Note: The root of the problem is already in "Makefile.am". | |
7019 | (substitute* "Makefile" | |
7020 | (("/bin/sh") (which "sh"))) | |
7021 | #t)) | |
c29bb909 | 7022 | (add-after 'unpack 'patch-script |
d1dfcc7c DM |
7023 | (lambda* (#:key inputs #:allow-other-keys) |
7024 | (substitute* "scripts/fakeroot.in" | |
7025 | (("getopt") | |
7026 | (string-append (assoc-ref inputs "util-linux") | |
c29bb909 MO |
7027 | "/bin/getopt")) |
7028 | (("sed") | |
7029 | (string-append (assoc-ref inputs "sed") | |
7030 | "/bin/sed")) | |
7031 | (("cut") | |
7032 | (string-append (assoc-ref inputs "coreutils") | |
7033 | "/bin/cut")) ) | |
d1dfcc7c | 7034 | #t)) |
0d5c5b1b DM |
7035 | (add-before 'configure 'setenv |
7036 | (lambda _ | |
7037 | (setenv "LIBS" "-lacl") | |
7038 | #t)) | |
d1dfcc7c DM |
7039 | (add-before 'check 'prepare-check |
7040 | (lambda _ | |
7041 | (setenv "SHELL" (which "bash")) | |
7042 | (setenv "VERBOSE" "1") | |
7043 | (substitute* "test/t.touchinstall" | |
7044 | ;; We don't have the name of the root user, so use ID=0. | |
7045 | (("grep root") "grep \"\\<0\\>\"")) | |
7046 | (substitute* "test/tartest" | |
7047 | ;; We don't have the name of the root group, so use ID=0. | |
7048 | (("ROOTGROUP=root") "ROOTGROUP=0") | |
7049 | ;; We don't have the name of the daemon user, so use IDs. | |
7050 | (("daemon:sys") "1:3") | |
7051 | (("daemon:") "1:")) | |
7052 | ;; We don't have an /etc/passwd entry for "root" - use numeric IDs. | |
7053 | (substitute* "test/compare-tar" | |
7054 | (("tar -tvf") "tar --numeric-owner -tvf")) | |
ba151b7e MB |
7055 | |
7056 | ;; coreutils 8.32 changed 'ls' to use the statx() syscall instead | |
7057 | ;; of lstat(). fakeroot 1.24 does not support the former, so | |
7058 | ;; adjust these tests to use 'test -b' instead of 'ls' to test for | |
7059 | ;; block device. See <https://bugs.gnu.org/41090>. | |
7060 | (substitute* '("test/t.mknod" "test/t.chmod_dev") | |
7061 | (("ls -ld? \\$tmp/hda3") | |
7062 | "test -b $tmp/hda3 && echo block || echo fail")) | |
d1dfcc7c DM |
7063 | #t))))) |
7064 | (native-inputs | |
0d5c5b1b DM |
7065 | `(("acl" ,acl) |
7066 | ("sharutils" ,sharutils) ; for the tests | |
d1dfcc7c DM |
7067 | ("xz" ,xz))) ; for the tests |
7068 | (inputs | |
ba151b7e | 7069 | `(("libcap" ,libcap/next) |
c29bb909 MO |
7070 | ("util-linux" ,util-linux) |
7071 | ("sed" ,sed) | |
7072 | ("coreutils" ,coreutils))) | |
d1dfcc7c DM |
7073 | (synopsis "Provides a fake root environment") |
7074 | (description "@command{fakeroot} runs a command in an environment where | |
7075 | it appears to have root privileges for file manipulation. This is useful | |
7076 | for allowing users to create archives (tar, ar, .deb etc.) with files in | |
7077 | them with root permissions/ownership. Without fakeroot one would have to | |
7078 | have root privileges to create the constituent files of the archives with | |
7079 | the correct permissions and ownership, and then pack them up, or one would | |
7080 | have to construct the archives directly, without using the archiver.") | |
7081 | (home-page "http://freshmeat.sourceforge.net/projects/fakeroot") | |
7082 | (license license:gpl3+))) | |
bf2a9969 | 7083 | |
4449e7c5 LC |
7084 | (define-public fakechroot |
7085 | (package | |
7086 | (name "fakechroot") | |
7087 | (version "2.20.1") | |
7088 | (source (origin | |
7089 | (method url-fetch) | |
7090 | (uri (string-append | |
7091 | "https://github.com/dex4er/fakechroot/releases/download/" | |
7092 | version "/fakechroot-" version ".tar.gz")) | |
7093 | (sha256 | |
7094 | (base32 | |
7095 | "1aijkd0b45wav25v01qhw8zxwa3pl0nnp9fabmmy1nlx7hr09gas")))) | |
7096 | (build-system gnu-build-system) | |
7097 | (arguments | |
7098 | ;; XXX: The tests heavily assume they run on an FHS system so for now | |
7099 | ;; skip them. | |
7100 | '(#:tests? #f | |
7101 | #:configure-flags '("--disable-static"))) | |
7102 | (synopsis "Emulate @code{chroot} by overriding file system calls") | |
7103 | (description | |
7104 | "@command{fakechroot} runs a command in an environment were is additional | |
7105 | possibility to use @code{chroot} command without root privileges. This is | |
7106 | useful for allowing users to create own chrooted environment with possibility | |
7107 | to install another packages without need for root privileges. | |
7108 | ||
7109 | It works by providing @file{libfakechroot.so}, a shared library meant to be | |
7110 | set as @code{LD_PRELOAD} to override the C library file system functions.") | |
7111 | (home-page "https://github.com/dex4er/fakechroot/") | |
7112 | (license license:lgpl2.1+))) | |
7113 | ||
bf2a9969 TG |
7114 | (define-public inputattach |
7115 | (package | |
7116 | (name "inputattach") | |
7117 | (version "0.42.0") | |
7118 | (source (origin | |
7119 | (method git-fetch) | |
7120 | (uri (git-reference | |
b0e7b699 | 7121 | (url "https://github.com/linuxwacom/input-wacom") |
bf2a9969 TG |
7122 | (commit (string-append "input-wacom-" version)))) |
7123 | (file-name (git-file-name name version)) | |
7124 | (sha256 | |
7125 | (base32 "04lnn7v0rm4ppbya140im5d4igcl6c1nrqpgbsr0i8wkral0nv7j")))) | |
7126 | (build-system gnu-build-system) | |
7127 | (arguments | |
7128 | `(#:phases | |
7129 | (modify-phases %standard-phases | |
7130 | (delete 'bootstrap) | |
7131 | (delete 'configure) | |
7132 | (replace 'build | |
7133 | (lambda* (#:key inputs #:allow-other-keys) | |
7134 | (with-directory-excursion "inputattach" | |
7135 | (invoke (string-append (assoc-ref inputs "gcc") | |
7136 | "/bin/gcc") | |
5ddf98da | 7137 | "-O2" "-o" "inputattach" "inputattach.c")) |
bf2a9969 TG |
7138 | #t)) |
7139 | (delete 'check) | |
7140 | (replace 'install | |
7141 | (lambda* (#:key outputs #:allow-other-keys) | |
7142 | (let ((target-dir (string-append | |
7143 | (assoc-ref outputs "out") | |
7144 | "/bin/"))) | |
7145 | (mkdir-p target-dir) | |
7146 | (copy-file "inputattach/inputattach" | |
7147 | (string-append target-dir | |
7148 | "inputattach")) | |
7149 | #t)))))) | |
7150 | (home-page "https://linuxwacom.github.io/") | |
7151 | (synopsis "Dispatch input peripherals events to a device file") | |
7152 | (description "inputattach dispatches input events from several device | |
7153 | types and interfaces and translates so that the X server can use them.") | |
7154 | (license license:gpl2+))) | |
de3896fb | 7155 | |
8c6c97de KK |
7156 | (define-public pipewire |
7157 | (package | |
7158 | (name "pipewire") | |
e7d710af | 7159 | (version "0.2.7") |
8c6c97de KK |
7160 | (source (origin |
7161 | (method git-fetch) | |
7162 | (uri (git-reference | |
7163 | (url "https://github.com/PipeWire/pipewire") | |
7164 | (commit version))) | |
7165 | (file-name (git-file-name name version)) | |
7166 | (sha256 | |
7167 | (base32 | |
e7d710af | 7168 | "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc")))) |
8c6c97de KK |
7169 | (build-system meson-build-system) |
7170 | (arguments | |
7171 | '(#:configure-flags '("-Dsystemd=false"))) | |
7172 | (native-inputs | |
7173 | `(("pkg-config" ,pkg-config))) | |
7174 | (inputs | |
7175 | `(("alsa-lib" ,alsa-lib) | |
7176 | ("dbus" ,dbus) | |
7177 | ("eudev" ,eudev) | |
7178 | ("ffmpeg" ,ffmpeg) | |
7179 | ("gstreamer" ,gstreamer) | |
7180 | ("gst-plugins-base" ,gst-plugins-base) | |
7181 | ("libva" ,libva) | |
7182 | ("sbc" ,sbc) | |
7183 | ("sdl2" ,sdl2))) | |
7184 | (home-page "https://pipewire.org/") | |
7185 | (synopsis "Server and user space API to deal with multimedia pipelines") | |
7186 | (description | |
7187 | "PipeWire is a project that aims to greatly improve handling of audio and | |
7188 | video under Linux. It aims to support the usecases currently handled by both | |
7189 | PulseAudio and Jack and at the same time provide same level of powerful handling | |
7190 | of Video input and output. It also introduces a security model that makes | |
7191 | interacting with audio and video devices from containerized applications easy, | |
7192 | with supporting Flatpak applications being the primary goal. Alongside Wayland | |
7193 | and Flatpak we expect PipeWire to provide a core building block for the future | |
7194 | of Linux application development.") | |
7195 | (license license:lgpl2.0+))) | |
7196 | ||
d888a9c9 AT |
7197 | (define-public pipewire-0.3 |
7198 | (package | |
7199 | (inherit pipewire) | |
7200 | (name "pipewire") | |
616fa14b | 7201 | (version "0.3.10") |
d888a9c9 AT |
7202 | (source (origin |
7203 | (method git-fetch) | |
7204 | (uri (git-reference | |
7205 | (url "https://github.com/PipeWire/pipewire") | |
7206 | (commit version))) | |
7207 | (file-name (git-file-name name version)) | |
7208 | (sha256 | |
7209 | (base32 | |
616fa14b | 7210 | "1y293sfhhmzbgnlvs46bpiyimlii5nk71f8115qxs8sviwlsdr3w")))) |
d888a9c9 | 7211 | (arguments |
616fa14b TGR |
7212 | '(#:configure-flags |
7213 | (list (string-append "-Dudevrulesdir=" (assoc-ref %outputs "out") | |
7214 | "/lib/udev/rules.d") | |
7215 | "-Dsystemd=false") | |
d888a9c9 AT |
7216 | #:phases |
7217 | (modify-phases %standard-phases | |
616fa14b | 7218 | ;; Skip shrink-runpath, otherwise validate-runpath fails. |
d888a9c9 AT |
7219 | (delete 'shrink-runpath)))) |
7220 | (inputs | |
7221 | (append (package-inputs pipewire) | |
7222 | `(("bluez" ,bluez) | |
7223 | ("jack" ,jack-2) | |
7224 | ("pulseaudio" ,pulseaudio) | |
7225 | ("vulkan-loader" ,vulkan-loader) | |
7226 | ("vulkan-headers" ,vulkan-headers)))))) | |
7227 | ||
de3896fb BW |
7228 | (define-public ell |
7229 | (package | |
7230 | (name "ell") | |
7231 | (version "0.23") | |
7232 | (source (origin | |
7233 | (method git-fetch) | |
7234 | (uri (git-reference | |
7235 | (url "https://git.kernel.org/pub/scm/libs/ell/ell.git") | |
7236 | (commit version))) | |
7237 | (file-name (git-file-name name version)) | |
7238 | (sha256 | |
7239 | (base32 | |
7240 | "1qhlcwhn0gj877yss2ymx1aczghlddzb5v9mm1dgp2zliii3jy10")))) | |
7241 | (build-system gnu-build-system) | |
7242 | (arguments | |
7243 | `(#:phases | |
7244 | (modify-phases %standard-phases | |
7245 | (add-after 'unpack 'fix-dbus-tests | |
7246 | (lambda _ | |
7247 | (substitute* '("unit/test-dbus-message-fds.c" | |
7248 | "unit/test-dbus-properties.c" | |
7249 | "unit/test-dbus.c") | |
7250 | (("/usr/bin/dbus-daemon") (which "dbus-daemon"))) | |
7251 | #t))))) | |
7252 | (inputs | |
d6f1f607 | 7253 | `(("dbus" ,dbus))) |
de3896fb BW |
7254 | (native-inputs |
7255 | `(("autoconf" ,autoconf) | |
d6f1f607 | 7256 | ("libtool" ,libtool) |
de3896fb BW |
7257 | ("pkgconfig" ,pkg-config) |
7258 | ("automake" ,automake))) | |
7259 | (home-page "https://01.org/ell") | |
7260 | (synopsis "Embedded Linux Library") | |
7261 | (description "The Embedded Linux* Library (ELL) provides core, low-level | |
7262 | functionality for system daemons. It typically has no dependencies other than | |
7263 | the Linux kernel, C standard library, and libdl (for dynamic linking). While | |
7264 | ELL is designed to be efficient and compact enough for use on embedded Linux | |
7265 | platforms, it is not limited to resource-constrained systems.") | |
7266 | (license license:lgpl2.1+))) | |
a69bc738 PN |
7267 | |
7268 | (define-public lttng-ust | |
7269 | (package | |
7270 | (name "lttng-ust") | |
7271 | (version "2.11.0") | |
7272 | (source (origin | |
7273 | (method url-fetch) | |
7274 | (uri (string-append "https://lttng.org/files/lttng-ust/" | |
7275 | "lttng-ust-" version ".tar.bz2")) | |
7276 | (sha256 | |
7277 | (base32 | |
7278 | "1n646yz7882svf5a4ay3vqiiz3qjn3pgkkij9kk22871wp7q0ck8")))) | |
7279 | (build-system gnu-build-system) | |
7280 | (inputs | |
7281 | `(("liburcu" ,liburcu) | |
7282 | ("numactl" ,numactl))) | |
7283 | (native-inputs | |
7284 | `(("python" ,python-3))) | |
7285 | (home-page "https://lttng.org/") | |
7286 | (synopsis "LTTng userspace tracer libraries") | |
7287 | (description "The user space tracing library, liblttng-ust, is the LTTng | |
7288 | user space tracer. It receives commands from a session daemon, for example to | |
7289 | enable and disable specific instrumentation points, and writes event records | |
7290 | to ring buffers shared with a consumer daemon.") | |
7291 | (license license:lgpl2.1+))) | |
dedbdacf CM |
7292 | |
7293 | (define-public kexec-tools | |
7294 | (package | |
7295 | (name "kexec-tools") | |
7296 | (version "2.0.20") | |
7297 | (source (origin | |
7298 | (method url-fetch) | |
7299 | (uri (string-append "mirror://kernel.org/linux/utils/kernel" | |
7300 | "/kexec/kexec-tools-" version ".tar.xz")) | |
7301 | (sha256 | |
7302 | (base32 | |
7303 | "1j7qlhxk1rbv9jbj8wd6hb7zl8p2mp29ymrmccgmsi0m0dzhgn6s")))) | |
7304 | (build-system gnu-build-system) | |
7305 | (arguments | |
7306 | ;; There are no automated tests. | |
7307 | '(#:tests? #f)) | |
7308 | (home-page "https://projects.horms.net/projects/kexec/") | |
7309 | (synopsis "Tools for booting directly into different kernels") | |
7310 | (description "This package provides the @code{kexec} program and ancillary | |
7311 | utilities. Using @code{kexec}, it is possible to boot directly into a new | |
7312 | kernel from the context of an already-running kernel, bypassing the normal | |
7313 | system boot process.") | |
7314 | (license license:gpl2))) | |
c0792d77 JBN |
7315 | |
7316 | (define-public cachefilesd | |
7317 | (package | |
7318 | (name "cachefilesd") | |
7319 | (version "0.10.10") | |
7320 | (source (origin | |
7321 | (method url-fetch) | |
7322 | (uri (string-append | |
7323 | "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells" | |
7324 | "/cachefilesd.git/snapshot/cachefilesd-" | |
7325 | version ".tar.gz")) | |
7326 | (sha256 | |
7327 | (base32 | |
7328 | "0g40ljjnn3wzh9gp6il21c95f977298qrrkrxfnwfl3k3asfmnbi")))) | |
7329 | (build-system gnu-build-system) | |
7330 | (outputs '("out")) | |
7331 | (arguments | |
7332 | `(#:tests? #f ; there are no tests | |
7333 | #:make-flags | |
7334 | (let ((prefix-dir (lambda (var dir) | |
1ca44ae3 MB |
7335 | (string-append var "=" %output "/" dir)))) |
7336 | (list (string-append "CC=" ,(cc-for-target)) | |
c0792d77 JBN |
7337 | (prefix-dir "SBINDIR" "sbin/") |
7338 | (prefix-dir "ETCDIR" "etc/") | |
7339 | (prefix-dir "MANDIR" "share/man/"))) | |
7340 | #:phases (modify-phases %standard-phases (delete 'configure)))) | |
7341 | (home-page "https://people.redhat.com/~dhowells/cachefs/") | |
7342 | (synopsis "CacheFiles userspace management daemon") | |
7343 | (description "@code{cachefilesd} is a userspace daemon that manages the | |
7344 | cache data store that is used by network file systems such as @code{AFS} and | |
7345 | @code{NFS} to cache data locally on disk. The content of the cache is | |
7346 | persistent over reboots.") | |
7347 | (license license:gpl2+))) | |
b523b034 JS |
7348 | |
7349 | (define-public libbpf | |
7350 | (package | |
7351 | (name "libbpf") | |
7352 | (version "0.0.9") | |
7353 | (source | |
7354 | (origin | |
7355 | (method git-fetch) | |
7356 | (uri (git-reference | |
7357 | (url "https://github.com/libbpf/libbpf") | |
7358 | (commit (string-append "v" version)))) | |
7359 | (file-name (git-file-name name version)) | |
7360 | (sha256 | |
7361 | (base32 | |
7362 | "18l0gff7nm841mwhr7bc7x863xcyvwh58zl7mc0amnsjqlbrvqg7")))) | |
7363 | (build-system gnu-build-system) | |
7364 | (native-inputs | |
7365 | `(("pkg-config" ,pkg-config))) | |
7366 | (inputs | |
7367 | `(("libelf" ,libelf) | |
7368 | ("zlib" ,zlib))) | |
7369 | (arguments | |
7370 | `(#:tests? #f ; No tests | |
7371 | #:make-flags | |
7372 | (list | |
7373 | (string-append "PREFIX=''") | |
7374 | (string-append "DESTDIR=" (assoc-ref %outputs "out")) | |
7375 | (string-append "LIBDIR=/lib") | |
7376 | (string-append | |
7377 | "CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc")) | |
7378 | #:phases | |
7379 | (modify-phases %standard-phases | |
7380 | (delete 'configure) | |
7381 | (add-before 'build 'pre-build | |
7382 | (lambda* (#:key inputs #:allow-other-keys) | |
7383 | (substitute* "scripts/check-reallocarray.sh" | |
7384 | (("/bin/rm" rm) | |
7385 | (string-append (assoc-ref inputs "coreutils") rm))) | |
7386 | (chdir "src") | |
7387 | #t))))) | |
7388 | (home-page "https://github.com/libbpf/libbpf") | |
7389 | (synopsis "BPF CO-RE (Compile Once – Run Everywhere)") | |
7390 | (description | |
7391 | "Libbpf supports building BPF CO-RE-enabled applications, which, in | |
7392 | contrast to BCC, do not require the Clang/LLVM runtime or linux kernel | |
7393 | headers.") | |
7394 | (license `(,license:lgpl2.1 ,license:bsd-2)))) | |
cfd8daaf JS |
7395 | |
7396 | (define-public bcc | |
7397 | (package | |
7398 | (name "bcc") | |
7399 | (version "0.15.0") | |
7400 | (source | |
7401 | (origin | |
7402 | (method git-fetch) | |
7403 | (uri (git-reference | |
7404 | (url "https://github.com/iovisor/bcc") | |
7405 | (commit (string-append "v" version)))) | |
7406 | (file-name (git-file-name name version)) | |
7407 | (sha256 | |
7408 | (base32 | |
7409 | "1d5j9zanffa1c7lpi5fcrdlx1n7hy86xl82fam2xqr0s41q4ipxw")))) | |
7410 | (build-system cmake-build-system) | |
7411 | (native-inputs | |
7412 | `(("bison" ,bison) | |
7413 | ("flex" ,flex))) | |
7414 | (inputs | |
7415 | `(("clang-toolchain" ,clang-toolchain) | |
7416 | ("libbpf" ,(package-source libbpf)) | |
7417 | ;; LibElf required but libelf does not contain | |
7418 | ;; archives, only object files. | |
7419 | ;; https://github.com/iovisor/bcc/issues/504 | |
7420 | ("elfutils" ,elfutils) | |
7421 | ("linux-libre-headers" ,linux-libre-headers) | |
7422 | ("luajit" ,luajit) | |
7423 | ("python-wrapper" ,python-wrapper))) | |
7424 | (arguments | |
7425 | `(;; Tests all require root permissions and a "standard" file hierarchy. | |
7426 | #:tests? #f | |
7427 | #:configure-flags | |
7428 | (let ((revision ,version)) | |
7429 | `(,(string-append "-DREVISION=" revision))) | |
7430 | #:phases | |
7431 | (modify-phases %standard-phases | |
7432 | ;; FIXME: Use "-DCMAKE_USE_LIBBPF_PACKAGE=ON". | |
7433 | (add-after 'unpack 'copy-libbpf | |
7434 | (lambda* (#:key inputs #:allow-other-keys) | |
7435 | (delete-file-recursively "src/cc/libbpf") | |
7436 | (copy-recursively | |
7437 | (assoc-ref inputs "libbpf") "src/cc/libbpf"))) | |
7438 | (add-after 'copy-libbpf 'substitute-libbc | |
7439 | (lambda* (#:key outputs #:allow-other-keys) | |
7440 | (substitute* "src/python/bcc/libbcc.py" | |
7441 | (("(libbcc\\.so.*)\\b" _ libbcc) | |
7442 | (string-append | |
7443 | (assoc-ref outputs "out") "/lib/" libbcc))))) | |
7444 | (add-after 'install 'wrap-tools | |
7445 | (lambda* (#:key outputs #:allow-other-keys) | |
7446 | (use-modules (ice-9 textual-ports)) | |
7447 | (let* ((out (assoc-ref outputs "out")) | |
7448 | (lib (string-append out "/lib")) | |
7449 | (tools (string-append out "/share/bcc/tools")) | |
7450 | (python-executable? | |
7451 | (lambda (filename _) | |
7452 | (call-with-input-file filename | |
7453 | (lambda (port) | |
7454 | (string-contains (get-line port) | |
7455 | "/bin/python")))))) | |
7456 | (for-each | |
7457 | (lambda (python-executable) | |
7458 | (format #t "Wrapping: ~A.~%" python-executable) | |
7459 | (wrap-program python-executable | |
7460 | `("PYTHONPATH" ":" prefix | |
7461 | (,(string-append lib | |
7462 | "/python" | |
7463 | ,(version-major+minor | |
7464 | (package-version python)) | |
7465 | "/site-packages"))))) | |
7466 | (find-files tools python-executable?)) | |
7467 | #t)))))) | |
7468 | (home-page "https://github.com/iovisor/bcc") | |
7469 | (synopsis "Tools for BPF on Linux") | |
7470 | (description | |
7471 | "BCC is a toolkit for creating efficient kernel tracing and manipulation | |
7472 | programs, and includes several useful tools and examples. It makes use of | |
7473 | extended BPF (Berkeley Packet Filters), formally known as eBPF, a new feature | |
7474 | that was first added to Linux 3.15. Much of what BCC uses requires Linux 4.1 | |
7475 | and above.") | |
7476 | (license license:asl2.0))) | |
c55acb07 JS |
7477 | |
7478 | (define-public bpftrace | |
7479 | (package | |
7480 | (name "bpftrace") | |
7481 | (version "0.10.0") | |
7482 | (source | |
7483 | (origin | |
7484 | (method git-fetch) | |
7485 | (uri (git-reference | |
7486 | (url "https://github.com/iovisor/bpftrace") | |
7487 | (commit (string-append "v" version)))) | |
7488 | (file-name (git-file-name name version)) | |
7489 | (sha256 | |
7490 | (base32 | |
7491 | "023ardywbw5w8815j2ny9rrp2xlpxndqaa7v2njjm8109p7ilsdn")) | |
7492 | (patches (search-patches "bpftrace-disable-bfd-disasm.patch")))) | |
7493 | (build-system cmake-build-system) | |
7494 | (native-inputs | |
7495 | `(("bison" ,bison) | |
7496 | ("flex" ,flex))) | |
7497 | (inputs | |
7498 | `(("bcc" ,bcc) | |
7499 | ("clang-toolchain" ,clang-toolchain) | |
7500 | ("elfutils" ,elfutils) | |
7501 | ("libbpf" ,libbpf) | |
7502 | ("linux-libre-headers" ,linux-libre-headers))) | |
7503 | (arguments | |
7504 | `(#:tests? #f ;Tests require googletest sources. | |
7505 | #:configure-flags | |
7506 | '("-DBUILD_TESTING=OFF" | |
7507 | ;; FIXME: libbfd misses some link dependencies, when fixed, remove | |
7508 | ;; the associated patch. | |
7509 | "-DHAVE_BFD_DISASM=OFF"))) | |
7510 | (home-page "https://github.com/iovisor/bpftrace") | |
7511 | (synopsis "High-level tracing language for Linux eBPF") | |
7512 | (description | |
7513 | "bpftrace is a high-level tracing language for Linux enhanced Berkeley | |
7514 | Packet Filter (eBPF) available in recent Linux kernels (4.x). bpftrace uses | |
7515 | LLVM as a backend to compile scripts to BPF-bytecode and makes use of BCC for | |
7516 | interacting with the Linux BPF system, as well as existing Linux tracing | |
7517 | capabilities: kernel dynamic tracing (kprobes), user-level dynamic | |
7518 | tracing (uprobes), and tracepoints. The bpftrace language is inspired by awk | |
7519 | and C, and predecessor tracers such as DTrace and SystemTap. bpftrace was | |
7520 | created by Alastair Robertson.") | |
7521 | (license license:asl2.0))) | |
629982c0 DM |
7522 | |
7523 | (define-public ttyebus-linux-module | |
7524 | (let ((revision "0") | |
7525 | (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f")) | |
7526 | (package | |
7527 | (name "ttyebus-linux-module") | |
7528 | (version (git-version "1.5" revision commit)) | |
7529 | (source | |
7530 | (origin | |
7531 | (method git-fetch) | |
7532 | (uri (git-reference | |
7533 | (url "https://github.com/eBUS/ttyebus.git") | |
7534 | (commit "fe4332a2281cf79804ef4d8516aa848ca1c58d1f"))) | |
7535 | (file-name (git-file-name name version)) | |
7536 | (sha256 | |
7537 | (base32 | |
7538 | "1i66xjs9vln5cca6wx7aiiw7jihrlsk9hjdqyczp36fvm1b1bani")))) | |
7539 | (supported-systems '("armhf-linux" "aarch64-linux")) | |
7540 | (build-system linux-module-build-system) | |
7541 | (arguments | |
7542 | `(#:tests? #f)) | |
7543 | (home-page "https://github.com/eBUS/ttyebus") | |
7544 | (synopsis "Low-latency Raspberry Pi UART driver") | |
7545 | (description "This package provides a Linux kernel module that will | |
7546 | provide a serial device @code{/dev/ttyebus} with almost no latency upon | |
7547 | receiving. It is dedicated to the PL011 UART of the Raspberry Pi.") | |
7548 | (license license:gpl3+)))) |