Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
6869e5c9 | 2 | ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org> |
e062d542 | 3 | ;;; Copyright © 2014 Andreas Enge <andreas@enge.fr> |
233e7676 | 4 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> |
0d55c356 | 5 | ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org> |
fd76c904 | 6 | ;;; |
233e7676 | 7 | ;;; This file is part of GNU Guix. |
fd76c904 | 8 | ;;; |
233e7676 | 9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
fd76c904 LC |
10 | ;;; under the terms of the GNU General Public License as published by |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
233e7676 | 14 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
fd76c904 LC |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
fd76c904 | 21 | |
1ffa7090 | 22 | (define-module (gnu packages linux) |
023fef7d LC |
23 | #:use-module ((guix licenses) |
24 | #:hide (zlib)) | |
59a43334 | 25 | #:use-module (gnu packages) |
1ffa7090 | 26 | #:use-module ((gnu packages compression) |
4a44e743 | 27 | #:renamer (symbol-prefix-proc 'guix:)) |
1ffa7090 | 28 | #:use-module (gnu packages flex) |
90a0048f | 29 | #:use-module (gnu packages bison) |
d7d42d6b | 30 | #:use-module (gnu packages gperf) |
1ffa7090 LC |
31 | #:use-module (gnu packages libusb) |
32 | #:use-module (gnu packages ncurses) | |
d7d42d6b | 33 | #:use-module (gnu packages pciutils) |
90a0048f | 34 | #:use-module (gnu packages bdb) |
1ffa7090 LC |
35 | #:use-module (gnu packages perl) |
36 | #:use-module (gnu packages pkg-config) | |
7c0dbe78 | 37 | #:use-module (gnu packages python) |
e7b38500 | 38 | #:use-module (gnu packages algebra) |
1dba6407 | 39 | #:use-module (gnu packages gettext) |
db288efa | 40 | #:use-module (gnu packages glib) |
17b293a0 | 41 | #:use-module (gnu packages pulseaudio) |
c762e82e | 42 | #:use-module (gnu packages attr) |
17b293a0 | 43 | #:use-module (gnu packages xml) |
215b6431 | 44 | #:use-module (gnu packages autotools) |
f57d2639 | 45 | #:use-module (gnu packages texinfo) |
b10e9ff6 | 46 | #:use-module (gnu packages check) |
02b80c3f NK |
47 | #:use-module (guix packages) |
48 | #:use-module (guix download) | |
7c0dbe78 | 49 | #:use-module (guix build-system gnu) |
220193ad | 50 | #:use-module (guix build-system cmake) |
e102f940 LC |
51 | #:use-module (guix build-system python) |
52 | #:use-module (guix build-system trivial)) | |
fd76c904 | 53 | |
aaf4cb20 LC |
54 | (define-public (system->linux-architecture arch) |
55 | "Return the Linux architecture name for ARCH, a Guix system name such as | |
56 | \"x86_64-linux\"." | |
618cea69 NK |
57 | (let ((arch (car (string-split arch #\-)))) |
58 | (cond ((string=? arch "i686") "i386") | |
59 | ((string-prefix? "mips" arch) "mips") | |
aaf4cb20 | 60 | ((string-prefix? "arm" arch) "arm") |
618cea69 NK |
61 | (else arch)))) |
62 | ||
6023cc74 LC |
63 | (define (linux-libre-urls version) |
64 | "Return a list of URLs for Linux-Libre VERSION." | |
65 | (list (string-append | |
66 | "http://linux-libre.fsfla.org/pub/linux-libre/releases/" | |
67 | version "-gnu/linux-libre-" version "-gnu.tar.xz") | |
68 | ||
69 | ;; XXX: Work around <http://bugs.gnu.org/14851>. | |
70 | (string-append | |
71 | "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-" | |
72 | version "-gnu.tar.xz") | |
73 | ||
74 | ;; Maybe this URL will become valid eventually. | |
75 | (string-append | |
76 | "mirror://gnu/linux-libre/" version "-gnu/linux-libre-" | |
77 | version "-gnu.tar.xz"))) | |
78 | ||
80fe5c60 | 79 | (define-public linux-libre-headers |
dfb52abb | 80 | (let* ((version "3.3.8") |
80fe5c60 | 81 | (build-phase |
618cea69 NK |
82 | (lambda (arch) |
83 | `(lambda _ | |
84 | (setenv "ARCH" ,(system->linux-architecture arch)) | |
85 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")) | |
45298f8f | 86 | |
618cea69 NK |
87 | (and (zero? (system* "make" "defconfig")) |
88 | (zero? (system* "make" "mrproper" "headers_check")))))) | |
80fe5c60 LC |
89 | (install-phase |
90 | `(lambda* (#:key outputs #:allow-other-keys) | |
91 | (let ((out (assoc-ref outputs "out"))) | |
92 | (and (zero? (system* "make" | |
93 | (string-append "INSTALL_HDR_PATH=" out) | |
94 | "headers_install")) | |
95 | (mkdir (string-append out "/include/config")) | |
96 | (call-with-output-file | |
97 | (string-append out | |
98 | "/include/config/kernel.release") | |
99 | (lambda (p) | |
dfb52abb | 100 | (format p "~a-default~%" ,version)))))))) |
80fe5c60 LC |
101 | (package |
102 | (name "linux-libre-headers") | |
dfb52abb | 103 | (version version) |
80fe5c60 LC |
104 | (source (origin |
105 | (method url-fetch) | |
6023cc74 | 106 | (uri (linux-libre-urls version)) |
80fe5c60 LC |
107 | (sha256 |
108 | (base32 | |
109 | "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl")))) | |
110 | (build-system gnu-build-system) | |
111 | (native-inputs `(("perl" ,perl))) | |
112 | (arguments | |
113 | `(#:modules ((guix build gnu-build-system) | |
114 | (guix build utils) | |
56c092ce | 115 | (srfi srfi-1)) |
80fe5c60 | 116 | #:phases (alist-replace |
fb6c2fa8 LC |
117 | 'build ,(build-phase (or (%current-target-system) |
118 | (%current-system))) | |
80fe5c60 LC |
119 | (alist-replace |
120 | 'install ,install-phase | |
56c092ce | 121 | (alist-delete 'configure %standard-phases))) |
80fe5c60 LC |
122 | #:tests? #f)) |
123 | (synopsis "GNU Linux-Libre kernel headers") | |
124 | (description "Headers of the Linux-Libre kernel.") | |
38bbd61d | 125 | (license gpl2) |
80fe5c60 LC |
126 | (home-page "http://www.gnu.org/software/linux-libre/")))) |
127 | ||
b4fcb735 LC |
128 | (define-public module-init-tools |
129 | (package | |
130 | (name "module-init-tools") | |
131 | (version "3.16") | |
132 | (source (origin | |
133 | (method url-fetch) | |
134 | (uri (string-append | |
135 | "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-" | |
136 | version ".tar.bz2")) | |
137 | (sha256 | |
138 | (base32 | |
d3bbe992 LC |
139 | "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1")) |
140 | (patches | |
141 | (list (search-patch "module-init-tools-moduledir.patch"))))) | |
b4fcb735 | 142 | (build-system gnu-build-system) |
b4fcb735 | 143 | (arguments |
5c413a9c LC |
144 | ;; FIXME: The upstream tarball lacks man pages, and building them would |
145 | ;; require DocBook & co. We used to use Gentoo's pre-built man pages, | |
146 | ;; but they vanished. In the meantime, fake it. | |
b4fcb735 | 147 | '(#:phases (alist-cons-before |
5c413a9c LC |
148 | 'configure 'fake-docbook |
149 | (lambda _ | |
150 | (substitute* "Makefile.in" | |
151 | (("^DOCBOOKTOMAN.*$") | |
152 | "DOCBOOKTOMAN = true\n"))) | |
b4fcb735 LC |
153 | %standard-phases))) |
154 | (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/") | |
155 | (synopsis "Tools for loading and managing Linux kernel modules") | |
156 | (description | |
157 | "Tools for loading and managing Linux kernel modules, such as `modprobe', | |
158 | `insmod', `lsmod', and more.") | |
159 | (license gpl2+))) | |
160 | ||
beacfcab | 161 | (define-public linux-libre |
ed4a8816 | 162 | (let* ((version "3.15") |
beacfcab LC |
163 | (build-phase |
164 | '(lambda* (#:key system #:allow-other-keys #:rest args) | |
165 | (let ((arch (car (string-split system #\-)))) | |
166 | (setenv "ARCH" | |
167 | (cond ((string=? arch "i686") "i386") | |
168 | (else arch))) | |
169 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))) | |
170 | ||
171 | (let ((build (assoc-ref %standard-phases 'build))) | |
2e48455d LC |
172 | (and (zero? (system* "make" "defconfig")) |
173 | (begin | |
c0888b3f AE |
174 | ;; Appending works even when the option wasn't in the |
175 | ;; file. The last one prevails if duplicated. | |
882f034f | 176 | (let ((port (open-file ".config" "a"))) |
c0888b3f AE |
177 | (display (string-append "CONFIG_NET_9P=m\n" |
178 | "CONFIG_NET_9P_VIRTIO=m\n" | |
882f034f | 179 | "CONFIG_VIRTIO_BLK=m\n" |
be0d8af8 | 180 | "CONFIG_SATA_SIS=y\n" |
c0888b3f | 181 | "CONFIG_VIRTIO_NET=m\n" |
be0d8af8 AE |
182 | "CONFIG_SIS190=y\n" |
183 | ;; https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00039.html | |
184 | "CONFIG_DEVPTS_MULTIPLE_INSTANCES=y\n" | |
c0888b3f AE |
185 | "CONFIG_VIRTIO_PCI=m\n" |
186 | "CONFIG_VIRTIO_BALLOON=m\n" | |
187 | "CONFIG_VIRTIO_MMIO=m\n" | |
188 | "CONFIG_FUSE_FS=m\n" | |
189 | "CONFIG_CIFS=m\n" | |
d8bb353c LC |
190 | "CONFIG_9P_FS=m\n" |
191 | "CONFIG_E1000E=m\n") | |
882f034f LC |
192 | port) |
193 | (close-port port)) | |
194 | ||
2e48455d | 195 | (zero? (system* "make" "oldconfig"))) |
beacfcab LC |
196 | |
197 | ;; Call the default `build' phase so `-j' is correctly | |
198 | ;; passed. | |
199 | (apply build #:make-flags "all" args))))) | |
200 | (install-phase | |
201 | `(lambda* (#:key inputs outputs #:allow-other-keys) | |
202 | (let* ((out (assoc-ref outputs "out")) | |
203 | (moddir (string-append out "/lib/modules")) | |
204 | (mit (assoc-ref inputs "module-init-tools"))) | |
205 | (mkdir-p moddir) | |
206 | (for-each (lambda (file) | |
207 | (copy-file file | |
208 | (string-append out "/" (basename file)))) | |
209 | (find-files "." "^(bzImage|System\\.map)$")) | |
210 | (copy-file ".config" (string-append out "/config")) | |
211 | (zero? (system* "make" | |
212 | (string-append "DEPMOD=" mit "/sbin/depmod") | |
213 | (string-append "MODULE_DIR=" moddir) | |
214 | (string-append "INSTALL_PATH=" out) | |
215 | (string-append "INSTALL_MOD_PATH=" out) | |
216 | "modules_install")))))) | |
217 | (package | |
218 | (name "linux-libre") | |
dfb52abb | 219 | (version version) |
beacfcab LC |
220 | (source (origin |
221 | (method url-fetch) | |
6023cc74 | 222 | (uri (linux-libre-urls version)) |
beacfcab LC |
223 | (sha256 |
224 | (base32 | |
ed4a8816 | 225 | "125n04rwqmr3bm9slk62w6xcg355hx85rwv2x16nl6qki70hsick")))) |
beacfcab LC |
226 | (build-system gnu-build-system) |
227 | (native-inputs `(("perl" ,perl) | |
e7b38500 | 228 | ("bc" ,bc) |
beacfcab LC |
229 | ("module-init-tools" ,module-init-tools))) |
230 | (arguments | |
231 | `(#:modules ((guix build gnu-build-system) | |
232 | (guix build utils) | |
233 | (srfi srfi-1) | |
234 | (ice-9 match)) | |
235 | #:phases (alist-replace | |
236 | 'build ,build-phase | |
237 | (alist-replace | |
238 | 'install ,install-phase | |
239 | (alist-delete 'configure %standard-phases))) | |
240 | #:tests? #f)) | |
f50d2669 | 241 | (synopsis "100% free redistribution of a cleaned Linux kernel") |
a22dc0c4 | 242 | (description |
79c311b8 LC |
243 | "GNU Linux-Libre is a free (as in freedom) variant of the Linux kernel. |
244 | It has been modified to remove all non-free binary blobs.") | |
beacfcab LC |
245 | (license gpl2) |
246 | (home-page "http://www.gnu.org/software/linux-libre/")))) | |
247 | ||
c84d0eca LC |
248 | \f |
249 | ;;; | |
250 | ;;; Pluggable authentication modules (PAM). | |
251 | ;;; | |
252 | ||
fd76c904 LC |
253 | (define-public linux-pam |
254 | (package | |
255 | (name "linux-pam") | |
256 | (version "1.1.6") | |
257 | (source | |
258 | (origin | |
259 | (method url-fetch) | |
260 | (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-" | |
261 | version ".tar.bz2") | |
262 | (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-" | |
263 | version ".tar.bz2"))) | |
264 | (sha256 | |
265 | (base32 | |
266 | "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s")))) | |
267 | (build-system gnu-build-system) | |
c4c4cc05 | 268 | (native-inputs |
fd76c904 LC |
269 | `(("flex" ,flex) |
270 | ||
271 | ;; TODO: optional dependencies | |
272 | ;; ("libxcrypt" ,libxcrypt) | |
273 | ;; ("cracklib" ,cracklib) | |
274 | )) | |
275 | (arguments | |
c134056a LC |
276 | '(;; Most users, such as `shadow', expect the headers to be under |
277 | ;; `security'. | |
278 | #:configure-flags (list (string-append "--includedir=" | |
279 | (assoc-ref %outputs "out") | |
280 | "/include/security")) | |
281 | ||
282 | ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d | |
283 | ;; isn't available. | |
284 | #:tests? #f)) | |
fd76c904 LC |
285 | (home-page "http://www.linux-pam.org/") |
286 | (synopsis "Pluggable authentication modules for Linux") | |
287 | (description | |
288 | "A *Free* project to implement OSF's RFC 86.0. | |
289 | Pluggable authentication modules are small shared object files that can | |
290 | be used through the PAM API to perform tasks, like authenticating a user | |
291 | at login. Local and dynamic reconfiguration are its key features") | |
4a44e743 | 292 | (license bsd-3))) |
686f14e8 | 293 | |
c84d0eca LC |
294 | \f |
295 | ;;; | |
296 | ;;; Miscellaneous. | |
297 | ;;; | |
298 | ||
686f14e8 LC |
299 | (define-public psmisc |
300 | (package | |
301 | (name "psmisc") | |
302 | (version "22.20") | |
303 | (source | |
304 | (origin | |
305 | (method url-fetch) | |
306 | (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-" | |
307 | version ".tar.gz")) | |
308 | (sha256 | |
309 | (base32 | |
310 | "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi")))) | |
311 | (build-system gnu-build-system) | |
312 | (inputs `(("ncurses" ,ncurses))) | |
313 | (home-page "http://psmisc.sourceforge.net/") | |
314 | (synopsis | |
315 | "set of utilities that use the proc filesystem, such as fuser, killall, and pstree") | |
316 | (description | |
317 | "This PSmisc package is a set of some small useful utilities that | |
318 | use the proc filesystem. We're not about changing the world, but | |
319 | providing the system administrator with some help in common tasks.") | |
4a44e743 | 320 | (license gpl2+))) |
02b80c3f NK |
321 | |
322 | (define-public util-linux | |
323 | (package | |
324 | (name "util-linux") | |
325 | (version "2.21") | |
5a6a3ba4 LC |
326 | (source (origin |
327 | (method url-fetch) | |
328 | (uri (string-append "mirror://kernel.org/linux/utils/" | |
329 | name "/v" version "/" | |
330 | name "-" version ".2" ".tar.xz")) | |
331 | (sha256 | |
332 | (base32 | |
333 | "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir")) | |
334 | (patches (list (search-patch "util-linux-perl.patch"))))) | |
02b80c3f NK |
335 | (build-system gnu-build-system) |
336 | (arguments | |
8b8476b8 AE |
337 | `(#:configure-flags '("--disable-use-tty-group" |
338 | "--enable-ddate") | |
02b80c3f NK |
339 | #:phases (alist-cons-after |
340 | 'install 'patch-chkdupexe | |
341 | (lambda* (#:key outputs #:allow-other-keys) | |
342 | (let ((out (assoc-ref outputs "out"))) | |
343 | (substitute* (string-append out "/bin/chkdupexe") | |
344 | ;; Allow 'patch-shebang' to do its work. | |
345 | (("@PERL@") "/bin/perl")))) | |
346 | %standard-phases))) | |
4a44e743 | 347 | (inputs `(("zlib" ,guix:zlib) |
c4c4cc05 JD |
348 | ("ncurses" ,ncurses))) |
349 | (native-inputs | |
350 | `(("perl" ,perl))) | |
02b80c3f | 351 | (home-page "https://www.kernel.org/pub/linux/utils/util-linux/") |
35ec07c7 | 352 | (synopsis "Collection of utilities for the Linux kernel") |
02b80c3f NK |
353 | (description |
354 | "util-linux is a random collection of utilities for the Linux kernel.") | |
fe8ccfcc | 355 | |
02b80c3f | 356 | ;; Note that util-linux doesn't use the same license for all the |
fe8ccfcc | 357 | ;; code. GPLv2+ is the default license for a code without an |
02b80c3f | 358 | ;; explicitly defined license. |
fe8ccfcc LC |
359 | (license (list gpl3+ gpl2+ gpl2 lgpl2.0+ |
360 | bsd-4 public-domain)))) | |
5d5c4278 | 361 | |
e47e3eff LC |
362 | (define-public procps |
363 | (package | |
364 | (name "procps") | |
365 | (version "3.2.8") | |
366 | (source (origin | |
367 | (method url-fetch) | |
368 | (uri (string-append "http://procps.sourceforge.net/procps-" | |
369 | version ".tar.gz")) | |
370 | (sha256 | |
371 | (base32 | |
01eafd38 LC |
372 | "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i")) |
373 | (patches (list (search-patch "procps-make-3.82.patch"))))) | |
e47e3eff | 374 | (build-system gnu-build-system) |
01eafd38 | 375 | (inputs `(("ncurses" ,ncurses))) |
e47e3eff | 376 | (arguments |
01eafd38 | 377 | '(#:phases (alist-replace |
e47e3eff LC |
378 | 'configure |
379 | (lambda* (#:key outputs #:allow-other-keys) | |
380 | ;; No `configure', just a single Makefile. | |
381 | (let ((out (assoc-ref outputs "out"))) | |
382 | (substitute* "Makefile" | |
383 | (("/usr/") "/") | |
384 | (("--(owner|group) 0") "") | |
385 | (("ldconfig") "true") | |
386 | (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value) | |
387 | ;; Add libproc to the RPATH. | |
388 | (string-append "LDFLAGS := -Wl,-rpath=" | |
389 | out "/lib" value)))) | |
390 | (setenv "CC" "gcc")) | |
391 | (alist-replace | |
392 | 'install | |
393 | (lambda* (#:key outputs #:allow-other-keys) | |
394 | (let ((out (assoc-ref outputs "out"))) | |
395 | (and (zero? | |
396 | (system* "make" "install" | |
397 | (string-append "DESTDIR=" out))) | |
398 | ||
399 | ;; Sanity check. | |
400 | (zero? | |
401 | (system* (string-append out "/bin/ps") | |
402 | "--version"))))) | |
403 | %standard-phases)) | |
404 | ||
405 | ;; What did you expect? Tests? | |
406 | #:tests? #f)) | |
407 | (home-page "http://procps.sourceforge.net/") | |
35ec07c7 | 408 | (synopsis "Utilities that give information about processes") |
e47e3eff LC |
409 | (description |
410 | "procps is the package that has a bunch of small useful utilities | |
411 | that give information about processes using the Linux /proc file system. | |
412 | The package includes the programs ps, top, vmstat, w, kill, free, | |
413 | slabtop, and skill.") | |
414 | (license gpl2))) | |
415 | ||
5d5c4278 NK |
416 | (define-public usbutils |
417 | (package | |
418 | (name "usbutils") | |
419 | (version "006") | |
420 | (source | |
421 | (origin | |
422 | (method url-fetch) | |
423 | (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/" | |
424 | "usbutils-" version ".tar.xz")) | |
425 | (sha256 | |
426 | (base32 | |
427 | "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr")))) | |
428 | (build-system gnu-build-system) | |
429 | (inputs | |
c4c4cc05 JD |
430 | `(("libusb" ,libusb))) |
431 | (native-inputs | |
432 | `(("pkg-config" ,pkg-config))) | |
5d5c4278 NK |
433 | (home-page "http://www.linux-usb.org/") |
434 | (synopsis | |
435 | "Tools for working with USB devices, such as lsusb") | |
436 | (description | |
437 | "Tools for working with USB devices, such as lsusb.") | |
4050e5d6 | 438 | (license gpl2+))) |
0750452a LC |
439 | |
440 | (define-public e2fsprogs | |
441 | (package | |
442 | (name "e2fsprogs") | |
443 | (version "1.42.7") | |
444 | (source (origin | |
445 | (method url-fetch) | |
446 | (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-" | |
447 | version ".tar.gz")) | |
448 | (sha256 | |
449 | (base32 | |
450 | "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw")))) | |
451 | (build-system gnu-build-system) | |
c4c4cc05 | 452 | (inputs `(("util-linux" ,util-linux))) |
f57d2639 LC |
453 | (native-inputs `(("pkg-config" ,pkg-config) |
454 | ("texinfo" ,texinfo))) ; for the libext2fs Info manual | |
0750452a LC |
455 | (arguments |
456 | '(#:phases (alist-cons-before | |
457 | 'configure 'patch-shells | |
458 | (lambda _ | |
459 | (substitute* "configure" | |
460 | (("/bin/sh (.*)parse-types.sh" _ dir) | |
461 | (string-append (which "sh") " " dir | |
462 | "parse-types.sh"))) | |
463 | (substitute* (find-files "." "^Makefile.in$") | |
464 | (("#!/bin/sh") | |
465 | (string-append "#!" (which "sh"))))) | |
466 | %standard-phases) | |
467 | ||
468 | ;; FIXME: Tests work by comparing the stdout/stderr of programs, that | |
469 | ;; they fail because we get an extra line that says "Can't check if | |
470 | ;; filesystem is mounted due to missing mtab file". | |
471 | #:tests? #f)) | |
472 | (home-page "http://e2fsprogs.sourceforge.net/") | |
35ec07c7 | 473 | (synopsis "Creating and checking ext2/ext3/ext4 file systems") |
0750452a LC |
474 | (description |
475 | "This package provides tools for manipulating ext2/ext3/ext4 file systems.") | |
476 | (license (list gpl2 ; programs | |
477 | lgpl2.0 ; libext2fs | |
478 | x11)))) ; libuuid | |
d8482ad0 | 479 | |
e102f940 LC |
480 | (define-public e2fsck/static |
481 | (package | |
482 | (name "e2fsck-static") | |
0997771a | 483 | (version (package-version e2fsprogs)) |
e102f940 LC |
484 | (build-system trivial-build-system) |
485 | (source #f) | |
486 | (arguments | |
487 | `(#:modules ((guix build utils)) | |
488 | #:builder | |
489 | (begin | |
490 | (use-modules (guix build utils) | |
491 | (ice-9 ftw) | |
492 | (srfi srfi-26)) | |
493 | ||
494 | (let ((source (string-append (assoc-ref %build-inputs "e2fsprogs") | |
495 | "/sbin")) | |
496 | (bin (string-append (assoc-ref %outputs "out") "/sbin"))) | |
497 | (mkdir-p bin) | |
498 | (with-directory-excursion bin | |
499 | (for-each (lambda (file) | |
500 | (copy-file (string-append source "/" file) | |
501 | file) | |
502 | (remove-store-references file) | |
503 | (chmod file #o555)) | |
504 | (scandir source (cut string-prefix? "fsck." <>)))))))) | |
0997771a | 505 | (inputs `(("e2fsprogs" ,(static-package e2fsprogs)))) |
e102f940 LC |
506 | (synopsis "Statically-linked fsck.* commands from e2fsprogs") |
507 | (description | |
508 | "This package provides statically-linked command of fsck.ext[234] taken | |
509 | from the e2fsprogs package. It is meant to be used in initrds.") | |
0997771a LC |
510 | (home-page (package-home-page e2fsprogs)) |
511 | (license (package-license e2fsprogs)))) | |
e102f940 | 512 | |
d8482ad0 LC |
513 | (define-public strace |
514 | (package | |
515 | (name "strace") | |
516 | (version "4.7") | |
517 | (source (origin | |
518 | (method url-fetch) | |
519 | (uri (string-append "mirror://sourceforge/strace/strace-" | |
520 | version ".tar.xz")) | |
521 | (sha256 | |
522 | (base32 | |
523 | "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764")))) | |
524 | (build-system gnu-build-system) | |
c4c4cc05 | 525 | (native-inputs `(("perl" ,perl))) |
d8482ad0 LC |
526 | (home-page "http://strace.sourceforge.net/") |
527 | (synopsis "System call tracer for Linux") | |
528 | (description | |
529 | "strace is a system call tracer, i.e. a debugging tool which prints out a | |
530 | trace of all the system calls made by a another process/program.") | |
531 | (license bsd-3))) | |
ba04571a LC |
532 | |
533 | (define-public alsa-lib | |
534 | (package | |
535 | (name "alsa-lib") | |
536 | (version "1.0.27.1") | |
537 | (source (origin | |
538 | (method url-fetch) | |
539 | (uri (string-append | |
540 | "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-" | |
541 | version ".tar.bz2")) | |
542 | (sha256 | |
543 | (base32 | |
bcd94e19 MW |
544 | "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9")) |
545 | (patches (list (search-patch "alsa-lib-mips-atomic-fix.patch"))))) | |
ba04571a LC |
546 | (build-system gnu-build-system) |
547 | (home-page "http://www.alsa-project.org/") | |
548 | (synopsis "The Advanced Linux Sound Architecture libraries") | |
549 | (description | |
550 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
551 | MIDI functionality to the Linux-based operating system.") | |
552 | (license lgpl2.1+))) | |
10afdf50 | 553 | |
17b293a0 LC |
554 | (define-public alsa-utils |
555 | (package | |
556 | (name "alsa-utils") | |
557 | (version "1.0.27.2") | |
558 | (source (origin | |
559 | (method url-fetch) | |
560 | (uri (string-append "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-" | |
561 | version ".tar.bz2")) | |
562 | (sha256 | |
563 | (base32 | |
564 | "1sjjngnq50jv5ilwsb4zys6smifni3bd6fn28gbnhfrg14wsrgq2")))) | |
565 | (build-system gnu-build-system) | |
566 | (arguments | |
567 | ;; XXX: Disable man page creation until we have DocBook. | |
568 | '(#:configure-flags (list "--disable-xmlto" | |
569 | (string-append "--with-udev-rules-dir=" | |
570 | (assoc-ref %outputs "out") | |
571 | "/lib/udev/rules.d")) | |
572 | #:phases (alist-cons-before | |
573 | 'install 'pre-install | |
574 | (lambda _ | |
575 | ;; Don't try to mkdir /var/lib/alsa. | |
576 | (substitute* "Makefile" | |
577 | (("\\$\\(MKDIR_P\\) .*ASOUND_STATE_DIR.*") | |
578 | "true\n"))) | |
579 | %standard-phases))) | |
580 | (inputs | |
581 | `(("libsamplerate" ,libsamplerate) | |
582 | ("ncurses" ,ncurses) | |
583 | ("alsa-lib" ,alsa-lib) | |
584 | ("xmlto" ,xmlto) | |
1dba6407 | 585 | ("gettext" ,gnu-gettext))) |
17b293a0 LC |
586 | (home-page "http://www.alsa-project.org/") |
587 | (synopsis "Utilities for the Advanced Linux Sound Architecture (ALSA)") | |
588 | (description | |
589 | "The Advanced Linux Sound Architecture (ALSA) provides audio and | |
590 | MIDI functionality to the Linux-based operating system.") | |
591 | ||
592 | ;; This is mostly GPLv2+ but a few files such as 'alsactl.c' are | |
593 | ;; GPLv2-only. | |
594 | (license gpl2))) | |
595 | ||
10afdf50 LC |
596 | (define-public iptables |
597 | (package | |
598 | (name "iptables") | |
599 | (version "1.4.16.2") | |
600 | (source (origin | |
601 | (method url-fetch) | |
602 | (uri (string-append | |
603 | "http://www.netfilter.org/projects/iptables/files/iptables-" | |
604 | version ".tar.bz2")) | |
605 | (sha256 | |
606 | (base32 | |
607 | "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24")))) | |
608 | (build-system gnu-build-system) | |
609 | (arguments '(#:tests? #f)) ; no test suite | |
610 | (home-page "http://www.netfilter.org/projects/iptables/index.html") | |
611 | (synopsis "Program to configure the Linux IP packet filtering rules") | |
612 | (description | |
613 | "iptables is the userspace command line program used to configure the | |
614 | Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards | |
615 | system administrators. Since Network Address Translation is also configured | |
616 | from the packet filter ruleset, iptables is used for this, too. The iptables | |
617 | package also includes ip6tables. ip6tables is used for configuring the IPv6 | |
618 | packet filter.") | |
619 | (license gpl2+))) | |
90a0048f LC |
620 | |
621 | (define-public iproute | |
622 | (package | |
623 | (name "iproute2") | |
5fd7f3e0 | 624 | (version "3.12.0") |
90a0048f LC |
625 | (source (origin |
626 | (method url-fetch) | |
627 | (uri (string-append | |
628 | "mirror://kernel.org/linux/utils/net/iproute2/iproute2-" | |
629 | version ".tar.xz")) | |
630 | (sha256 | |
631 | (base32 | |
5fd7f3e0 | 632 | "04gi11gh087bg2nlxhj0lxrk8l9qxkpr88nsiil23917bm3h1xj4")))) |
90a0048f LC |
633 | (build-system gnu-build-system) |
634 | (arguments | |
635 | `(#:tests? #f ; no test suite | |
636 | #:make-flags (let ((out (assoc-ref %outputs "out"))) | |
637 | (list "DESTDIR=" | |
638 | (string-append "LIBDIR=" out "/lib") | |
639 | (string-append "SBINDIR=" out "/sbin") | |
640 | (string-append "CONFDIR=" out "/etc") | |
641 | (string-append "DOCDIR=" out "/share/doc/" | |
642 | ,name "-" ,version) | |
643 | (string-append "MANDIR=" out "/share/man"))) | |
644 | #:phases (alist-cons-before | |
645 | 'install 'pre-install | |
646 | (lambda _ | |
647 | ;; Don't attempt to create /var/lib/arpd. | |
648 | (substitute* "Makefile" | |
649 | (("^.*ARPDDIR.*$") ""))) | |
650 | %standard-phases))) | |
651 | (inputs | |
652 | `(("iptables" ,iptables) | |
c4c4cc05 JD |
653 | ("db4" ,bdb))) |
654 | (native-inputs | |
655 | `(("pkg-config" ,pkg-config) | |
90a0048f LC |
656 | ("flex" ,flex) |
657 | ("bison" ,bison))) | |
658 | (home-page | |
659 | "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2") | |
660 | (synopsis | |
661 | "A collection of utilities for controlling TCP/IP networking and traffic control in Linux") | |
662 | (description | |
663 | "Iproute2 is a collection of utilities for controlling TCP/IP | |
664 | networking and traffic with the Linux kernel. | |
665 | ||
666 | Most network configuration manuals still refer to ifconfig and route as the | |
667 | primary network configuration tools, but ifconfig is known to behave | |
668 | inadequately in modern network environments. They should be deprecated, but | |
669 | most distros still include them. Most network configuration systems make use | |
670 | of ifconfig and thus provide a limited feature set. The /etc/net project aims | |
671 | to support most modern network technologies, as it doesn't use ifconfig and | |
672 | allows a system administrator to make use of all iproute2 features, including | |
673 | traffic control. | |
674 | ||
675 | iproute2 is usually shipped in a package called iproute or iproute2 and | |
676 | consists of several tools, of which the most important are ip and tc. ip | |
677 | controls IPv4 and IPv6 configuration and tc stands for traffic control. Both | |
678 | tools print detailed usage messages and are accompanied by a set of | |
679 | manpages.") | |
680 | (license gpl2+))) | |
85e0dc6a LC |
681 | |
682 | (define-public net-tools | |
683 | ;; XXX: This package is basically unmaintained, but it provides a few | |
684 | ;; commands not yet provided by Inetutils, such as 'route', so we have to | |
685 | ;; live with it. | |
686 | (package | |
687 | (name "net-tools") | |
688 | (version "1.60") | |
689 | (home-page "http://www.tazenda.demon.co.uk/phil/net-tools/") | |
690 | (source (origin | |
691 | (method url-fetch) | |
692 | (uri (string-append home-page "/" name "-" | |
693 | version ".tar.bz2")) | |
694 | (sha256 | |
695 | (base32 | |
696 | "0yvxrzk0mzmspr7sa34hm1anw6sif39gyn85w4c5ywfn8inxvr3s")))) | |
697 | (build-system gnu-build-system) | |
698 | (arguments | |
cd143df0 LC |
699 | '(#:phases (alist-cons-after |
700 | 'unpack 'patch | |
85e0dc6a LC |
701 | (lambda* (#:key inputs #:allow-other-keys) |
702 | (define (apply-patch file) | |
703 | (zero? (system* "patch" "-p1" "--batch" | |
704 | "--input" file))) | |
705 | ||
706 | (let ((patch.gz (assoc-ref inputs "patch"))) | |
707 | (format #t "applying Debian patch set '~a'...~%" | |
708 | patch.gz) | |
709 | (system (string-append "gunzip < " patch.gz " > the-patch")) | |
710 | (pk 'here) | |
711 | (and (apply-patch "the-patch") | |
712 | (for-each apply-patch | |
713 | (find-files "debian/patches" | |
714 | "\\.patch"))))) | |
715 | (alist-replace | |
716 | 'configure | |
717 | (lambda* (#:key outputs #:allow-other-keys) | |
718 | (let ((out (assoc-ref outputs "out"))) | |
719 | (mkdir-p (string-append out "/bin")) | |
720 | (mkdir-p (string-append out "/sbin")) | |
721 | ||
722 | ;; Pretend we have everything... | |
723 | (system "yes | make config") | |
724 | ||
725 | ;; ... except we don't have libdnet, so remove that | |
726 | ;; definition. | |
727 | (substitute* '("config.make" "config.h") | |
728 | (("^.*HAVE_AFDECnet.*$") "")))) | |
729 | %standard-phases)) | |
730 | ||
731 | ;; Binaries that depend on libnet-tools.a don't declare that | |
732 | ;; dependency, making it parallel-unsafe. | |
733 | #:parallel-build? #f | |
734 | ||
735 | #:tests? #f ; no test suite | |
0d55c356 MW |
736 | #:make-flags (let ((out (assoc-ref %outputs "out"))) |
737 | (list "CC=gcc" | |
738 | (string-append "BASEDIR=" out) | |
739 | (string-append "INSTALLNLSDIR=" out "/share/locale") | |
740 | (string-append "mandir=/share/man"))))) | |
85e0dc6a LC |
741 | |
742 | ;; Use the big Debian patch set (the thing does not even compile out of | |
743 | ;; the box.) | |
744 | (inputs `(("patch" ,(origin | |
745 | (method url-fetch) | |
746 | (uri | |
747 | "http://ftp.de.debian.org/debian/pool/main/n/net-tools/net-tools_1.60-24.2.diff.gz") | |
748 | (sha256 | |
749 | (base32 | |
750 | "0p93lsqx23v5fv4hpbrydmfvw1ha2rgqpn2zqbs2jhxkzhjc030p")))))) | |
1dba6407 | 751 | (native-inputs `(("gettext" ,gnu-gettext))) |
85e0dc6a LC |
752 | |
753 | (synopsis "Tools for controlling the network subsystem in Linux") | |
754 | (description | |
755 | "This package includes the important tools for controlling the network | |
756 | subsystem of the Linux kernel. This includes arp, hostname, ifconfig, | |
757 | netstat, rarp and route. Additionally, this package contains utilities | |
758 | relating to particular network hardware types (plipconfig, slattach) and | |
759 | advanced aspects of IP configuration (iptunnel, ipmaddr).") | |
760 | (license gpl2+))) | |
c762e82e LC |
761 | |
762 | (define-public libcap | |
763 | (package | |
764 | (name "libcap") | |
765 | (version "2.22") | |
766 | (source (origin | |
767 | (method url-fetch) | |
768 | ||
769 | ;; Tarballs used to be available from | |
770 | ;; <https://www.kernel.org/pub/linux/libs/security/linux-privs/> | |
771 | ;; but they never came back after kernel.org was compromised. | |
772 | (uri (string-append | |
773 | "mirror://debian/pool/main/libc/libcap2/libcap2_" | |
774 | version ".orig.tar.gz")) | |
775 | (sha256 | |
776 | (base32 | |
777 | "07vjhkznm82p8dm4w6j8mmg7h5c70lp5s9bwwfdmgwpbixfydjp1")))) | |
778 | (build-system gnu-build-system) | |
779 | (arguments '(#:phases (alist-delete 'configure %standard-phases) | |
780 | #:tests? #f ; no 'check' target | |
781 | #:make-flags (list "lib=lib" | |
782 | (string-append "prefix=" | |
783 | (assoc-ref %outputs "out")) | |
784 | "RAISE_SETFCAP=no"))) | |
785 | (native-inputs `(("perl" ,perl))) | |
786 | (inputs `(("attr" ,attr))) | |
787 | (home-page "https://sites.google.com/site/fullycapable/") | |
788 | (synopsis "Library for working with POSIX capabilities") | |
789 | (description | |
790 | "libcap2 provides a programming interface to POSIX capabilities on | |
791 | Linux-based operating systems.") | |
792 | ||
793 | ;; License is BSD-3 or GPLv2, at the user's choice. | |
794 | (license gpl2))) | |
215b6431 LC |
795 | |
796 | (define-public bridge-utils | |
797 | (package | |
798 | (name "bridge-utils") | |
799 | (version "1.5") | |
800 | (source (origin | |
801 | (method url-fetch) | |
802 | (uri (string-append "mirror://sourceforge/bridge/bridge-utils-" | |
803 | version ".tar.gz")) | |
804 | (sha256 | |
805 | (base32 | |
806 | "12367cwqmi0yqphi6j8rkx97q8hw52yq2fx4k0xfclkcizxybya2")))) | |
807 | (build-system gnu-build-system) | |
808 | ||
809 | ;; The tarball lacks all the generated files. | |
810 | (native-inputs `(("autoconf" ,autoconf) | |
811 | ("automake" ,automake))) | |
812 | (arguments | |
813 | '(#:phases (alist-cons-before | |
814 | 'configure 'bootstrap | |
815 | (lambda _ | |
816 | (zero? (system* "autoreconf" "-vf"))) | |
817 | %standard-phases) | |
818 | #:tests? #f)) ; no 'check' target | |
819 | ||
820 | (home-page | |
821 | "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge") | |
822 | (synopsis "Manipulate Ethernet bridges") | |
823 | (description | |
824 | "Utilities for Linux's Ethernet bridging facilities. A bridge is a way | |
825 | to connect two Ethernet segments together in a protocol independent way. | |
826 | Packets are forwarded based on Ethernet address, rather than IP address (like | |
827 | a router). Since forwarding is done at Layer 2, all protocols can go | |
828 | transparently through a bridge.") | |
829 | (license gpl2+))) | |
3cc20675 LC |
830 | |
831 | (define-public libnl | |
832 | (package | |
833 | (name "libnl") | |
834 | (version "3.2.13") | |
835 | (source (origin | |
836 | (method url-fetch) | |
837 | (uri (string-append | |
838 | "http://www.infradead.org/~tgr/libnl/files/libnl-" | |
839 | version ".tar.gz")) | |
840 | (sha256 | |
841 | (base32 | |
842 | "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd")))) | |
843 | (build-system gnu-build-system) | |
844 | (native-inputs `(("flex" ,flex) ("bison" ,bison))) | |
845 | (home-page "http://www.infradead.org/~tgr/libnl/") | |
846 | (synopsis "NetLink protocol library suite") | |
847 | (description | |
848 | "The libnl suite is a collection of libraries providing APIs to netlink | |
849 | protocol based Linux kernel interfaces. Netlink is an IPC mechanism primarly | |
850 | between the kernel and user space processes. It was designed to be a more | |
851 | flexible successor to ioctl to provide mainly networking related kernel | |
852 | configuration and monitoring interfaces.") | |
853 | ||
854 | ;; Most files are LGPLv2.1-only, but some are GPLv2-only (like | |
855 | ;; 'nl-addr-add.c'), so the result is GPLv2-only. | |
856 | (license gpl2))) | |
023fef7d LC |
857 | |
858 | (define-public powertop | |
859 | (package | |
860 | (name "powertop") | |
861 | (version "2.5") | |
862 | (source | |
863 | (origin | |
864 | (method url-fetch) | |
865 | (uri (string-append | |
866 | "https://01.org/powertop/sites/default/files/downloads/powertop-" | |
867 | version ".tar.gz")) | |
868 | (sha256 | |
869 | (base32 | |
870 | "02rwqbpasdayl201v0549gbp2f82rd0hqiv3i111r7npanjhhb4b")))) | |
871 | (build-system gnu-build-system) | |
872 | (inputs | |
873 | ;; TODO: Add pciutils. | |
874 | `(("zlib" ,guix:zlib) | |
023fef7d LC |
875 | ;; ("pciutils" ,pciutils) |
876 | ("ncurses" ,ncurses) | |
877 | ("libnl" ,libnl))) | |
c4c4cc05 JD |
878 | (native-inputs |
879 | `(("pkg-config" ,pkg-config))) | |
023fef7d LC |
880 | (home-page "https://01.org/powertop/") |
881 | (synopsis "Analyze power consumption on Intel-based laptops") | |
882 | (description | |
883 | "PowerTOP is a Linux tool to diagnose issues with power consumption and | |
884 | power management. In addition to being a diagnostic tool, PowerTOP also has | |
885 | an interactive mode where the user can experiment various power management | |
886 | settings for cases where the operating system has not enabled these | |
887 | settings.") | |
888 | (license gpl2))) | |
6869e5c9 LC |
889 | |
890 | (define-public aumix | |
891 | (package | |
892 | (name "aumix") | |
893 | (version "2.9.1") | |
894 | (source (origin | |
895 | (method url-fetch) | |
896 | (uri (string-append | |
897 | "http://www.jpj.net/~trevor/aumix/releases/aumix-" | |
898 | version ".tar.bz2")) | |
899 | (sha256 | |
900 | (base32 | |
901 | "0a8fwyxnc5qdxff8sl2sfsbnvgh6pkij4yafiln0fxgg6bal7knj")))) | |
902 | (build-system gnu-build-system) | |
903 | (inputs `(("ncurses" ,ncurses))) | |
904 | (home-page "http://www.jpj.net/~trevor/aumix.html") | |
905 | (synopsis "Audio mixer for X and the console") | |
906 | (description | |
907 | "Aumix adjusts an audio mixer from X, the console, a terminal, | |
908 | the command line or a script.") | |
909 | (license gpl2+))) | |
7c0dbe78 SHT |
910 | |
911 | (define-public iotop | |
912 | (package | |
913 | (name "iotop") | |
914 | (version "0.6") | |
915 | (source | |
916 | (origin | |
917 | (method url-fetch) | |
918 | (uri (string-append "http://guichaz.free.fr/iotop/files/iotop-" | |
919 | version ".tar.gz")) | |
920 | (sha256 (base32 | |
921 | "1kp8mqg2pbxq4xzpianypadfxcsyfgwcaqgqia6h9fsq6zyh4z0s")))) | |
922 | (build-system python-build-system) | |
923 | (arguments | |
35cebf01 | 924 | ;; The setup.py script expects python-2. |
7c0dbe78 | 925 | `(#:python ,python-2 |
35cebf01 | 926 | ;; There are currently no checks in the package. |
7c0dbe78 SHT |
927 | #:tests? #f)) |
928 | (native-inputs `(("python" ,python-2))) | |
929 | (home-page "http://guichaz.free.fr/iotop/") | |
930 | (synopsis | |
931 | "Displays the IO activity of running processes") | |
932 | (description | |
933 | "Iotop is a Python program with a top like user interface to show the | |
934 | processes currently causing I/O.") | |
35cebf01 | 935 | (license gpl2+))) |
e30835e2 LC |
936 | |
937 | (define-public fuse | |
938 | (package | |
939 | (name "fuse") | |
940 | (version "2.9.3") | |
941 | (source (origin | |
942 | (method url-fetch) | |
943 | (uri (string-append "mirror://sourceforge/fuse/fuse-" | |
944 | version ".tar.gz")) | |
945 | (sha256 | |
946 | (base32 | |
947 | "071r6xjgssy8vwdn6m28qq1bqxsd2bphcd2mzhq0grf5ybm87sqb")))) | |
948 | (build-system gnu-build-system) | |
b148bd71 | 949 | (inputs `(("util-linux" ,util-linux))) |
e30835e2 LC |
950 | (arguments |
951 | '(#:configure-flags (list (string-append "MOUNT_FUSE_PATH=" | |
952 | (assoc-ref %outputs "out") | |
953 | "/sbin") | |
954 | (string-append "INIT_D_PATH=" | |
955 | (assoc-ref %outputs "out") | |
956 | "/etc/init.d") | |
957 | (string-append "UDEV_RULES_PATH=" | |
958 | (assoc-ref %outputs "out") | |
b148bd71 LC |
959 | "/etc/udev")) |
960 | #:phases (alist-cons-before | |
961 | 'build 'set-file-names | |
962 | (lambda* (#:key inputs #:allow-other-keys) | |
963 | ;; libfuse calls out to mount(8) and umount(8). Make sure | |
964 | ;; it refers to the right ones. | |
965 | (substitute* '("lib/mount_util.c" "util/mount_util.c") | |
966 | (("/bin/(u?)mount" _ maybe-u) | |
967 | (string-append (assoc-ref inputs "util-linux") | |
968 | "/bin/" maybe-u "mount"))) | |
969 | (substitute* '("util/mount.fuse.c") | |
970 | (("/bin/sh") | |
bd663902 LC |
971 | (which "sh"))) |
972 | ||
973 | ;; This hack leads libfuse to search for 'fusermount' in | |
974 | ;; $PATH, where it may find a setuid-root binary, instead of | |
975 | ;; trying solely $out/sbin/fusermount and failing because | |
976 | ;; it's not setuid. | |
977 | (substitute* "lib/Makefile" | |
978 | (("-DFUSERMOUNT_DIR=[[:graph:]]+") | |
979 | "-DFUSERMOUNT_DIR=\\\"/var/empty\\\""))) | |
b148bd71 | 980 | %standard-phases))) |
e30835e2 LC |
981 | (home-page "http://fuse.sourceforge.net/") |
982 | (synopsis "Support file systems implemented in user space") | |
983 | (description | |
984 | "As a consequence of its monolithic design, file system code for Linux | |
985 | normally goes into the kernel itself---which is not only a robustness issue, | |
986 | but also an impediment to system extensibility. FUSE, for \"file systems in | |
987 | user space\", is a kernel module and user-space library that tries to address | |
988 | part of this problem by allowing users to run file system implementations as | |
989 | user-space processes.") | |
990 | (license (list lgpl2.1 ; library | |
991 | gpl2+)))) ; command-line utilities | |
220193ad LC |
992 | |
993 | (define-public unionfs-fuse | |
994 | (package | |
995 | (name "unionfs-fuse") | |
996 | (version "0.26") | |
997 | (source (origin | |
998 | (method url-fetch) | |
999 | (uri (string-append | |
1000 | "http://podgorny.cz/unionfs-fuse/releases/unionfs-fuse-" | |
1001 | version ".tar.xz")) | |
1002 | (sha256 | |
1003 | (base32 | |
1004 | "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d")))) | |
1005 | (build-system cmake-build-system) | |
1006 | (inputs `(("fuse" ,fuse))) | |
1007 | (arguments '(#:tests? #f)) ; no tests | |
1008 | (home-page "http://podgorny.cz/moin/UnionFsFuse") | |
1009 | (synopsis "User-space union file system") | |
1010 | (description | |
1011 | "UnionFS-FUSE is a flexible union file system implementation in user | |
1012 | space, using the FUSE library. Mounting a union file system allows you to | |
1013 | \"aggregate\" the contents of several directories into a single mount point. | |
1014 | UnionFS-FUSE additionally supports copy-on-write.") | |
1015 | (license bsd-3))) | |
ed748588 | 1016 | |
0b7a0c20 LC |
1017 | (define fuse-static |
1018 | (package (inherit fuse) | |
1019 | (name "fuse-static") | |
1020 | (source (origin (inherit (package-source fuse)) | |
1021 | (modules '((guix build utils))) | |
1022 | (snippet | |
1023 | ;; Normally libfuse invokes mount(8) so that /etc/mtab is | |
1024 | ;; updated. Change calls to 'mtab_needs_update' to 0 so that | |
1025 | ;; it doesn't do that, allowing us to remove the dependency on | |
1026 | ;; util-linux (something that is useful in initrds.) | |
1027 | '(substitute* '("lib/mount_util.c" | |
1028 | "util/mount_util.c") | |
1029 | (("mtab_needs_update[[:blank:]]*\\([a-z_]+\\)") | |
1030 | "0") | |
1031 | (("/bin/") | |
1032 | ""))))))) | |
1033 | ||
ed748588 LC |
1034 | (define-public unionfs-fuse/static |
1035 | (package (inherit unionfs-fuse) | |
1036 | (synopsis "User-space union file system (statically linked)") | |
1037 | (name (string-append (package-name unionfs-fuse) "-static")) | |
1038 | (source (origin (inherit (package-source unionfs-fuse)) | |
1039 | (modules '((guix build utils))) | |
1040 | (snippet | |
1041 | ;; Add -ldl to the libraries, because libfuse.a needs that. | |
1042 | '(substitute* "src/CMakeLists.txt" | |
1043 | (("target_link_libraries(.*)\\)" _ libs) | |
1044 | (string-append "target_link_libraries" | |
1045 | libs " dl)")))))) | |
1046 | (arguments | |
1047 | '(#:tests? #f | |
0b7a0c20 LC |
1048 | #:configure-flags '("-DCMAKE_EXE_LINKER_FLAGS=-static"))) |
1049 | (inputs `(("fuse" ,fuse-static))))) | |
67b66003 | 1050 | |
db288efa LC |
1051 | (define-public sshfs-fuse |
1052 | (package | |
1053 | (name "sshfs-fuse") | |
1054 | (version "2.5") | |
1055 | (source (origin | |
1056 | (method url-fetch) | |
1057 | (uri (string-append "mirror://sourceforge/fuse/sshfs-fuse-" | |
1058 | version ".tar.gz")) | |
1059 | (sha256 | |
1060 | (base32 | |
1061 | "0gp6qr33l2p0964j0kds0dfmvyyf5lpgsn11daf0n5fhwm9185z9")))) | |
1062 | (build-system gnu-build-system) | |
1063 | (inputs | |
1064 | `(("fuse" ,fuse) | |
1065 | ("glib" ,glib))) | |
1066 | (native-inputs | |
1067 | `(("pkg-config" ,pkg-config))) | |
1068 | (home-page "http://fuse.sourceforge.net/sshfs.html") | |
1069 | (synopsis "Mount remote file systems over SSH") | |
1070 | (description | |
1071 | "This is a file system client based on the SSH File Transfer Protocol. | |
1072 | Since most SSH servers already support this protocol it is very easy to set | |
1073 | up: on the server side there's nothing to do; on the client side mounting the | |
1074 | file system is as easy as logging into the server with an SSH client.") | |
1075 | (license gpl2+))) | |
1076 | ||
67b66003 LC |
1077 | (define-public numactl |
1078 | (package | |
1079 | (name "numactl") | |
1080 | (version "2.0.9") | |
1081 | (source (origin | |
1082 | (method url-fetch) | |
1083 | (uri (string-append | |
1084 | "ftp://oss.sgi.com/www/projects/libnuma/download/numactl-" | |
1085 | version | |
1086 | ".tar.gz")) | |
1087 | (sha256 | |
1088 | (base32 | |
1089 | "073myxlyyhgxh1w3r757ajixb7s2k69czc3r0g12c3scq7k3784w")))) | |
1090 | (build-system gnu-build-system) | |
1091 | (arguments | |
1092 | '(#:phases (alist-replace | |
1093 | 'configure | |
1094 | (lambda* (#:key outputs #:allow-other-keys) | |
1095 | ;; There's no 'configure' script, just a raw makefile. | |
1096 | (substitute* "Makefile" | |
1097 | (("^prefix := .*$") | |
1098 | (string-append "prefix := " (assoc-ref outputs "out") | |
1099 | "\n")) | |
1100 | (("^libdir := .*$") | |
1101 | ;; By default the thing tries to install under | |
1102 | ;; $prefix/lib64 when on a 64-bit platform. | |
1103 | (string-append "libdir := $(prefix)/lib\n")))) | |
1104 | %standard-phases) | |
1105 | ||
1106 | #:make-flags (list | |
1107 | ;; By default the thing tries to use 'cc'. | |
1108 | "CC=gcc" | |
1109 | ||
1110 | ;; Make sure programs have an RPATH so they can find | |
1111 | ;; libnuma.so. | |
1112 | (string-append "LDLIBS=-Wl,-rpath=" | |
1113 | (assoc-ref %outputs "out") "/lib")) | |
1114 | ||
1115 | ;; There's a 'test' target, but it requires NUMA support in the kernel | |
1116 | ;; to run, which we can't assume to have. | |
1117 | #:tests? #f)) | |
1118 | (home-page "http://oss.sgi.com/projects/libnuma/") | |
1119 | (synopsis "Tools for non-uniform memory access (NUMA) machines") | |
1120 | (description | |
1121 | "NUMA stands for Non-Uniform Memory Access, in other words a system whose | |
1122 | memory is not all in one place. The numactl program allows you to run your | |
1123 | application program on specific CPU's and memory nodes. It does this by | |
1124 | supplying a NUMA memory policy to the operating system before running your | |
1125 | program. | |
1126 | ||
1127 | The package contains other commands, such as numademo, numastat and memhog. | |
1128 | The numademo command provides a quick overview of NUMA performance on your | |
1129 | system.") | |
1130 | (license (list gpl2 ; programs | |
1131 | lgpl2.1)))) ; library | |
b10e9ff6 LC |
1132 | |
1133 | (define-public kbd | |
1134 | (package | |
1135 | (name "kbd") | |
1136 | (version "2.0.1") | |
1137 | (source (origin | |
1138 | (method url-fetch) | |
1139 | (uri (string-append "mirror://kernel.org/linux/utils/kbd/kbd-" | |
1140 | version ".tar.gz")) | |
1141 | (sha256 | |
1142 | (base32 | |
c8f60748 LC |
1143 | "0c34b0za2v0934acvgnva0vaqpghmmhz4zh7k0m9jd4mbc91byqm")) |
1144 | (modules '((guix build utils))) | |
1145 | (snippet | |
1146 | '(substitute* "tests/Makefile.in" | |
1147 | ;; The '%: %.in' rule incorrectly uses @VERSION@. | |
1148 | (("@VERSION@") | |
1149 | "[@]VERSION[@]"))))) | |
b10e9ff6 LC |
1150 | (build-system gnu-build-system) |
1151 | (arguments | |
1152 | '(#:phases (alist-cons-before | |
1153 | 'build 'pre-build | |
1154 | (lambda* (#:key inputs #:allow-other-keys) | |
1155 | (let ((gzip (assoc-ref %build-inputs "gzip")) | |
1156 | (bzip2 (assoc-ref %build-inputs "bzip2"))) | |
1157 | (substitute* "src/libkeymap/findfile.c" | |
1158 | (("gzip") | |
1159 | (string-append gzip "/bin/gzip")) | |
1160 | (("bzip2") | |
1161 | (string-append bzip2 "/bin/bzip2"))))) | |
1162 | %standard-phases))) | |
1163 | (inputs `(("check" ,check) | |
1164 | ("gzip" ,guix:gzip) | |
1165 | ("bzip2" ,guix:bzip2) | |
1166 | ("pam" ,linux-pam))) | |
1167 | (native-inputs `(("pkg-config" ,pkg-config))) | |
1168 | (home-page "ftp://ftp.kernel.org/pub/linux/utils/kbd/") | |
1169 | (synopsis "Linux keyboard utilities and keyboard maps") | |
1170 | (description | |
1171 | "This package contains keytable files and keyboard utilities compatible | |
1172 | for systems using the Linux kernel. This includes commands such as | |
1173 | 'loadkeys', 'setfont', 'kbdinfo', and 'chvt'.") | |
1174 | (license gpl2+))) | |
de0b620e LC |
1175 | |
1176 | (define-public inotify-tools | |
1177 | (package | |
1178 | (name "inotify-tools") | |
1179 | (version "3.13") | |
1180 | (source (origin | |
1181 | (method url-fetch) | |
1182 | (uri (string-append | |
1183 | "mirror://sourceforge/inotify-tools/inotify-tools/" | |
1184 | version "/inotify-tools-" version ".tar.gz")) | |
1185 | (sha256 | |
1186 | (base32 | |
1187 | "0icl4bx041axd5dvhg89kilfkysjj86hjakc7bk8n49cxjn4cha6")))) | |
1188 | (build-system gnu-build-system) | |
1189 | (home-page "http://inotify-tools.sourceforge.net/") | |
1190 | (synopsis "Monitor file accesses") | |
1191 | (description | |
1192 | "The inotify-tools packages provides a C library and command-line tools | |
1193 | to use Linux' inotify mechanism, which allows file accesses to be monitored.") | |
1194 | (license gpl2+))) | |
e062d542 AE |
1195 | |
1196 | (define-public kmod | |
1197 | (package | |
1198 | (name "kmod") | |
1199 | (version "17") | |
1200 | (source (origin | |
1201 | (method url-fetch) | |
1202 | (uri | |
1203 | (string-append "mirror://kernel.org/linux/utils/kernel/kmod/" | |
1204 | "kmod-" version ".tar.xz")) | |
1205 | (sha256 | |
1206 | (base32 | |
528b6a3d LC |
1207 | "1yid3a9b64a60ybj66fk2ysrq5klnl0ijl4g624cl16y8404g9rv")) |
1208 | (patches (list (search-patch "kmod-module-directory.patch"))))) | |
e062d542 AE |
1209 | (build-system gnu-build-system) |
1210 | (native-inputs | |
1211 | `(("pkg-config" ,pkg-config))) | |
1212 | (inputs | |
1213 | `(("xz" ,guix:xz) | |
1214 | ("zlib" ,guix:zlib))) | |
1215 | (arguments | |
1216 | `(#:tests? #f ; FIXME: Investigate test failures | |
1217 | #:configure-flags '("--with-xz" "--with-zlib"))) | |
1218 | (home-page "https://www.kernel.org/") | |
1219 | (synopsis "Kernel module tools") | |
1220 | (description "kmod is a set of tools to handle common tasks with Linux | |
1221 | kernel modules like insert, remove, list, check properties, resolve | |
1222 | dependencies and aliases. | |
1223 | ||
1224 | These tools are designed on top of libkmod, a library that is shipped with | |
1225 | kmod. The aim is to be compatible with tools, configurations and indices | |
1226 | from the module-init-tools project.") | |
1227 | (license gpl2+))) ; library under lgpl2.1+ | |
d7d42d6b AE |
1228 | |
1229 | (define-public udev | |
1230 | (package | |
1231 | (name "udev") | |
1232 | (version "182") | |
1233 | (source (origin | |
1234 | (method url-fetch) | |
1235 | (uri (string-append | |
1236 | "mirror://kernel.org/linux/utils/kernel/hotplug/udev-" | |
1237 | version ".tar.xz")) | |
1238 | (sha256 | |
1239 | (base32 | |
1240 | "1awp7p07gi083w0dwqhhbbas68a7fx2sbm1yf1ip2jwf7cpqkf5d")) | |
1241 | (patches (list (search-patch "udev-gir-libtool.patch"))))) | |
1242 | (build-system gnu-build-system) | |
1243 | (arguments | |
1244 | `(#:configure-flags (list (string-append | |
1245 | "--with-pci-ids-path=" | |
1246 | (assoc-ref %build-inputs "pciutils") | |
1247 | "/share/pci.ids.gz") | |
1248 | ||
1249 | "--with-firmware-path=/no/firmware" | |
1250 | ||
1251 | ;; Work around undefined reference to | |
1252 | ;; 'mq_getattr' in sc-daemon.c. | |
1253 | "LDFLAGS=-lrt"))) | |
1254 | (native-inputs | |
1255 | `(("pkg-config" ,pkg-config) | |
1256 | ("gperf" ,gperf) | |
1257 | ("perl" ,perl) ; for the tests | |
1258 | ("python" ,python-2))) ; ditto | |
1259 | (inputs | |
1260 | `(("kmod" ,kmod) | |
1261 | ("pciutils" ,pciutils) | |
1262 | ("usbutils" ,usbutils) | |
1263 | ("util-linux" ,util-linux) | |
1264 | ("glib" ,glib) | |
1265 | ("gobject-introspection" ,gobject-introspection))) | |
1266 | (home-page "http://www.freedesktop.org/software/systemd/libudev/") | |
1267 | (synopsis "Userspace device management") | |
1268 | (description "Udev is a daemon which dynamically creates and removes | |
1269 | device nodes from /dev/, handles hotplug events and loads drivers at boot | |
1270 | time.") | |
1271 | (license gpl2+))) ; libudev is under lgpl2.1+ |