Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
fb9b7ce2 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
66269d47 | 3 | ;;; Copyright © 2013, 2014 Andreas Enge <andreas@enge.fr> |
233e7676 | 4 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> |
bdac3d4b | 5 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
31aa4379 | 6 | ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch> |
fd76c904 | 7 | ;;; |
233e7676 | 8 | ;;; This file is part of GNU Guix. |
fd76c904 | 9 | ;;; |
233e7676 | 10 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
fd76c904 LC |
11 | ;;; under the terms of the GNU General Public License as published by |
12 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
13 | ;;; your option) any later version. | |
14 | ;;; | |
233e7676 | 15 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
fd76c904 LC |
16 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;;; GNU General Public License for more details. | |
19 | ;;; | |
20 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 21 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
fd76c904 | 22 | |
1ffa7090 | 23 | (define-module (gnu packages linux) |
023fef7d LC |
24 | #:use-module ((guix licenses) |
25 | #:hide (zlib)) | |
59a43334 | 26 | #:use-module (gnu packages) |
30016044 | 27 | #:use-module ((gnu packages compression) #:prefix guix:) |
3b027388 | 28 | #:use-module (gnu packages gcc) |
1ffa7090 | 29 | #:use-module (gnu packages flex) |
90a0048f | 30 | #:use-module (gnu packages bison) |
9f533d60 | 31 | #:use-module (gnu packages admin) |
d7d42d6b | 32 | #:use-module (gnu packages gperf) |
1ffa7090 LC |
33 | #:use-module (gnu packages libusb) |
34 | #:use-module (gnu packages ncurses) | |
d7d42d6b | 35 | #:use-module (gnu packages pciutils) |
5f96f303 | 36 | #:use-module (gnu packages databases) |
1ffa7090 LC |
37 | #:use-module (gnu packages perl) |
38 | #:use-module (gnu packages pkg-config) | |
7c0dbe78 | 39 | #:use-module (gnu packages python) |
b1fb4b23 | 40 | #:use-module (gnu packages slang) |
e7b38500 | 41 | #:use-module (gnu packages algebra) |
1dba6407 | 42 | #:use-module (gnu packages gettext) |
db288efa | 43 | #:use-module (gnu packages glib) |
17b293a0 | 44 | #:use-module (gnu packages pulseaudio) |
c762e82e | 45 | #:use-module (gnu packages attr) |
17b293a0 | 46 | #:use-module (gnu packages xml) |
215b6431 | 47 | #:use-module (gnu packages autotools) |
f57d2639 | 48 | #:use-module (gnu packages texinfo) |
b10e9ff6 | 49 | #:use-module (gnu packages check) |
30016044 MW |
50 | #:use-module (gnu packages maths) |
51 | #:use-module (gnu packages which) | |
52 | #:use-module (gnu packages rrdtool) | |
b62fe07f | 53 | #:use-module (gnu packages elf) |
b087d413 | 54 | #:use-module (gnu packages gtk) |
d7ece67a LC |
55 | #:use-module (gnu packages docbook) |
56 | #:use-module (gnu packages asciidoc) | |
02b80c3f NK |
57 | #:use-module (guix packages) |
58 | #:use-module (guix download) | |
dc2d59af | 59 | #:use-module (guix utils) |
7c0dbe78 | 60 | #:use-module (guix build-system gnu) |
220193ad | 61 | #:use-module (guix build-system cmake) |
e102f940 | 62 | #:use-module (guix build-system python) |
a94546ec LC |
63 | #:use-module (guix build-system trivial) |
64 | #:use-module (srfi srfi-26) | |
65 | #:use-module (ice-9 match)) | |
fd76c904 | 66 | |
aaf4cb20 LC |
67 | (define-public (system->linux-architecture arch) |
68 | "Return the Linux architecture name for ARCH, a Guix system name such as | |
69 | \"x86_64-linux\"." | |
618cea69 NK |
70 | (let ((arch (car (string-split arch #\-)))) |
71 | (cond ((string=? arch "i686") "i386") | |
72 | ((string-prefix? "mips" arch) "mips") | |
aaf4cb20 | 73 | ((string-prefix? "arm" arch) "arm") |
618cea69 NK |
74 | (else arch)))) |
75 | ||
6023cc74 LC |
76 | (define (linux-libre-urls version) |
77 | "Return a list of URLs for Linux-Libre VERSION." | |
78 | (list (string-append | |
79 | "http://linux-libre.fsfla.org/pub/linux-libre/releases/" | |
80 | version "-gnu/linux-libre-" version "-gnu.tar.xz") | |
81 | ||
82 | ;; XXX: Work around <http://bugs.gnu.org/14851>. | |
83 | (string-append | |
84 | "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-" | |
85 | version "-gnu.tar.xz") | |
86 | ||
87 | ;; Maybe this URL will become valid eventually. | |
88 | (string-append | |
89 | "mirror://gnu/linux-libre/" version "-gnu/linux-libre-" | |
90 | version "-gnu.tar.xz"))) | |
91 | ||
80fe5c60 | 92 | (define-public linux-libre-headers |
dfb52abb | 93 | (let* ((version "3.3.8") |
80fe5c60 | 94 | (build-phase |
618cea69 NK |
95 | (lambda (arch) |
96 | `(lambda _ | |
97 | (setenv "ARCH" ,(system->linux-architecture arch)) | |
98 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) | |
45298f8f | 99 | |
618cea69 NK |
100 | (and (zero? (system* "make" "defconfig")) |
101 | (zero? (system* "make" "mrproper" "headers_check")))))) | |
80fe5c60 LC |
102 | (install-phase |
103 | `(lambda* (#:key outputs #:allow-other-keys) | |
104 | (let ((out (assoc-ref outputs "out"))) | |
105 | (and (zero? (system* "make" | |
106 | (string-append "INSTALL_HDR_PATH=" out) | |
107 | "headers_install")) | |
108 | (mkdir (string-append out "/include/config")) | |
109 | (call-with-output-file | |
110 | (string-append out | |
111 | "/include/config/kernel.release") | |
112 | (lambda (p) | |
dfb52abb | 113 | (format p "~a-default~%" ,version)))))))) |
80fe5c60 LC |
114 | (package |
115 | (name "linux-libre-headers") | |
dfb52abb | 116 | (version version) |
80fe5c60 LC |
117 | (source (origin |
118 | (method url-fetch) | |
6023cc74 | 119 | (uri (linux-libre-urls version)) |
80fe5c60 LC |
120 | (sha256 |
121 | (base32 | |
122 | "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl")))) | |
123 | (build-system gnu-build-system) | |
124 | (native-inputs `(("perl" ,perl))) | |
125 | (arguments | |
126 | `(#:modules ((guix build gnu-build-system) | |
127 | (guix build utils) | |
56c092ce | 128 | (srfi srfi-1)) |
80fe5c60 | 129 | #:phases (alist-replace |
fb6c2fa8 LC |
130 | 'build ,(build-phase (or (%current-target-system) |
131 | (%current-system))) | |
80fe5c60 LC |
132 | (alist-replace |
133 | 'install ,install-phase | |
56c092ce | 134 | (alist-delete 'configure %standard-phases))) |
80fe5c60 LC |
135 | #:tests? #f)) |
136 | (synopsis "GNU Linux-Libre kernel headers") | |
137 | (description "Headers of the Linux-Libre kernel.") | |
38bbd61d | 138 | (license gpl2) |
80fe5c60 LC |
139 | (home-page "http://www.gnu.org/software/linux-libre/")))) |
140 | ||
b4fcb735 LC |
141 | (define-public module-init-tools |
142 | (package | |
143 | (name "module-init-tools") | |
144 | (version "3.16") | |
145 | (source (origin | |
146 | (method url-fetch) | |
147 | (uri (string-append | |
148 | "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-" | |
149 | version ".tar.bz2")) | |
150 | (sha256 | |
151 | (base32 | |
d3bbe992 LC |
152 | "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1")) |
153 | (patches | |
154 | (list (search-patch "module-init-tools-moduledir.patch"))))) | |
b4fcb735 | 155 | (build-system gnu-build-system) |
b4fcb735 | 156 | (arguments |
5c413a9c LC |
157 | ;; FIXME: The upstream tarball lacks man pages, and building them would |
158 | ;; require DocBook & co. We used to use Gentoo's pre-built man pages, | |
159 | ;; but they vanished. In the meantime, fake it. | |
b4fcb735 | 160 | '(#:phases (alist-cons-before |
5c413a9c LC |
161 | 'configure 'fake-docbook |
162 | (lambda _ | |
163 | (substitute* "Makefile.in" | |
164 | (("^DOCBOOKTOMAN.*$") | |
165 | "DOCBOOKTOMAN = true\n"))) | |
b4fcb735 LC |
166 | %standard-phases))) |
167 | (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/") | |
168 | (synopsis "Tools for loading and managing Linux kernel modules") | |
169 | (description | |
170 | "Tools for loading and managing Linux kernel modules, such as `modprobe', | |
171 | `insmod', `lsmod', and more.") | |
172 | (license gpl2+))) | |
173 | ||
ac47a7c2 LC |
174 | (define %boot-logo-patch |
175 | ;; Linux-Libre boot logo featuring Freedo and a gnu. | |
176 | (origin | |
177 | (method url-fetch) | |
178 | (uri (string-append "http://www.fsfla.org/svn/fsfla/software/linux-libre/" | |
74dde9e9 | 179 | "lemote/gnewsense/branches/3.16/100gnu+freedo.patch")) |
ac47a7c2 LC |
180 | (sha256 |
181 | (base32 | |
182 | "1hk9swxxc80bmn2zd2qr5ccrjrk28xkypwhl4z0qx4hbivj7qm06")))) | |
183 | ||
a94546ec LC |
184 | (define (kernel-config system) |
185 | "Return the absolute file name of the Linux-Libre build configuration file | |
1650dd8a | 186 | for SYSTEM, or #f if there is no configuration for SYSTEM." |
a94546ec LC |
187 | (define (lookup file) |
188 | (let ((file (string-append "gnu/packages/" file))) | |
189 | (search-path %load-path file))) | |
190 | ||
191 | (match system | |
192 | ("i686-linux" | |
193 | (lookup "linux-libre-i686.conf")) | |
194 | ("x86_64-linux" | |
195 | (lookup "linux-libre-x86_64.conf")) | |
196 | (_ | |
1650dd8a | 197 | #f))) |
a94546ec | 198 | |
beacfcab | 199 | (define-public linux-libre |
1f4edec4 | 200 | (let* ((version "3.19") |
beacfcab | 201 | (build-phase |
ac47a7c2 LC |
202 | '(lambda* (#:key system inputs #:allow-other-keys #:rest args) |
203 | ;; Apply the neat patch. | |
9a224ac2 | 204 | (system* "patch" "-p1" "--force" |
ac47a7c2 LC |
205 | "-i" (assoc-ref inputs "patch/freedo+gnu")) |
206 | ||
beacfcab LC |
207 | (let ((arch (car (string-split system #\-)))) |
208 | (setenv "ARCH" | |
209 | (cond ((string=? arch "i686") "i386") | |
210 | (else arch))) | |
211 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))) | |
212 | ||
a94546ec LC |
213 | (let ((build (assoc-ref %standard-phases 'build)) |
214 | (config (assoc-ref inputs "kconfig"))) | |
1650dd8a LC |
215 | |
216 | ;; Use the architecture-specific config if available, and | |
217 | ;; 'defconfig' otherwise. | |
218 | (if config | |
219 | (begin | |
220 | (copy-file config ".config") | |
221 | (chmod ".config" #o666)) | |
222 | (system* "make" "defconfig")) | |
a94546ec LC |
223 | |
224 | ;; Appending works even when the option wasn't in the | |
225 | ;; file. The last one prevails if duplicated. | |
226 | (let ((port (open-file ".config" "a"))) | |
227 | (display (string-append "CONFIG_NET_9P=m\n" | |
228 | "CONFIG_NET_9P_VIRTIO=m\n" | |
229 | "CONFIG_VIRTIO_BLK=m\n" | |
230 | "CONFIG_VIRTIO_NET=m\n" | |
231 | ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html | |
232 | "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n" | |
233 | "CONFIG_VIRTIO_PCI=m\n" | |
234 | "CONFIG_VIRTIO_BALLOON=m\n" | |
235 | "CONFIG_VIRTIO_MMIO=m\n" | |
236 | "CONFIG_FUSE_FS=m\n" | |
237 | "CONFIG_CIFS=m\n" | |
238 | "CONFIG_9P_FS=m\n") | |
239 | port) | |
240 | (close-port port)) | |
241 | ||
242 | (zero? (system* "make" "oldconfig")) | |
243 | ||
244 | ;; Call the default `build' phase so `-j' is correctly | |
245 | ;; passed. | |
246 | (apply build #:make-flags "all" args)))) | |
beacfcab LC |
247 | (install-phase |
248 | `(lambda* (#:key inputs outputs #:allow-other-keys) | |
249 | (let* ((out (assoc-ref outputs "out")) | |
250 | (moddir (string-append out "/lib/modules")) | |
251 | (mit (assoc-ref inputs "module-init-tools"))) | |
252 | (mkdir-p moddir) | |
253 | (for-each (lambda (file) | |
254 | (copy-file file | |
255 | (string-append out "/" (basename file)))) | |
256 | (find-files "." "^(bzImage|System\\.map)$")) | |
257 | (copy-file ".config" (string-append out "/config")) | |
258 | (zero? (system* "make" | |
259 | (string-append "DEPMOD=" mit "/sbin/depmod") | |
260 | (string-append "MODULE_DIR=" moddir) | |
261 | (string-append "INSTALL_PATH=" out) | |
262 | (string-append "INSTALL_MOD_PATH=" out) | |
cda3d81e | 263 | "INSTALL_MOD_STRIP=1" |
beacfcab LC |
264 | "modules_install")))))) |
265 | (package | |
266 | (name "linux-libre") | |
dfb52abb | 267 | (version version) |
beacfcab LC |
268 | (source (origin |
269 | (method url-fetch) | |
6023cc74 | 270 | (uri (linux-libre-urls version)) |
beacfcab LC |
271 | (sha256 |
272 | (base32 | |
1f4edec4 | 273 | "1ndrflzalkcyy61im6kcm8z681yaq2hwqgn6zbd7r3j9mscyqq1a")))) |
beacfcab LC |
274 | (build-system gnu-build-system) |
275 | (native-inputs `(("perl" ,perl) | |
e7b38500 | 276 | ("bc" ,bc) |
ac47a7c2 | 277 | ("module-init-tools" ,module-init-tools) |
a94546ec | 278 | ("patch/freedo+gnu" ,%boot-logo-patch) |
1650dd8a LC |
279 | |
280 | ,@(let ((conf (kernel-config (or (%current-target-system) | |
281 | (%current-system))))) | |
282 | (if conf | |
283 | `(("kconfig" ,conf)) | |
284 | '())))) | |
3b027388 LC |
285 | |
286 | ;; XXX: Work around an ICE with our patched GCC 4.8.3 while compiling | |
287 | ;; 'drivers/staging/vt6656/michael.o': <http://hydra.gnu.org/build/96389/>. | |
288 | (inputs `(("gcc" ,gcc-4.9))) | |
289 | ||
beacfcab LC |
290 | (arguments |
291 | `(#:modules ((guix build gnu-build-system) | |
292 | (guix build utils) | |
293 | (srfi srfi-1) | |
294 | (ice-9 match)) | |
295 | #:phases (alist-replace | |
296 | 'build ,build-phase | |
297 | (alist-replace | |
298 | 'install ,install-phase | |
299 | (alist-delete 'configure %standard-phases))) | |
300 | #:tests? #f)) | |
f50d2669 | 301 | (synopsis "100% free redistribution of a cleaned Linux kernel") |
a22dc0c4 | 302 | (description |
79c311b8 LC |
303 | "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel. |
304 | It has been modified to remove all non-free binary blobs.") | |
beacfcab LC |
305 | (license gpl2) |
306 | (home-page "http://www.gnu.org/software/linux-libre/")))) | |
307 | ||
c84d0eca LC |
308 | \f |
309 | ;;; | |
310 | ;;; Pluggable authentication modules (PAM). | |
311 | ;;; | |
312 | ||
fd76c904 LC |
313 | (define-public linux-pam |
314 | (package | |
315 | (name "linux-pam") | |
316 | (version "1.1.6") | |
317 | (source | |
318 | (origin | |
319 | (method url-fetch) | |
320 | (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-" | |
321 | version ".tar.bz2") | |
322 | (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-" | |
323 | version ".tar.bz2"))) | |
324 | (sha256 | |
325 | (base32 | |
326 | "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s")))) | |
327 | (build-system gnu-build-system) | |
c4c4cc05 | 328 | (native-inputs |
fd76c904 LC |
329 | `(("flex" ,flex) |
330 | ||
331 | ;; TODO: optional dependencies | |
332 | ;; ("libxcrypt" ,libxcrypt) | |
333 | ;; ("cracklib" ,cracklib) | |
334 | )) | |
335 | (arguments | |
c134056a LC |
336 | '(;; Most users, such as `shadow', expect the headers to be under |
337 | ;; `security'. | |
338 | #:configure-flags (list (string-append "--includedir=" | |
339 | (assoc-ref %outputs "out") | |
340 | "/include/security")) | |
341 | ||
342 | ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d | |
343 | ;; isn't available. | |
344 | #:tests? #f)) | |
fd76c904 LC |
345 | (home-page "http://www.linux-pam.org/") |
346 | (synopsis "Pluggable authentication modules for Linux") | |
347 | (description | |
348 | "A *Free* project to implement OSF's RFC 86.0. | |
349 | Pluggable authentication modules are small shared object files that can | |
350 | be used through the PAM API to perform tasks, like authenticating a user | |
351 | at login. Local and dynamic reconfiguration are its key features") | |
4a44e743 | 352 | (license bsd-3))) |
686f14e8 | 353 | |
c84d0eca LC |
354 | \f |
355 | ;;; | |
356 | ;;; Miscellaneous. | |
357 | ;;; | |
358 | ||
686f14e8 LC |
359 | (define-public psmisc |
360 | (package | |
361 | (name "psmisc") | |
362 | (version "22.20") | |
363 | (source | |
364 | (origin | |
365 | (method url-fetch) | |
366 | (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-" | |
367 | version ".tar.gz")) | |
368 | (sha256 | |
369 | (base32 | |
370 | "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi")))) | |
371 | (build-system gnu-build-system) | |
372 | (inputs `(("ncurses" ,ncurses))) | |
373 | (home-page "http://psmisc.sourceforge.net/") | |
374 | (synopsis | |
35b9e423 | 375 | "Small utilities that use the proc filesystem") |
686f14e8 LC |
376 | (description |
377 | "This PSmisc package is a set of some small useful utilities that | |
35b9e423 | 378 | use the proc filesystem. We're not about changing the world, but |
686f14e8 | 379 | providing the system administrator with some help in common tasks.") |
4a44e743 | 380 | (license gpl2+))) |
02b80c3f NK |
381 | |
382 | (define-public util-linux | |
383 | (package | |
384 | (name "util-linux") | |
9f533d60 | 385 | (version "2.25.2") |
5a6a3ba4 LC |
386 | (source (origin |
387 | (method url-fetch) | |
388 | (uri (string-append "mirror://kernel.org/linux/utils/" | |
9f533d60 LC |
389 | name "/v" (version-major+minor version) "/" |
390 | name "-" version ".tar.xz")) | |
5a6a3ba4 LC |
391 | (sha256 |
392 | (base32 | |
9f533d60 LC |
393 | "1miwwdq1zwvhf0smrxx3fjddq3mz22s8rc5cw54s7x3kbdqpyig0")) |
394 | (patches (list (search-patch "util-linux-tests.patch"))) | |
9d77da2a LC |
395 | (modules '((guix build utils))) |
396 | (snippet | |
ec2da92c LC |
397 | ;; We take the 'logger' program from GNU Inetutils and 'kill' |
398 | ;; from GNU Coreutils. | |
9f533d60 | 399 | '(substitute* "configure" |
ec2da92c LC |
400 | (("build_logger=yes") "build_logger=no") |
401 | (("build_kill=yes") "build_kill=no"))))) | |
02b80c3f NK |
402 | (build-system gnu-build-system) |
403 | (arguments | |
8b8476b8 AE |
404 | `(#:configure-flags '("--disable-use-tty-group" |
405 | "--enable-ddate") | |
9f533d60 LC |
406 | #:phases (alist-cons-before |
407 | 'check 'pre-check | |
408 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
409 | (let ((out (assoc-ref outputs "out")) | |
410 | (net (assoc-ref inputs "net-base"))) | |
411 | ;; Change the test to refer to the right file. | |
412 | (substitute* "tests/ts/misc/mcookie" | |
413 | (("/etc/services") | |
414 | (string-append net "/etc/services"))) | |
415 | #t)) | |
02b80c3f | 416 | %standard-phases))) |
4a44e743 | 417 | (inputs `(("zlib" ,guix:zlib) |
c4c4cc05 JD |
418 | ("ncurses" ,ncurses))) |
419 | (native-inputs | |
9f533d60 LC |
420 | `(("perl" ,perl) |
421 | ("net-base" ,net-base))) ;for tests | |
02b80c3f | 422 | (home-page "https://www.kernel.org/pub/linux/utils/util-linux/") |
35ec07c7 | 423 | (synopsis "Collection of utilities for the Linux kernel") |
02b80c3f | 424 | (description |
35b9e423 | 425 | "Util-linux is a random collection of utilities for the Linux kernel.") |
fe8ccfcc | 426 | |
02b80c3f | 427 | ;; Note that util-linux doesn't use the same license for all the |
fe8ccfcc | 428 | ;; code. GPLv2+ is the default license for a code without an |
02b80c3f | 429 | ;; explicitly defined license. |
fe8ccfcc LC |
430 | (license (list gpl3+ gpl2+ gpl2 lgpl2.0+ |
431 | bsd-4 public-domain)))) | |
5d5c4278 | 432 | |
e47e3eff LC |
433 | (define-public procps |
434 | (package | |
435 | (name "procps") | |
436 | (version "3.2.8") | |
437 | (source (origin | |
438 | (method url-fetch) | |
439 | (uri (string-append "http://procps.sourceforge.net/procps-" | |
440 | version ".tar.gz")) | |
441 | (sha256 | |
442 | (base32 | |
01eafd38 LC |
443 | "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i")) |
444 | (patches (list (search-patch "procps-make-3.82.patch"))))) | |
e47e3eff | 445 | (build-system gnu-build-system) |
01eafd38 | 446 | (inputs `(("ncurses" ,ncurses))) |
e47e3eff | 447 | (arguments |
01eafd38 | 448 | '(#:phases (alist-replace |
e47e3eff LC |
449 | 'configure |
450 | (lambda* (#:key outputs #:allow-other-keys) | |
451 | ;; No `configure', just a single Makefile. | |
452 | (let ((out (assoc-ref outputs "out"))) | |
453 | (substitute* "Makefile" | |
454 | (("/usr/") "/") | |
455 | (("--(owner|group) 0") "") | |
456 | (("ldconfig") "true") | |
457 | (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value) | |
458 | ;; Add libproc to the RPATH. | |
459 | (string-append "LDFLAGS := -Wl,-rpath=" | |
460 | out "/lib" value)))) | |
461 | (setenv "CC" "gcc")) | |
462 | (alist-replace | |
463 | 'install | |
464 | (lambda* (#:key outputs #:allow-other-keys) | |
465 | (let ((out (assoc-ref outputs "out"))) | |
466 | (and (zero? | |
467 | (system* "make" "install" | |
468 | (string-append "DESTDIR=" out))) | |
469 | ||
470 | ;; Sanity check. | |
471 | (zero? | |
472 | (system* (string-append out "/bin/ps") | |
473 | "--version"))))) | |
474 | %standard-phases)) | |
475 | ||
476 | ;; What did you expect? Tests? | |
477 | #:tests? #f)) | |
478 | (home-page "http://procps.sourceforge.net/") | |
35ec07c7 | 479 | (synopsis "Utilities that give information about processes") |
e47e3eff | 480 | (description |
35b9e423 | 481 | "Procps is the package that has a bunch of small useful utilities |
e47e3eff LC |
482 | that give information about processes using the Linux /proc file system. |
483 | The package includes the programs ps, top, vmstat, w, kill, free, | |
484 | slabtop, and skill.") | |
485 | (license gpl2))) | |
486 | ||
5d5c4278 NK |
487 | (define-public usbutils |
488 | (package | |
489 | (name "usbutils") | |
490 | (version "006") | |
491 | (source | |
492 | (origin | |
493 | (method url-fetch) | |
494 | (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/" | |
495 | "usbutils-" version ".tar.xz")) | |
496 | (sha256 | |
497 | (base32 | |
498 | "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr")))) | |
499 | (build-system gnu-build-system) | |
500 | (inputs | |
c4c4cc05 JD |
501 | `(("libusb" ,libusb))) |
502 | (native-inputs | |
503 | `(("pkg-config" ,pkg-config))) | |
5d5c4278 NK |
504 | (home-page "http://www.linux-usb.org/") |
505 | (synopsis | |
506 | "Tools for working with USB devices, such as lsusb") | |
507 | (description | |
508 | "Tools for working with USB devices, such as lsusb.") | |
4050e5d6 | 509 | (license gpl2+))) |
0750452a LC |
510 | |
511 | (define-public e2fsprogs | |
512 | (package | |
513 | (name "e2fsprogs") | |
61bce2f9 | 514 | (version "1.42.11") |
0750452a LC |
515 | (source (origin |
516 | (method url-fetch) | |
517 | (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-" | |
518 | version ".tar.gz")) | |
519 | (sha256 | |
520 | (base32 | |
61bce2f9 | 521 | "0xhbj7494g3y2w2miyrzdz6nciaffxajrs6wqm73yp4jnrqagn2b")) |
7c594a2c LC |
522 | (modules '((guix build utils))) |
523 | (snippet | |
524 | '(substitute* "MCONFIG.in" | |
525 | (("INSTALL_SYMLINK = /bin/sh") | |
526 | "INSTALL_SYMLINK = sh"))))) | |
0750452a | 527 | (build-system gnu-build-system) |
c4c4cc05 | 528 | (inputs `(("util-linux" ,util-linux))) |
f57d2639 | 529 | (native-inputs `(("pkg-config" ,pkg-config) |
7c594a2c | 530 | ("texinfo" ,texinfo))) ;for the libext2fs Info manual |
0750452a | 531 | (arguments |
c44ed26c LC |
532 | '(;; util-linux is not the preferred source for some of the libraries and |
533 | ;; commands, so disable them (see, e.g., | |
ddfc2fd8 | 534 | ;; <http://git.buildroot.net/buildroot/commit/?id=e1ffc2f791b336339909c90559b7db40b455f172>.) |
c44ed26c LC |
535 | #:configure-flags '("--disable-libblkid" |
536 | "--disable-libuuid" "--disable-uuidd" | |
537 | "--disable-fsck" | |
7c594a2c LC |
538 | |
539 | ;; Install libext2fs et al. | |
540 | "--enable-elf-shlibs") | |
541 | ||
542 | #:make-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
543 | (assoc-ref %outputs "out") | |
544 | "/lib")) | |
ddfc2fd8 LC |
545 | |
546 | #:phases (alist-cons-before | |
0750452a LC |
547 | 'configure 'patch-shells |
548 | (lambda _ | |
549 | (substitute* "configure" | |
550 | (("/bin/sh (.*)parse-types.sh" _ dir) | |
551 | (string-append (which "sh") " " dir | |
552 | "parse-types.sh"))) | |
553 | (substitute* (find-files "." "^Makefile.in$") | |
554 | (("#!/bin/sh") | |
555 | (string-append "#!" (which "sh"))))) | |
1c975f60 LC |
556 | (alist-cons-after |
557 | 'install 'install-libs | |
558 | (lambda _ | |
559 | (zero? (system* "make" "install-libs"))) | |
560 | %standard-phases)) | |
0750452a LC |
561 | |
562 | ;; FIXME: Tests work by comparing the stdout/stderr of programs, that | |
563 | ;; they fail because we get an extra line that says "Can't check if | |
564 | ;; filesystem is mounted due to missing mtab file". | |
565 | #:tests? #f)) | |
566 | (home-page "http://e2fsprogs.sourceforge.net/") | |
35ec07c7 | 567 | (synopsis "Creating and checking ext2/ext3/ext4 file systems") |
0750452a LC |
568 | (description |
569 | "This package provides tools for manipulating ext2/ext3/ext4 file systems.") | |
570 | (license (list gpl2 ; programs | |
571 | lgpl2.0 ; libext2fs | |
572 | x11)))) ; libuuid | |
d8482ad0 | 573 | |
e48977e7 LC |
574 | (define e2fsprogs/static |
575 | (static-package | |
576 | (package (inherit e2fsprogs) | |
577 | (arguments | |
578 | ;; Do not build shared libraries. | |
579 | (substitute-keyword-arguments (package-arguments e2fsprogs) | |
580 | ((#:configure-flags _) | |
581 | '(list "--disable-blkid")) | |
582 | ((#:make-flags _) | |
583 | '(list))))))) | |
584 | ||
e102f940 LC |
585 | (define-public e2fsck/static |
586 | (package | |
587 | (name "e2fsck-static") | |
0997771a | 588 | (version (package-version e2fsprogs)) |
e102f940 LC |
589 | (build-system trivial-build-system) |
590 | (source #f) | |
591 | (arguments | |
592 | `(#:modules ((guix build utils)) | |
593 | #:builder | |
594 | (begin | |
595 | (use-modules (guix build utils) | |
596 | (ice-9 ftw) | |
597 | (srfi srfi-26)) | |
598 | ||
599 | (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs") | |
600 | "/sbin")) | |
601 | (bin (string-append (assoc-ref %outputs "out") "/sbin"))) | |
602 | (mkdir-p bin) | |
603 | (with-directory-excursion bin | |
604 | (for-each (lambda (file) | |
605 | (copy-file (string-append source "/" file) | |
606 | file) | |
607 | (remove-store-references file) | |
608 | (chmod file #o555)) | |
609 | (scandir source (cut string-prefix? "fsck." <>)))))))) | |
e48977e7 | 610 | (inputs `(("e2fsprogs" ,e2fsprogs/static))) |
e102f940 LC |
611 | (synopsis "Statically-linked fsck.* commands from e2fsprogs") |
612 | (description | |
613 | "This package provides statically-linked command of fsck.ext[234] taken | |
614 | from the e2fsprogs package. It is meant to be used in initrds.") | |
0997771a LC |
615 | (home-page (package-home-page e2fsprogs)) |
616 | (license (package-license e2fsprogs)))) | |
e102f940 | 617 | |
1c975f60 LC |
618 | (define-public zerofree |
619 | (package | |
620 | (name "zerofree") | |
621 | (version "1.0.3") | |
622 | (home-page "http://intgat.tigress.co.uk/rmy/uml/") | |
623 | (source (origin | |
624 | (method url-fetch) | |
625 | (uri (string-append home-page name "-" version | |
626 | ".tgz")) | |
627 | (sha256 | |
628 | (base32 | |
629 | "1xncw3dn2cp922ly42m96p6fh7jv8ysg6bwqbk5xvw701f3dmkrs")))) | |
630 | (build-system gnu-build-system) | |
631 | (arguments | |
632 | '(#:phases (alist-replace | |
633 | 'install | |
634 | (lambda* (#:key outputs #:allow-other-keys) | |
635 | (let* ((out (assoc-ref outputs "out")) | |
636 | (bin (string-append out "/bin"))) | |
637 | (mkdir-p bin) | |
638 | (copy-file "zerofree" | |
639 | (string-append bin "/zerofree")) | |
640 | (chmod (string-append bin "/zerofree") | |
641 | #o555) | |
642 | #t)) | |
643 | (alist-delete 'configure %standard-phases)) | |
644 | #:tests? #f)) ;no tests | |
645 | (inputs `(("libext2fs" ,e2fsprogs))) | |
646 | (synopsis "Zero non-allocated regions in ext2/ext3/ext4 file systems") | |
647 | (description | |
648 | "The zerofree command scans the free blocks in an ext2 file system and | |
649 | fills any non-zero blocks with zeroes. This is a useful way to make disk | |
650 | images more compressible.") | |
651 | (license gpl2))) | |
652 | ||
d8482ad0 LC |
653 | (define-public strace |
654 | (package | |
655 | (name "strace") | |
656 | (version "4.7") | |
657 | (source (origin | |
658 | (method url-fetch) | |
659 | (uri (string-append "mirror://sourceforge/strace/strace-" | |
660 | version ".tar.xz")) | |
661 | (sha256 | |
662 | (base32 | |
663 | "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764")))) | |
664 | (build-system gnu-build-system) | |
c4c4cc05 | 665 | (native-inputs `(("perl" ,perl))) |
d8482ad0 LC |
666 | (home-page "http://strace.sourceforge.net/") |
667 | (synopsis "System call tracer for Linux") | |
668 | (description | |
669 | "strace is a system call tracer, i.e. a debugging tool which prints out a | |
670 | trace of all the system calls made by a another process/program.") | |
671 | (license bsd-3))) | |
ba04571a LC |
672 | |
673 | (define-public alsa-lib | |
674 | (package | |
675 | (name "alsa-lib") | |
676 | (version "1.0.27.1") | |
677 | (source (origin | |
678 | (method url-fetch) | |
679 | (uri (string-append | |
680 | "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-" | |
681 | version ".tar.bz2")) | |
682 | (sha256 | |
683 | (base32 | |
bcd94e19 MW |
684 | "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9")) |
685 | (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch"))))) | |
ba04571a LC |
686 | (build-system gnu-build-system) |
687 | (home-page "http://www.alsa-project.org/") | |
688 | (synopsis "The Advanced Linux Sound Architecture libraries") | |
689 | (description | |
690 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
691 | MIDI functionality to the Linux-based operating system.") | |
692 | (license lgpl2.1+))) | |
10afdf50 | 693 | |
17b293a0 LC |
694 | (define-public alsa-utils |
695 | (package | |
696 | (name "alsa-utils") | |
697 | (version "1.0.27.2") | |
698 | (source (origin | |
699 | (method url-fetch) | |
700 | (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-" | |
701 | version ".tar.bz2")) | |
702 | (sha256 | |
703 | (base32 | |
704 | "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2")))) | |
705 | (build-system gnu-build-system) | |
706 | (arguments | |
707 | ;; XXX: Disable man page creation until we have DocBook. | |
708 | '(#:configure-flags (list "--disable-xmlto" | |
f2817d43 LC |
709 | |
710 | ;; The udev rule is responsible for restoring | |
711 | ;; the volume. | |
17b293a0 LC |
712 | (string-append "--with-udev-rules-dir=" |
713 | (assoc-ref %outputs "out") | |
714 | "/lib/udev/rules.d")) | |
715 | #:phases (alist-cons-before | |
716 | 'install 'pre-install | |
717 | (lambda _ | |
718 | ;; Don't try to mkdir /var/lib/alsa. | |
719 | (substitute* "Makefile" | |
720 | (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*") | |
721 | "true\n"))) | |
722 | %standard-phases))) | |
723 | (inputs | |
724 | `(("libsamplerate" ,libsamplerate) | |
725 | ("ncurses" ,ncurses) | |
726 | ("alsa-lib" ,alsa-lib) | |
727 | ("xmlto" ,xmlto) | |
1dba6407 | 728 | ("gettext" ,gnu-gettext))) |
17b293a0 LC |
729 | (home-page "http://www.alsa-project.org/") |
730 | (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)") | |
731 | (description | |
732 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
733 | MIDI functionality to the Linux-based operating system.") | |
734 | ||
735 | ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are | |
736 | ;; GPLv2-only. | |
737 | (license gpl2))) | |
738 | ||
10afdf50 LC |
739 | (define-public iptables |
740 | (package | |
741 | (name "iptables") | |
742 | (version "1.4.16.2") | |
743 | (source (origin | |
744 | (method url-fetch) | |
745 | (uri (string-append | |
746 | "http://www.netfilter.org/projects/iptables/files/iptables-" | |
747 | version ".tar.bz2")) | |
748 | (sha256 | |
749 | (base32 | |
750 | "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24")))) | |
751 | (build-system gnu-build-system) | |
752 | (arguments '(#:tests? #f)) ; no test suite | |
753 | (home-page "http://www.netfilter.org/projects/iptables/index.html") | |
754 | (synopsis "Program to configure the Linux IP packet filtering rules") | |
755 | (description | |
756 | "iptables is the userspace command line program used to configure the | |
757 | Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards | |
758 | system administrators. Since Network Address Translation is also configured | |
759 | from the packet filter ruleset, iptables is used for this, too. The iptables | |
760 | package also includes ip6tables. ip6tables is used for configuring the IPv6 | |
761 | packet filter.") | |
762 | (license gpl2+))) | |
90a0048f LC |
763 | |
764 | (define-public iproute | |
765 | (package | |
766 | (name "iproute2") | |
5fd7f3e0 | 767 | (version "3.12.0") |
90a0048f LC |
768 | (source (origin |
769 | (method url-fetch) | |
770 | (uri (string-append | |
771 | "mirror://kernel.org/linux/utils/net/iproute2/iproute2-" | |
772 | version ".tar.xz")) | |
773 | (sha256 | |
774 | (base32 | |
5fd7f3e0 | 775 | "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4")))) |
90a0048f LC |
776 | (build-system gnu-build-system) |
777 | (arguments | |
778 | `(#:tests? #f ; no test suite | |
779 | #:make-flags (let ((out (assoc-ref %outputs "out"))) | |
780 | (list "DESTDIR=" | |
781 | (string-append "LIBDIR=" out "/lib") | |
782 | (string-append "SBINDIR=" out "/sbin") | |
783 | (string-append "CONFDIR=" out "/etc") | |
784 | (string-append "DOCDIR=" out "/share/doc/" | |
785 | ,name "-" ,version) | |
786 | (string-append "MANDIR=" out "/share/man"))) | |
787 | #:phases (alist-cons-before | |
788 | 'install 'pre-install | |
789 | (lambda _ | |
790 | ;; Don't attempt to create /var/lib/arpd. | |
791 | (substitute* "Makefile" | |
792 | (("^.*ARPDDIR.*$") ""))) | |
793 | %standard-phases))) | |
794 | (inputs | |
795 | `(("iptables" ,iptables) | |
c4c4cc05 JD |
796 | ("db4" ,bdb))) |
797 | (native-inputs | |
798 | `(("pkg-config" ,pkg-config) | |
90a0048f LC |
799 | ("flex" ,flex) |
800 | ("bison" ,bison))) | |
801 | (home-page | |
802 | "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2") | |
803 | (synopsis | |
9e771e3b | 804 | "Utilities for controlling TCP/IP networking and traffic in Linux") |
90a0048f LC |
805 | (description |
806 | "Iproute2 is a collection of utilities for controlling TCP/IP | |
807 | networking and traffic with the Linux kernel. | |
808 | ||
809 | Most network configuration manuals still refer to ifconfig and route as the | |
810 | primary network configuration tools, but ifconfig is known to behave | |
811 | inadequately in modern network environments. They should be deprecated, but | |
812 | most distros still include them. Most network configuration systems make use | |
813 | of ifconfig and thus provide a limited feature set. The /etc/net project aims | |
814 | to support most modern network technologies, as it doesn't use ifconfig and | |
815 | allows a system administrator to make use of all iproute2 features, including | |
816 | traffic control. | |
817 | ||
818 | iproute2 is usually shipped in a package called iproute or iproute2 and | |
819 | consists of several tools, of which the most important are ip and tc. ip | |
820 | controls IPv4 and IPv6 configuration and tc stands for traffic control. Both | |
821 | tools print detailed usage messages and are accompanied by a set of | |
822 | manpages.") | |
823 | (license gpl2+))) | |
85e0dc6a LC |
824 | |
825 | (define-public net-tools | |
826 | ;; XXX: This package is basically unmaintained, but it provides a few | |
827 | ;; commands not yet provided by Inetutils, such as 'route', so we have to | |
828 | ;; live with it. | |
829 | (package | |
830 | (name "net-tools") | |
831 | (version "1.60") | |
832 | (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/") | |
833 | (source (origin | |
834 | (method url-fetch) | |
835 | (uri (string-append home-page "/" name "-" | |
836 | version ".tar.bz2")) | |
837 | (sha256 | |
838 | (base32 | |
177088a3 LC |
839 | "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s")) |
840 | (patches | |
841 | (list (search-patch "net-tools-bitrot.patch"))))) | |
85e0dc6a LC |
842 | (build-system gnu-build-system) |
843 | (arguments | |
cd143df0 LC |
844 | '(#:phases (alist-cons-after |
845 | 'unpack 'patch | |
85e0dc6a LC |
846 | (lambda* (#:key inputs #:allow-other-keys) |
847 | (define (apply-patch file) | |
9a224ac2 | 848 | (zero? (system* "patch" "-p1" "--force" |
85e0dc6a LC |
849 | "--input" file))) |
850 | ||
851 | (let ((patch.gz (assoc-ref inputs "patch"))) | |
852 | (format #t "applying Debian patch set '~a'...~%" | |
853 | patch.gz) | |
854 | (system (string-append "gunzip < " patch.gz " > the-patch")) | |
855 | (pk 'here) | |
856 | (and (apply-patch "the-patch") | |
857 | (for-each apply-patch | |
858 | (find-files "debian/patches" | |
859 | "\\.patch"))))) | |
860 | (alist-replace | |
861 | 'configure | |
862 | (lambda* (#:key outputs #:allow-other-keys) | |
863 | (let ((out (assoc-ref outputs "out"))) | |
864 | (mkdir-p (string-append out "/bin")) | |
865 | (mkdir-p (string-append out "/sbin")) | |
866 | ||
867 | ;; Pretend we have everything... | |
868 | (system "yes | make config") | |
869 | ||
870 | ;; ... except we don't have libdnet, so remove that | |
871 | ;; definition. | |
872 | (substitute* '("config.make" "config.h") | |
873 | (("^.*HAVE_AFDECnet.*$") "")))) | |
874 | %standard-phases)) | |
875 | ||
876 | ;; Binaries that depend on libnet-tools.a don't declare that | |
877 | ;; dependency, making it parallel-unsafe. | |
878 | #:parallel-build? #f | |
879 | ||
880 | #:tests? #f ; no test suite | |
0d55c356 MW |
881 | #:make-flags (let ((out (assoc-ref %outputs "out"))) |
882 | (list "CC=gcc" | |
883 | (string-append "BASEDIR=" out) | |
884 | (string-append "INSTALLNLSDIR=" out "/share/locale") | |
885 | (string-append "mandir=/share/man"))))) | |
85e0dc6a LC |
886 | |
887 | ;; Use the big Debian patch set (the thing does not even compile out of | |
888 | ;; the box.) | |
889 | (inputs `(("patch" ,(origin | |
890 | (method url-fetch) | |
891 | (uri | |
892 | "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz") | |
893 | (sha256 | |
894 | (base32 | |
895 | "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p")))))) | |
1dba6407 | 896 | (native-inputs `(("gettext" ,gnu-gettext))) |
85e0dc6a LC |
897 | |
898 | (synopsis "Tools for controlling the network subsystem in Linux") | |
899 | (description | |
900 | "This package includes the important tools for controlling the network | |
901 | subsystem of the Linux kernel. This includes arp, hostname, ifconfig, | |
902 | netstat, rarp and route. Additionally, this package contains utilities | |
903 | relating to particular network hardware types (plipconfig, slattach) and | |
904 | advanced aspects of IP configuration (iptunnel, ipmaddr).") | |
905 | (license gpl2+))) | |
c762e82e LC |
906 | |
907 | (define-public libcap | |
908 | (package | |
909 | (name "libcap") | |
910 | (version "2.22") | |
911 | (source (origin | |
912 | (method url-fetch) | |
913 | ||
914 | ;; Tarballs used to be available from | |
915 | ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/> | |
916 | ;; but they never came back after kernel.org was compromised. | |
917 | (uri (string-append | |
918 | "mirror://debian/pool/main/libc/libcap2/libcap2_" | |
919 | version ".orig.tar.gz")) | |
920 | (sha256 | |
921 | (base32 | |
922 | "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1")))) | |
923 | (build-system gnu-build-system) | |
924 | (arguments '(#:phases (alist-delete 'configure %standard-phases) | |
925 | #:tests? #f ; no 'check' target | |
926 | #:make-flags (list "lib=lib" | |
927 | (string-append "prefix=" | |
928 | (assoc-ref %outputs "out")) | |
929 | "RAISE_SETFCAP=no"))) | |
930 | (native-inputs `(("perl" ,perl))) | |
931 | (inputs `(("attr" ,attr))) | |
932 | (home-page "https://sites.google.com/site/fullycapable/") | |
933 | (synopsis "Library for working with POSIX capabilities") | |
934 | (description | |
35b9e423 | 935 | "Libcap2 provides a programming interface to POSIX capabilities on |
c762e82e LC |
936 | Linux-based operating systems.") |
937 | ||
938 | ;; License is BSD-3 or GPLv2, at the user's choice. | |
939 | (license gpl2))) | |
215b6431 LC |
940 | |
941 | (define-public bridge-utils | |
942 | (package | |
943 | (name "bridge-utils") | |
944 | (version "1.5") | |
945 | (source (origin | |
946 | (method url-fetch) | |
947 | (uri (string-append "mirror://sourceforge/bridge/bridge-utils-" | |
948 | version ".tar.gz")) | |
949 | (sha256 | |
950 | (base32 | |
951 | "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2")))) | |
952 | (build-system gnu-build-system) | |
953 | ||
954 | ;; The tarball lacks all the generated files. | |
955 | (native-inputs `(("autoconf" ,autoconf) | |
956 | ("automake" ,automake))) | |
957 | (arguments | |
958 | '(#:phases (alist-cons-before | |
959 | 'configure 'bootstrap | |
960 | (lambda _ | |
961 | (zero? (system* "autoreconf" "-vf"))) | |
962 | %standard-phases) | |
963 | #:tests? #f)) ; no 'check' target | |
964 | ||
965 | (home-page | |
966 | "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge") | |
967 | (synopsis "Manipulate Ethernet bridges") | |
968 | (description | |
969 | "Utilities for Linux's Ethernet bridging facilities. A bridge is a way | |
970 | to connect two Ethernet segments together in a protocol independent way. | |
971 | Packets are forwarded based on Ethernet address, rather than IP address (like | |
972 | a router). Since forwarding is done at Layer 2, all protocols can go | |
973 | transparently through a bridge.") | |
974 | (license gpl2+))) | |
3cc20675 LC |
975 | |
976 | (define-public libnl | |
977 | (package | |
978 | (name "libnl") | |
bdac3d4b | 979 | (version "3.2.25") |
3cc20675 LC |
980 | (source (origin |
981 | (method url-fetch) | |
982 | (uri (string-append | |
983 | "http://www.infradead.org/~tgr/libnl/files/libnl-" | |
984 | version ".tar.gz")) | |
985 | (sha256 | |
986 | (base32 | |
bdac3d4b | 987 | "1icfrv8yihcb74as1gcgmp0wfpdq632q2zvbvqqvjms9cy87bswb")))) |
3cc20675 LC |
988 | (build-system gnu-build-system) |
989 | (native-inputs `(("flex" ,flex) ("bison" ,bison))) | |
990 | (home-page "http://www.infradead.org/~tgr/libnl/") | |
991 | (synopsis "NetLink protocol library suite") | |
992 | (description | |
993 | "The libnl suite is a collection of libraries providing APIs to netlink | |
994 | protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly | |
995 | between the kernel and user space processes. It was designed to be a more | |
996 | flexible successor to ioctl to provide mainly networking related kernel | |
997 | configuration and monitoring interfaces.") | |
998 | ||
999 | ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like | |
1000 | ;; 'nl-addr-add.c'), so the result is GPLv2-only. | |
1001 | (license gpl2))) | |
023fef7d | 1002 | |
65cd77db MW |
1003 | (define-public iw |
1004 | (package | |
1005 | (name "iw") | |
1006 | (version "3.17") | |
1007 | (source (origin | |
1008 | (method url-fetch) | |
1009 | (uri (string-append | |
1010 | "https://www.kernel.org/pub/software/network/iw/iw-" | |
1011 | version ".tar.xz")) | |
1012 | (sha256 | |
1013 | (base32 | |
1014 | "14zsapqhivk0ws5z21y1ys2c2czi05mzk7bl2yb7qxcfrnsjx9j8")))) | |
1015 | (build-system gnu-build-system) | |
1016 | (native-inputs `(("pkg-config" ,pkg-config))) | |
1017 | (inputs `(("libnl" ,libnl))) | |
1018 | (arguments | |
1019 | `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) | |
1020 | "CC=gcc") | |
1021 | #:phases (alist-delete 'configure %standard-phases))) | |
1022 | (home-page "http://wireless.kernel.org/en/users/Documentation/iw") | |
1023 | (synopsis "Tool for configuring wireless devices") | |
1024 | (description | |
1025 | "iw is a new nl80211 based CLI configuration utility for wireless | |
1026 | devices. It replaces 'iwconfig', which is deprecated.") | |
1027 | (license isc))) | |
1028 | ||
023fef7d LC |
1029 | (define-public powertop |
1030 | (package | |
1031 | (name "powertop") | |
1032 | (version "2.5") | |
1033 | (source | |
1034 | (origin | |
1035 | (method url-fetch) | |
1036 | (uri (string-append | |
1037 | "https://01.org/powertop/sites/default/files/downloads/powertop-" | |
1038 | version ".tar.gz")) | |
1039 | (sha256 | |
1040 | (base32 | |
1041 | "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b")))) | |
1042 | (build-system gnu-build-system) | |
1043 | (inputs | |
1044 | ;; TODO: Add pciutils. | |
1045 | `(("zlib" ,guix:zlib) | |
023fef7d LC |
1046 | ;; ("pciutils" ,pciutils) |
1047 | ("ncurses" ,ncurses) | |
1048 | ("libnl" ,libnl))) | |
c4c4cc05 JD |
1049 | (native-inputs |
1050 | `(("pkg-config" ,pkg-config))) | |
023fef7d LC |
1051 | (home-page "https://01.org/powertop/") |
1052 | (synopsis "Analyze power consumption on Intel-based laptops") | |
1053 | (description | |
1054 | "PowerTOP is a Linux tool to diagnose issues with power consumption and | |
1055 | power management. In addition to being a diagnostic tool, PowerTOP also has | |
1056 | an interactive mode where the user can experiment various power management | |
1057 | settings for cases where the operating system has not enabled these | |
1058 | settings.") | |
1059 | (license gpl2))) | |
6869e5c9 LC |
1060 | |
1061 | (define-public aumix | |
1062 | (package | |
1063 | (name "aumix") | |
1064 | (version "2.9.1") | |
1065 | (source (origin | |
1066 | (method url-fetch) | |
1067 | (uri (string-append | |
1068 | "http://www.jpj.net/~trevor/aumix/releases/aumix-" | |
1069 | version ".tar.bz2")) | |
1070 | (sha256 | |
1071 | (base32 | |
1072 | "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj")))) | |
1073 | (build-system gnu-build-system) | |
1074 | (inputs `(("ncurses" ,ncurses))) | |
1075 | (home-page "http://www.jpj.net/~trevor/aumix.html") | |
1076 | (synopsis "Audio mixer for X and the console") | |
1077 | (description | |
1078 | "Aumix adjusts an audio mixer from X, the console, a terminal, | |
1079 | the command line or a script.") | |
1080 | (license gpl2+))) | |
7c0dbe78 SHT |
1081 | |
1082 | (define-public iotop | |
1083 | (package | |
1084 | (name "iotop") | |
1085 | (version "0.6") | |
1086 | (source | |
1087 | (origin | |
1088 | (method url-fetch) | |
1089 | (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-" | |
1090 | version ".tar.gz")) | |
1091 | (sha256 (base32 | |
1092 | "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s")))) | |
1093 | (build-system python-build-system) | |
1094 | (arguments | |
35cebf01 | 1095 | ;; The setup.py script expects python-2. |
7c0dbe78 | 1096 | `(#:python ,python-2 |
35cebf01 | 1097 | ;; There are currently no checks in the package. |
7c0dbe78 SHT |
1098 | #:tests? #f)) |
1099 | (native-inputs `(("python" ,python-2))) | |
1100 | (home-page "http://guichaz.free.fr/iotop/") | |
1101 | (synopsis | |
1102 | "Displays the IO activity of running processes") | |
1103 | (description | |
1104 | "Iotop is a Python program with a top like user interface to show the | |
1105 | processes currently causing I/O.") | |
35cebf01 | 1106 | (license gpl2+))) |
e30835e2 LC |
1107 | |
1108 | (define-public fuse | |
1109 | (package | |
1110 | (name "fuse") | |
1111 | (version "2.9.3") | |
1112 | (source (origin | |
1113 | (method url-fetch) | |
1114 | (uri (string-append "mirror://sourceforge/fuse/fuse-" | |
1115 | version ".tar.gz")) | |
1116 | (sha256 | |
1117 | (base32 | |
1118 | "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb")))) | |
1119 | (build-system gnu-build-system) | |
b148bd71 | 1120 | (inputs `(("util-linux" ,util-linux))) |
e30835e2 LC |
1121 | (arguments |
1122 | '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH=" | |
1123 | (assoc-ref %outputs "out") | |
1124 | "/sbin") | |
1125 | (string-append "INIT_D_PATH=" | |
1126 | (assoc-ref %outputs "out") | |
1127 | "/etc/init.d") | |
9a4efac9 LC |
1128 | |
1129 | ;; The rule makes /dev/fuse 666. | |
e30835e2 LC |
1130 | (string-append "UDEV_RULES_PATH=" |
1131 | (assoc-ref %outputs "out") | |
9a4efac9 | 1132 | "/lib/udev/rules.d")) |
b148bd71 LC |
1133 | #:phases (alist-cons-before |
1134 | 'build 'set-file-names | |
1135 | (lambda* (#:key inputs #:allow-other-keys) | |
1136 | ;; libfuse calls out to mount(8) and umount(8). Make sure | |
1137 | ;; it refers to the right ones. | |
1138 | (substitute* '("lib/mount_util.c" "util/mount_util.c") | |
1139 | (("/bin/(u?)mount" _ maybe-u) | |
1140 | (string-append (assoc-ref inputs "util-linux") | |
1141 | "/bin/" maybe-u "mount"))) | |
1142 | (substitute* '("util/mount.fuse.c") | |
1143 | (("/bin/sh") | |
bd663902 LC |
1144 | (which "sh"))) |
1145 | ||
1146 | ;; This hack leads libfuse to search for 'fusermount' in | |
1147 | ;; $PATH, where it may find a setuid-root binary, instead of | |
1148 | ;; trying solely $out/sbin/fusermount and failing because | |
1149 | ;; it's not setuid. | |
1150 | (substitute* "lib/Makefile" | |
1151 | (("-DFUSERMOUNT_DIR=[[:graph:]]+") | |
1152 | "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))) | |
b148bd71 | 1153 | %standard-phases))) |
e30835e2 LC |
1154 | (home-page "http://fuse.sourceforge.net/") |
1155 | (synopsis "Support file systems implemented in user space") | |
1156 | (description | |
1157 | "As a consequence of its monolithic design, file system code for Linux | |
1158 | normally goes into the kernel itself---which is not only a robustness issue, | |
1159 | but also an impediment to system extensibility. FUSE, for \"file systems in | |
1160 | user space\", is a kernel module and user-space library that tries to address | |
1161 | part of this problem by allowing users to run file system implementations as | |
1162 | user-space processes.") | |
1163 | (license (list lgpl2.1 ; library | |
1164 | gpl2+)))) ; command-line utilities | |
220193ad LC |
1165 | |
1166 | (define-public unionfs-fuse | |
1167 | (package | |
1168 | (name "unionfs-fuse") | |
1169 | (version "0.26") | |
1170 | (source (origin | |
1171 | (method url-fetch) | |
1172 | (uri (string-append | |
1173 | "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-" | |
1174 | version ".tar.xz")) | |
1175 | (sha256 | |
1176 | (base32 | |
1177 | "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d")))) | |
1178 | (build-system cmake-build-system) | |
1179 | (inputs `(("fuse" ,fuse))) | |
1180 | (arguments '(#:tests? #f)) ; no tests | |
1181 | (home-page "http://podgorny.cz/moin/UnionFsFuse") | |
1182 | (synopsis "User-space union file system") | |
1183 | (description | |
1184 | "UnionFS-FUSE is a flexible union file system implementation in user | |
1185 | space, using the FUSE library. Mounting a union file system allows you to | |
1186 | \"aggregate\" the contents of several directories into a single mount point. | |
1187 | UnionFS-FUSE additionally supports copy-on-write.") | |
1188 | (license bsd-3))) | |
ed748588 | 1189 | |
0b7a0c20 LC |
1190 | (define fuse-static |
1191 | (package (inherit fuse) | |
1192 | (name "fuse-static") | |
1193 | (source (origin (inherit (package-source fuse)) | |
1194 | (modules '((guix build utils))) | |
1195 | (snippet | |
1196 | ;; Normally libfuse invokes mount(8) so that /etc/mtab is | |
1197 | ;; updated. Change calls to 'mtab_needs_update' to 0 so that | |
1198 | ;; it doesn't do that, allowing us to remove the dependency on | |
1199 | ;; util-linux (something that is useful in initrds.) | |
1200 | '(substitute* '("lib/mount_util.c" | |
1201 | "util/mount_util.c") | |
1202 | (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") | |
1203 | "0") | |
1204 | (("/bin/") | |
1205 | ""))))))) | |
1206 | ||
ed748588 LC |
1207 | (define-public unionfs-fuse/static |
1208 | (package (inherit unionfs-fuse) | |
1209 | (synopsis "User-space union file system (statically linked)") | |
1210 | (name (string-append (package-name unionfs-fuse) "-static")) | |
1211 | (source (origin (inherit (package-source unionfs-fuse)) | |
1212 | (modules '((guix build utils))) | |
1213 | (snippet | |
1214 | ;; Add -ldl to the libraries, because libfuse.a needs that. | |
1215 | '(substitute* "src/CMakeLists.txt" | |
1216 | (("target_link_libraries(.*)\\)" _ libs) | |
1217 | (string-append "target_link_libraries" | |
1218 | libs " dl)")))))) | |
1219 | (arguments | |
1220 | '(#:tests? #f | |
1456cff1 LC |
1221 | #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static") |
1222 | #:phases (alist-cons-after | |
1223 | 'install 'post-install | |
1224 | (lambda* (#:key outputs #:allow-other-keys) | |
1225 | (let* ((out (assoc-ref outputs "out")) | |
1226 | (exe (string-append out "/bin/unionfs"))) | |
1227 | ;; By default, 'unionfs' keeps references to | |
1228 | ;; $glibc/share/locale and similar stuff. Remove them. | |
1229 | (remove-store-references exe))) | |
1230 | %standard-phases))) | |
0b7a0c20 | 1231 | (inputs `(("fuse" ,fuse-static))))) |
67b66003 | 1232 | |
db288efa LC |
1233 | (define-public sshfs-fuse |
1234 | (package | |
1235 | (name "sshfs-fuse") | |
1236 | (version "2.5") | |
1237 | (source (origin | |
1238 | (method url-fetch) | |
1239 | (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-" | |
1240 | version ".tar.gz")) | |
1241 | (sha256 | |
1242 | (base32 | |
1243 | "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9")))) | |
1244 | (build-system gnu-build-system) | |
1245 | (inputs | |
1246 | `(("fuse" ,fuse) | |
1247 | ("glib" ,glib))) | |
1248 | (native-inputs | |
1249 | `(("pkg-config" ,pkg-config))) | |
1250 | (home-page "http://fuse.sourceforge.net/sshfs.html") | |
1251 | (synopsis "Mount remote file systems over SSH") | |
1252 | (description | |
1253 | "This is a file system client based on the SSH File Transfer Protocol. | |
1254 | Since most SSH servers already support this protocol it is very easy to set | |
1255 | up: on the server side there's nothing to do; on the client side mounting the | |
1256 | file system is as easy as logging into the server with an SSH client.") | |
1257 | (license gpl2+))) | |
1258 | ||
67b66003 LC |
1259 | (define-public numactl |
1260 | (package | |
1261 | (name "numactl") | |
1262 | (version "2.0.9") | |
1263 | (source (origin | |
1264 | (method url-fetch) | |
1265 | (uri (string-append | |
1266 | "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-" | |
1267 | version | |
1268 | ".tar.gz")) | |
1269 | (sha256 | |
1270 | (base32 | |
1271 | "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w")))) | |
1272 | (build-system gnu-build-system) | |
1273 | (arguments | |
1274 | '(#:phases (alist-replace | |
1275 | 'configure | |
1276 | (lambda* (#:key outputs #:allow-other-keys) | |
1277 | ;; There's no 'configure' script, just a raw makefile. | |
1278 | (substitute* "Makefile" | |
1279 | (("^prefix := .*$") | |
1280 | (string-append "prefix := " (assoc-ref outputs "out") | |
1281 | "\n")) | |
1282 | (("^libdir := .*$") | |
1283 | ;; By default the thing tries to install under | |
1284 | ;; $prefix/lib64 when on a 64-bit platform. | |
1285 | (string-append "libdir := $(prefix)/lib\n")))) | |
1286 | %standard-phases) | |
1287 | ||
1288 | #:make-flags (list | |
1289 | ;; By default the thing tries to use 'cc'. | |
1290 | "CC=gcc" | |
1291 | ||
1292 | ;; Make sure programs have an RPATH so they can find | |
1293 | ;; libnuma.so. | |
1294 | (string-append "LDLIBS=-Wl,-rpath=" | |
1295 | (assoc-ref %outputs "out") "/lib")) | |
1296 | ||
1297 | ;; There's a 'test' target, but it requires NUMA support in the kernel | |
1298 | ;; to run, which we can't assume to have. | |
1299 | #:tests? #f)) | |
1300 | (home-page "http://oss.sgi.com/projects/libnuma/") | |
1301 | (synopsis "Tools for non-uniform memory access (NUMA) machines") | |
1302 | (description | |
1303 | "NUMA stands for Non-Uniform Memory Access, in other words a system whose | |
1304 | memory is not all in one place. The numactl program allows you to run your | |
1305 | application program on specific CPU's and memory nodes. It does this by | |
1306 | supplying a NUMA memory policy to the operating system before running your | |
1307 | program. | |
1308 | ||
1309 | The package contains other commands, such as numademo, numastat and memhog. | |
1310 | The numademo command provides a quick overview of NUMA performance on your | |
1311 | system.") | |
1312 | (license (list gpl2 ; programs | |
1313 | lgpl2.1)))) ; library | |
b10e9ff6 LC |
1314 | |
1315 | (define-public kbd | |
1316 | (package | |
1317 | (name "kbd") | |
1318 | (version "2.0.1") | |
1319 | (source (origin | |
1320 | (method url-fetch) | |
1321 | (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-" | |
1322 | version ".tar.gz")) | |
1323 | (sha256 | |
1324 | (base32 | |
c8f60748 LC |
1325 | "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm")) |
1326 | (modules '((guix build utils))) | |
1327 | (snippet | |
f2cdcafb LC |
1328 | '(begin |
1329 | (substitute* "tests/Makefile.in" | |
1330 | ;; The '%: %.in' rule incorrectly uses @VERSION@. | |
1331 | (("@VERSION@") | |
1332 | "[@]VERSION[@]")) | |
1333 | (substitute* '("src/unicode_start" "src/unicode_stop") | |
1334 | ;; Assume the Coreutils are in $PATH. | |
1335 | (("/usr/bin/tty") | |
1336 | "tty")))))) | |
b10e9ff6 LC |
1337 | (build-system gnu-build-system) |
1338 | (arguments | |
1339 | '(#:phases (alist-cons-before | |
1340 | 'build 'pre-build | |
1341 | (lambda* (#:key inputs #:allow-other-keys) | |
1342 | (let ((gzip (assoc-ref %build-inputs "gzip")) | |
1343 | (bzip2 (assoc-ref %build-inputs "bzip2"))) | |
1344 | (substitute* "src/libkeymap/findfile.c" | |
1345 | (("gzip") | |
1346 | (string-append gzip "/bin/gzip")) | |
1347 | (("bzip2") | |
1348 | (string-append bzip2 "/bin/bzip2"))))) | |
f2cdcafb LC |
1349 | (alist-cons-after |
1350 | 'install 'post-install | |
1351 | (lambda* (#:key outputs #:allow-other-keys) | |
1352 | ;; Make sure these programs find their comrades. | |
1353 | (let* ((out (assoc-ref outputs "out")) | |
1354 | (bin (string-append out "/bin"))) | |
1355 | (for-each (lambda (prog) | |
1356 | (wrap-program (string-append bin "/" prog) | |
1357 | `("PATH" ":" prefix (,bin)))) | |
1358 | '("unicode_start" "unicode_stop")))) | |
1359 | %standard-phases)))) | |
b10e9ff6 LC |
1360 | (inputs `(("check" ,check) |
1361 | ("gzip" ,guix:gzip) | |
1362 | ("bzip2" ,guix:bzip2) | |
1363 | ("pam" ,linux-pam))) | |
1364 | (native-inputs `(("pkg-config" ,pkg-config))) | |
1365 | (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/") | |
1366 | (synopsis "Linux keyboard utilities and keyboard maps") | |
1367 | (description | |
1368 | "This package contains keytable files and keyboard utilities compatible | |
1369 | for systems using the Linux kernel. This includes commands such as | |
1370 | 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.") | |
1371 | (license gpl2+))) | |
de0b620e LC |
1372 | |
1373 | (define-public inotify-tools | |
1374 | (package | |
1375 | (name "inotify-tools") | |
1376 | (version "3.13") | |
1377 | (source (origin | |
1378 | (method url-fetch) | |
1379 | (uri (string-append | |
1380 | "mirror://sourceforge/inotify-tools/inotify-tools/" | |
1381 | version "/inotify-tools-" version ".tar.gz")) | |
1382 | (sha256 | |
1383 | (base32 | |
1384 | "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6")))) | |
1385 | (build-system gnu-build-system) | |
1386 | (home-page "http://inotify-tools.sourceforge.net/") | |
1387 | (synopsis "Monitor file accesses") | |
1388 | (description | |
1389 | "The inotify-tools packages provides a C library and command-line tools | |
1390 | to use Linux' inotify mechanism, which allows file accesses to be monitored.") | |
1391 | (license gpl2+))) | |
e062d542 AE |
1392 | |
1393 | (define-public kmod | |
1394 | (package | |
1395 | (name "kmod") | |
1396 | (version "17") | |
1397 | (source (origin | |
1398 | (method url-fetch) | |
1399 | (uri | |
1400 | (string-append "mirror://kernel.org/linux/utils/kernel/kmod/" | |
1401 | "kmod-" version ".tar.xz")) | |
1402 | (sha256 | |
1403 | (base32 | |
528b6a3d LC |
1404 | "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv")) |
1405 | (patches (list (search-patch "kmod-module-directory.patch"))))) | |
e062d542 AE |
1406 | (build-system gnu-build-system) |
1407 | (native-inputs | |
1408 | `(("pkg-config" ,pkg-config))) | |
1409 | (inputs | |
1410 | `(("xz" ,guix:xz) | |
1411 | ("zlib" ,guix:zlib))) | |
1412 | (arguments | |
1413 | `(#:tests? #f ; FIXME: Investigate test failures | |
4a8b4c25 LC |
1414 | #:configure-flags '("--with-xz" "--with-zlib") |
1415 | #:phases (alist-cons-after | |
1416 | 'install 'install-modprobe&co | |
1417 | (lambda* (#:key outputs #:allow-other-keys) | |
1418 | (let* ((out (assoc-ref outputs "out")) | |
1419 | (bin (string-append out "/bin"))) | |
1420 | (for-each (lambda (tool) | |
1421 | (symlink "kmod" | |
1422 | (string-append bin "/" tool))) | |
1423 | '("insmod" "rmmod" "lsmod" "modprobe" | |
1424 | "modinfo" "depmod")))) | |
1425 | %standard-phases))) | |
e062d542 AE |
1426 | (home-page "https://www.kernel.org/") |
1427 | (synopsis "Kernel module tools") | |
35b9e423 | 1428 | (description "Kmod is a set of tools to handle common tasks with Linux |
e062d542 AE |
1429 | kernel modules like insert, remove, list, check properties, resolve |
1430 | dependencies and aliases. | |
1431 | ||
1432 | These tools are designed on top of libkmod, a library that is shipped with | |
1433 | kmod. The aim is to be compatible with tools, configurations and indices | |
1434 | from the module-init-tools project.") | |
1435 | (license gpl2+))) ; library under lgpl2.1+ | |
d7d42d6b | 1436 | |
7fa715e7 LC |
1437 | (define-public eudev |
1438 | ;; The post-systemd fork, maintained by Gentoo. | |
fe32c7f7 | 1439 | (package |
7fa715e7 | 1440 | (name "eudev") |
b6e5e1b7 | 1441 | (version "2.1.1") |
7fa715e7 LC |
1442 | (source (origin |
1443 | (method url-fetch) | |
1444 | (uri (string-append | |
1445 | "http://dev.gentoo.org/~blueness/eudev/eudev-" | |
1446 | version ".tar.gz")) | |
1447 | (sha256 | |
1448 | (base32 | |
b6e5e1b7 | 1449 | "0shf5vqiz9fdxl95aa1a8vh0xjxwim3psc39wr2xr8lnahf11vva")) |
eb564fc3 LC |
1450 | (patches (list (search-patch "eudev-rules-directory.patch"))) |
1451 | (modules '((guix build utils))) | |
1452 | (snippet | |
1453 | ;; 'configure' checks uses <linux/btrfs.h> as an indication of | |
1454 | ;; whether Linux headers are available, but it doesn't actually | |
1455 | ;; use it, and our 'linux-libre-headers' package doesn't | |
1456 | ;; provide it. So just remove that. | |
1457 | '(substitute* "configure" | |
1458 | (("linux/btrfs\\.h") | |
1459 | ""))))) | |
fe32c7f7 MW |
1460 | (build-system gnu-build-system) |
1461 | (native-inputs | |
1462 | `(("pkg-config" ,pkg-config) | |
1463 | ("gperf" ,gperf) | |
1464 | ("glib" ,glib "bin") ; glib-genmarshal, etc. | |
1465 | ("perl" ,perl) ; for the tests | |
1466 | ("python" ,python-2))) ; ditto | |
1467 | (inputs | |
1468 | `(("kmod" ,kmod) | |
1469 | ("pciutils" ,pciutils) | |
1470 | ("usbutils" ,usbutils) | |
1471 | ("util-linux" ,util-linux) | |
1472 | ("glib" ,glib) | |
1473 | ("gobject-introspection" ,gobject-introspection))) | |
dc2d59af | 1474 | (arguments |
fe32c7f7 MW |
1475 | `(#:configure-flags (list "--enable-libkmod" |
1476 | ||
1477 | (string-append | |
1478 | "--with-pci-ids-path=" | |
1479 | (assoc-ref %build-inputs "pciutils") | |
1480 | "/share/pci.ids.gz") | |
1481 | ||
1482 | "--with-firmware-path=/no/firmware" | |
1483 | ||
1484 | ;; Work around undefined reference to | |
1485 | ;; 'mq_getattr' in sc-daemon.c. | |
31aa4379 FB |
1486 | "LDFLAGS=-lrt") |
1487 | #:phases | |
1488 | (alist-cons-before | |
1489 | 'build 'pre-build | |
1490 | ;; The program 'g-ir-scanner' (part of the package | |
1491 | ;; 'gobject-introspection'), to generate .gir files, makes some | |
1492 | ;; library pre-processing. During that phase it looks for the C | |
1493 | ;; compiler as either 'cc' or as defined by the environment variable | |
1494 | ;; 'CC' (with code in 'giscanner/dumper.py'). | |
1495 | (lambda* _ | |
1496 | (setenv "CC" "gcc")) | |
1497 | %standard-phases))) | |
fe32c7f7 MW |
1498 | (home-page "http://www.gentoo.org/proj/en/eudev/") |
1499 | (synopsis "Userspace device management") | |
1500 | (description "Udev is a daemon which dynamically creates and removes | |
1501 | device nodes from /dev/, handles hotplug events and loads drivers at boot | |
1502 | time.") | |
1503 | (license gpl2+))) | |
7fa715e7 | 1504 | |
66269d47 LC |
1505 | (define-public lvm2 |
1506 | (package | |
1507 | (name "lvm2") | |
1508 | (version "2.02.109") | |
1509 | (source (origin | |
1510 | (method url-fetch) | |
1511 | (uri (string-append "ftp://sources.redhat.com/pub/lvm2/releases/LVM2." | |
1512 | version ".tgz")) | |
1513 | (sha256 | |
1514 | (base32 | |
1515 | "1rv5ivg0l1w3nwzwdkqixm96h5bzg7ib4rr196ysb2lw42jmpjbv")) | |
1516 | (modules '((guix build utils))) | |
1517 | (snippet | |
1518 | '(begin | |
1519 | (use-modules (guix build utils)) | |
1520 | ||
1521 | ;; Honor sysconfdir. | |
1522 | (substitute* "make.tmpl.in" | |
1523 | (("confdir = .*$") | |
1524 | "confdir = @sysconfdir@\n") | |
1525 | (("DEFAULT_SYS_DIR = @DEFAULT_SYS_DIR@") | |
1526 | "DEFAULT_SYS_DIR = @sysconfdir@")))))) | |
1527 | (build-system gnu-build-system) | |
1528 | (native-inputs | |
1529 | `(("pkg-config" ,pkg-config) | |
1530 | ("procps" ,procps))) ;tests use 'pgrep' | |
1531 | (inputs | |
8fcaf8b1 | 1532 | `(("udev" ,eudev))) |
66269d47 LC |
1533 | (arguments |
1534 | '(#:phases (alist-cons-after | |
1535 | 'configure 'set-makefile-shell | |
1536 | (lambda _ | |
1537 | ;; Use 'sh', not 'bash', so that '. lib/utils.sh' works as | |
1538 | ;; expected. | |
1539 | (setenv "SHELL" (which "sh")) | |
1540 | ||
1541 | ;; Replace /bin/sh with the right file name. | |
1542 | (patch-makefile-SHELL "make.tmpl")) | |
1543 | %standard-phases) | |
1544 | ||
1545 | #:configure-flags (list (string-append "--sysconfdir=" | |
1546 | (assoc-ref %outputs "out") | |
1547 | "/etc/lvm") | |
1548 | "--enable-udev_sync" | |
f2817d43 LC |
1549 | "--enable-udev_rules" |
1550 | ||
1551 | ;; Make sure programs such as 'dmsetup' can | |
1552 | ;; find libdevmapper.so. | |
1553 | (string-append "LDFLAGS=-Wl,-rpath=" | |
1554 | (assoc-ref %outputs "out") | |
1555 | "/lib")) | |
66269d47 LC |
1556 | |
1557 | ;; The tests use 'mknod', which requires root access. | |
1558 | #:tests? #f)) | |
1559 | (home-page "http://sourceware.org/lvm2/") | |
1560 | (synopsis "Logical volume management for Linux") | |
1561 | (description | |
1562 | "LVM2 is the logical volume management tool set for Linux-based systems. | |
1563 | This package includes the user-space libraries and tools, including the device | |
1564 | mapper. Kernel components are part of Linux-libre.") | |
1565 | ||
1566 | ;; Libraries (liblvm2, libdevmapper) are LGPLv2.1. | |
1567 | ;; Command-line tools are GPLv2. | |
1568 | (license (list gpl2 lgpl2.1)))) | |
1569 | ||
000f7559 DT |
1570 | (define-public wireless-tools |
1571 | (package | |
1572 | (name "wireless-tools") | |
1573 | (version "30.pre9") | |
1574 | (source (origin | |
1575 | (method url-fetch) | |
1576 | (uri (string-append "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/wireless_tools." | |
1577 | version ".tar.gz")) | |
1578 | (sha256 | |
1579 | (base32 | |
ec01f22d SB |
1580 | "0qscyd44jmhs4k32ggp107hlym1pcyjzihiai48xs7xzib4wbndb")) |
1581 | (modules '((guix build utils))) | |
1582 | (snippet | |
1583 | ;; Install the manual pages in the right place. | |
1584 | '(substitute* "Makefile" | |
1585 | (("INSTALL_MAN= .*") | |
1586 | "INSTALL_MAN= $(PREFIX)/share/man"))))) | |
000f7559 DT |
1587 | (build-system gnu-build-system) |
1588 | (arguments | |
1589 | `(#:phases (alist-replace | |
1590 | 'configure | |
1591 | (lambda* (#:key outputs #:allow-other-keys) | |
1592 | (setenv "PREFIX" (assoc-ref outputs "out"))) | |
1593 | %standard-phases) | |
1594 | #:tests? #f)) | |
1595 | (synopsis "Tools for manipulating Linux Wireless Extensions") | |
fb9b7ce2 LC |
1596 | (description "Wireless Tools are used to manipulate the now-deprecated |
1597 | Linux Wireless Extensions; consider using 'iw' instead. The Wireless | |
1598 | Extension was an interface allowing you to set Wireless LAN specific | |
1599 | parameters and get the specific stats. It is deprecated in favor the nl80211 | |
1600 | interface.") | |
000f7559 DT |
1601 | (home-page "http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html") |
1602 | (license gpl2+))) | |
30016044 MW |
1603 | |
1604 | (define-public lm-sensors | |
1605 | (package | |
1606 | (name "lm-sensors") | |
1607 | (version "3.3.5") | |
1608 | (source (origin | |
1609 | (method url-fetch) | |
1610 | (uri (string-append | |
1611 | "http://dl.lm-sensors.org/lm-sensors/releases/lm_sensors-" | |
1612 | version ".tar.bz2")) | |
1613 | (sha256 | |
1614 | (base32 | |
1615 | "1ksgrynxgrq590nb2fwxrl1gwzisjkqlyg3ljfd1al0ibrk6mbjx")) | |
1616 | (patches (list (search-patch "lm-sensors-hwmon-attrs.patch"))))) | |
1617 | (build-system gnu-build-system) | |
1618 | (inputs `(("rrdtool" ,rrdtool) | |
1619 | ("perl" ,perl) | |
1620 | ("kmod" ,kmod) | |
1621 | ("gnuplot" ,gnuplot))) | |
1622 | (native-inputs `(("pkg-config" ,pkg-config) | |
1623 | ("flex" ,flex) | |
1624 | ("bison" ,bison) | |
1625 | ("which" ,which))) | |
1626 | (arguments | |
1627 | `(#:tests? #f ; no 'check' target | |
1628 | #:make-flags (list (string-append "PREFIX=" %output) | |
1629 | (string-append "ETCDIR=" %output "/etc") | |
1630 | (string-append "MANDIR=" %output "/share/man")) | |
1631 | #:phases | |
1632 | (alist-delete | |
1633 | 'configure | |
1634 | (alist-cons-before | |
1635 | 'build 'patch-exec-paths | |
1636 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1637 | (substitute* "prog/detect/sensors-detect" | |
1638 | (("`uname") | |
1639 | (string-append "`" (assoc-ref inputs "coreutils") | |
1640 | "/bin/uname")) | |
1641 | (("(`|\")modprobe" all open-quote) | |
1642 | (string-append open-quote | |
1643 | (assoc-ref inputs "kmod") | |
1644 | "/bin/modprobe"))) | |
1645 | (substitute* '("prog/pwm/pwmconfig" | |
1646 | "prog/pwm/fancontrol") | |
1647 | (("gnuplot") | |
1648 | (string-append (assoc-ref inputs "gnuplot") | |
1649 | "/bin/gnuplot")) | |
1650 | (("cat ") | |
1651 | (string-append (assoc-ref inputs "coreutils") | |
1652 | "/bin/cat ")) | |
1653 | (("egrep ") | |
1654 | (string-append (assoc-ref inputs "grep") | |
1655 | "/bin/egrep ")) | |
1656 | (("sed -e") | |
1657 | (string-append (assoc-ref inputs "sed") | |
1658 | "/bin/sed -e")) | |
1659 | (("cut -d") | |
1660 | (string-append (assoc-ref inputs "coreutils") | |
1661 | "/bin/cut -d")) | |
1662 | (("sleep ") | |
1663 | (string-append (assoc-ref inputs "coreutils") | |
1664 | "/bin/sleep ")) | |
1665 | (("readlink -f") | |
1666 | (string-append (assoc-ref inputs "coreutils") | |
1667 | "/bin/readlink -f")))) | |
1668 | %standard-phases)))) | |
1669 | (home-page "http://www.lm-sensors.org/") | |
1670 | (synopsis "Utilities to read temperature/voltage/fan sensors") | |
1671 | (description | |
35b9e423 | 1672 | "Lm-sensors is a hardware health monitoring package for Linux. It allows |
30016044 MW |
1673 | you to access information from temperature, voltage, and fan speed sensors. |
1674 | It works with most newer systems.") | |
1675 | (license gpl2+))) | |
b087d413 MW |
1676 | |
1677 | (define-public xsensors | |
1678 | (package | |
1679 | (name "xsensors") | |
1680 | (version "0.70") | |
1681 | (source (origin | |
1682 | (method url-fetch) | |
1683 | (uri (string-append | |
1684 | "http://www.linuxhardware.org/xsensors/xsensors-" | |
1685 | version ".tar.gz")) | |
1686 | (sha256 | |
1687 | (base32 | |
1688 | "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh")))) | |
1689 | (build-system gnu-build-system) | |
1690 | (inputs `(("lm-sensors" ,lm-sensors) | |
1691 | ("gtk" ,gtk+-2))) | |
1692 | (native-inputs `(("pkg-config" ,pkg-config))) | |
1693 | (arguments | |
1694 | `(#:phases (alist-cons-before | |
1695 | 'configure 'enable-deprecated | |
1696 | (lambda _ | |
1697 | (substitute* "src/Makefile.in" | |
1698 | (("-DGDK_DISABLE_DEPRECATED") "") | |
1699 | (("-DGTK_DISABLE_DEPRECATED") ""))) | |
1700 | (alist-cons-before | |
1701 | 'configure 'remove-Werror | |
1702 | (lambda _ | |
1703 | (substitute* '("configure" "src/Makefile.in") | |
1704 | (("-Werror") ""))) | |
1705 | %standard-phases)))) | |
1706 | (home-page "http://www.linuxhardware.org/xsensors/") | |
1707 | (synopsis "Hardware health information viewer") | |
1708 | (description | |
35b9e423 | 1709 | "Xsensors reads data from the libsensors library regarding hardware |
b087d413 MW |
1710 | health such as temperature, voltage and fan speed and displays the information |
1711 | in a digital read-out.") | |
1712 | (license gpl2+))) | |
b62fe07f LC |
1713 | |
1714 | (define-public perf | |
1715 | (package | |
1716 | (name "perf") | |
1717 | (version (package-version linux-libre)) | |
1718 | (source (package-source linux-libre)) | |
1719 | (build-system gnu-build-system) | |
1720 | (arguments | |
1721 | '(#:phases (alist-replace | |
1722 | 'configure | |
1723 | (lambda* (#:key inputs #:allow-other-keys) | |
1724 | (setenv "SHELL_PATH" (which "bash")) | |
1725 | (chdir "tools/perf")) | |
1726 | %standard-phases) | |
1727 | #:make-flags (list (string-append "DESTDIR=" | |
1728 | (assoc-ref %outputs "out")) | |
2af29d23 LC |
1729 | "WERROR=0" |
1730 | ||
1731 | ;; By default, 'config/Makefile' uses lib64 on | |
1732 | ;; x86_64. Work around that. | |
1733 | "lib=lib") | |
b62fe07f LC |
1734 | #:tests? #f)) ;no tests |
1735 | (native-inputs | |
1736 | `(("pkg-config" ,pkg-config) | |
1737 | ("bison" ,bison) | |
1738 | ("flex" ,flex) | |
1739 | ||
1740 | ;; There are build scripts written in these languages. | |
1741 | ("perl" ,perl) | |
1742 | ("python" ,python-2))) | |
1743 | (inputs | |
b1fb4b23 | 1744 | `(("slang" ,slang) ;for the interactive TUI |
b62fe07f | 1745 | ;; ("newt" ,newt) |
6c030d10 | 1746 | ("python" ,python-2) ;'perf' links against libpython |
b62fe07f LC |
1747 | ("elfutils" ,elfutils) |
1748 | ||
d7ece67a LC |
1749 | ;; Documentation. |
1750 | ("libxml2" ,libxml2) ;for $XML_CATALOG_FILES | |
1751 | ("libxslt" ,libxslt) | |
1752 | ("docbook-xml" ,docbook-xml) | |
1753 | ("docbook-xsl" ,docbook-xsl) | |
1754 | ("xmlto" ,xmlto) | |
1755 | ("asciidoc" ,asciidoc))) | |
b62fe07f LC |
1756 | (home-page "https://perf.wiki.kernel.org/") |
1757 | (synopsis "Linux profiling with performance counters") | |
1758 | (description | |
1759 | "perf is a tool suite for profiling using hardware performance counters, | |
1760 | with support in the Linux kernel. perf can instrument CPU performance | |
1761 | counters, tracepoints, kprobes, and uprobes (dynamic tracing). It is capable | |
1762 | of lightweight profiling. This package contains the user-land tools and in | |
1763 | particular the 'perf' command.") | |
1764 | (license (package-license linux-libre)))) | |
c09e60e4 DT |
1765 | |
1766 | (define-public pflask | |
1767 | (package | |
1768 | (name "pflask") | |
1769 | (version "0.2") | |
1770 | (source (origin | |
1771 | (method url-fetch) | |
1772 | (uri (string-append "https://github.com/ghedo/pflask/archive/v" | |
1773 | version ".tar.gz")) | |
1774 | (sha256 | |
1775 | (base32 | |
1776 | "1g8fjj67dfkc2s0852l9vqi1pm61gp4rxbpzbzg780f5s5hd1fys")))) | |
1777 | (build-system cmake-build-system) | |
1778 | (arguments | |
1779 | '(#:tests? #f)) ; no tests | |
1780 | (home-page "http://ghedo.github.io/pflask/") | |
1781 | (synopsis "Simple tool for creating Linux namespace containers") | |
1782 | (description "pflask is a simple tool for creating Linux namespace | |
1783 | containers. It can be used for running a command or even booting an OS inside | |
1784 | an isolated container, created with the help of Linux namespaces. It is | |
1785 | similar in functionality to chroot, although pflask provides better isolation | |
1786 | thanks to the use of namespaces.") | |
1787 | (license bsd-2))) | |
288084d5 MW |
1788 | |
1789 | (define-public hdparm | |
1790 | (package | |
1791 | (name "hdparm") | |
1792 | (version "9.45") | |
1793 | (source (origin | |
1794 | (method url-fetch) | |
1795 | (uri (string-append "mirror://sourceforge/" name "/" | |
1796 | name "-" version ".tar.gz")) | |
1797 | (sha256 | |
1798 | (base32 | |
1799 | "0sc6yf3k6sd7n6a2ig2my9fjlqpak3znlyw7jw4cz5d9asm1rc13")))) | |
1800 | (build-system gnu-build-system) | |
1801 | (arguments | |
1802 | `(#:make-flags (let ((out (assoc-ref %outputs "out"))) | |
1803 | (list (string-append "binprefix=" out) | |
1804 | (string-append "manprefix=" out) | |
1805 | "CC=gcc")) | |
1806 | #:phases (alist-delete 'configure %standard-phases) | |
1807 | #:tests? #f)) ; no test suite | |
1808 | (home-page "http://sourceforge.net/projects/hdparm/") | |
1809 | (synopsis "tune hard disk parameters for high performance") | |
1810 | (description | |
1811 | "Get/set device parameters for Linux SATA/IDE drives. It's primary use | |
1812 | is for enabling irq-unmasking and IDE multiplemode.") | |
1813 | (license (bsd-style "file://LICENSE.TXT")))) | |
1814 |