gnu: dmd: Download from alpha.gnu.org.
[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 25 #:use-module (gnu packages flex)
90a0048f 26 #:use-module (gnu packages bison)
1ffa7090
LC
27 #:use-module (gnu packages libusb)
28 #:use-module (gnu packages ncurses)
90a0048f 29 #:use-module (gnu packages bdb)
1ffa7090
LC
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages pkg-config)
e7b38500 32 #:use-module (gnu packages algebra)
02b80c3f
NK
33 #:use-module (guix packages)
34 #:use-module (guix download)
0ded70f3 35 #:use-module (guix build-system gnu))
fd76c904 36
aaf4cb20
LC
37(define-public (system->linux-architecture arch)
38 "Return the Linux architecture name for ARCH, a Guix system name such as
39\"x86_64-linux\"."
618cea69
NK
40 (let ((arch (car (string-split arch #\-))))
41 (cond ((string=? arch "i686") "i386")
42 ((string-prefix? "mips" arch) "mips")
aaf4cb20 43 ((string-prefix? "arm" arch) "arm")
618cea69
NK
44 (else arch))))
45
6023cc74
LC
46(define (linux-libre-urls version)
47 "Return a list of URLs for Linux-Libre VERSION."
48 (list (string-append
49 "http://linux-libre.fsfla.org/pub/linux-libre/releases/"
50 version "-gnu/linux-libre-" version "-gnu.tar.xz")
51
52 ;; XXX: Work around <http://bugs.gnu.org/14851>.
53 (string-append
54 "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-"
55 version "-gnu.tar.xz")
56
57 ;; Maybe this URL will become valid eventually.
58 (string-append
59 "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
60 version "-gnu.tar.xz")))
61
80fe5c60
LC
62(define-public linux-libre-headers
63 (let* ((version* "3.3.8")
64 (build-phase
618cea69
NK
65 (lambda (arch)
66 `(lambda _
67 (setenv "ARCH" ,(system->linux-architecture arch))
68 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH"))
45298f8f 69
618cea69
NK
70 (and (zero? (system* "make" "defconfig"))
71 (zero? (system* "make" "mrproper" "headers_check"))))))
80fe5c60
LC
72 (install-phase
73 `(lambda* (#:key outputs #:allow-other-keys)
74 (let ((out (assoc-ref outputs "out")))
75 (and (zero? (system* "make"
76 (string-append "INSTALL_HDR_PATH=" out)
77 "headers_install"))
78 (mkdir (string-append out "/include/config"))
79 (call-with-output-file
80 (string-append out
81 "/include/config/kernel.release")
82 (lambda (p)
83 (format p "~a-default~%" ,version*))))))))
84 (package
85 (name "linux-libre-headers")
86 (version version*)
87 (source (origin
88 (method url-fetch)
6023cc74 89 (uri (linux-libre-urls version))
80fe5c60
LC
90 (sha256
91 (base32
92 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
93 (build-system gnu-build-system)
94 (native-inputs `(("perl" ,perl)))
95 (arguments
96 `(#:modules ((guix build gnu-build-system)
97 (guix build utils)
56c092ce 98 (srfi srfi-1))
80fe5c60 99 #:phases (alist-replace
618cea69 100 'build ,(build-phase (%current-system))
80fe5c60
LC
101 (alist-replace
102 'install ,install-phase
56c092ce 103 (alist-delete 'configure %standard-phases)))
80fe5c60
LC
104 #:tests? #f))
105 (synopsis "GNU Linux-Libre kernel headers")
106 (description "Headers of the Linux-Libre kernel.")
38bbd61d 107 (license gpl2)
80fe5c60
LC
108 (home-page "http://www.gnu.org/software/linux-libre/"))))
109
b4fcb735
LC
110(define-public module-init-tools
111 (package
112 (name "module-init-tools")
113 (version "3.16")
114 (source (origin
115 (method url-fetch)
116 (uri (string-append
117 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
118 version ".tar.bz2"))
119 (sha256
120 (base32
121 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))))
122 (build-system gnu-build-system)
123 (inputs
124 ;; The upstream tarball lacks man pages, and building them would require
125 ;; DocBook & co. Thus, use Gentoo's pre-built man pages.
126 `(("man-pages"
127 ,(origin
128 (method url-fetch)
129 (uri (string-append
130 "http://distfiles.gentoo.org/distfiles/module-init-tools-" version
131 "-man.tar.bz2"))
132 (sha256
133 (base32
134 "1j1nzi87kgsh4scl645fhwhjvljxj83cmdasa4n4p5krhasgw358"))))))
135 (arguments
136 '(#:phases (alist-cons-before
137 'unpack 'unpack-man-pages
138 (lambda* (#:key inputs #:allow-other-keys)
139 (let ((man-pages (assoc-ref inputs "man-pages")))
140 (zero? (system* "tar" "xvf" man-pages))))
141 %standard-phases)))
142 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
143 (synopsis "Tools for loading and managing Linux kernel modules")
144 (description
145 "Tools for loading and managing Linux kernel modules, such as `modprobe',
146`insmod', `lsmod', and more.")
147 (license gpl2+)))
148
beacfcab 149(define-public linux-libre
e7b38500 150 (let* ((version* "3.11")
beacfcab
LC
151 (build-phase
152 '(lambda* (#:key system #:allow-other-keys #:rest args)
153 (let ((arch (car (string-split system #\-))))
154 (setenv "ARCH"
155 (cond ((string=? arch "i686") "i386")
156 (else arch)))
157 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
158
159 (let ((build (assoc-ref %standard-phases 'build)))
2e48455d
LC
160 (and (zero? (system* "make" "defconfig"))
161 (begin
162 (format #t "enabling additional modules...~%")
163 (substitute* ".config"
164 (("^# CONFIG_CIFS.*$")
165 "CONFIG_CIFS=m\n"))
166 (zero? (system* "make" "oldconfig")))
beacfcab
LC
167
168 ;; Call the default `build' phase so `-j' is correctly
169 ;; passed.
170 (apply build #:make-flags "all" args)))))
171 (install-phase
172 `(lambda* (#:key inputs outputs #:allow-other-keys)
173 (let* ((out (assoc-ref outputs "out"))
174 (moddir (string-append out "/lib/modules"))
175 (mit (assoc-ref inputs "module-init-tools")))
176 (mkdir-p moddir)
177 (for-each (lambda (file)
178 (copy-file file
179 (string-append out "/" (basename file))))
180 (find-files "." "^(bzImage|System\\.map)$"))
181 (copy-file ".config" (string-append out "/config"))
182 (zero? (system* "make"
183 (string-append "DEPMOD=" mit "/sbin/depmod")
184 (string-append "MODULE_DIR=" moddir)
185 (string-append "INSTALL_PATH=" out)
186 (string-append "INSTALL_MOD_PATH=" out)
187 "modules_install"))))))
188 (package
189 (name "linux-libre")
190 (version version*)
191 (source (origin
192 (method url-fetch)
6023cc74 193 (uri (linux-libre-urls version))
beacfcab
LC
194 (sha256
195 (base32
e7b38500 196 "1vlk04xkvyy1kc9zz556md173rn1qzlnvhz7c9sljv4bpk3mdspl"))))
beacfcab
LC
197 (build-system gnu-build-system)
198 (native-inputs `(("perl" ,perl)
e7b38500 199 ("bc" ,bc)
beacfcab
LC
200 ("module-init-tools" ,module-init-tools)))
201 (arguments
202 `(#:modules ((guix build gnu-build-system)
203 (guix build utils)
204 (srfi srfi-1)
205 (ice-9 match))
206 #:phases (alist-replace
207 'build ,build-phase
208 (alist-replace
209 'install ,install-phase
210 (alist-delete 'configure %standard-phases)))
211 #:tests? #f))
f50d2669 212 (synopsis "100% free redistribution of a cleaned Linux kernel")
beacfcab
LC
213 (description "Linux-Libre operating system kernel.")
214 (license gpl2)
215 (home-page "http://www.gnu.org/software/linux-libre/"))))
216
c84d0eca
LC
217\f
218;;;
219;;; Pluggable authentication modules (PAM).
220;;;
221
fd76c904
LC
222(define-public linux-pam
223 (package
224 (name "linux-pam")
225 (version "1.1.6")
226 (source
227 (origin
228 (method url-fetch)
229 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
230 version ".tar.bz2")
231 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
232 version ".tar.bz2")))
233 (sha256
234 (base32
235 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
236 (build-system gnu-build-system)
237 (inputs
238 `(("flex" ,flex)
239
240 ;; TODO: optional dependencies
241 ;; ("libxcrypt" ,libxcrypt)
242 ;; ("cracklib" ,cracklib)
243 ))
244 (arguments
c134056a
LC
245 '(;; Most users, such as `shadow', expect the headers to be under
246 ;; `security'.
247 #:configure-flags (list (string-append "--includedir="
248 (assoc-ref %outputs "out")
249 "/include/security"))
250
251 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
252 ;; isn't available.
253 #:tests? #f))
fd76c904
LC
254 (home-page "http://www.linux-pam.org/")
255 (synopsis "Pluggable authentication modules for Linux")
256 (description
257 "A *Free* project to implement OSF's RFC 86.0.
258Pluggable authentication modules are small shared object files that can
259be used through the PAM API to perform tasks, like authenticating a user
260at login. Local and dynamic reconfiguration are its key features")
4a44e743 261 (license bsd-3)))
686f14e8 262
c84d0eca
LC
263\f
264;;;
265;;; Miscellaneous.
266;;;
267
686f14e8
LC
268(define-public psmisc
269 (package
270 (name "psmisc")
271 (version "22.20")
272 (source
273 (origin
274 (method url-fetch)
275 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
276 version ".tar.gz"))
277 (sha256
278 (base32
279 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
280 (build-system gnu-build-system)
281 (inputs `(("ncurses" ,ncurses)))
282 (home-page "http://psmisc.sourceforge.net/")
283 (synopsis
284 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
285 (description
286 "This PSmisc package is a set of some small useful utilities that
287use the proc filesystem. We're not about changing the world, but
288providing the system administrator with some help in common tasks.")
4a44e743 289 (license gpl2+)))
02b80c3f
NK
290
291(define-public util-linux
292 (package
293 (name "util-linux")
294 (version "2.21")
295 (source
296 (origin
297 (method url-fetch)
298 (uri (string-append "mirror://kernel.org/linux/utils/"
299 name "/v" version "/"
300 name "-" version ".2" ".tar.xz"))
301 (sha256
302 (base32
303 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
304 (build-system gnu-build-system)
305 (arguments
306 `(#:configure-flags '("--disable-use-tty-group")
307 #:phases (alist-cons-after
308 'install 'patch-chkdupexe
309 (lambda* (#:key outputs #:allow-other-keys)
310 (let ((out (assoc-ref outputs "out")))
311 (substitute* (string-append out "/bin/chkdupexe")
312 ;; Allow 'patch-shebang' to do its work.
313 (("@PERL@") "/bin/perl"))))
314 %standard-phases)))
4a44e743 315 (inputs `(("zlib" ,guix:zlib)
02b80c3f
NK
316 ("ncurses" ,ncurses)
317 ("perl" ,perl)))
318 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
35ec07c7 319 (synopsis "Collection of utilities for the Linux kernel")
02b80c3f
NK
320 (description
321 "util-linux is a random collection of utilities for the Linux kernel.")
fe8ccfcc 322
02b80c3f 323 ;; Note that util-linux doesn't use the same license for all the
fe8ccfcc 324 ;; code. GPLv2+ is the default license for a code without an
02b80c3f 325 ;; explicitly defined license.
fe8ccfcc
LC
326 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
327 bsd-4 public-domain))))
5d5c4278 328
e47e3eff
LC
329(define-public procps
330 (package
331 (name "procps")
332 (version "3.2.8")
333 (source (origin
334 (method url-fetch)
335 (uri (string-append "http://procps.sourceforge.net/procps-"
336 version ".tar.gz"))
337 (sha256
338 (base32
339 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))))
340 (build-system gnu-build-system)
341 (inputs `(("ncurses" ,ncurses)
342 ("patch/make-3.82" ,(search-patch "procps-make-3.82.patch"))))
343 (arguments
344 '(#:patches (list (assoc-ref %build-inputs "patch/make-3.82"))
345 #:phases (alist-replace
346 'configure
347 (lambda* (#:key outputs #:allow-other-keys)
348 ;; No `configure', just a single Makefile.
349 (let ((out (assoc-ref outputs "out")))
350 (substitute* "Makefile"
351 (("/usr/") "/")
352 (("--(owner|group) 0") "")
353 (("ldconfig") "true")
354 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
355 ;; Add libproc to the RPATH.
356 (string-append "LDFLAGS := -Wl,-rpath="
357 out "/lib" value))))
358 (setenv "CC" "gcc"))
359 (alist-replace
360 'install
361 (lambda* (#:key outputs #:allow-other-keys)
362 (let ((out (assoc-ref outputs "out")))
363 (and (zero?
364 (system* "make" "install"
365 (string-append "DESTDIR=" out)))
366
367 ;; Sanity check.
368 (zero?
369 (system* (string-append out "/bin/ps")
370 "--version")))))
371 %standard-phases))
372
373 ;; What did you expect? Tests?
374 #:tests? #f))
375 (home-page "http://procps.sourceforge.net/")
35ec07c7 376 (synopsis "Utilities that give information about processes")
e47e3eff
LC
377 (description
378 "procps is the package that has a bunch of small useful utilities
379that give information about processes using the Linux /proc file system.
380The package includes the programs ps, top, vmstat, w, kill, free,
381slabtop, and skill.")
382 (license gpl2)))
383
5d5c4278
NK
384(define-public usbutils
385 (package
386 (name "usbutils")
387 (version "006")
388 (source
389 (origin
390 (method url-fetch)
391 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
392 "usbutils-" version ".tar.xz"))
393 (sha256
394 (base32
395 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
396 (build-system gnu-build-system)
397 (inputs
398 `(("libusb" ,libusb) ("pkg-config" ,pkg-config)))
399 (home-page "http://www.linux-usb.org/")
400 (synopsis
401 "Tools for working with USB devices, such as lsusb")
402 (description
403 "Tools for working with USB devices, such as lsusb.")
4050e5d6 404 (license gpl2+)))
0750452a
LC
405
406(define-public e2fsprogs
407 (package
408 (name "e2fsprogs")
409 (version "1.42.7")
410 (source (origin
411 (method url-fetch)
412 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
413 version ".tar.gz"))
414 (sha256
415 (base32
416 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
417 (build-system gnu-build-system)
418 (inputs `(("util-linux" ,util-linux)
419 ("pkg-config" ,pkg-config)))
420 (arguments
421 '(#:phases (alist-cons-before
422 'configure 'patch-shells
423 (lambda _
424 (substitute* "configure"
425 (("/bin/sh (.*)parse-types.sh" _ dir)
426 (string-append (which "sh") " " dir
427 "parse-types.sh")))
428 (substitute* (find-files "." "^Makefile.in$")
429 (("#!/bin/sh")
430 (string-append "#!" (which "sh")))))
431 %standard-phases)
432
433 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
434 ;; they fail because we get an extra line that says "Can't check if
435 ;; filesystem is mounted due to missing mtab file".
436 #:tests? #f))
437 (home-page "http://e2fsprogs.sourceforge.net/")
35ec07c7 438 (synopsis "Creating and checking ext2/ext3/ext4 file systems")
0750452a
LC
439 (description
440 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
441 (license (list gpl2 ; programs
442 lgpl2.0 ; libext2fs
443 x11)))) ; libuuid
d8482ad0
LC
444
445(define-public strace
446 (package
447 (name "strace")
448 (version "4.7")
449 (source (origin
450 (method url-fetch)
451 (uri (string-append "mirror://sourceforge/strace/strace-"
452 version ".tar.xz"))
453 (sha256
454 (base32
455 "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764"))))
456 (build-system gnu-build-system)
457 (inputs `(("perl" ,perl)))
458 (home-page "http://strace.sourceforge.net/")
459 (synopsis "System call tracer for Linux")
460 (description
461 "strace is a system call tracer, i.e. a debugging tool which prints out a
462trace of all the system calls made by a another process/program.")
463 (license bsd-3)))
ba04571a
LC
464
465(define-public alsa-lib
466 (package
467 (name "alsa-lib")
468 (version "1.0.27.1")
469 (source (origin
470 (method url-fetch)
471 (uri (string-append
472 "ftp://ftp.alsa-project.org/pub/lib/alsa-lib-"
473 version ".tar.bz2"))
474 (sha256
475 (base32
476 "0fx057746dj7rjdi0jnvx2m9b0y1lgdkh1hks87d8w32xyihf3k9"))))
477 (build-system gnu-build-system)
478 (home-page "http://www.alsa-project.org/")
479 (synopsis "The Advanced Linux Sound Architecture libraries")
480 (description
481 "The Advanced Linux Sound Architecture (ALSA) provides audio and
482MIDI functionality to the Linux-based operating system.")
483 (license lgpl2.1+)))
10afdf50
LC
484
485(define-public iptables
486 (package
487 (name "iptables")
488 (version "1.4.16.2")
489 (source (origin
490 (method url-fetch)
491 (uri (string-append
492 "http://www.netfilter.org/projects/iptables/files/iptables-"
493 version ".tar.bz2"))
494 (sha256
495 (base32
496 "0vkg5lzkn4l3i1sm6v3x96zzvnv9g7mi0qgj6279ld383mzcws24"))))
497 (build-system gnu-build-system)
498 (arguments '(#:tests? #f)) ; no test suite
499 (home-page "http://www.netfilter.org/projects/iptables/index.html")
500 (synopsis "Program to configure the Linux IP packet filtering rules")
501 (description
502 "iptables is the userspace command line program used to configure the
503Linux 2.4.x and later IPv4 packet filtering ruleset. It is targeted towards
504system administrators. Since Network Address Translation is also configured
505from the packet filter ruleset, iptables is used for this, too. The iptables
506package also includes ip6tables. ip6tables is used for configuring the IPv6
507packet filter.")
508 (license gpl2+)))
90a0048f
LC
509
510(define-public iproute
511 (package
512 (name "iproute2")
513 (version "3.8.0")
514 (source (origin
515 (method url-fetch)
516 (uri (string-append
517 "mirror://kernel.org/linux/utils/net/iproute2/iproute2-"
518 version ".tar.xz"))
519 (sha256
520 (base32
521 "0kqy30wz2krbg4y7750hjq5218hgy2vj9pm5qzkn1bqskxs4b4ap"))))
522 (build-system gnu-build-system)
523 (arguments
524 `(#:tests? #f ; no test suite
525 #:make-flags (let ((out (assoc-ref %outputs "out")))
526 (list "DESTDIR="
527 (string-append "LIBDIR=" out "/lib")
528 (string-append "SBINDIR=" out "/sbin")
529 (string-append "CONFDIR=" out "/etc")
530 (string-append "DOCDIR=" out "/share/doc/"
531 ,name "-" ,version)
532 (string-append "MANDIR=" out "/share/man")))
533 #:phases (alist-cons-before
534 'install 'pre-install
535 (lambda _
536 ;; Don't attempt to create /var/lib/arpd.
537 (substitute* "Makefile"
538 (("^.*ARPDDIR.*$") "")))
539 %standard-phases)))
540 (inputs
541 `(("iptables" ,iptables)
542 ("db4" ,bdb)
543 ("pkg-config" ,pkg-config)
544 ("flex" ,flex)
545 ("bison" ,bison)))
546 (home-page
547 "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2")
548 (synopsis
549 "A collection of utilities for controlling TCP/IP networking and traffic control in Linux")
550 (description
551 "Iproute2 is a collection of utilities for controlling TCP/IP
552networking and traffic with the Linux kernel.
553
554Most network configuration manuals still refer to ifconfig and route as the
555primary network configuration tools, but ifconfig is known to behave
556inadequately in modern network environments. They should be deprecated, but
557most distros still include them. Most network configuration systems make use
558of ifconfig and thus provide a limited feature set. The /etc/net project aims
559to support most modern network technologies, as it doesn't use ifconfig and
560allows a system administrator to make use of all iproute2 features, including
561traffic control.
562
563iproute2 is usually shipped in a package called iproute or iproute2 and
564consists of several tools, of which the most important are ip and tc. ip
565controls IPv4 and IPv6 configuration and tc stands for traffic control. Both
566tools print detailed usage messages and are accompanied by a set of
567manpages.")
568 (license gpl2+)))