distro: Rename (distro) to (gnu packages).
[jackhill/guix/guix.git] / gnu / packages / linux.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
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
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages linux)
21 #:use-module (guix licenses)
22 #:use-module (gnu packages)
23 #:use-module ((gnu packages compression)
24 #:renamer (symbol-prefix-proc 'guix:))
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)
30 #:use-module (guix packages)
31 #:use-module (guix download)
32 #:use-module (guix build-system gnu))
33
34 (define-public linux-libre-headers
35 (let* ((version* "3.3.8")
36 (build-phase
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
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.")
83 (license "GPLv2")
84 (home-page "http://www.gnu.org/software/linux-libre/"))))
85
86 (define-public linux-pam
87 (package
88 (name "linux-pam")
89 (version "1.1.6")
90 (source
91 (origin
92 (method url-fetch)
93 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
94 version ".tar.bz2")
95 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
96 version ".tar.bz2")))
97 (sha256
98 (base32
99 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
100 (build-system gnu-build-system)
101 (inputs
102 `(("flex" ,flex)
103
104 ;; TODO: optional dependencies
105 ;; ("libxcrypt" ,libxcrypt)
106 ;; ("cracklib" ,cracklib)
107 ))
108 (arguments
109 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
110 ;; isn't available.
111 '(#:tests? #f))
112 (home-page "http://www.linux-pam.org/")
113 (synopsis "Pluggable authentication modules for Linux")
114 (description
115 "A *Free* project to implement OSF's RFC 86.0.
116 Pluggable authentication modules are small shared object files that can
117 be used through the PAM API to perform tasks, like authenticating a user
118 at login. Local and dynamic reconfiguration are its key features")
119 (license bsd-3)))
120
121 (define-public psmisc
122 (package
123 (name "psmisc")
124 (version "22.20")
125 (source
126 (origin
127 (method url-fetch)
128 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
129 version ".tar.gz"))
130 (sha256
131 (base32
132 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
133 (build-system gnu-build-system)
134 (inputs `(("ncurses" ,ncurses)))
135 (home-page "http://psmisc.sourceforge.net/")
136 (synopsis
137 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
138 (description
139 "This PSmisc package is a set of some small useful utilities that
140 use the proc filesystem. We're not about changing the world, but
141 providing the system administrator with some help in common tasks.")
142 (license gpl2+)))
143
144 (define-public util-linux
145 (package
146 (name "util-linux")
147 (version "2.21")
148 (source
149 (origin
150 (method url-fetch)
151 (uri (string-append "mirror://kernel.org/linux/utils/"
152 name "/v" version "/"
153 name "-" version ".2" ".tar.xz"))
154 (sha256
155 (base32
156 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
157 (build-system gnu-build-system)
158 (arguments
159 `(#:configure-flags '("--disable-use-tty-group")
160 #:phases (alist-cons-after
161 'install 'patch-chkdupexe
162 (lambda* (#:key outputs #:allow-other-keys)
163 (let ((out (assoc-ref outputs "out")))
164 (substitute* (string-append out "/bin/chkdupexe")
165 ;; Allow 'patch-shebang' to do its work.
166 (("@PERL@") "/bin/perl"))))
167 %standard-phases)))
168 (inputs `(("zlib" ,guix:zlib)
169 ("ncurses" ,ncurses)
170 ("perl" ,perl)))
171 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
172 (synopsis
173 "util-linux is a random collection of utilities for the Linux kernel")
174 (description
175 "util-linux is a random collection of utilities for the Linux kernel.")
176
177 ;; Note that util-linux doesn't use the same license for all the
178 ;; code. GPLv2+ is the default license for a code without an
179 ;; explicitly defined license.
180 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
181 bsd-4 public-domain))))
182
183 (define-public procps
184 (package
185 (name "procps")
186 (version "3.2.8")
187 (source (origin
188 (method url-fetch)
189 (uri (string-append "http://procps.sourceforge.net/procps-"
190 version ".tar.gz"))
191 (sha256
192 (base32
193 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))))
194 (build-system gnu-build-system)
195 (inputs `(("ncurses" ,ncurses)
196 ("patch/make-3.82" ,(search-patch "procps-make-3.82.patch"))))
197 (arguments
198 '(#:patches (list (assoc-ref %build-inputs "patch/make-3.82"))
199 #:phases (alist-replace
200 'configure
201 (lambda* (#:key outputs #:allow-other-keys)
202 ;; No `configure', just a single Makefile.
203 (let ((out (assoc-ref outputs "out")))
204 (substitute* "Makefile"
205 (("/usr/") "/")
206 (("--(owner|group) 0") "")
207 (("ldconfig") "true")
208 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
209 ;; Add libproc to the RPATH.
210 (string-append "LDFLAGS := -Wl,-rpath="
211 out "/lib" value))))
212 (setenv "CC" "gcc"))
213 (alist-replace
214 'install
215 (lambda* (#:key outputs #:allow-other-keys)
216 (let ((out (assoc-ref outputs "out")))
217 (and (zero?
218 (system* "make" "install"
219 (string-append "DESTDIR=" out)))
220
221 ;; Sanity check.
222 (zero?
223 (system* (string-append out "/bin/ps")
224 "--version")))))
225 %standard-phases))
226
227 ;; What did you expect? Tests?
228 #:tests? #f))
229 (home-page "http://procps.sourceforge.net/")
230 (synopsis
231 "Utilities that give information about processes using the /proc filesystem")
232 (description
233 "procps is the package that has a bunch of small useful utilities
234 that give information about processes using the Linux /proc file system.
235 The package includes the programs ps, top, vmstat, w, kill, free,
236 slabtop, and skill.")
237 (license gpl2)))
238
239 (define-public usbutils
240 (package
241 (name "usbutils")
242 (version "006")
243 (source
244 (origin
245 (method url-fetch)
246 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
247 "usbutils-" version ".tar.xz"))
248 (sha256
249 (base32
250 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
251 (build-system gnu-build-system)
252 (inputs
253 `(("libusb" ,libusb) ("pkg-config" ,pkg-config)))
254 (home-page "http://www.linux-usb.org/")
255 (synopsis
256 "Tools for working with USB devices, such as lsusb")
257 (description
258 "Tools for working with USB devices, such as lsusb.")
259 (license gpl2+)))