1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
4 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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))
29 (define-public busybox
36 "http://www.busybox.net/downloads/" name "-"
40 "12v7nri79v8gns3inmz4k24q7pcnwi00hybs0wddfkcy1afh42xf"))))
41 (build-system gnu-build-system)
46 (lambda _ (zero? (system* "make" "defconfig")))
50 (substitute* '("testsuite/du/du-s-works"
51 "testsuite/du/du-works")
52 (("/bin") "/etc")) ; there is no /bin but there is a /etc
54 ;; There is no /usr/bin or /bin - replace it with /gnu/store
55 (substitute* "testsuite/cpio.tests"
56 (("/usr/bin") "/gnu/store")
59 (substitute* "testsuite/date/date-works-1"
60 (("/bin/date") (which "date")))
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)"))
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\""))
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")
81 (zero? (system* "make"
84 "SKIP_INTERNET_TESTS=1"
88 (lambda* (#:key outputs #:allow-other-keys)
89 (let ((out (assoc-ref outputs "out")))
92 (string-append "CONFIG_PREFIX=" out)
95 (native-inputs `(("perl" ,perl) ; needed to generate the man pages (pod2man)
96 ;; The following are needed by the tests.
97 ("inetutils" ,inetutils)
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+