Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
e47e3eff | 2 | ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org> |
233e7676 | 3 | ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org> |
fd76c904 | 4 | ;;; |
233e7676 | 5 | ;;; This file is part of GNU Guix. |
fd76c904 | 6 | ;;; |
233e7676 | 7 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
fd76c904 LC |
8 | ;;; under the terms of the GNU General Public License as published by |
9 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
10 | ;;; your option) any later version. | |
11 | ;;; | |
233e7676 | 12 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
fd76c904 LC |
13 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | ;;; GNU General Public License for more details. | |
16 | ;;; | |
17 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 18 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
fd76c904 | 19 | |
1ffa7090 | 20 | (define-module (gnu packages linux) |
4a44e743 | 21 | #:use-module (guix licenses) |
59a43334 | 22 | #:use-module (gnu packages) |
1ffa7090 | 23 | #:use-module ((gnu packages compression) |
4a44e743 | 24 | #:renamer (symbol-prefix-proc 'guix:)) |
1ffa7090 LC |
25 | #:use-module (gnu packages flex) |
26 | #:use-module (gnu packages libusb) | |
27 | #:use-module (gnu packages ncurses) | |
28 | #:use-module (gnu packages perl) | |
29 | #:use-module (gnu packages pkg-config) | |
02b80c3f NK |
30 | #:use-module (guix packages) |
31 | #:use-module (guix download) | |
fd76c904 LC |
32 | #:use-module (guix build-system gnu)) |
33 | ||
80fe5c60 LC |
34 | (define-public linux-libre-headers |
35 | (let* ((version* "3.3.8") | |
36 | (build-phase | |
45298f8f LC |
37 | '(lambda* (#:key system #:allow-other-keys) |
38 | (let ((arch (car (string-split system #\-)))) | |
39 | (setenv "ARCH" | |
40 | (cond ((string=? arch "i686") "i386") | |
41 | (else arch))) | |
42 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))) | |
43 | ||
80fe5c60 LC |
44 | (and (zero? (system* "make" "defconfig")) |
45 | (zero? (system* "make" "mrproper" "headers_check"))))) | |
46 | (install-phase | |
47 | `(lambda* (#:key outputs #:allow-other-keys) | |
48 | (let ((out (assoc-ref outputs "out"))) | |
49 | (and (zero? (system* "make" | |
50 | (string-append "INSTALL_HDR_PATH=" out) | |
51 | "headers_install")) | |
52 | (mkdir (string-append out "/include/config")) | |
53 | (call-with-output-file | |
54 | (string-append out | |
55 | "/include/config/kernel.release") | |
56 | (lambda (p) | |
57 | (format p "~a-default~%" ,version*)))))))) | |
58 | (package | |
59 | (name "linux-libre-headers") | |
60 | (version version*) | |
61 | (source (origin | |
62 | (method url-fetch) | |
63 | (uri (string-append | |
64 | "http://linux-libre.fsfla.org/pub/linux-libre/releases/3.3.8-gnu/linux-libre-" | |
65 | version "-gnu.tar.xz")) | |
66 | (sha256 | |
67 | (base32 | |
68 | "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl")))) | |
69 | (build-system gnu-build-system) | |
70 | (native-inputs `(("perl" ,perl))) | |
71 | (arguments | |
72 | `(#:modules ((guix build gnu-build-system) | |
73 | (guix build utils) | |
74 | (srfi srfi-1)) | |
75 | #:phases (alist-replace | |
76 | 'build ,build-phase | |
77 | (alist-replace | |
78 | 'install ,install-phase | |
79 | (alist-delete 'configure %standard-phases))) | |
80 | #:tests? #f)) | |
81 | (synopsis "GNU Linux-Libre kernel headers") | |
82 | (description "Headers of the Linux-Libre kernel.") | |
38bbd61d | 83 | (license gpl2) |
80fe5c60 LC |
84 | (home-page "http://www.gnu.org/software/linux-libre/")))) |
85 | ||
b4fcb735 LC |
86 | (define-public module-init-tools |
87 | (package | |
88 | (name "module-init-tools") | |
89 | (version "3.16") | |
90 | (source (origin | |
91 | (method url-fetch) | |
92 | (uri (string-append | |
93 | "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-" | |
94 | version ".tar.bz2")) | |
95 | (sha256 | |
96 | (base32 | |
97 | "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1")))) | |
98 | (build-system gnu-build-system) | |
99 | (inputs | |
100 | ;; The upstream tarball lacks man pages, and building them would require | |
101 | ;; DocBook & co. Thus, use Gentoo's pre-built man pages. | |
102 | `(("man-pages" | |
103 | ,(origin | |
104 | (method url-fetch) | |
105 | (uri (string-append | |
106 | "http://distfiles.gentoo.org/distfiles/module-init-tools-" version | |
107 | "-man.tar.bz2")) | |
108 | (sha256 | |
109 | (base32 | |
110 | "1j1nzi87kgsh4scl645fhwhjvljxj83cmdasa4n4p5krhasgw358")))))) | |
111 | (arguments | |
112 | '(#:phases (alist-cons-before | |
113 | 'unpack 'unpack-man-pages | |
114 | (lambda* (#:key inputs #:allow-other-keys) | |
115 | (let ((man-pages (assoc-ref inputs "man-pages"))) | |
116 | (zero? (system* "tar" "xvf" man-pages)))) | |
117 | %standard-phases))) | |
118 | (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/") | |
119 | (synopsis "Tools for loading and managing Linux kernel modules") | |
120 | (description | |
121 | "Tools for loading and managing Linux kernel modules, such as `modprobe', | |
122 | `insmod', `lsmod', and more.") | |
123 | (license gpl2+))) | |
124 | ||
beacfcab LC |
125 | (define-public linux-libre |
126 | (let* ((version* "3.3.8") | |
127 | (build-phase | |
128 | '(lambda* (#:key system #:allow-other-keys #:rest args) | |
129 | (let ((arch (car (string-split system #\-)))) | |
130 | (setenv "ARCH" | |
131 | (cond ((string=? arch "i686") "i386") | |
132 | (else arch))) | |
133 | (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))) | |
134 | ||
135 | (let ((build (assoc-ref %standard-phases 'build))) | |
136 | (and (zero? (system* "make" "allmodconfig")) | |
137 | ||
138 | ;; Call the default `build' phase so `-j' is correctly | |
139 | ;; passed. | |
140 | (apply build #:make-flags "all" args))))) | |
141 | (install-phase | |
142 | `(lambda* (#:key inputs outputs #:allow-other-keys) | |
143 | (let* ((out (assoc-ref outputs "out")) | |
144 | (moddir (string-append out "/lib/modules")) | |
145 | (mit (assoc-ref inputs "module-init-tools"))) | |
146 | (mkdir-p moddir) | |
147 | (for-each (lambda (file) | |
148 | (copy-file file | |
149 | (string-append out "/" (basename file)))) | |
150 | (find-files "." "^(bzImage|System\\.map)$")) | |
151 | (copy-file ".config" (string-append out "/config")) | |
152 | (zero? (system* "make" | |
153 | (string-append "DEPMOD=" mit "/sbin/depmod") | |
154 | (string-append "MODULE_DIR=" moddir) | |
155 | (string-append "INSTALL_PATH=" out) | |
156 | (string-append "INSTALL_MOD_PATH=" out) | |
157 | "modules_install")))))) | |
158 | (package | |
159 | (name "linux-libre") | |
160 | (version version*) | |
161 | (source (origin | |
162 | (method url-fetch) | |
163 | (uri (string-append | |
164 | "http://linux-libre.fsfla.org/pub/linux-libre/releases/3.3.8-gnu/linux-libre-" | |
165 | version "-gnu.tar.xz")) | |
166 | (sha256 | |
167 | (base32 | |
168 | "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl")))) | |
169 | (build-system gnu-build-system) | |
170 | (native-inputs `(("perl" ,perl) | |
171 | ("module-init-tools" ,module-init-tools))) | |
172 | (arguments | |
173 | `(#:modules ((guix build gnu-build-system) | |
174 | (guix build utils) | |
175 | (srfi srfi-1) | |
176 | (ice-9 match)) | |
177 | #:phases (alist-replace | |
178 | 'build ,build-phase | |
179 | (alist-replace | |
180 | 'install ,install-phase | |
181 | (alist-delete 'configure %standard-phases))) | |
182 | #:tests? #f)) | |
183 | (synopsis "GNU Linux-Libre kernel") | |
184 | (description "Linux-Libre operating system kernel.") | |
185 | (license gpl2) | |
186 | (home-page "http://www.gnu.org/software/linux-libre/")))) | |
187 | ||
fd76c904 LC |
188 | (define-public linux-pam |
189 | (package | |
190 | (name "linux-pam") | |
191 | (version "1.1.6") | |
192 | (source | |
193 | (origin | |
194 | (method url-fetch) | |
195 | (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-" | |
196 | version ".tar.bz2") | |
197 | (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-" | |
198 | version ".tar.bz2"))) | |
199 | (sha256 | |
200 | (base32 | |
201 | "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s")))) | |
202 | (build-system gnu-build-system) | |
203 | (inputs | |
204 | `(("flex" ,flex) | |
205 | ||
206 | ;; TODO: optional dependencies | |
207 | ;; ("libxcrypt" ,libxcrypt) | |
208 | ;; ("cracklib" ,cracklib) | |
209 | )) | |
210 | (arguments | |
211 | ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d | |
212 | ;; isn't available. | |
213 | '(#:tests? #f)) | |
214 | (home-page "http://www.linux-pam.org/") | |
215 | (synopsis "Pluggable authentication modules for Linux") | |
216 | (description | |
217 | "A *Free* project to implement OSF's RFC 86.0. | |
218 | Pluggable authentication modules are small shared object files that can | |
219 | be used through the PAM API to perform tasks, like authenticating a user | |
220 | at login. Local and dynamic reconfiguration are its key features") | |
4a44e743 | 221 | (license bsd-3))) |
686f14e8 LC |
222 | |
223 | (define-public psmisc | |
224 | (package | |
225 | (name "psmisc") | |
226 | (version "22.20") | |
227 | (source | |
228 | (origin | |
229 | (method url-fetch) | |
230 | (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-" | |
231 | version ".tar.gz")) | |
232 | (sha256 | |
233 | (base32 | |
234 | "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi")))) | |
235 | (build-system gnu-build-system) | |
236 | (inputs `(("ncurses" ,ncurses))) | |
237 | (home-page "http://psmisc.sourceforge.net/") | |
238 | (synopsis | |
239 | "set of utilities that use the proc filesystem, such as fuser, killall, and pstree") | |
240 | (description | |
241 | "This PSmisc package is a set of some small useful utilities that | |
242 | use the proc filesystem. We're not about changing the world, but | |
243 | providing the system administrator with some help in common tasks.") | |
4a44e743 | 244 | (license gpl2+))) |
02b80c3f NK |
245 | |
246 | (define-public util-linux | |
247 | (package | |
248 | (name "util-linux") | |
249 | (version "2.21") | |
250 | (source | |
251 | (origin | |
252 | (method url-fetch) | |
253 | (uri (string-append "mirror://kernel.org/linux/utils/" | |
254 | name "/v" version "/" | |
255 | name "-" version ".2" ".tar.xz")) | |
256 | (sha256 | |
257 | (base32 | |
258 | "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir")))) | |
259 | (build-system gnu-build-system) | |
260 | (arguments | |
261 | `(#:configure-flags '("--disable-use-tty-group") | |
262 | #:phases (alist-cons-after | |
263 | 'install 'patch-chkdupexe | |
264 | (lambda* (#:key outputs #:allow-other-keys) | |
265 | (let ((out (assoc-ref outputs "out"))) | |
266 | (substitute* (string-append out "/bin/chkdupexe") | |
267 | ;; Allow 'patch-shebang' to do its work. | |
268 | (("@PERL@") "/bin/perl")))) | |
269 | %standard-phases))) | |
4a44e743 | 270 | (inputs `(("zlib" ,guix:zlib) |
02b80c3f NK |
271 | ("ncurses" ,ncurses) |
272 | ("perl" ,perl))) | |
273 | (home-page "https://www.kernel.org/pub/linux/utils/util-linux/") | |
274 | (synopsis | |
275 | "util-linux is a random collection of utilities for the Linux kernel") | |
276 | (description | |
277 | "util-linux is a random collection of utilities for the Linux kernel.") | |
fe8ccfcc | 278 | |
02b80c3f | 279 | ;; Note that util-linux doesn't use the same license for all the |
fe8ccfcc | 280 | ;; code. GPLv2+ is the default license for a code without an |
02b80c3f | 281 | ;; explicitly defined license. |
fe8ccfcc LC |
282 | (license (list gpl3+ gpl2+ gpl2 lgpl2.0+ |
283 | bsd-4 public-domain)))) | |
5d5c4278 | 284 | |
e47e3eff LC |
285 | (define-public procps |
286 | (package | |
287 | (name "procps") | |
288 | (version "3.2.8") | |
289 | (source (origin | |
290 | (method url-fetch) | |
291 | (uri (string-append "http://procps.sourceforge.net/procps-" | |
292 | version ".tar.gz")) | |
293 | (sha256 | |
294 | (base32 | |
295 | "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i")))) | |
296 | (build-system gnu-build-system) | |
297 | (inputs `(("ncurses" ,ncurses) | |
298 | ("patch/make-3.82" ,(search-patch "procps-make-3.82.patch")))) | |
299 | (arguments | |
300 | '(#:patches (list (assoc-ref %build-inputs "patch/make-3.82")) | |
301 | #:phases (alist-replace | |
302 | 'configure | |
303 | (lambda* (#:key outputs #:allow-other-keys) | |
304 | ;; No `configure', just a single Makefile. | |
305 | (let ((out (assoc-ref outputs "out"))) | |
306 | (substitute* "Makefile" | |
307 | (("/usr/") "/") | |
308 | (("--(owner|group) 0") "") | |
309 | (("ldconfig") "true") | |
310 | (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value) | |
311 | ;; Add libproc to the RPATH. | |
312 | (string-append "LDFLAGS := -Wl,-rpath=" | |
313 | out "/lib" value)))) | |
314 | (setenv "CC" "gcc")) | |
315 | (alist-replace | |
316 | 'install | |
317 | (lambda* (#:key outputs #:allow-other-keys) | |
318 | (let ((out (assoc-ref outputs "out"))) | |
319 | (and (zero? | |
320 | (system* "make" "install" | |
321 | (string-append "DESTDIR=" out))) | |
322 | ||
323 | ;; Sanity check. | |
324 | (zero? | |
325 | (system* (string-append out "/bin/ps") | |
326 | "--version"))))) | |
327 | %standard-phases)) | |
328 | ||
329 | ;; What did you expect? Tests? | |
330 | #:tests? #f)) | |
331 | (home-page "http://procps.sourceforge.net/") | |
332 | (synopsis | |
333 | "Utilities that give information about processes using the /proc filesystem") | |
334 | (description | |
335 | "procps is the package that has a bunch of small useful utilities | |
336 | that give information about processes using the Linux /proc file system. | |
337 | The package includes the programs ps, top, vmstat, w, kill, free, | |
338 | slabtop, and skill.") | |
339 | (license gpl2))) | |
340 | ||
5d5c4278 NK |
341 | (define-public usbutils |
342 | (package | |
343 | (name "usbutils") | |
344 | (version "006") | |
345 | (source | |
346 | (origin | |
347 | (method url-fetch) | |
348 | (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/" | |
349 | "usbutils-" version ".tar.xz")) | |
350 | (sha256 | |
351 | (base32 | |
352 | "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr")))) | |
353 | (build-system gnu-build-system) | |
354 | (inputs | |
355 | `(("libusb" ,libusb) ("pkg-config" ,pkg-config))) | |
356 | (home-page "http://www.linux-usb.org/") | |
357 | (synopsis | |
358 | "Tools for working with USB devices, such as lsusb") | |
359 | (description | |
360 | "Tools for working with USB devices, such as lsusb.") | |
4050e5d6 | 361 | (license gpl2+))) |
0750452a LC |
362 | |
363 | (define-public e2fsprogs | |
364 | (package | |
365 | (name "e2fsprogs") | |
366 | (version "1.42.7") | |
367 | (source (origin | |
368 | (method url-fetch) | |
369 | (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-" | |
370 | version ".tar.gz")) | |
371 | (sha256 | |
372 | (base32 | |
373 | "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw")))) | |
374 | (build-system gnu-build-system) | |
375 | (inputs `(("util-linux" ,util-linux) | |
376 | ("pkg-config" ,pkg-config))) | |
377 | (arguments | |
378 | '(#:phases (alist-cons-before | |
379 | 'configure 'patch-shells | |
380 | (lambda _ | |
381 | (substitute* "configure" | |
382 | (("/bin/sh (.*)parse-types.sh" _ dir) | |
383 | (string-append (which "sh") " " dir | |
384 | "parse-types.sh"))) | |
385 | (substitute* (find-files "." "^Makefile.in$") | |
386 | (("#!/bin/sh") | |
387 | (string-append "#!" (which "sh"))))) | |
388 | %standard-phases) | |
389 | ||
390 | ;; FIXME: Tests work by comparing the stdout/stderr of programs, that | |
391 | ;; they fail because we get an extra line that says "Can't check if | |
392 | ;; filesystem is mounted due to missing mtab file". | |
393 | #:tests? #f)) | |
394 | (home-page "http://e2fsprogs.sourceforge.net/") | |
395 | (synopsis "Tools for creating and checking ext2/ext3/ext4 filesystems") | |
396 | (description | |
397 | "This package provides tools for manipulating ext2/ext3/ext4 file systems.") | |
398 | (license (list gpl2 ; programs | |
399 | lgpl2.0 ; libext2fs | |
400 | x11)))) ; libuuid |