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>
5 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
34 (define-public linux-libre-headers
35 (let* ((version* "3.3.8")
37 '(lambda* (#:key system #:allow-other-keys)
38 (let ((arch (car (string-split system #\-))))
40 (cond ((string=? arch "i686") "i386")
42 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
44 (and (zero? (system* "make" "defconfig"))
45 (zero? (system* "make" "mrproper" "headers_check")))))
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)
52 (mkdir (string-append out "/include/config"))
53 (call-with-output-file
55 "/include/config/kernel.release")
57 (format p "~a-default~%" ,version*))))))))
59 (name "linux-libre-headers")
64 "http://linux-libre.fsfla.org/pub/linux-libre/releases/3.3.8-gnu/linux-libre-"
65 version "-gnu.tar.xz"))
68 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
69 (build-system gnu-build-system)
70 (native-inputs `(("perl" ,perl)))
72 `(#:modules ((guix build gnu-build-system)
75 #:phases (alist-replace
78 'install ,install-phase
79 (alist-delete 'configure %standard-phases)))
81 (synopsis "GNU Linux-Libre kernel headers")
82 (description "Headers of the Linux-Libre kernel.")
84 (home-page "http://www.gnu.org/software/linux-libre/"))))
86 (define-public module-init-tools
88 (name "module-init-tools")
93 "mirror://kernel.org/linux/utils/kernel/module-init-tools/module-init-tools-"
97 "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1"))))
98 (build-system gnu-build-system)
100 ;; The upstream tarball lacks man pages, and building them would require
101 ;; DocBook & co. Thus, use Gentoo's pre-built man pages.
106 "http://distfiles.gentoo.org/distfiles/module-init-tools-" version
110 "1j1nzi87kgsh4scl645fhwhjvljxj83cmdasa4n4p5krhasgw358"))))))
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))))
118 (home-page "http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/")
119 (synopsis "Tools for loading and managing Linux kernel modules")
121 "Tools for loading and managing Linux kernel modules, such as `modprobe',
122 `insmod', `lsmod', and more.")
125 (define-public linux-libre
126 (let* ((version* "3.3.8")
128 '(lambda* (#:key system #:allow-other-keys #:rest args)
129 (let ((arch (car (string-split system #\-))))
131 (cond ((string=? arch "i686") "i386")
133 (format #t "`ARCH' set to `~a'~%" (getenv "ARCH")))
135 (let ((build (assoc-ref %standard-phases 'build)))
136 (and (zero? (system* "make" "defconfig"))
138 (format #t "enabling additional modules...~%")
139 (substitute* ".config"
140 (("^# CONFIG_CIFS.*$")
142 (zero? (system* "make" "oldconfig")))
144 ;; Call the default `build' phase so `-j' is correctly
146 (apply build #:make-flags "all" args)))))
148 `(lambda* (#:key inputs outputs #:allow-other-keys)
149 (let* ((out (assoc-ref outputs "out"))
150 (moddir (string-append out "/lib/modules"))
151 (mit (assoc-ref inputs "module-init-tools")))
153 (for-each (lambda (file)
155 (string-append out "/" (basename file))))
156 (find-files "." "^(bzImage|System\\.map)$"))
157 (copy-file ".config" (string-append out "/config"))
158 (zero? (system* "make"
159 (string-append "DEPMOD=" mit "/sbin/depmod")
160 (string-append "MODULE_DIR=" moddir)
161 (string-append "INSTALL_PATH=" out)
162 (string-append "INSTALL_MOD_PATH=" out)
163 "modules_install"))))))
170 "http://linux-libre.fsfla.org/pub/linux-libre/releases/3.3.8-gnu/linux-libre-"
171 version "-gnu.tar.xz"))
174 "0jkfh0z1s6izvdnc3njm39dhzp1cg8i06jv06izwqz9w9qsprvnl"))))
175 (build-system gnu-build-system)
176 (native-inputs `(("perl" ,perl)
177 ("module-init-tools" ,module-init-tools)))
179 `(#:modules ((guix build gnu-build-system)
183 #:phases (alist-replace
186 'install ,install-phase
187 (alist-delete 'configure %standard-phases)))
189 (synopsis "GNU Linux-Libre kernel")
190 (description "Linux-Libre operating system kernel.")
192 (home-page "http://www.gnu.org/software/linux-libre/"))))
194 (define-public linux-pam
201 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
203 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
204 version ".tar.bz2")))
207 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
208 (build-system gnu-build-system)
212 ;; TODO: optional dependencies
213 ;; ("libxcrypt" ,libxcrypt)
214 ;; ("cracklib" ,cracklib)
217 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
220 (home-page "http://www.linux-pam.org/")
221 (synopsis "Pluggable authentication modules for Linux")
223 "A *Free* project to implement OSF's RFC 86.0.
224 Pluggable authentication modules are small shared object files that can
225 be used through the PAM API to perform tasks, like authenticating a user
226 at login. Local and dynamic reconfiguration are its key features")
229 (define-public psmisc
236 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
240 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
241 (build-system gnu-build-system)
242 (inputs `(("ncurses" ,ncurses)))
243 (home-page "http://psmisc.sourceforge.net/")
245 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
247 "This PSmisc package is a set of some small useful utilities that
248 use the proc filesystem. We're not about changing the world, but
249 providing the system administrator with some help in common tasks.")
252 (define-public util-linux
259 (uri (string-append "mirror://kernel.org/linux/utils/"
260 name "/v" version "/"
261 name "-" version ".2" ".tar.xz"))
264 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
265 (build-system gnu-build-system)
267 `(#:configure-flags '("--disable-use-tty-group")
268 #:phases (alist-cons-after
269 'install 'patch-chkdupexe
270 (lambda* (#:key outputs #:allow-other-keys)
271 (let ((out (assoc-ref outputs "out")))
272 (substitute* (string-append out "/bin/chkdupexe")
273 ;; Allow 'patch-shebang' to do its work.
274 (("@PERL@") "/bin/perl"))))
276 (inputs `(("zlib" ,guix:zlib)
279 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
281 "util-linux is a random collection of utilities for the Linux kernel")
283 "util-linux is a random collection of utilities for the Linux kernel.")
285 ;; Note that util-linux doesn't use the same license for all the
286 ;; code. GPLv2+ is the default license for a code without an
287 ;; explicitly defined license.
288 (license (list gpl3+ gpl2+ gpl2 lgpl2.0+
289 bsd-4 public-domain))))
291 (define-public procps
297 (uri (string-append "http://procps.sourceforge.net/procps-"
301 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))))
302 (build-system gnu-build-system)
303 (inputs `(("ncurses" ,ncurses)
304 ("patch/make-3.82" ,(search-patch "procps-make-3.82.patch"))))
306 '(#:patches (list (assoc-ref %build-inputs "patch/make-3.82"))
307 #:phases (alist-replace
309 (lambda* (#:key outputs #:allow-other-keys)
310 ;; No `configure', just a single Makefile.
311 (let ((out (assoc-ref outputs "out")))
312 (substitute* "Makefile"
314 (("--(owner|group) 0") "")
315 (("ldconfig") "true")
316 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
317 ;; Add libproc to the RPATH.
318 (string-append "LDFLAGS := -Wl,-rpath="
323 (lambda* (#:key outputs #:allow-other-keys)
324 (let ((out (assoc-ref outputs "out")))
326 (system* "make" "install"
327 (string-append "DESTDIR=" out)))
331 (system* (string-append out "/bin/ps")
335 ;; What did you expect? Tests?
337 (home-page "http://procps.sourceforge.net/")
339 "Utilities that give information about processes using the /proc filesystem")
341 "procps is the package that has a bunch of small useful utilities
342 that give information about processes using the Linux /proc file system.
343 The package includes the programs ps, top, vmstat, w, kill, free,
344 slabtop, and skill.")
347 (define-public usbutils
354 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
355 "usbutils-" version ".tar.xz"))
358 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
359 (build-system gnu-build-system)
361 `(("libusb" ,libusb) ("pkg-config" ,pkg-config)))
362 (home-page "http://www.linux-usb.org/")
364 "Tools for working with USB devices, such as lsusb")
366 "Tools for working with USB devices, such as lsusb.")
369 (define-public e2fsprogs
375 (uri (string-append "mirror://sourceforge/e2fsprogs/e2fsprogs-"
379 "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw"))))
380 (build-system gnu-build-system)
381 (inputs `(("util-linux" ,util-linux)
382 ("pkg-config" ,pkg-config)))
384 '(#:phases (alist-cons-before
385 'configure 'patch-shells
387 (substitute* "configure"
388 (("/bin/sh (.*)parse-types.sh" _ dir)
389 (string-append (which "sh") " " dir
391 (substitute* (find-files "." "^Makefile.in$")
393 (string-append "#!" (which "sh")))))
396 ;; FIXME: Tests work by comparing the stdout/stderr of programs, that
397 ;; they fail because we get an extra line that says "Can't check if
398 ;; filesystem is mounted due to missing mtab file".
400 (home-page "http://e2fsprogs.sourceforge.net/")
401 (synopsis "Tools for creating and checking ext2/ext3/ext4 filesystems")
403 "This package provides tools for manipulating ext2/ext3/ext4 file systems.")
404 (license (list gpl2 ; programs