gnu: Add libunwind.
[jackhill/guix/guix.git] / gnu / packages / linux.scm
CommitLineData
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
fd76c904
LC
125(define-public linux-pam
126 (package
127 (name "linux-pam")
128 (version "1.1.6")
129 (source
130 (origin
131 (method url-fetch)
132 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
133 version ".tar.bz2")
134 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
135 version ".tar.bz2")))
136 (sha256
137 (base32
138 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
139 (build-system gnu-build-system)
140 (inputs
141 `(("flex" ,flex)
142
143 ;; TODO: optional dependencies
144 ;; ("libxcrypt" ,libxcrypt)
145 ;; ("cracklib" ,cracklib)
146 ))
147 (arguments
148 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
149 ;; isn't available.
150 '(#:tests? #f))
151 (home-page "http://www.linux-pam.org/")
152 (synopsis "Pluggable authentication modules for Linux")
153 (description
154 "A *Free* project to implement OSF's RFC 86.0.
155Pluggable authentication modules are small shared object files that can
156be used through the PAM API to perform tasks, like authenticating a user
157at login. Local and dynamic reconfiguration are its key features")
4a44e743 158 (license bsd-3)))
686f14e8
LC
159
160(define-public psmisc
161 (package
162 (name "psmisc")
163 (version "22.20")
164 (source
165 (origin
166 (method url-fetch)
167 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
168 version ".tar.gz"))
169 (sha256
170 (base32
171 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
172 (build-system gnu-build-system)
173 (inputs `(("ncurses" ,ncurses)))
174 (home-page "http://psmisc.sourceforge.net/")
175 (synopsis
176 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
177 (description
178 "This PSmisc package is a set of some small useful utilities that
179use the proc filesystem. We're not about changing the world, but
180providing the system administrator with some help in common tasks.")
4a44e743 181 (license gpl2+)))
02b80c3f
NK
182
183(define-public util-linux
184 (package
185 (name "util-linux")
186 (version "2.21")
187 (source
188 (origin
189 (method url-fetch)
190 (uri (string-append "mirror://kernel.org/linux/utils/"
191 name "/v" version "/"
192 name "-" version ".2" ".tar.xz"))
193 (sha256
194 (base32
195 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
196 (build-system gnu-build-system)
197 (arguments
198 `(#:configure-flags '("--disable-use-tty-group")
199 #:phases (alist-cons-after
200 'install 'patch-chkdupexe
201 (lambda* (#:key outputs #:allow-other-keys)
202 (let ((out (assoc-ref outputs "out")))
203 (substitute* (string-append out "/bin/chkdupexe")
204 ;; Allow 'patch-shebang' to do its work.
205 (("@PERL@") "/bin/perl"))))
206 %standard-phases)))
4a44e743 207 (inputs `(("zlib" ,guix:zlib)
02b80c3f
NK
208 ("ncurses" ,ncurses)
209 ("perl" ,perl)))
210 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
211 (synopsis
212 "util-linux is a random collection of utilities for the Linux kernel")
213 (description
214 "util-linux is a random collection of utilities for the Linux kernel.")
fe8ccfcc 215
02b80c3f 216 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 217 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 218 ;; explicitly defined license.
fe8ccfcc
LC
219 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
220 bsd-4 public-domain))))
5d5c4278 221
e47e3eff
LC
222(define-public procps
223 (package
224 (name "procps")
225 (version "3.2.8")
226 (source (origin
227 (method url-fetch)
228 (uri (string-append "http://procps.sourceforge.net/procps-"
229 version ".tar.gz"))
230 (sha256
231 (base32
232 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))))
233 (build-system gnu-build-system)
234 (inputs `(("ncurses" ,ncurses)
235 ("patch/make-3.82" ,(search-patch "procps-make-3.82.patch"))))
236 (arguments
237 '(#:patches (list (assoc-ref %build-inputs "patch/make-3.82"))
238 #:phases (alist-replace
239 'configure
240 (lambda* (#:key outputs #:allow-other-keys)
241 ;; No `configure', just a single Makefile.
242 (let ((out (assoc-ref outputs "out")))
243 (substitute* "Makefile"
244 (("/usr/") "/")
245 (("--(owner|group) 0") "")
246 (("ldconfig") "true")
247 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
248 ;; Add libproc to the RPATH.
249 (string-append "LDFLAGS := -Wl,-rpath="
250 out "/lib" value))))
251 (setenv "CC" "gcc"))
252 (alist-replace
253 'install
254 (lambda* (#:key outputs #:allow-other-keys)
255 (let ((out (assoc-ref outputs "out")))
256 (and (zero?
257 (system* "make" "install"
258 (string-append "DESTDIR=" out)))
259
260 ;; Sanity check.
261 (zero?
262 (system* (string-append out "/bin/ps")
263 "--version")))))
264 %standard-phases))
265
266 ;; What did you expect? Tests?
267 #:tests? #f))
268 (home-page "http://procps.sourceforge.net/")
269 (synopsis
270 "Utilities that give information about processes using the /proc filesystem")
271 (description
272 "procps is the package that has a bunch of small useful utilities
273that give information about processes using the Linux /proc file system.
274The package includes the programs ps, top, vmstat, w, kill, free,
275slabtop, and skill.")
276 (license gpl2)))
277
5d5c4278
NK
278(define-public usbutils
279 (package
280 (name "usbutils")
281 (version "006")
282 (source
283 (origin
284 (method url-fetch)
285 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
286 "usbutils-" version ".tar.xz"))
287 (sha256
288 (base32
289 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
290 (build-system gnu-build-system)
291 (inputs
292 `(("libusb" ,libusb) ("pkg-config" ,pkg-config)))
293 (home-page "http://www.linux-usb.org/")
294 (synopsis
295 "Tools for working with USB devices, such as lsusb")
296 (description
297 "Tools for working with USB devices, such as lsusb.")
4050e5d6 298 (license gpl2+)))
0750452a
LC
299
300(define-public e2fsprogs
301 (package
302 (name "e2fsprogs")
303 (version "1.42.7")
304 (source (origin
305 (method url-fetch)
306 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
307 version ".tar.gz"))
308 (sha256
309 (base32
310 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
311 (build-system gnu-build-system)
312 (inputs `(("util-linux" ,util-linux)
313 ("pkg-config" ,pkg-config)))
314 (arguments
315 '(#:phases (alist-cons-before
316 'configure 'patch-shells
317 (lambda _
318 (substitute* "configure"
319 (("/bin/sh (.*)parse-types.sh" _ dir)
320 (string-append (which "sh") " " dir
321 "parse-types.sh")))
322 (substitute* (find-files "." "^Makefile.in$")
323 (("#!/bin/sh")
324 (string-append "#!" (which "sh")))))
325 %standard-phases)
326
327 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
328 ;; they fail because we get an extra line that says "Can't check if
329 ;; filesystem is mounted due to missing mtab file".
330 #:tests? #f))
331 (home-page "http://e2fsprogs.sourceforge.net/")
332 (synopsis "Tools for creating and checking ext2/ext3/ext4 filesystems")
333 (description
334 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
335 (license (list gpl2 ; programs
336 lgpl2.0 ; libext2fs
337 x11)))) ; libuuid