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