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 linux-pam
93 (uri (list (string-append "http://www.linux-pam.org/library/Linux-PAM-"
95 (string-append "mirror://kernel.org/linux/libs/pam/library/Linux-PAM-"
99 "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s"))))
100 (build-system gnu-build-system)
104 ;; TODO: optional dependencies
105 ;; ("libxcrypt" ,libxcrypt)
106 ;; ("cracklib" ,cracklib)
109 ;; XXX: Tests won't run in chroot, presumably because /etc/pam.d
112 (home-page "http://www.linux-pam.org/")
113 (synopsis "Pluggable authentication modules for Linux")
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")
121 (define-public psmisc
128 (uri (string-append "mirror://sourceforge/psmisc/psmisc/psmisc-"
132 "052mfraykmxnavpi8s78aljx8w87hyvpx8mvzsgpjsjz73i28wmi"))))
133 (build-system gnu-build-system)
134 (inputs `(("ncurses" ,ncurses)))
135 (home-page "http://psmisc.sourceforge.net/")
137 "set of utilities that use the proc filesystem, such as fuser, killall, and pstree")
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.")
144 (define-public util-linux
151 (uri (string-append "mirror://kernel.org/linux/utils/"
152 name "/v" version "/"
153 name "-" version ".2" ".tar.xz"))
156 "1rpgghf7n0zx0cdy8hibr41wvkm2qp1yvd8ab1rxr193l1jmgcir"))))
157 (build-system gnu-build-system)
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"))))
168 (inputs `(("zlib" ,guix:zlib)
171 (home-page "https://www.kernel.org/pub/linux/utils/util-linux/")
173 "util-linux is a random collection of utilities for the Linux kernel")
175 "util-linux is a random collection of utilities for the Linux kernel.")
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))))
183 (define-public procps
189 (uri (string-append "http://procps.sourceforge.net/procps-"
193 "0d8mki0q4yamnkk4533kx8mc0jd879573srxhg6r2fs3lkc6iv8i"))))
194 (build-system gnu-build-system)
195 (inputs `(("ncurses" ,ncurses)
196 ("patch/make-3.82" ,(search-patch "procps-make-3.82.patch"))))
198 '(#:patches (list (assoc-ref %build-inputs "patch/make-3.82"))
199 #:phases (alist-replace
201 (lambda* (#:key outputs #:allow-other-keys)
202 ;; No `configure', just a single Makefile.
203 (let ((out (assoc-ref outputs "out")))
204 (substitute* "Makefile"
206 (("--(owner|group) 0") "")
207 (("ldconfig") "true")
208 (("^LDFLAGS[[:blank:]]*:=(.*)$" _ value)
209 ;; Add libproc to the RPATH.
210 (string-append "LDFLAGS := -Wl,-rpath="
215 (lambda* (#:key outputs #:allow-other-keys)
216 (let ((out (assoc-ref outputs "out")))
218 (system* "make" "install"
219 (string-append "DESTDIR=" out)))
223 (system* (string-append out "/bin/ps")
227 ;; What did you expect? Tests?
229 (home-page "http://procps.sourceforge.net/")
231 "Utilities that give information about processes using the /proc filesystem")
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.")
239 (define-public usbutils
246 (uri (string-append "mirror://kernel.org/linux/utils/usb/usbutils/"
247 "usbutils-" version ".tar.xz"))
250 "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr"))))
251 (build-system gnu-build-system)
253 `(("libusb" ,libusb) ("pkg-config" ,pkg-config)))
254 (home-page "http://www.linux-usb.org/")
256 "Tools for working with USB devices, such as lsusb")
258 "Tools for working with USB devices, such as lsusb.")