Commit | Line | Data |
---|---|---|
95faa107 JD |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2014 John Darrington <jmd@gnu.org> | |
3 | ;;; | |
4 | ;;; This file is part of GNU Guix. | |
5 | ;;; | |
6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
7 | ;;; under the terms of the GNU General Public License as published by | |
8 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
9 | ;;; your option) any later version. | |
10 | ;;; | |
11 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | ;;; GNU General Public License for more details. | |
15 | ;;; | |
16 | ;;; You should have received a copy of the GNU General Public License | |
17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
18 | ||
19 | (define-module (gnu packages busybox) | |
20 | #:use-module (guix licenses) | |
21 | #:use-module (guix packages) | |
22 | #:use-module (guix download) | |
23 | #:use-module (guix build-system gnu) | |
24 | #:use-module (gnu packages) | |
25 | #:use-module (gnu packages admin) | |
26 | #:use-module (gnu packages perl) | |
27 | #:use-module (gnu packages zip)) | |
28 | ||
29 | (define-public busybox | |
30 | (package | |
31 | (name "busybox") | |
32 | (version "1.22.1") | |
33 | (source (origin | |
34 | (method url-fetch) | |
35 | (uri (string-append | |
36 | "http://www.busybox.net/downloads/" name "-" | |
37 | version ".tar.bz2")) | |
38 | (sha256 | |
39 | (base32 | |
40 | "12v7nri79v8gns3inmz4k24q7pcnwi00hybs0wddfkcy1afh42xf")))) | |
41 | (build-system gnu-build-system) | |
42 | (arguments | |
43 | `(#:phases | |
44 | (alist-replace | |
45 | 'configure | |
46 | (lambda _ (zero? (system* "make" "defconfig"))) | |
47 | (alist-replace | |
48 | 'check | |
49 | (lambda _ | |
50 | (substitute* '("testsuite/du/du-s-works" | |
51 | "testsuite/du/du-works") | |
52 | (("/bin") "/etc")) ; there is no /bin but there is a /etc | |
53 | ||
54 | ;; There is no /usr/bin or /bin - replace it with /gnu/store | |
55 | (substitute* "testsuite/cpio.tests" | |
56 | (("/usr/bin") "/gnu/store") | |
57 | (("usr") "gnu")) | |
58 | ||
59 | (substitute* "testsuite/date/date-works-1" | |
60 | (("/bin/date") (which "date"))) | |
61 | ||
62 | ;; The pidof tests assume that pid 1 is called "init" but that is not | |
63 | ;; true in guix build environment | |
64 | (substitute* "testsuite/pidof.tests" | |
65 | (("-s init") "-s $(cat /proc/1/comm)")) | |
66 | ||
67 | (substitute* "testsuite/grep.tests" | |
68 | ;; The subject of this test is buggy. It is known by upstream (fixed in git) | |
69 | ;; So mark it with SKIP_KNOWN_BUGS like the others. | |
70 | ;; Presumably it wasn't known at the time of release ... | |
71 | ;; (It is strange that they release software which they know to have bugs) | |
72 | (("testing \"grep -w \\^str doesn't match str not at the beginning\"") | |
73 | "test x\"$SKIP_KNOWN_BUGS\" = x\"\" && testing \"grep -w ^str doesn't match str not at the beginning\"")) | |
74 | ||
75 | ;; This test cannot possibly pass. | |
76 | ;; It is trying to test that "which ls" returns "/bin/ls" when PATH is not set. | |
77 | ;; However, this relies on /bin/ls existing. Which it does not in guix. | |
78 | (delete-file "testsuite/which/which-uses-default-path") | |
79 | (rmdir "testsuite/which") | |
80 | ||
81 | (zero? (system* "make" | |
82 | ;; "V=1" | |
83 | "SKIP_KNOWN_BUGS=1" | |
84 | "SKIP_INTERNET_TESTS=1" | |
85 | "check"))) | |
86 | (alist-replace | |
87 | 'install | |
88 | (lambda* (#:key outputs #:allow-other-keys) | |
89 | (let ((out (assoc-ref outputs "out"))) | |
90 | (zero? | |
91 | (system* "make" | |
92 | (string-append "CONFIG_PREFIX=" out) | |
93 | "install")))) | |
94 | %standard-phases))))) | |
95 | (native-inputs `(("perl" ,perl) ; needed to generate the man pages (pod2man) | |
96 | ;; The following are needed by the tests. | |
97 | ("inetutils" ,inetutils) | |
98 | ("zip" ,zip))) | |
99 | (synopsis "Many common UNIX utilities in a single executable") | |
100 | (description "BusyBox combines tiny versions of many common UNIX utilities | |
101 | into a single small executable. It provides a fairly complete | |
102 | environment for any small or embedded system.") | |
103 | (home-page "http://www.busybox.net") | |
104 | ;; Some files are gplv2+ | |
105 | (license gpl2))) |